October 15, 2014 EXISTENCE OF FINITE BASES FOR QUASI-EQUATIONS OF UNARY ALGEBRAS WITH 0

Similar documents
EXISTENCE OF FINITE BASES FOR QUASI-EQUATIONS OF UNARY ALGEBRAS WITH 0

SUBLATTICES OF LATTICES OF ORDER-CONVEX SETS, III. THE CASE OF TOTALLY ORDERED SETS

Semilattice Modes II: the amalgamation property

A strongly rigid binary relation

Equational Logic. Chapter Syntax Terms and Term Algebras

MATH 8253 ALGEBRAIC GEOMETRY WEEK 12

A GUIDE FOR MORTALS TO TAME CONGRUENCE THEORY

Subdirectly Irreducible Modes

Notes on ordinals and cardinals

arxiv:math/ v1 [math.gm] 21 Jan 2005

A CHARACTERIZATION OF LOCALLY FINITE VARIETIES THAT SATISFY A NONTRIVIAL CONGRUENCE IDENTITY

CLASSIFYING THE COMPLEXITY OF CONSTRAINTS USING FINITE ALGEBRAS

Homework Problems Some Even with Solutions

Finite Simple Abelian Algebras are Strictly Simple

This is a closed subset of X Y, by Proposition 6.5(b), since it is equal to the inverse image of the diagonal under the regular map:

THE CLOSED-POINT ZARISKI TOPOLOGY FOR IRREDUCIBLE REPRESENTATIONS. K. R. Goodearl and E. S. Letzter

A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ

3. Abstract Boolean Algebras

Jónsson posets and unary Jónsson algebras

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

Chapter 1. Sets and Mappings

PETER A. CHOLAK, PETER GERDES, AND KAREN LANGE

4.4 Noetherian Rings

Universal Algebra for Logics

Bounded width problems and algebras

Houston Journal of Mathematics. c 2007 University of Houston Volume 33, No. 1, 2007

PETER A. CHOLAK, PETER GERDES, AND KAREN LANGE

LATTICES OF QUASI-EQUATIONAL THEORIES AS CONGRUENCE LATTICES OF SEMILATTICES WITH OPERATORS, PART II

Knowledge spaces from a topological point of view

Walker Ray Econ 204 Problem Set 3 Suggested Solutions August 6, 2015

Implicational classes ofde Morgan Boolean algebras

LOCALLY SOLVABLE FACTORS OF VARIETIES

A SUBALGEBRA INTERSECTION PROPERTY FOR CONGRUENCE DISTRIBUTIVE VARIETIES

FINITELY RELATED CLONES AND ALGEBRAS WITH CUBE-TERMS

Isomorphisms between pattern classes

Theorem 5.3. Let E/F, E = F (u), be a simple field extension. Then u is algebraic if and only if E/F is finite. In this case, [E : F ] = deg f u.

Multi-coloring and Mycielski s construction

Rings and Fields Theorems

Class Notes on Poset Theory Johan G. Belinfante Revised 1995 May 21

Short Introduction to Admissible Recursion Theory

10. Finite Lattices and their Congruence Lattices. If memories are all I sing I d rather drive a truck. Ricky Nelson

0 Sets and Induction. Sets

A Proof of CSP Dichotomy Conjecture

THE EQUATIONAL THEORIES OF REPRESENTABLE RESIDUATED SEMIGROUPS

VC-DENSITY FOR TREES

Part II. Logic and Set Theory. Year

COLLAPSING PERMUTATION GROUPS

CONGRUENCE MODULAR VARIETIES WITH SMALL FREE SPECTRA

Factorization in Polynomial Rings

TESTING FOR A SEMILATTICE TERM

Math 588, Fall 2001 Problem Set 1 Due Sept. 18, 2001

Chapter 1. Sets and Numbers

Finite pseudocomplemented lattices: The spectra and the Glivenko congruence

Existential Second-Order Logic and Modal Logic with Quantified Accessibility Relations

VAUGHT S THEOREM: THE FINITE SPECTRUM OF COMPLETE THEORIES IN ℵ 0. Contents

γ γ γ γ(α) ). Then γ (a) γ (a ) ( γ 1

8. Distributive Lattices. Every dog must have his day.

MULTIPLICITIES OF MONOMIAL IDEALS

Enhanced Dynkin diagrams and Weyl orbits

Abelian Algebras and the Hamiltonian Property. Abstract. In this paper we show that a nite algebra A is Hamiltonian if the

An Algebraic View of the Relation between Largest Common Subtrees and Smallest Common Supertrees

On poset Boolean algebras

Notes on Ordered Sets

DISJOINT-UNION PARTIAL ALGEBRAS

Boolean Algebras, Boolean Rings and Stone s Representation Theorem

A GENERAL THEORY OF ZERO-DIVISOR GRAPHS OVER A COMMUTATIVE RING. David F. Anderson and Elizabeth F. Lewis

AN AXIOMATIC FORMATION THAT IS NOT A VARIETY

Chapter 1 : The language of mathematics.

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 205A Part 1. I. Foundational material

arxiv:math/ v1 [math.gm] 21 Jan 2005

K 4 -free graphs with no odd holes

On the size of Heyting Semi-Lattices and Equationally Linear Heyting Algebras

Lecture 2: Connecting the Three Models

Embedding Differential Algebraic Groups in Algebraic Groups

CHAPTER 1. AFFINE ALGEBRAIC VARIETIES

A Discrete Duality Between Nonmonotonic Consequence Relations and Convex Geometries

Reducts of Polyadic Equality Algebras without the Amalgamation Property

IDEMPOTENT RESIDUATED STRUCTURES: SOME CATEGORY EQUIVALENCES AND THEIR APPLICATIONS

A Do It Yourself Guide to Linear Algebra

Löwenheim-Skolem Theorems, Countable Approximations, and L ω. David W. Kueker (Lecture Notes, Fall 2007)

= ϕ r cos θ. 0 cos ξ sin ξ and sin ξ cos ξ. sin ξ 0 cos ξ

Finitely generated free Heyting algebras; the well-founded initial segment

RESIDUAL SMALLNESS AND WEAK CENTRALITY

arxiv: v2 [math.lo] 25 Jul 2017

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

Overgroups of Intersections of Maximal Subgroups of the. Symmetric Group. Jeffrey Kuan

NOTE ON A THEOREM OF PUTNAM S

A Class of Infinite Convex Geometries

CHAPTER 2. FIRST ORDER LOGIC

Margulis Superrigidity I & II

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

5 Set Operations, Functions, and Counting

9/19/2018. Cartesian Product. Cartesian Product. Partitions

The complexity of recursive constraint satisfaction problems.

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability

Axioms of separation

Generalized Pigeonhole Properties of Graphs and Oriented Graphs

CSE 20 DISCRETE MATH WINTER

ERRATA. Abstract Algebra, Third Edition by D. Dummit and R. Foote (most recently revised on March 4, 2009)

Sergey Norin Department of Mathematics and Statistics McGill University Montreal, Quebec H3A 2K6, Canada. and

Transcription:

October 15, 2014 EXISTENCE OF FINITE BASES FOR QUASI-EQUATIONS OF UNARY ALGEBRAS WITH 0 D. CASPERSON, J. HYNDMAN, J. MASON, J.B. NATION, AND B. SCHAAN Abstract. A finite unary algebra of finite type with a constant function 0 that is a one element subalgebra, and whose operations have range 0, 1}, is called a 0, 1}-valued unary algebra with 0. Such an algebra has a finite basis for its quasi-equations if and only if the relation defined by the rows of the non-trivial functions in the clone form an order ideal. 1. Introduction An ongoing question is to determine which finite algebras have a finite basis for their equations or quasi-equations. G. Birkhoff s early work [2] shows that a finite unary algebra with finite type has a finite basis for its equations. More recently, V. K. Kartashov considered commutative unary algebras, that is, unary algebras where every pair of basic operations commute. He showed that every variety of commutative unary algebras of finite type has a finite basis of equations [9]. Note that Kartashov s result includes non-finitely-generated varieties. Mal cev [10] proved that every variety of mono-unary algebras (unars) has a one-element basis of equations. Kartashov has also shown (see [8]) that every finite mono-unary algebra has a finite basis of quasi-equations. Non-existence of finite basis results include that of I. P. Bestsennyi, who showed in [1] that a 3-element unary algebra of finite type does not have a finite basis for its quasi-equations if and only if it has as a term reduct one of three bad algebras. Since then, Hyndman [6] showed that any finite unary algebra of finite type with a pp-acyclic relation does not have a finite basis for its quasi-equations. The connection between these results is that the three bad algebras of Bestsennyi all have a pp-acyclic relation. Continuing with the flavour of non-existence of a finite basis, Casperson and Hyndman in [5] show that if the graph of a group operation can be defined using positive primitive formulas, then a finite unary algebra of finite type does not have a finite basis for its quasi-equations. When working with a finite unary algebra, the clone of non-trivial operations can be presented as a table of elements. Properties of the rows of this table can be used to determine if the algebra has a finite basis for its quasi-equations. For particular finite unary algebras that we call 0, 1}-valued unary algebra with 0, and define in the next section, we show that the rows form an order ideal if and only if the algebra has a finite basis for its quasi-equations. 2. 0, 1}-Valued Unary Algebras with 0: Definitions and Main Result Consider a finite unary algebra of finite type, M, with constant 0 that is a oneelement subalgebra and such that the range of all basic operations is included in 0, 1}. Assume that the clone of functions of M is f 0, f 1,..., f s, f s+1 } where f 0 is 1

2 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN the constant 0 function and f s+1 is the identity function. We call such an algebra a 0, 1}-valued unary algebra with 0. These algebras are by definition finite and of finite type, and hence generate locally finite varieties. See Figure 1. f 0 f 1... f s f s+1 0 0 0... 0 0 1 0 0 or 1... 0 or 1 1...... m 0 0 or 1... 0 or 1 m... Figure 1. A generic 0, 1}-valued unary algebra with 0. Let M be a 0, 1}-valued unary algebra with 0. For c M define row(c) 0, 1} s to be the tuple f 1 (c),..., f s (c). Let Rows(M) be the s-ary relation Rows(M) = row(c) c M}. This relation is referred to as the rows of M. Relations defined by positive primitive formulas (see Section 6) are important to the quasi-equational theory of an algebra. We note in passing that Rows(M) is a positive primitively defined relation. For ζ Rows(M) and for c in M, when ζ = row(c) we say that ζ is witnessed by c. Note that there may be multiple witnesses for ζ. A partial order on Rows(M) is induced by the order on 0, 1} with 0 < 1. Rows(M) is an order ideal if for every ζ in Rows(M) and every σ 0, 1} s with σ ζ, the row σ is also in Rows(M). This order is important, and indeed the main result of this article is Theorem 31, which has the following as an immediate consequence.... Corollary 32. Let M be a finite 0, 1}-valued unary algebra with 0. Then M has a finite basis for its quasi-equations if and only if the rows of M form an order ideal. 3. Quasicritical Algebras One direction of the proof of Theorem 31 consists of showing that algebras whose rows form an order ideal have finite bases for their quasi-equations. To show that a finite algebra has a finite basis for its quasi-equations we use the concept of quasicritical algebras. Let Q(M) = ISP(M) be the quasivariety generated by M, and let Q n (M) be the quasivariety of all algebras in HSP(M) that satisfy the at most n-variable quasi-equations of M. For M finite, of finite type, and in a locally finite variety, for a given N there are only finitely many quasi-equations with at most N variables. To show that such an M has a finite basis for its quasiequations, it suffices to show that there exists an N such that for all algebras E we have E Q N (M) implies E ISP(M). In fact, we can restrict our attention to algebras E that are finite and quasicritical. We first define quasicriticality and explore the concept generally, and then show how it applies to 0, 1}-valued unary algebras with 0.

3 A finite algebra E is quasicritical if it is not isomorphic to any subdirect product of its proper subalgebras. V. A. Gorbunov shows in [3, 4] that the lattice of subquasivarieties of a locally finite quasivariety V is finite if and only if the number of quasicritical algebras in V is finite. The proof of this utilizes the facts that finite subdirectly irreducible algebras are quasicritical and that distinct quasicritical algebras generate distinct quasivarieties. In fact, given two quasivarieties U and V of the same type, if U is a proper sub-quasivariety of V, then there is a quasicritical algebra in V that is not in U. This allows a proof technique to show that two quasivarieties are equal by showing that all quasicritical algebras in one are already in the other, and vice versa. Thus counting (as in [1]) or classifying the quasicritical algebras can assist with determining the existence of a finite basis. Here we develop techniques that give explicit embeddings of appropriate finite quasicritical algebras into powers of M. The next lemma indicates that, for locally finite varieties, looking at the finite quasicritical algebras is sufficient. This lemma underpins the proof of Theorem 8. Lemma 1. Let M be a finite algebra in a locally finite variety. If E is an algebra in HSP(M) such that E satisfies the n-variable quasi-equations of M but not all of the (n + 1)-variable quasi-equations of M, then there is a finite quasicritical subalgebra of E that satisfies the n-variable quasi-equations of M but not all of the (n + 1)-variable quasi-equations of M. Proof. Let E satisfy the n-variable quasi-equations of M, and let Υ be an (n + 1)- variable quasi-equation of M that E does not satisfy. There are elements a 0, a 1,..., a n of E that invalidate Υ. Consider E, the subalgebra of E generated by a 0, a 1,..., a n. This finite subalgebra will satisfy all quasi-equation that E satisfies, in particular, E satisfies the n-variable quasi-equations of M. However, E does not satisfy Υ. Now choose some Ê E minimal with respect to satisfying the n-variable quasiequations of M but not all of the (n + 1)-variable quasi-equations of M. By the above Ê is finite. If Ê is not quasicritical, then it is a subdirect product of proper subalgebras of itself. By minimality of Ê each of these subalgebras satisfies the (n + 1)-variable quasi-equations of M. As Ê is isomorphic to a subalgebra of a product of algebras satisfying the (n + 1)-variable quasi-equations of M, we get, for a contradiction, that Ê satisfies the (n + 1)-variable quasi-equations of M. Lemma 2. Let M be a finite algebra of finite type in a locally finite variety. If, in the variety generated by M, every finite quasicritical algebra satisfying the n- variable quasi-equations of M is in the quasivariety generated by M, then the n- variable quasi-equations form a basis of the quasi-equations of M. Proof. We prove the contrapositive. Assume that the n-variable quasi-equations do not form a basis of the quasi-equations of M. As the quasivariety generated by M is different from the quasivariety determined by the n-variable quasi-equations, there is a quasicritical algebra E that satisfies the n-variable quasi-equations of M but not all of the quasi-equations of M. There must be an s n such that E satisfies all of the s-variable quasi-equations of M but not all of the (s + 1)-variable quasi-equations of M. By Lemma 1, we may assume that E is finite. Choose an (s+1)-variable quasi-equation Υ of M that does not hold in E. Since s n, the finite algebra E satisfies the n-variable quasi-equations of M but is not in the quasivariety generated by M.

4 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN Corollary 3. Let M be a finite algebra in a locally finite variety. If there are only finitely many finite quasicritical algebras in the variety generated by M, then there is a finite basis for the quasi-equations of M. 3.1. Quasicritical Unary Algebras. For finite unary algebras with a one-element subalgebra 0}, there are restrictions on what the structure of a quasicritical algebra can be. Lemma 4. Assume E is a unary algebra that has a one-element subalgebra 0}. If E = A B where A B = 0} and A and B are proper subalgebras of E, then E is not quasicritical. Proof. Let α: E A B be given by (x, 0) if x A, α(x) = (0, x) if x B. Then α is a subdirect embedding. An irredundant generating set of an algebra E is a subset D such that D generates E but no proper subset of D does. For A any subset of a unary algebra E, the subalgebra generated by A is Sg E (A) = a A SgE (a}). This implies that when D is a generating set of E for d D we have E = Sg E (D) = Sg E (D \ d}) Sg E (d}). Thus, when D is an irredundant generating set and d f(d) for all non-identity functions f in the clone, the set E \ d} is a subalgebra of E. Lemma 5. Assume E is a unary algebra that has an irredundant generating set that contains distinct a, b, and c. If f(a) = f(b) = f(c) for all terms f that are not the identity map, then E is not quasicritical. Proof. Let D be the irredundant generating set containing a, b, and c. Let A = E \ c}. If c = f(c) for some non-identity term f then c = f(a) which contradicts the minimality of the generating set. Thus A is a proper subalgebra of E. Embed E into A A via (x, x) if x A, α(x) = (a, b) if x = c. As f(α(c)) = f((a, b)) = (f(a), f(b)) = (f(c), f(c)) = α(f(c)) for any non-identity term f, the map α is a subdirect embedding. 3.2. Quasicritical: 0, 1}-Valued Unary Algebras with 0. We now turn our attention to the nature of finite quasicritical algebras in the variety generated by M, a 0, 1}-valued unary algebra with 0. The following observations are used frequently. Because 0 forms a one-element subalgebra, the constant 1 is not a function in the clone, while the constant 0 function is f 0. Thus the range of each f i is 0, 1} for 1 i s. For i s and j s, we have on M that f 0 if f i (1) = 0, (1) f i f j = f j if f i (1) = 1.

5 This holds as 0 forms a one-element subalgebra, so that f i (0) = 0. Equation (1) implies that the non-trivial functions in the clone must correspond to basic operations of the algebra. As we continually are concerned with whether f i (1) = 1 or not, we partition 0, 1, 2..., s} as I 0 I 1 such that for a in 0, 1} and i in I a we have f i (1) = a. Thus for i 0 I 0 and i 1 I 1 the following equations hold in M for 0 j s: (2) f i0 (f j (x)) f 0 (x) 0 and f i1 (f j (x)) f j (x). Note that (3) row(1)(i) = 1 if i I 1, 0 if i I 0. Lemma 6. Let M be a 0, 1}-valued unary algebra with 0. Let E be a finite quasicritical algebra in the variety generated by M, with E having at least three elements. Let D be an irredundant set of generators of E and set C = E \ (D 0 E }). For every c C and every d D, we have f j (d) j s} C 0 E } and c if i I 1, f i (c) = 0 E if i I 0. Moreover, for each d D there exists an i s with f i (d) C, and consequently C is non-empty. Proof. Suppose that for some d D and some j s, we have d = f j (d). Then for all i s we have f i (d) = f i (f j (d)) 0 E, f j (d)} = 0 E, d} by Equation (2). Thus 0 E, d} is a subalgebra of E, and, as E has at least three elements, 0 E, d} is a proper subalgebra. As D is irredundant d Sg E (D \ d}). This fact and Lemma 4 imply that E is not quasicritical, which is a contradiction. Thus we have d f j (d) for every d D and every j s. Together with irredundancy of D this implies D f j (D) = for j s. Hence f j (D) C 0 E } for each j s. However, if for some d D we have f i (d) = 0 E for every i s then Sg E (d) = 0 E, d} and, by Lemma 4, E is not quasicritical. Thus we may assume for each d D there is an i s with f i (d) C. For c C there exist j s and d D with c = f j (d). For i s we have f i (c) = f i (f j (d)) 0 E, f j (d)} = 0 E, c} with f i (c) = c when i I 1. The next lemma gives us a complete description of the quasicritical algebras in the quasivariety generated by a 0, 1}-valued unary algebra with 0 when there is at most one non-trivial function in the clone. Thus, after this lemma we freely assume that there are at least two non-trivial functions. Lemma 7. Let M be a 0, 1}-valued unary algebra with 0 with at most one nonzero, non-identity function in its clone. Then HSP(M) has finitely many quasicritical algebras, and therefore ISP(M) has a finite basis for its quasi-equations. Proof. If M has no non-trivial functions in its clone, then the only quasicritical algebra in HSP(M) is the two-element algebra. Thus we may assume that there is a non-trivial function. Let f be the non-zero, non-identity function in the clone of M. Either f 2 = f or f 2 = f 0, the constant 0-valued function. Let E be a finite quasicritical algebra in the variety generated by M with at least 3 elements. Fix D an irredundant set

6 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN of generators of E, and set C = E \ (D 0 E }). By Lemma 6, C is non-empty; and for each d in D there is some non-trivial function that maps d into C. As the only such function is f, we have that f(d) is in C. In addition, for each c C there exists d D with f(d) = c. Suppose there are at least two elements in C. Pick one, say c, and let D c = d D : f(d) = c}. Then D c 0 E, c} is a subalgebra of E as is E \ (D c c}). Their intersection is 0 E }, so E is not quasicritical by Lemma 4. Thus C is a singleton. By Lemma 5, D has at most two elements. Thus every finite quasicritical algebra E has at most four elements. By Corollary 3, M has a finite basis for its quasi-equations. 4. When the Rows Form an Order Ideal Consider M 1 whose operations are those shown in Figure 2. This 0, 1}-valued f 0 f 1 f 2 f 3 0 0 0 0 0 1 0 0 0 1 2 0 1 1 0 3 0 1 0 0 4 0 0 1 0 Figure 2. Rows(M 1 ) form an order ideal. unary algebra with 0 has rows which form an order ideal. The next theorem applies to algebras like M 1 to show that they have a finite basis for their quasi-equations. Theorem 8. Let M be a finite 0, 1}-valued unary algebra with 0 whose rows form an order ideal. Then M has a finite basis for its quasi-equations. The remainder of this section is the proof of Theorem 8. Recall that the clone of functions of M is f 0, f 1,..., f s, f s+1 } where f 0 is the constant 0 and f s+1 is the identity function. By Lemma 7 we may assume s 2. Set N = 2 + M ( M 1). As M has at least two elements N 4. We wish to show that the N-variable quasi-equations form a basis. Let E be an arbitrary finite quasicritical algebra that satisfies the N-variable quasi-equations of M. By Lemma 2 it suffices to show that E is in ISP(M). If E has at most N elements and satisfies the N-variable quasiequations, then E satisfies all quasi-equations of M and hence is in ISP(M). Thus we also assume that E has at least N + 1 5 elements. The proof starts with partitioning of the elements of the quasicritical algebra. Let D be an irredundant set of generators of E. Set C = E \ (D 0 E }). By Lemma 6, C is non-empty and for every c C and every d D we have f j (d) j s} C 0 E }, f i (c) i s} 0 E, c}, and for every d D there is some j s with f j (d) C. To simplify notation in various situations we let f(x) denote the tuple f 1 (x),..., f s (x). Throughout the remainder of Section 4, where E denotes a finite quasicritical algebra, we utilize the above notation and assumptions.

7 4.1. The Quasi-equational Order Ideal Property. In this subsection we develop the concept of the quasi-equational order ideal property and show that it is equivalent to Rows(M) being an order ideal. For i 0 and T chosen such that i 0 T 1, 2,..., s}, let Σ T i 0 be the one-variable quasi-equation [ ] i,j T & f i (x) f j (x) f i0 (x) 0, and let Γ T i 0 be the associated (at most) s-variable quasi-equation [ ] i,j T & z i z j z i0 0. Notice that for a M we have that row(a) = f 1 (a), f 2 (a),..., f s (a) satisfies Γ T i 0 if and only if a satisfies Σ T i 0. For i 0 T the operation f i0 is not the constant 0 map, so if M satisfies some Σ T i 0 then T 2. We say that M satisfies the quasi-equational order ideal property when for every tuple σ in 0, 1} s \ Rows(M), there exist T 1, 2,..., s} and i 0 T such that M satisfies Σ T i 0 but σ does not satisfy Γ T i 0. Within algebras that satisfy this property we look for failure of Γ T i 0 rather than prove directly that Σ T i 0 holds. The next two lemmas guarantee the existence of particular rows in Rows(M) when M satisfies the quasi-equational order ideal property. Lemma 9. Suppose that M satisfies the quasi-equational order ideal property. Let E be an algebra in HSP(M) satisfying the 1-variable quasi-equations of M. For all ζ 0, 1} s if there exists e E, and c E with c 0 E, such that then we have ζ Rows(M). ζ(i) = 1 implies f i (e) = c, Proof. Let ζ 0, 1} s and assume that c, e E with c 0 E have the property that ζ(i) = 1 implies f i (e) = c. Note that if c D, then, as f i (e) D, we have that ζ is the zero tuple which is in Rows(M), so we may assume that c C. If for every Σ T i 0 that holds in M we obtain Γ T i 0 holding for ζ, then we must have ζ in Rows(M), as otherwise we would have a contradiction to the quasi-equational order ideal property. Suppose that Σ T i 0 holds in M and hence in E. We show that Γ T i 0 holds for ζ. Consider what happens when we set x = e in Σ T i 0. Either the hypothesis of Σ T i 0 holds, in which case the result holds, to wit, f i (e) i T } = 0 E } so ζ(i) i T } = 0}; or the hypothesis of Σ T i 0 fails and f i (e) i T } is not the singleton c}. Since ζ(i) = 1 implies f i (e) = c it follows that ζ(i) i T } is not the singleton 1}. Thus, either ζ(i) i T } = 0} or the hypothesis of Γ T i 0 fails. In either case Γ T i 0 is satisfied by ζ. By the first paragraph, ζ is in Rows(M). Corollary 10. Suppose that M satisfies the quasi-equational order ideal property. Let E be an algebra in HSP(M) satisfying the 1-variable quasi-equations of M. Then for c, e E, with c 0 E, the tuple ζc e defined by ζc e 1 if f i (e) = c, (i) = 0 otherwise is in Rows(M).

8 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN Lemma 11. For M a 0, 1}-valued unary algebra with 0, we have that Rows(M) is an order ideal if and only if M satisfies the quasi-equational order ideal property. Proof. Assume that Rows(M) is an order ideal. Suppose that σ 0, 1} s but σ is not in Rows(M). Let T = i: σ(i) = 1}. As σ row(0) the set T is non-empty. For any i 0 in T the quasi-equation Σ T i 0, which is [ ] i,j T & f i (w) f j (w) f i0 (w) 0, is satisfied by M. To see this, note that the failure of this quasi-equation to hold in M implies the existence of an element m in M with f i (m) = 1 for i T. Since σ row(m) for any such m and Rows(M) forms an order ideal, we have σ in Rows(M), a contradiction. However, the corresponding Γ T i 0 fails for any τ σ, in particular for σ itself. Thus M satisfies the quasi-equational order ideal property. Now assume that M satisfies the quasi-equational order ideal property. Suppose that m M, and ζ 0, 1} s is such that ζ row(m). Set E = M, e = m, and c = 1, so that ζ(i) = 1 implies f i (m) = 1, that is, f i (e) = c. By Lemma 9, we have that ζ is in Rows(M). Thus Rows(M) is downward closed, that is, an order ideal. 4.2. Homomorphisms. To show that E ISP(M) it is sufficient to show that for any pair of distinct elements in E there is a homomorphism separating them, that is show that for every pair (e 1, e 2 ) E 2 \ E, there is a homomorphism h: E M such that h(e 1 ) h(e 2 ). That E ISP(M) follows, as then the map E M Hom(E,M) given by e h(e) : h Hom(E, M) is an embedding. Under the hypotheses of Theorem 8 and the quasicriticality of E, we now construct these homomorphisms. In what follows, let and J 1 = (a, b) D 2 : a b and f(a) = f(b)} J 2 = (c, d) C D : f(c) = f(d)}. The overview for the remainder of this section is as follows. Lemma 12 shows that J 1 J 2 has at most 1 element. Corollary 14 shows that for c C, we can construct a homomorphism h c : E M such that h c (c) h c (c ) for c E \ D. For (a, b) J 1, Lemma 17 provides a homomorphism h: E M such that h(a) h(b). For (c, d) J 2, Lemma 22 provides a homomorphism h: E M such that h(c) h(d). Lemma 23 assembles this information to show that there is a homomorphism separating any pair of distinct elements of E, thereby completing the proof of Theorem 8. Lemma 13 and Corollary 14 construct homomorphisms from E to M that separate elements of C. Note that Lemma 13 does not assume that M has the quasiequational order ideal property, but Corollary 14 does. The next lemma demonstrates that, in a quasicritical algebra, there are very few pairs of elements (u, v) with f(u) = f(v). We would like to thank the anonymous referee for this observation. Lemma 12. The set J 1 J 2 has at most one element. Proof. Suppose that (a, b) and (u, v) are in J 1 J 2. Thus b and v are in D. The sets A = E \ b} and B = E \ v} are proper subuniverses of E as D is a minimal

9 generating set. Embed E into A B via (x, x) if x A B, α(x) = (a, b) if x = b, (v, u) if x = v. As f i (h(b)) = f i ((a, b)) = (f i (a), f i (b)) = (f i (b), f i (b)) = h(f i (b)) and f i (h(v)) = f i ((v, u)) = (f i (v), f i (u)) = (f i (v), f i (v)) = h(f i (v)) for 0 i s, the map α is a subdirect embedding, contradicting the quasicriticality of E. Lemma 13. Let M be a 0, 1}-valued unary algebra with 0, and let E HSP(M) be quasicritical, have at least three elements, and satisfy the 1-variable quasi-equations of M. Let D be an irredundant set of generators of E. Set C = E \ (D 0 E }), and fix an element c C. For each d D, let ρ d 0, 1} s be defined by ρ d (j) = 1 if and only if f j (d) = c. Suppose that h: D M is a map such that h(d) witnesses ρ d for each d D, that is, row(h(d)) = ρ d. Then (1) h extends uniquely to a homomorphism ĥ: E M; (2) ĥ(c) = 1; and (3) ĥ(c ) = 0 for c / D c}. Proof. As D is a generating set, any homomorphism that extends h is unique. To show that such a homomorphism exists, set h(e) when e D; ĥ(e) = 1 when e = c; 0 otherwise. We now show for 0 j s + 1 and d D that (4) ĥ(f j (d)) = f j (h(d)). Consider any d in D. For j = 0 we have ĥ(f 0(d)) = ĥ(0e ) = 0 = f 0 (h(d)). For j = s + 1 we have ĥ(f s+1(d)) = ĥ(d) = h(d) = f s+1(h(d)). We now consider the cases where 1 j s. Since row(h(d)) = ρ d, we have f i (h(d)) = ρ d (i) for 1 i s. First, suppose that f j (d) = c. Then ĥ(f j(d)) = ĥ(c) = 1, and f j (h(d)) = ρ d (j). But ρ d (j) = 1 exactly when f j (d) = c. Now suppose f j (d) c, so that f j (d) / c} D and ĥ(f j(d)) = 0. On the other side we have f j (h(d)) = ρ d (j) = 0. The last equality holds because f j (d) c. Thus (4) holds and we use it to show that ĥ is a homomorphism. We wish to compute ĥ(f i(e)) for any e E and i with 0 i s + 1. Pick any d D, and any j with 0 j s + 1 such that e = f j (d). There is an r with 0 r s + 1 such that f i f j = f r. Now we compute ĥ(f i(e)) = ĥ(f i(f j (d))) = ĥ(f r (d)) = f r (h(d)) = f i (f j (h(d))) = f i (ĥ(f j(d))) = f i (ĥ(e)), showing that ĥ is a homomorphism. Corollary 14. Let M be a 0, 1}-valued unary algebra with 0 satisfying the quasiequational order ideal property, and let E HSP(M) be quasicritical, have at least three elements, and satisfy the 1-variable quasi-equations of M. Let D be an irredundant set of generators of E. Set C = E \ (D 0 E }).

10 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN Then, for c C, there exists a homomorphism h c : E M such that for c E\D In particular, h c (c) 0. h c (c) = h c (c ) if and only if c = c. Proof. Fix c C. For d D, consider ρ d 0, 1} s defined by ρ d (j) = 1 if and only if f j (d) = c. By Corollary 10, ρ d is in Rows(M). Define h: D M by setting h(d) to be any witnesses that ρ d is in Rows(M). Then by Lemma 13 there is a homomorphism h c : E M extending h such that h c (c) = 1 and for c c, with c / D, we have h(c ) = 0. Under certain circumstances Corollary 14 suffices to prove Theorem 8. If M satisfies the two-variable quasi-equation f(x) f(y) x y, then so does E. The quasi-equation f(x) f(y) x y holding in M says that row(c 1 ) = row(c 2 ) implies that c 1 = c 2. In this case we say that the relation Rows(M) is uniquely witnessed. When Rows(M) is uniquely witnessed, we have J 1 J 2 = and we shall see in Lemma 23 that h c c C} separates points in E. In general we need more homomorphisms. Recall that J 1 = (a, b) D 2 : a b and f(a) = f(b)}. Lemma 17 states that if (a, b) in J 1, then there is a homomorphism h: E M such that h(a) h(b), that is, there are homomorphisms to separate the elements in a pair in J 1. From now through the proof of Lemma 17 we assume that (a, b) J 1 and use the following algebras and formulas. Let E 0 = Sg E (a, b}), and let E ω be the algebra whose universe is given by E ω = e E : Sg E (e}) E 0 = 0 E }}. By Lemma 6, C E 0 E ω. We now define various formulas that relate to the existence of appropriate homomorphisms. Let ψ 0 (w a, w b ) be the two variable formula, and for e E let ψ e (w a, w b, w e ) be the three variable formula, defined by: ψ 0 (w a, w b ): f(w a ) f(w b ) & & f i (w a ) f j (w a ); f i(a)=f j(a) ψ e (w a, w b, w e ): ψ 0 (w a, w b ) & & f i (w e ) f j (w a ). f i(e)=f j(a) The formula ψ 0 identifies elements that behave like a and b, while ψ e captures how e interacts with a and b. Note that for (a, b) J 1 and e E, the formulas ψ 0 (a, b) and ψ e (a, b, e) hold in the algebra E. Let H 1 be the set of homomorphisms H 1 = h Hom(E 0 E ω, M): h(a) h(b) and h Eω 0}. We now prove two technical lemmas about homomorphisms before proceeding to the proof of Lemma 17. Lemma 15. The set H 1 is non-empty. Moreover, for every pair (m a, m b ) of distinct elements in M 2 such that ψ 0 (m a, m b ) holds in M, there is exactly one h H 1 such that h(a) = m a and h(b) = m b.

11 Proof. The quasi-equation ψ 0 (w a, w b ) w a w b fails in E 0 (i.e, in E) with w a = a and w b = b, so it must also fail in M. This means that there exist distinct m a, m b M with ψ 0 (m a, m b ) holding. We demonstrate one-to-one correspondences between H 1, h E0 h H 1 }, and (h(a), h(b)) h H 1 }. Let H 0 = h Hom(E 0, M): h(a) h(b)}. The map ext : H 0 H 1 given by [ext h 0 ](x) = h 0 (x) x E 0, 0 x E ω ; is the inverse of the restriction map E0 : H 1 H 0, so H 0 and H 1 are in one-to-one correspondence. For h H 0, as a, b} generates E 0 it is clear that (h(a), h(b)) completely defines h in H 0 and ext h in H 1. Pick m a m b such that ψ 0 (m a, m b ) holds in M. This allows us to construct a homomorphism h H 0. To start, set h(a) = m a and h(b) = m b. As E 0 is generated by a, b} and f(a) = f(b), for every e E 0 \ a, b} there is a non-identity term f i with i 0, 1,..., s} such that f i (a) = f i (b) = e. Set h(e) = h(f i (a)) = f i (m a ). If f i (a) = f j (a) then ψ 0 (m a, m b ) implies that f i (m a ) = f j (m a ), so h is a well-defined homomorphism. By the preceding paragraph this homomorphism extends uniquely to H 1. The following lemma connects the formula ψ e (w a, w b, w e ) with the ability to lift homomorphisms. Lemma 16. Let E 2 be a proper subalgebra of E that contains E 0 E ω, and let h : E 2 M be a homomorphism with h Eω 0. Then, for e E \ E 2 there is a homomorphism ĥ: E 2 e} M extending h if and only if there exists an m M with ψ e (h(a), h(b), m) holding in M. Proof. Set L = i 1,..., s}: f i (e) / E w }. Note that, since f i (e) C E 0 E ω, we have f i (e) E ω implies f i (e) E 0. Suppose that there exists an m M such that ψ e (h(a), h(b), m) holds in M, that is, ψ 0 (h(a), h(b)) & & f i(e)=f j(a) f i (m) = f j (h(a)). Define ζ 0, 1} s by ζ(i) = 1 if and only if f i (m) = 1 and i L. Apply Lemma 9 (with E = M, e = m, c = 1) to conclude that ζ Rows(M). Let m witness ζ. Then m satisfies f i (m f i (m) when i L, ) = ζ(i) = 0 when i / L. Since C E 0 E ω and for any i we have f i (e) C 0 E }, it follows that E 2 e} is a subuniverse of E. Extend h to E 2 e} by ĥ(e) = m. To see that ĥ is a homomorphism consider ĥ(f i(e)). For i L we have f i (e) / E ω so f i (e) E 0 and f i (e) = f j (a) for some j. Thus ĥ(f i(e)) = h(f i (e)) = h(f j (a)) = f j (h(a)). But f j (h(a)) = f i (m) because f j (a) = f i (e) and ψ e (h(a), h(b), m) holds. Thus ĥ(f i (e)) = f j (h(a)) = f i (m) = f i (m ) = f i (ĥ(e)). For i / L, we have f i(e) E ω and ζ(i) = 0; whence ĥ(f i(e)) = h(f i (e)) = 0 = ζ(i) = f i (m ) = f i (ĥ(e)). Thus ĥ is a homomorphism.

12 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN On the other hand if ĥ(e) = m is a homomorphism extending h, use the fact that ψ e (a, b, e) holds and apply ĥ to the identities in ψ e(a, b, e) to get that ψ e (h(a), h(b), m) holds. We now have the machinery to prove that we can separate elements of a pair in J 1 = (a, b) D 2 : a b and f(a) = f(b)}. Lemma 17. If (a, b) in J 1, then there is a homomorphism h a,b : E M such that h a,b (a) h a,b (b). Proof. Fix (a, b) in J 1. With notation as above, define Q, a subset of M 2 \ M, as Q = (u, v): h H 1 with (u, v) = (h(a), h(b)) and u v and h does not lift to E}. If Q is empty then every h H 1 lifts to E, and since Lemma 15 says H 1 is nonempty, we are done. Thus we assume Q is non-empty. Again by Lemma 15, for each pair q in Q there is a unique h q : E 0 E ω M in H 1 such that (h q (a), h q (b)) = q. As q Q there must be at least one element e q E such that some maximal extension of h q does not contain e q. Indeed, by Lemma 16, e q is not in the domain of any extension of h q. We proceed to demonstrate that there must be an h 1 H 1 that has an extension whose domain includes each e q. This will imply that (h 1 (a), h 1 (b)) is not in Q, that is, h 1 extends to E. Consider now the formula ψ(w a, w b, w eq : q Q}) given by ψ(w a, w b, w eq : q Q}): ψ 0 (w a, w b ) & & q Q ψ eq (w a, w b, w eq ). The formula ψ essentially describes the relationships in E between the elements a, b, and e q q Q}. Notice that this formula has at most Q +2 M ( M 1)+2 = N variables. The quasi-equation ψ(w a, w b, w eq : q Q}) w a w b fails on E as a b and we can satisfy the left hand side with w a = a, w b = b, and w eq = e q. Thus it must also fail on M, as E satisfies all the N-variable quasi-equations satisfied by M. That means that there are elements m q in M for q Q, and distinct m a, m b, such that ψ(m a, m b, m q }) holds in M. In particular ψ 0 (m a, m b ) holds in M and (by Lemma 15) there is a homomorphism h 1 H 1 such that h 1 (a) = m a and h 1 (b) = m b. As each ψ eq (m a, m b, m q ) holds in M, each formula w ψ eq (m a, m b, w) holds in M, and by Lemma 16 any maximal extension of h 1 contains e q q Q} ( in its domain. Thus h 1 h q for all q Q, which implies that (m a, m b ) = h1 (a), h 1 (b) ) / Q, so h 1 lifts to E. Set h a,b to be an extension of h 1 to E. We now turn our attention to J 2. Recall that J 2 = (c, d) C D : f(c) = f(d)}. In addition I 0 = i 0, 1, 2,..., s}: f i (1) = 0} and I 1 = i 1, 2,..., s}: f i (1) = 1}. For i 0 I 0 and i 1 I 1 and any j, we have f i0 f j = f 0 and f i1 f j = f j. Lemma 18. Assume (c, d) J 2. Then I 1 and for 1 i s, c if i I 1, f i (d) = 0 E if i I 0.

13 Proof. By Lemma 6, f i (c) = c if i I 1, 0 E if i I 0. Since f(d) = f(c), the same holds for each f i (d). Again by Lemma 6, there is some i with f i (d) C, whence I 1 is non-empty. Note that the proofs of the next few lemmas use at most 2-variable quasiequations, whereas the proof of Lemma 17 used an N-variable quasi-equation. Lemma 19. If J 2 is non-empty, then either row(0) has two distinct witnesses or row(1) has two distinct witnesses. Proof. Assume that (c, d) J 2 with f(c) = f(d). By Lemma 18, I 1. For each i 1 I 1 we have f i1 (d) = f i1 (c) = c, and for i 0 I 0 we have f i0 (d) = f i0 (c) = 0 E. Consider the 2-variable quasi-equation Υ(x, y) [ ] f(x) f(y) & i1 I & f i1 (x) x & & f i0 (x) 0 x y. 1 i0 I 0 In E the pair (c, d) satisfies the hypothesis of Υ(x, y) but c d. Thus Υ does not hold in E, and consequently it must not hold in M either. In M, if the hypothesis of Υ(x, y) holds then x 0, 1}, so the failure of Υ(x, y) in M implies that either row(0) or row(1) is not uniquely witnessed. Lemma 20. Suppose that (c, d) J 2 and that 0 and m are distinct witnesses of row(0). Then h: E M defined by m if x = d h(x) = 0 otherwise is a homomorphism with h(c) h(d). Proof. For 1 j s, we have f j (h(d)) = f j (m) = 0 as m witnesses row(0); and h(f j (d)) = h(f j (c)) = 0 as f j (c) d. For u d we have f j (h(u)) = f j (0) = 0 and h(f j (u)) = 0. Thus h is a homomorphism with the desired property. Lemma 21. Suppose that (c, d) J 2 and that 1 and m are distinct witnesses of row(1). Then there is a homomorphism h: E M defined so that h(c) = 1 and h(d) = m. Proof. For u D define ρ u 0, 1} s by ρ u (j) = 1 if and only if f j (u) = c. By Corollary 10, ρ u is in Rows(M) so has a witness y u in M. Define h : D M by h m if u = d (u) = otherwise. y u By Lemma 18, f j (d) = c if and only if j I 1. Thus, by Equation (3), ρ d = row(1) which is also row(m). The map h satisfies the hypothesis of Lemma 13 so extends to a homomorphism h: E M with h(c) = 1. Lemma 22. If (c, d) J 2, then there is a homomorphism h c,d : E M such that h c,d (c) h c,d (d).

14 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN Proof. Assume that (c, d) J 2. By Lemma 19 either row(0) has distinct witnesses or row(1) has distinct witnesses. Use Lemma 20 or Lemma 21, respectively, for the existence of the desired homomorphism. Finally we show that E is actually in ISP(M) by verifying that for all (e 1, e 2 ) E 2 \ E there is a homomorphism h separating e 1 and e 2. Lemma 23. For all (e 1, e 2 ) E 2 \ E there is a homomorphism h: E M such that h(e 1 ) h(e 2 ). The homomorphism may be chosen from h c c C} h a,b (a, b) J 1 } h c,d (c, d) J 2 } as defined in Corollary 14, Lemma 17, and Lemma 22 respectively. Proof. Let e 1 and e 2 be distinct elements in E. If both e 1 and e 2 are in E \D = C 0 E }, then without loss of generality e 1 = c C. By Corollary 14, h c (e 1 ) h c (e 2 ). For the rest of the proof we assume that e 2 D. If f(e 1 ) f(e 2 ), then there is a basic term operation f i with f i (e 1 ) f i (e 2 ). Pick c f i (e 1 ), f i (e 2 )} C. Let c denote the other element of f i (e 1 ), f i (e 2 )}. Using the homomorphism h c of Corollary 14 we have f i (h c (e 1 )), f i (h c (e 2 ))} = h c (f i (e 1 )), h c (f i (e 2 ))} = h c (c), h c (c )}, a two-element set. Thus f i (h c (e 1 )) f i (h c (e 2 )) and consequently h c (e 1 ) h c (e 2 ). The only cases that remain are when f(e 1 ) = f(e 2 ) while still having e 2 D. Then (e 1, e 2 ) J 1 J 2. (We cannot have e 1 = 0 E by Lemma 6.) Thus by either Lemma 17 or Lemma 22 we can construct a homomorphism h such that h(e 1 ) h(e 2 ). Corollary 24. For E in HSP(M) with E finite, quasicritical, and satisfying the N-variable quasi-equations of M, we have E in ISP(M). Proof. The map E M Hom(E,M) given by e h(e) : h Hom(E, M) is an embedding. The proof of Theorem 8 is now complete, as every finite quasicritical algebra that satisfies the N-variable quasi-equations is actually already in the quasivariety. Lemma 2 shows that the N-variable quasi-equations form a basis of the quasi-equations of M. An interesting observation is that the proof of Lemma 17 potentially uses all N variables for a pair in J 1, while the proofs for J 2 and unique witnesses only require 2-variable quasi-equations. 5. When the Rows Do Not Form an Order Ideal The content of this section is the proof of the converse of Theorem 8: that a finite 0, 1}-valued unary algebra with 0 whose rows do not form an order ideal does not have a finite basis for its quasi-equations. We first do this for algebras on a 4-element universe and then generalize to an arbitrary finite algebra. As before, throughout this section assume that M is a finite 0, 1}-valued unary algebra with 0 and that the clone is f 0, f 1, f 2,..., f s+1 where f 0 is the constant 0

15 function and f s+1 is the identity map. To prove the converse of Theorem 8 we need conditions for the non-existence of a finite basis for the quasi-equations of M. Results and definitions from [5] and [6] give these conditions. A positive primitive formula is an existentially quantified conjunction of atomic formulas. In the case of unary algebras the atomic formulas are of the form f(x) g(y) for notnecessarily-different variables x and y and terms (possibly the identity) f and g. A unary algebra M is pp-acyclic if there is a positive primitive formula φ(x, y) defining an acyclic binary relation such that there exist 0 and 1 in M with 0 1, φ(0, 0), φ(0, 1) and φ(1, 1). The simplest pp-acyclic relation is on the set 0, 1}. Theorem 25 ([6]). If M is a finite pp-acyclic unary algebra, then M does not have a finite basis for its quasi-equations. More generally, on an algebra M, an n-ary relation R is pp-defined if there is a positive primitive formula φ(x 1, x 2,..., x n ) such that R = (a 1, a 2,..., a n ) M n : φ(a 1, a 2,..., a n ) holds in M}. Theorem 26 ([5]). If M is a finite unary algebra that has a pp-defined relation that is the graph of a non-trivial group, then M does not have a finite basis for its quasi-equations. The example given in Figure 3 has the graph of addition modulo 2 defined via w [ x p(w) & y q(w) & z r(w)]. That is, the set of triples (p(m), q(m), r(m)) M 2 3 m M 2 } is (0, 0, 0), (0, 1, 1), (1, 0, 1), (1, 1, 0)}, which in turn is (x, y, z) 0, 1} 3 : x + y = z}. By Theorem 26, M 2 does not have a finite basis for its quasi-equations. However, for many examples, the positive primitive formulas are much more complex as will become evident in the upcoming proofs. 0 2 1 p q r p q r 0 0 0 0 1 0 1 1 2 1 0 1 3 1 1 0 3 Figure 3. The graph of the two-element group is pp-defined in M 2. Theorem 27. If M is a 4-element 0, 1}-valued unary algebra with 0, then one of the following holds: (1) the relation on 0, 1} can be positive primitively defined via a formula of the form w x f(w) & y g(w); (2) the graph of addition modulo 2 on 0, 1} can be positive primitively defined via a formula of the form w x p(w) & y q(w) & z r(w); (3) the rows of M form an order ideal.

16 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN In the first two cases there is no finite basis for the quasi-equations, and in the last case there is a finite basis for the quasi-equations. Proof. Let F be the non-constant, non-identity operations in the clone of M. On a four-element set the possible non-identity functions for a 0, 1}-valued unary algebra with 0 are given in Table 1. If F is empty or has one element then, by g 0 g 1 g 2 g 3 g 4 g 5 g 6 g 7 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 1 1 2 0 0 1 1 0 0 1 1 3 0 1 0 1 0 1 0 1 Table 1. All possible operations of a four-element 0, 1}-valued unary algebra with 0. Lemma 7, there is a finite basis for the quasi-equations. Either Rows(M) is the empty ideal or there is one non-trivial function and the ideal formed by Rows(M) is 0, 1}. So we assume F 2. The formula w x g 3 (w) & y g 5 (w) & z g 6 (w) defines the graph of addition modulo 2, so we may assume not all of g 3, g 5, and g 6 are in F. If g 7 F then for any f F \ g 7 } the formula w x f(w) & y g 7 (w) defines on 0, 1}. Thus we may assume g 7 F. Similarly, any of the pairs g 1, g 3 }, g 1, g 5 }, g 2, g 3 }, g 2, g 6 }, g 4, g 5 }, or g 4, g 6 } can be used to define. Thus we may assume none of these pairs are in F. The remaining possible clones are g 1, g 2 }, g 1, g 4 }, g 1, g 6 }, g 2, g 4 }, g 2, g 5 }, g 3, g 4 }, g 3, g 5 }, g 3, g 6 }, g 5, g 6 }, and g 1, g 2, g 4 }. It is straightforward to check that all of these clones give order ideals. The remainder of this section is the proof that Theorem 27 can be generalized to an arbitrary finite 0, 1}-valued unary algebra with 0 if we do not specify the form of the positive primitive formulas. Lemma 28. If Rows(M) is not relatively complemented, then on 0, 1} can be positive primitively defined in M. Proof. As Rows(M) is not relatively complemented, there exists an interval of at least 3-elements, so we may assume a < c < b are in Rows(M) and the complement of c between a and b is not in Rows(M). Let S 000 = i: a(i) = c(i) = b(i) = 0} S 001 = i: a(i) = c(i) = 0 and b(i) = 1} S 011 = i: a(i) = 0 and c(i) = b(i) = 1} S 111 = i: a(i) = b(i) = c(i) = 1}. As a < c < b the disjoint union of these sets, S 000 S 001 S 011 S 111, is all of 1, 2,..., s}. In addition, as a, b, and c are distinct, the sets S 001 and S 011 are non-empty. Define Ĉ to be the formula that identifies rows which have a constant

17 value on each of these four sets and are 0 on S 000. That is, Ĉ(w) is Ĉ(w): & f i (w) 0 & & f i (w) f j (w) i S 000 i,j S001 & i,j S011 & f i (w) f j (w) & i,j S111 & f i (w) f j (w). When S 000 or S 111 is empty, then the conjunctions in Ĉ over S 000 or S 111 are omitted. Pick t 1 S 001, t 2 S 011. First assume S 111 is empty. This implies that a is row(0). The positive primitive formula ˆR(x, y) defined by ˆR(x, y): w Ĉ(w) & x f t 1 (w) & y f t2 (w) defines on 0, 1}. To see this, note that the witnesses of the rows a, c and b witness ˆR(0, 0), ˆR(0, 1), and ˆR(1, 1). If the witness of some row d were a witness to ˆR(1, 0) then d would be the relative complement of c in the interval between a and b. This contradicts the assumption that the relative complement of c between a and b is not in Rows(M). Now assume S 111 is non-empty and pick t 3 S 111. Note that a row(0) because a(t 3 ) = 1. Consider the relation E(x 1, x 2, x 3 ) defined by E(x 1, x 2, x 3 ): w Ĉ(w) & x 1 f t1 (w) & x 2 f t2 (w) & x 3 f t3 (w). There are two cases. First assume E(0, 1, 0) is witnessed in M. Define R(x, y) via R(x, y): w Ĉ(w) & x f t 1 (w) f t3 (w) & y f t2 (w). The zero element is witness to R(0, 0), and the witness of b gives R(1, 1) while the witness of E(0, 1, 0) gives R(0, 1). If R(1, 0) holds, then the witness to R(1, 0) is a witness to a complement of c between a and b, a contradiction. Thus is defined. Now assume E(0, 1, 0) is not witnessed in M. Define R (x, y) via R (x, y): w Ĉ(w) & 0 f t 1 (w) & x f t2 (w) & y f t3 (w). The witnesses of the zero row, a, and c witness R (0, 0), R (0, 1), and R (1, 1) respectively. R (1, 0) does not hold, as otherwise E(0, 1, 0) has a witness. Thus is again defined. Lemma 29. Assume M is a 0, 1}-valued unary algebra with 0 such that Rows(M) is relatively complemented but is not an order ideal. Then there is a pair of elements a, b Rows(M) with (1) a < b; (2) there exists c 0, 1} s \ Rows(M) with a < c < b; (3) for d < b with d Rows(M), the set of elements below d in Rows(M) form an order ideal; and (4) the interval from a to b in Rows(M) is a, b}. Proof. We start by choosing an interval of Rows(M) that is, in a sense, minimal with respect to not being an order ideal. As Rows(M) is not an order ideal and row(0) is in Rows(M), there exists a minimal element b in Rows(M) and c in 0, 1} s \ Rows(M) with row(0) < c < b. Fix c minimal with respect to this property. Thus for all d < b, if d Rows(M) then the interval below d in 0, 1} s is in Rows(M). By the minimality of c, each element strictly below c in 0, 1} s is also in Rows(M). Fix a a maximal element with row(0) a < c.

18 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN We now show that the interval from a to b in Rows(M) consists exactly of a and b. Suppose d in Rows(M) with a d b. If d c = c then d c and in fact d > c and by the minimality of b, we have d = b. Otherwise, using a d c < c and the minimality of c we get that d c is in Rows(M). In fact d c = a by maximality of a. Let ˆd be the complement of d in the interval from a to b. As Rows(M) is relatively complemented, ˆd is in Rows(M). Because d c = a, by distributivity of 0, 1} s we have ˆd c. In fact, ˆd > c as c Rows(M). By the minimality of b, the element ˆd is actually b. By uniqueness of complements d = a, showing that the interval from a to b in Rows(M) consists exactly of a and b. Lemma 30. Assume M is a 0, 1}-valued unary algebra with 0 such that Rows(M) is relatively complemented but is not an order ideal. Then either there is a positive primitive formula that defines on 0, 1}, or there is a positive primitive formula that defines the graph of addition modulo 2. Proof. By Lemma 29, there are elements a, b in Rows(M) such that a < b, the interval from a to b in Rows(M) is a, b}, and there is an element c 0, 1} s \ Rows(M) with a < c < b. Set T 00 = i: b(i) = 0} T 11 = i: a(i) = 1} T 01 = 1, 2,..., s} \ (T 00 T 11 ). We show that when T 11 is non-empty we can define with a positive primitive formula. When T 11 is empty we may be able to define but, if we cannot, then addition modulo 2 is definable. Notice that T 00 and T 11 are disjoint and that a is row(0) if and only if T 11 is empty. Note that T 01 is the set of co-ordinates on which a and b differ. As a < c < b we have that T 01 2. Case 1: Assume T 11 is non-empty. Let C 1 (w) be the formula that identifies rows which are constantly 0 on T 00, and are constant on T 11 and on T 01. That is, C 1 (w) is C 1 (w): & i T00 f i (w) 0 & & i,j T11 f i (w) f j (w) & Pick l 1 in T 01 and j 1 T 11. Define the formula R 1 (x, y) as & i,j T01 f i (w) f j (w). R 1 (x, y): w C 1 (w) & x f l1 (w) & y f j1 (w). From the rows a, b, and row(0) we obtain R 1 (0, 1), R 1 (1, 1), and R 1 (0, 0) respectively. When R 1 defines on 0, 1} we are done with this case. Otherwise R 1 (1, 0) holds for some witness. This means there is a row d in Rows(M) with 0 if i T 00 T 11, d(i) = 1 if i T 01. Thus d < b. By Lemma 29, we must have that Rows(M) is an order ideal below d. Thus the atom e which is 1 exactly on the co-ordinate l 1 is in Rows(M).

19 Let C 2 (w) be the formula that identifies rows which are constantly 0 on T 00, and are constant on T 11 T 01 \ l 1 }. That is, C 2 (w) is C 2 (w): i T00 & f i (w) 0 & & f i (w) f j (w). i,j T 11 T 01\l 1} With the same j 1 as above, define the formula R 2 (x, y) as R 2 (x, y): w C 2 (w) & x f j1 (w) & y f l1 (w). From the rows e, b, and row(0) we obtain R 2 (0, 1), R 2 (1, 1), and R 2 (0, 0) respectively. Suppose R 2 (1, 0) holds for some witness, then there is a row r with 0 if i T 00 l 1 }, r(i) = 1 if i T 11 T 01 \ l 1 }. Thus a < r < b, which is a contradiction as the interval in Rows(M) from a to b contains just a and b. We have shown that when T 11 is non-empty we can define on 0, 1}. Case 2: Now assume T 11 is empty. This means a is row(0). Pick l 1 and l 2 distinct in T 01. As f l1 and f l2 are distinct functions, there must be a row e in Rows(M) with e(l 1 ) e(l 2 ). Pick such an e minimal and, without loss of generality, assume e(l 1 ) = 0 and e(l 2 ) = 1. As the interval from a to b in Rows(M) contains exactly a and b we have e b. For β, γ 0, 1} define the subsets of 1, 2,..., s} S βγ = i: b(i) = β and e(i) = γ}. The co-ordinate l 1 is in S 10 and l 2 is in S 11. The set S 01 is non-empty as otherwise a = row(0) < e < b which cannot hold. Define C 3 (w) be the formula that identifies rows which are constantly 0 on S 00, and are constant on each of S 01, S 10, and S 11. That is, C 3 (w) is C 3 (w): & i S00 f i (w) 0 & Let R(x, y) be the formula R(x, y): i,j S01 & f i (w) f j (w) & & f i (w) f j (w) & i,j S 10 w C 3 (w) & x f l1 (w) & y f l2 (w). & i,j S11 f i (w) f j (w). R(0, 0), R(0, 1), and R(1, 1) hold via row(0), e, and b respectively. If R(1, 0) does not occur then we have defined. We shall see that when R(1, 0) does occur we can define addition modulo 2. Assume that there is an m 0, 1} and a row d with 0 if i S 00 S 11, d(i) = m if i S 01, 1 if i S 10. That is, a witness to row d is a witness to R(1, 0). If m = 0 then a < d < b, contradicting the non-existence in Rows(M) of rows between a and b, so m = 1. Pick l 3 in S 01. Let P (x, y, z) be the formula P (x, y, z): w C 3 (w) & x f l1 (w) & y f l2 (w) & z f l3 (w).

20 CASPERSON, HYNDMAN, MASON, NATION, AND SCHAAN P (0, 0, 0), P (1, 1, 0), P (1, 0, 1), and P (0, 1, 1) hold via witnesses of row(0), b, d, and e respectively. Any witness of P (0, 1, 0) or P (1, 0, 0) would be a witness for a non-zero row below b which cannot happen. If P (0, 0, 1) holds then a non-zero row is witnessed that is below e. Take the relative complement to this row between row(0) and e. The witness to this new row is a witness to P (0, 1, 0), a contradiction. Finally if P (1, 1, 1) has a witness then use the relative complement of e to obtain a witness to P (1, 0, 0) and a corresponding row below b, another contradiction. Thus the formula P defines the graph of addition modulo 2. 6. Classifying 0, 1}-Valued Unary Algebras with 0 Theorem 31. If M is a 0, 1}-valued unary algebra with 0 then one of the following holds: (1) the relation on 0, 1} can be positive primitively defined; (2) the graph of addition modulo 2 on 0, 1} can be positive primitively defined; or (3) the rows of M form an order ideal. In the first two cases there is no finite basis for the quasi-equations, and in the last case there is a finite basis for the quasi-equations. Proof. If M has one or fewer non-identity, non-zero operations then Rows(M) forms a (possibly empty) order ideal. By Lemma 7, there is a finite basis for the quasi-equations. If Rows(M) has an interval that is not relatively complemented then by Lemma 28 we can positive primitively define on 0, 1}. By Theorem 25 there is no finite basis for the quasi-equations. If Rows(M) is relatively complemented but is not an order ideal then, by Lemma 30, there is either a positive primitive formula that defines on 0, 1} or there is a positive primitive formula that defines the graph of addition modulo 2. By Theorem 25 or Theorem 26 there is no finite basis for the quasi-equations. If none of the above situations holds, then Rows(M) forms a non-empty order ideal. By Theorem 8 M has a finite basis for its quasi-equations. Corollary 32. Let M be a finite 0, 1}-valued unary algebra with 0. Then M has a finite basis for its quasi-equations if and only if the rows of M form an order ideal. References [1] I. P. Bestsennyi, Quasi-identities of finite unary algebras, Algebra and Logic, 28 (1989), 327 340. [2] G. Birkhoff, On the structure of abstract algebras, Proceedings of the Cambridge Philosophical Society, 31 (1935), part 4, 432 454. [3] V.A. Gorbunov, Algebraic theory of quasivarieties, translated from the Russian, Siberian School of Algebra and Logic, Consultants Bureau, New York, 1998. [4] V. A. Gorbunov, Quasi-identities of two-element algebras, Algebra and Logic, 22 (1983), no. 2, 83 88. [5] D. Casperson and J. Hyndman, Primitive positive formulas preventing a finite basis of quasiequations, International Journal of Algebra and Computation, 19 (2009), no. 7, 925 935. [6] J. Hyndman, Positive primitive formulas preventing enough algebraic operations, Algebra Universalis, 52 (2004), no. 2-3, 303 312. [7] J. Hyndman and J. Pitkethly, How finite is a three-element unary algebra?, International Journal of Algebra and Computation, 15 (2005), 217 254.