Equational Theories

1 Basic theory of magmas

Definition 1.1 Magma
#

A magma is a set G equipped with a binary operation :G×GG. A homomorphism φ:GH between two magmas is a map such that φ(xy)=φ(x)φ(y) for all x,yG. An isomorphism is an invertible homomorphism.

Groups, semi-groups, and monoids are familiar examples of magmas. However, in general we do not expect magmas to have any associative properties. In some literature, magmas are also known as groupoids, although this term is also used for a slightly different object (a category with inverses).

A magma is called empty if it has cardinality zero, singleton if it has cardinality one, and non-trivial otherwise.

The number of magma structures on a set G of cardinality n is of course nn2, which is 1

1,1,16,19683,4294967296,298023223876953125,

(OEIS A002489). Up to isomorphism, the number of finite magmas of cardinality n up to isomorphism is the slightly slower growing sequence

1,1,10,3330,178981952,2483527537094825,14325590003318891522275680,

(OEIS A001329).

Definition 1.2 Free Magma
#

The free magma MX generated by a set X (which we call an alphabet) is the set of all finite formal expressions built from elements of X and the operation . An element of MX will be called a word with alphabet X. The order of a word is the number of symbols needed to generate the word. Thus for instance X is precisely the set of words of order 0 in MX.

For sake of concreteness, we will take the alphabet X to default to the natural numbers N if not otherwise specified.

For instance, if X={0,1}, then MX would consist of the following words:

  • 0, 1 (the words of order 0);

  • 00, 01, 10, 11 (the words of order 1);

  • 0(00), 0(01), 0(10), 0(11), 1(00), 1(01), 1(10), 1(11), (00)0, (00)1, (01)0, (01)1, (10)0, (10)1, (11)0, (11)1 (the words of order 2);

  • etc.

Lemma 1.3

For a finite alphabet X, the number of words of order n is Cn|X|n+1, where Cn is the nth Catalan number and X is the cardinality of X.

Proof

The first few Catalan numbers are

1,1,2,5,14,42,132,

(OEIS A000108).

Definition 1.4 Induced homomorphism

Given a function f:XG from an alphabet X to a magma G, the induced homomorphism φf:MXG is the unique extension of f to a magma homomorphism. Similarly, if π:XY is a function, we write π:MXMY for the unique extension of π to a magma homomorphism.

For instance, if f:{0,1}G maps 0,1 to x,y respectively, then

φf(01)=xy
φf(1(01))=y(xy)

and so forth. If π:NN is the map π(n):=n+1, then

π(01)=12
π(1(01))=2(12)

and so forth.

Definition 1.5 Law
#

Let X be a set. A law with alphabet X is a formal expression of the form ww, where w,wMX are words with alphabet X (thus one can identify laws with alphabet X with elements of MX×MX). A magma G satisfies the law ww if we have φf(w)=φf(w) for all f:XG, in which case we write Gww.

Thus, for instance, the commutative law

0110
1

is satisfied by a magma G if and only if

xy=yx
2

for all x,yG. We refer to Equation 2 as the equation associated to the law Equation 1. One can think of equations as the “semantic” interpretation of a “syntactic” law. However, we shall often abuse notation and identify a law with its associated equation. In particular, we shall (somewhat carelessly) also refer to Equation 2 as “the commutative law” (rather than “the commutative equation”).

Definition 1.6 Models
#

A theory is a set Γ of laws. Given a theory Γ, a magma G is a model of Γ with the (overloaded) notation GΓ if Gww for every ww in Γ; we also say that G obeys Γ. Given a law E, we write ΓE if every magma G that models Γ, also models E.

Definition 1.7 Derivation
#

Given a theory Γ and a law ww over a fixed alphabet X, we say that Γ derives ww, and write Γww, if the law can be obtained using a finite number of applications of the following rules:

  1. if wwΓ, then Γww.

  2. Γww for any word w.

  3. if Γww, then Γww.

  4. if Γww and Γww, then Γww.

  5. if Γww, then Γφf(w)φf(w) for every f:XMX.

  6. if Γw1w2 and Γw3w4, then Γw1w3w2w4.

This definition is useful because of the following theorem:

Theorem 1.8 Birkhoff’s completeness theorem
#

For any theory Γ and words w,w over a fixed alphabet

Γww iff Γww.
Proof
Corollary 1.9 Compactness theorem

Let Γ be a theory, and let E be a law. Then ΓE if and only if there exists a finite subset Γ of Γ such that ΓE.

Proof
Lemma 1.10 Pushforward

Let ww be a law with some alphabet X, G be a magma, and π:XY be a function. If Gww, then Gπ(w)π(w). In particular, if π is a bijection, the statements Gww and Gπ(w)π(w) are equivalent.

Proof

If π is a bijection, we will call π(w)π(w) a relabeling of the law ww. Thus for instance

5775

is a relabeling of the commutative law Equation 1. By the above lemma, relabeling does not affect whether a given magna satisfies a given law.

Lemma 1.11 Equivalence

Let G be a magma and X be an alphabet. Then the relation Gww is an equivalence relation on MX.

Proof

Define the total order of a law ww to be the sum of the orders of w and w.

Lemma 1.12 Counting laws up to relabeling

Up to relabeling, the number of laws ww of total order n is Cn+1Bn+2.

Proof

The first few Bell numbers are

1,1,2,5,15,52,203,

(OEIS A000110).

The sequence in Lemma 1.12 is

2,10,75,728,8526,115764,

(OEIS A289679).

Now we would also like to count laws up to relabeling and symmetry.

Lemma 1.13 Counting laws up to relabeling and symmetry

Up to relabeling and symmetry, the number of laws ww of total order n is

Cn+1Bn+2/2

when n is odd, and

(Cn+1Bn+2+Cn/2(2Dn+2Bn+2))/2

when n is even, where Dn is the number of partitions of [n] up to reflection.

Proof

The sequence Dn is

1,1,2,4,11,32,117,

(OEIS A103293), and the sequence in Lemma 1.13 is

2,5,41,364,4294,57882,888440,

(OEIS A376620).

We can also identify all laws of the form ww with the trivial law 00. The number of such laws of total order n is zero if n is odd, and Cn/2Bn/2+1 if n is even. We conclude:

Lemma 1.14 Counting laws up to relabeling, symmetry, and triviality

Up to relabeling, symmetry, and triviality, the number of laws of total order n is

Cn+1Bn+2/2

if n is odd, 2 if n=0, and

(Cn+1Bn+2+Cn/2(2Dn+2Bn+2))/2Cn/2Bn/2+1

if n2 is even.

Proof

This sequence is

2,5,39,364,4284,57882,888365,

(OEIS A376640).

In particular, up to relabeling, symmetry, and triviality, there are exactly 2+5+39+364+4284=4694 laws of total order at most 4. A list can be found here. A script for generating them may be found here. The ordering of these equations is according to the following rules. First, an ordering on expressions with placeholder variables (such as ()):

  • (i) Expressions of lower order come before expressions of higher order.

  • (ii) Expressions wLwR of a given total order that is at least one are ordered lexicographically first by the ordering on the left component wL, and then by the ordering on the right component wR if the left components agree.

For instance, is less than (), which is less than ().

Then, we order placeholder equations such as ()(), where both sides are given placeholder variables:

  • (i) Equations of lower total order come before equations of higher total order.

  • (ii) Equations ww of a given total order are ordered lexicographically first by the ordering on the left-hand side w, and then by the ordering on the right hand side w if the left-hand sides agree.

For instance, () is less than ().

Finally, we order (and reduce) equations of the form ww as follows. Define the shape of an equation to be the equation in which all variables are replaced by placeholders .

  • (i) Equations of lower shape will be of lower order. For instance, any equation of shape () is less than any equation ().

  • (ii) Among equations of equations of equal shape, equations whose variables are first in the lexicographical ordering will be lower. For instance, 000(00) is less than 001(11), which is in turn less than 010(00).

  • (iii) Only the arrangement of the equation (up to relabeling and symmetry) which is minimal in this ordering is retained in the list. For instance, we do not retain 121 because it can be replaced by 001, which is earlier in the ordering.

  • (iv) Any trivial equation ww, other than the order zero law 00, is discarded.

1.0.1 Alternate formula

For integers 0ab let E(a,b) be the number of magma equations t1=t2 with t1 of order a, t2 of order b, counting up to relabelling, up to switching terms, and only allowing the equation x=x of the form t=t. Then one has

  • E(0,0)=2.

  • If ab:

    E(a,b)=12T(a)(T(a)1)1pa+11qb+10smin(p,q){a+1p}{b+1q}(ps)(qs)s! .
  • If a=b>0:

    Unknown environment 'bgroup'

Here the Stirling numbers {nm} of the second kind count the number of ways to partition a set of n elements into m non-empty subsets,

T(n)\coloneq1n+1(2nn)

counts the number of plane binary trees of order n, and.

Idem(n)=0kn/2(n2k)(2k1)!!

counts the number of idempotent bijections on n elements.

The number of magma equations of order n (under the given constraints) is then equal to

0an/2E(a,na).

For further details, as well as Maple calculations for E(a,b), see this folder.

  1. All sequences start from n=0 unless otherwise specified.