10 Some abstract nonsense
This is an alternate presentation of the material of the previous section, where we use the “abstract nonsense” of free magmas in the presence of a theory as the conceptual foundation.
Definition
10.1
Free magma relative to a theory
Let be a theory with an alphabet . A free magma with alphabet subject to the theory is a magma together with a function , with the following properties:
- (i)
obeys the theory : .
- (ii)
For any magma obeying the theory and any function , there exists a unique magma homomorphism such that .
Such magmas exist and are unique up to a suitable isomorphism:
Theorem
10.2
Existence and uniqueness of free magmas
Let be a theory with alphabet .
- (i)
There exists a free magma with alphabet subject to the theory .
- (ii)
If and are two free magmas with alphabet subject to the theory , then there exists a unique magma isomorphism such that .
We remark that the ordinary free magma corresponds to the case when is the empty theory.
Proof
▶
For (i), we define , where the equivalence relation is defined by requiring if and only if ; this is an equivalence relation thanks to Lemma 1.11, and from Theorem 1.8 we see that this relation respects the magma operations, so that is a magma. The map is defined by setting to be the equivalence class of in for each .
We first check that obeys . Let be a law in , and let be a function. We may lift this function to a function . From Definition 1.7, we have and hence . By Theorem 1.8, we conclude . Quotienting by , we conclude that , giving the claim by Definition 1.6.
Now we check the universal property (ii). Let be a magma obeying the theory , and let be a function, then we have a magma homomorphism . If are such that , then and hence . Hence descends to a map , which one can check to be a magma homomorphism with . By construction, is generated by , and so this homomorphism is unique.
Example
5
Free associative magma
Let consist solely of the associative law, Definition 2.46 (so contains ). Then one can take to be the set of nonempty strings with alphabet , with magma operation given by concatenation, and being the length one string . It is a routine matter to verify that this obeys the axioms of a free magma subject to .
Example
6
Free associative commutative magma
Let consist of the associative law (Definition 2.46) and the commutative law (Definition 2.18). Then one can take to be the free abelian monoid of tuples with the natural numbers, not all zero, with all but finitely many of the vanishing, with the magma operation given by vector addition, and with being the standard generator of associated to ; one can think of this space as the space of formal non-empty commuting associating sums of . It is a routine matter to verify that this obeys the axioms of a free magma subject to .
Example
7
Free left absorptive magma
Let consist of the left absorptive law (Definition 2.4). Then one can take to be with the law , and to be the identity map. It is easy to see that this is indeed a free magma subject to .
Example
8
Free constant magma
Let consist of the constant law (Definition 2.20). Then one can take to be the disjoint union of and another object , with being the identity embedding, and with the zero magma law for all .
Free magmas can be used to characterize entailment by in terms of a canonical invariant.
Theorem
10.3
Canonical invariant
Let be a theory with some alphabet , and let be a free magma with alphabet subject to , with associated map . Then for any , we have
Proof
▶
By Theorem 10.2 we may take to be the canonical free magma constructed in the proof of that theorem. The claim is then clear from expanding out definitions.
Every theory then gives a metatheorem about anti-implication:
Corollary
10.4
Criterion for anti-implication
Let be a theory with some alphabet , and let be a free magma with alphabet subject to , with associated map . Let and be laws with alphabet . If one has
but
then the law cannot imply the law .
Proof
▶
By Theorem 10.3, the hypothesis is equivalent to , and the hypothesis is equivalent to . The claim follows.
Example
9
Let be the associative and commutative law, so that we can take as in Example 6. One can then check that for any word , that is the tuple that assigns to each letter of the alphabet, the number of times appears in . We conclude that if have the same number of occurrences of each letter of the alphabet, but do not, then cannot imply . This recovers Theorem 4.8.
Example
10
Let consist of the left absorption law, so we can take as in Example 7. Then is the first letter of . We conclude that if have the same first letter, but do not, then cannot imply .
Example
11
Let consist of the constant law, so we can take as in Example 8. Then is if is just a letter of the alphabet, and otherwise. We conclude that if have order at least one, but has order zero, then cannot imply ; this is basically Theorem 4.7.
Example
12
Let be the theory consisting of the commutative and associative laws, and an additional law for a fixed , where denotes the magma operation applied to copies of (the order is irrelevant thanks to associativity), then one can check (for finite ) that the free magma can be taken to be with the addition operation, and being the standard generator associated to . Then for any word , corresponds to a tuple that assigns to each letter of the alphabet, the number of times occurs in modulo . We conclude that if have the same number of occurrences modulo of each letter of the alphabet, but do not, then cannot imply . This is a stronger version of Theorem 4.8.
10.1 Confluent theories
One promising source of theories for which the free magma can be understood are the confluent theories.
Definition
10.5
Confluent theory
Let be a theory. A word can be reduced to another if one can get from to by a series of substitutions of laws in , where no substitution increases the length of the word this is a working definition, might not be the best one to keep.. A theory is confluent if whenever a word can be reduced to both and , then both and can be reduced further to a common reduction . As such, each word should have a unique simplification to a reduced word in some normal form, for instance the shortest reduction that is minimal with respect to some suitable ordering such as lexicographical ordering.
Example
13
The associative law, Definition 2.46, appears to be confluent check this.
Example
15
The idempotent law, Definition 2.3, appears to be confluent check this.
The significance of confluent theories lies in
Theorem
10.6
Free magma of a confluent theory
Let be a confluent theory. Then the free magma subject to this theory can be described as the space of reduced words in in normal form, where the operation on this magma is defined as the normal form reduction of , and is the identity embedding (note that every single-letter word is already in normal form).
Proof
▶
Should just be a matter of expanding definitions properly.
Corollary
10.7
Criterion for anti-implication
Let be a confluent theory. Then a law is a consequence of if and only if have the same normal form reduction. In particular, a law with this property cannot imply a law without this property.
It is thus of interest to locate some confluent laws. Here is a non-trivial example:
Theorem
10.8
477 confluent
Proof
▶
See the notes here. A sketch of proof is as follows. We induct on the length of the term. As before we consider terms of the form . Also, in both sequences if a simplification is applied to the whole term, then we can assume the sequence is simply final.
By Lemma 10.9, if any of the two sequences is final, then right before the last step, the two factors of the outermost product are both simple. This is also true for the result of the non-final sequence. By the induction hypothesis, they can be identified correspondingly, so the two sequences are either both final or both non-final, and in the first case, the same simplification is applied to give the same result.
Lemma
10.9
477 lemma
If and are simple, then is simple.
Proof
▶
Assume the contrary. Then we have 2 cases.
Case 1: matches the pattern , with occurrences of (). Since , but , this is impossible.
Case 2: matches the pattern . Since , we have , so , contradicting . □