1 The Lattice of All Clones Definable by Binary Relations on a Three-Element Set Stanislav V. Moiseev <stanislav.moiseev@gmail.com> The 94th Workshop on General Algebra (AAA94) Novi Sad, Serbia, June 15 18, 2017
2 What is Studied: Relational Clones Let R k be the set of all finitary predicates on {0, 1,..., k 1}. Definition. M R k is called a relational clone if 1. {false (0), true (0), eq (2) } M; 2. and M is closed under primitive positive formulas: p (r1) 1 M,..., p (rn) n M, ( ) p (r) (x 1,..., x r ) = y 1... y s p (r1) 1 (z 1,1,..., z 1,r1 )... p (rn) n (z n,1,..., z n,rn ) = p (r) M (s 0, n 0; z k,j is one of the symbols: x 1,..., x r, y 1,..., y s ).
3 What is Studied: Closure Operator for Predicates Definition. We say that p is generated from M if p {false (0), true (0), eq (2) } or if p can be expressed as a primitive positive formula: p (r) (x 1,..., x r ) = ( ) = y 1... y s p (r1) 1 (z 1,1,..., z 1,r1 )... p (rn) n (z n,1,..., z n,rn ) The set of all predicates generated from M we denote as [M] p.p.
4 What is Studied: Finitely Generated Relational Clones Definition. A relational clone M is finitely generated if M 0 M: (M 0 is finite) (M = [M 0 ] p.p. ). Definition. Degree of a (finitely generated) relational clone M is the smallest number r such that M = [M R k (r)] p.p. where R k (r) is the set of all predicates of arity r on {0, 1,..., k 1}.
What is Studied: Finitely Generated Relational Clones Number of relational clones of degree r on k-element set. r = 2 r = 3 r = 4 k = 2 19 44 54 k = 3? > 2 50 > 2 500 k = 4 > 2 60 > 2 220 > 2 270 1 Figures for k = 2 are known from Блохина Г. Н. О предикатном описании классов Поста. Дискретный анализ 16, 16 29 (1970). 2 Figures in red are known from Dmitriy Zhuk, Stanislav Moiseev. On the Clones Containing a Near-Unanimity Function. 5 ISMVL 2013: 129-134.
6 Our Aim Construct all relational clones of degree 2 on three-element set: { M M = [M R 3 (2)] p.p. } =?
7 Our Tools and Obstacles Main tool Generation of predicates. Main obstacle There are infinitely many primitive positive formulas p(x 1,..., x r ) = y 1... y s φ(...) No limit for arities of predicates. No limit for the number of existential quantifiers. Our solution Consider binary predicates only. Limit the complexity of formulas.
8 Solution: Weak Closure Operator Definition Let M R k (2). By [M] weak we denote the smallest set satisfying the axioms: 1. {false (2), true (2), eq (2) } [M] weak. 2. If p M then p [M] weak. 3. [M] weak is closed under the following operations: op_permutation(p)(x 0, x 1 ) p(x 1, x 0 ) op_conjunction(p 1, p 2 )(x 0, x 1 ) p 1 (x 0, x 1 ) p 2 (x 0, x 1 ) op_composition(p 1, p 2 )(x 0, x 1 ) y (p 1 (x 0, y) p 2 (y, x 1 ) )
9 Our Plan to Compute All Relational Clones 1. Compute all [ ] weak -closed sets of binary predicates. 2. Analyze the connection between weakly closed sets of binary predicates and relational clones. [M 0 ] weak [M 0 ] p.p. [M 1 ] weak [M 2 ] weak [M 1 ] p.p. = [M 2 ] p.p. [M 3 ] weak weakly closed sets of binary predicates [M 3 ] p.p. relational clones
10 Step 1: Computation of All Weakly Closed Sets of Binary Predicates Algorithm Fix a sequence of all predicates: p 1, p 2,..., p 512. We will use an inductive procedure with 512 steps.
11 Algorithm: Induction Basis [ ] weak
Algorithm: Induction Step n Given: A set {M 0,..., M sn 1 } of all [ ] weak -closed predicate sets generated by predicates p 1, p 2,..., p n 1. Task: Construct all [ ] weak -closed predicate sets generated by p 1, p 2,..., p n 1, p n. M 0 M 1 M 2 M 3 12 M 4
Algorithm: Induction Step n M 0 +p n [M 0 {p n }] weak M 1 M 2 M 3 +p n [M 2 {p n }] weak = [M 3 {p n }] weak M 4 = [M 1 {p n }] weak = [M 4 {p n }] weak 13 new classes constructed on this induction step
14 Results Theorem On three-element set, there are exactly 2, 079, 040 weakly closed sets of binary predicates.
15 Our Plan to Compute All Relational Clones 1. Compute all [ ] weak -closed sets of predicates. 2. Analyze the connection between weakly closed sets of binary predicates and relational clones. [M 0 ] weak [M 0 ] p.p. [M 1 ] weak [M 2 ] weak [M 1 ] p.p. = [M 2 ] p.p. [M 3 ] weak weakly closed sets of binary predicates [M 3 ] p.p. relational clones
16 Step 2: Clone Separation Clone separation problem [M 1 ] weak preserves Given: [M 1 ] weak [M 2 ] weak Decide: [M 1 ] p.p.? = [M 2 ] p.p. f [M 2 ] weak preserves not
17 Step 2: Clone Separation Microsoft Z3 Solver Z3 is a Satisfiability Modulo Theories (SMT) solver. Z3 integrates several decision procedures. Z3 is used in several program analysis, verification, test case generation projects at Microsoft. https://github.com/z3prover/z3
18 Clone Separation: Specification for Z3 ;; define a finite domain (declare-datatypes () ((E3 V0 V1 V2))) ;; define a predicate p1 (declare-fun p1 (E3 E3) Bool) (assert (= (p1 V0 V0) true)) (assert (= (p1 V0 V1) true)) (assert (= (p1 V0 V2) true)) (assert (= (p1 V1 V0) false)) (assert (= (p1 V1 V1) true)) (assert (= (p1 V1 V2) true)) (assert (= (p1 V2 V0) false)) (assert (= (p1 V2 V1) false)) (assert (= (p1 V2 V2) true)) [M] weak preserves preserves not p (p / [M] weak ) f
19 Clone Separation: Specification for Z3 ;; declare f as an uninterpreted functional symbol (declare-fun f (E3 E3) E3) ;; f preserves p1 (assert (forall ((x0_0 E3) (x0_1 E3) (x1_0 E3) (x1_1 E3)) (implies (and (p1 x0_0 x0_1) (p1 x1_0 x1_1)) (and (p1 (f x0_0 x1_0) (f x0_1 x1_1)))))) ;; f does not preserve p (assert (not (forall ((x0_0 E3) (x0_1 E3) (x1_0 E3) (x1_1 E3)) (implies (and (p x0_0 x0_1) (p x1_0 x1_1)) (and (p (f x0_0 x1_0) (f x0_1 x1_1)))))))
Results Theorem (on clone separation) Given [M 1 ] weak [M 2 ] weak. There exists a function f (5) of arity 5 such that (f (5) preserves [M 1 ] weak ) (f (5) preserves [M 2 ] weak ). [M 1 ] weak preserves preserves not f (5) 20 [M 2 ] weak
Results Corollary Lattice of all weakly closed sets of binary predicates is isomorphic to the lattice of all relational clones of degree 2. [M 0 ] weak [M 0 ] p.p. [M 1 ] weak [M 2 ] weak [M 1 ] p.p. [M 2 ] p.p. 21 [M 3 ] weak weakly closed sets of binary predicates [M 3 ] p.p. relational clones
22 Results Theorem (on the closure operator in R 3 (2)) Let M R 3 (2) such that {false (2), true (2), eq (2) } M. Then [M] p.p. R 3 (2) = [M] weak.
23 Example p is expressed as a primitive positive formula over p 1, p 2, p 3, p 4, p 5 : p(x 1, x 2 ) = y 1 y 2 (p 1 (x 1, y 1 ) p 2 (x 2, y 1 ) p 3 (y 1, y 2 ) p 4 (y 2, x 1 ) p 5 (y 2, x 2 ) ). Fix p 1, p 2, p 3, p 4, p 5 R 3 (2). Then there exists a formula φ over op_permutation(p)(x 0, x 1 ) p(x 1, x 0 ) op_conjunction(p 1, p 2 )(x 0, x 1 ) p 1 (x 0, x 1 ) p 2 (x 0, x 1 ) op_composition(p 1, p 2 )(x 0, x 1 ) y (p 1 (x 0, y) p 2 (y, x 1 ) ) such that p(x 1, x 2 ) φ(false (2), true (2), eq (2), p 1, p 2, p 3, p 4, p 5 )(x 1, x 2 ). φ depends on p 1, p 2, p 3, p 4, p 5.
24 On Weak Closure for k 4 Observation (known from Dmitriy N. Zhuk, Reinhard Pöschel) Let k 4. There exists M R k (2) such that [M] p.p. R k (2) [M] weak.
25 On Weak Closure for k 4 0 0 2 2 3 1 3 1 4 4 5 (a) Predicate p R 6(2) 5 (b) Predicate q R 6(2)
26 On Weak Closure for k 4 M = {false (2), true (2), eq (2), p}. [M] weak = M. q(x 1, x 2 ) = y 1 y 2... y k 2 k 2 i=1 p(x 1, y i ) i, j: i j p(y i, y j ) k 2 j=1 p(y j, x 2 ). q [M] p.p. \ [M] weak.
27 Results
28 Results
29 Summary: Finitely Generated Relational Clones Number of relational clones of degree r on k-element set. r = 2 r = 3 r = 4 k = 2 19 44 54 k = 3 2, 079, 040 > 2 50 > 2 500 k = 4 > 2 60 > 2 220 > 2 270
30 Appendix
31 History: Clones of Degree 2 Bashtanov (1989) Classification of binary predicates in P 3 modulo automorphisms of P 3 and permutation of variables. All 74 equivalence classes were found. The number of corresponding clones of functions is 67.
32 History: Clones of Degree 2 Marchenkov S. S. (1997, 2003). A description of clones in P 3 containing the ternary discriminator function p(x, y, z) = z if x = y; x otherwise. 144 clones were described, 6 were missed.
History: Clones of Degree 2 33 Rosenberg (1993). A description of all 23 clones in P 3 containing f(x, y) = 2x + 2y.
34 History: Computer Calculations in Clone Theory Theorem [Wilde, Raney, 1972, without proof] Let Then (P 3 (1), ) has exactly (f g)(x) f(g(x)) 1299 subsemigroups (including ).
35 History: Computer Calculations in Clone Theory Theorem [Csákany, 1983, without proof] P 3 has exactly 84 minimal clones.
36 Thank You! {false (0), true (0), eq (2) } = 2, 079, 040 R 3
37 What is Studied? Let P k be the set of all finitary functions on {0, 1,..., k 1} (k < ℵ 0 ). Definition. F P k is called a clone if 1. F contains all the projection mappings: pr (r) j : (x 1,..., x r ) x j 2. and F is closed under superposition of functions: f (n) F, f (r1) 1 F,..., f (rn) n F, ( ) h (r) (x 1,..., x r ) = f (n) f (r) 1 (x 1,..., x r ),..., f (r) n (x 1,..., x r ) = h (r) F.
38 What is Studied? The set of all clones of P k forms a lattice L(P k ) with respect to inclusion. The lattice L(P k ) is the main object of study in clone theory. 1. L(P 1 ) contains exactly one element. 2. L(P 2 ) is countable. 3. L(P k ) (k 3) has the cardinality of the continuum.
39 Main Tools: Idea of a Function Preserving a Relation Let R k be the set of all finitary predicates on {0, 1,..., k 1}. Definition. f (n) P k preserves p (r) R k if a 1 p (r),..., a n p (r) = f (n) (a 1,..., a n ) p (r). a 1 1 a 1 2 a 1 n a 2 1 a 2 2 a 2 n f (n) b 1 f (n) b 2 a r 1 a r 2 a r n (r) p p (r) p (r) f (n) b r p (r)
40 Main Tools: Idea of a Function Preserving a Relation Rosenberg (1970) Description of all maximal clones in P k based on the idea of a function preserving a relation. Theorem [Rosenberg] Every maximal clone in P k has the form where ρ R (r) k Pol ρ {f P k f preserves ρ} (1 r k).
41 Main Tools: The Galois Connection Between Clones and Relational Clones Krasner (1939, 1945, 1968/69) The connection between algebras and relations was introduced. A special Galois connection between subsets of the permutation groups S n {f P k (1) f is bijective} and subsets of R k was formulated.
42 Main Tools: The Galois Connection Between Clones and Relational Clones Geiger (1968); Bodnarchuk et al. (1969) Galois theory for function algebras and relation algebra. Theorem [Geiger; Bodnarchuk et al.] There exists a one-to-one correspondence between clones and relational clones. If F P k is a clone, then Pol Inv F = F. If M R k is a relational clone, then Inv Pol M = M.
43 Main Tools: The Galois Connection Between Clones and Relational Clones Inv: F {p R k f F : f preserves p} F 3 M 0 lattice of clones of functions F 2 F 1 F 0 M 1 M 2 lattice of relational M 3 clones Pol: M {f P k p M : f preserves p}
44 Solution: Weak Closure Operator Remark (on consistency of weak closure operator) Weak closure [ ] weak is consistent with the closure under all primitive positive formulas: [[M] weak ] p.p.f = [M] p.p.. M [ ] p.p. [ ] weak [ ] p.p. [[M] weak ] p.p. = [M] p.p. [M] weak
45 Appendix Some properties of the lattice of all relational clones of degree 2. Total number of classes 2, 079, 040 Number of maximal subclasses 18 The longest chain size 55 Number of maximal subclones of a given clone 0 30 (average 5.8)