Boolean algebras

In mathematics, our understanding often progresses from more or less concrete examples to abstract concepts, from particular cases to the general one, from something we can understand using our everyday intuition and experience to something whose understanding requires rigorous assumptions and meticulous proofs. Thus, for example, our intuitive notion of change is captured in the definition of the derivative, which itself is a particular example of a linear operator. Similarly, we can immediately see that a square is ‘more symmetric’ than a parallelogram; it is then the task of mathematics to make this precise. One of the powers of abstraction lies in its generality, once a problem is solved on an abstract level, we are immediately freed from solving many individual problems. Perhaps more importantly for mathematics, abstraction simplifies many concepts by removing the irrelevant details, thus allowing us to see the essence of the concept. This movement from the concrete to the abstract will be the guiding principle in this blog post, as I will attempt to motivate Boolean algebras.

In the previous posts, we have discussed what is meant by classical first-order logic and how linear spaces can be used to break the distributivity law, demonstrating that ‘the logic of linear spaces’ does not form a classical logic. The linear spaces were in turn motivated by the fact that they form the state space for quantum mechanics. This time we will take a step back in some sense, we will ignore the fact that first-order logic has quantifiers, and consider only the logical propositions formed using ‘and’, ‘or’ and ‘not’1, we will call it propositional logic.

Although the distributive law does not hold for linear spaces, it looks like whatever ‘the logic of linear spaces’ is, it is not too far from the propositional logic; for example, it still makes sense to ask whether something is not in a given linear space, or whether something is in a linear space A or in a linear space B. This is a typical example of a more general concept lurking behind the corner, we have two very similar things, which disagree in one or two properties, the task is to find what exactly are the similarities of the two.

We begin by defining a bounded lattice, if this feels too boring or too technical, just skip the axioms! Although I have used the symbols \neg, \land and \lor before, for now let’s forget they had any meaning, the only properties they have are the ones derivable from the axioms we are about to introduce. Let L be some set, we will denote the elements of the set by small letters x, y, z, .... Let \land and \lor be some operations on L, that is, for any elements x and y in L both x \land y and x \lor y are again elements of L. We say that such set is a lattice if the following axioms hold.

(1)  x \lor x = x,    x \land x = x

(2)  x \lor y = y \lor x,    x \land y = y \land x

(3)  x \lor (y \lor z) = (x \lor y) \lor z,    x \land (y \land z) = (x \land y) \land z

(4)  (x \lor y) \land y = y,    (x \land y) \lor y = y

In short, the axioms are saying that the operations \land and \lor must be (1) redundant when the input on both sides is the same; (2) symmetric; and (3) associative (i.e. the order of the operations doesn’t matter). The axiom (4) is called absorption. A lattice L is said to be bounded if there are elements 0 and 1 in L so that for any element x in L the following holds.

(5)  x \lor 0 = x,    x \land 1 = x

Note that from (4) and (5) it follows that x \land 0 = 0 and x \lor 1 = 1. In this case 0 is called the bottom element of L and 1 the top element of L, the reason for this terminology will become clear via examples. We now observe that both propositional logic and linear spaces satisfy the axioms (1)-(5).2 For propositional logic, the set L is just the set of all logical propositions, \land the logical ‘and’, \lor the ‘or’, 0 = false is any sentence which is always false and 1 = true any sentence which is always true.

For the logic of linear spaces, L is a linear space, continuing the example of the previous post, we can take this to be a plane. Recall that \land is defined as the intersection of two spaces (which are mostly lines in our examples), and \lor is ‘the smallest linear space containing the two spaces’ (entire plane in the case of two distinct lines). In this case 0 = \textrm{the zero vector space}, that is the origin, and 1 = L, that is the entire plane, so 0 is the smallest space you can get and correspondingly 1 is the largest one.

We have thus succeeded in the task of finding what is common for propositional logic and linear spaces, namely, they are both bounded lattices. What we should be asking next is whether the similarities end here. It turns out the answer is no, there is indeed one more axiom satisfied by both. However, before we go on with comparing propositional logic with linear spaces, it is useful to introduce the notion of a Boolean algebra. A bounded lattice L is called a Boolean algebra if it has an operation \neg and the following two axioms hold (I promise these are the last axioms to be introduced in this post).

(6)  x \land (y \lor z) = (x \land y) \lor (x \land z),    x \lor (y \land z) = (x \lor y) \land (x \lor z)

(7)  x \lor \neg x = 1,    x \land \neg x = 0

The first part of axiom (6) should look familiar, it is the distributive law discussed in most of the previous posts. Interestingly, the two parts of axiom (6) are equivalent, by assuming either one, the other can be derived using the first four axioms.3 Axiom (7) is also, more dramatically, known as ‘The Law of Excluded Middle’, first stating that either the proposition itself or its negation must be true; and that both cannot be simultaneously true.

The easiest example of a Boolean algebra is given by propositional logic, it is indeed distributive, and since each proposition is either true or false, (7) holds. A Boolean algebra doesn’t need to be limited to two truth values though, an example of this is given by ‘the set of all subsets’ of any set (called, again more dramatically, the power set). For example, consider the subsets of the three element set \{1, 2, 3\}, or to make it look less scary, let us call the elements knife, fork and spoon. Now imagine you are a student, consequently, your kitchen drawer only contains one knife, one fork and one spoon, the power set of this drawer is then all the combinations of cutlery you can possibly take out of the drawer. It turns out that there are eight possible combinations, as illustrated by the following graph.

diagram

The symbol \varnothing stands for the empty set, that is, nothing is taken out from the drawer. An arrow between two sets in the graph indicates that the lower set is contained in the upper one. These sets form a Boolean algebra with the following operations; \land is the intersection of two sets, that is, it chooses the elements that are contained in both sets, \lor is the union of two sets, that is, it contains all the elements that are in either of the two sets, and finally, \neg x is the complement of the set x, defined by taking away all the elements of x from {knife, fork, spoon}. The top and bottom elements are {knife, fork, spoon} and \varnothing, respectively. As we can see, the Boolean algebra of the kitchen drawer doesn’t have much to do with truth values, or rather, it has more truth values than just true and false; thus the sentence ‘I took the cutlery from the drawer’ can be partially true if, say, you only took the fork.

Similarly, we can turn the algebra of linear spaces into a Boolean algebra by introducing a restriction on the allowed subspaces. We have already seen that it is a bounded lattice, now define the operation \neg x = x^{\perp} as the orthogonal complement of x, that is, all those spaces perpendicular to x, in the plane this is just another line.

perp

If we now fix two orthogonal subspaces of a given linear space, and include the zero space, then they form a Boolean algebra under the operations as defined before. In two dimensions, this is just a choice of two orthogonal lines, and looks very much like the picture above.

So by requiring the subspaces to be orthogonal, the logic of linear spaces becomes a Boolean algebra, and consequently the distributive law holds. It therefore looks like the non-distributivity, as demonstrated in the previous post, arises because the lines are not orthogonal; and indeed, in the example we used the three lines were chosen so that they are not orthogonal. If we consider a three-dimensional space instead, and pick three lines which are all mutually orthogonal, we can easily see that the distributive law holds, take for example, the following picture.

3daxis

Now x \land (y \lor z) = (x \land y) \lor (x \land z), since intersection will always result in zero, no matter which lines or planes intersect.

In fact, the logic of linear spaces (without requirement of orthogonality) satisfies all the axioms except (6), distributivity. This answers the question about how close the linear spaces are to propositional logic, the answer is: ‘very close’, they only differ by one axiom. There is even a special name for a set which satisfies the axioms (1)-(5) and (7), but not necessarily (6), it is called an orthocomplemented lattice by analogy with orthogonal complements of linear spaces. This demonstrates the power of the abstract approach, the similarities between the two have hopefully become apparent.

To conclude, let me emphasize that in order to turn an algebra of linear spaces into a Boolean algebra (which we would like to do, since we have a good intuitive understanding for Boolean algebras) we had to make a choice of the orthogonal spaces. In general, there are infinitely many such choices. Very roughly speaking, each such choice corresponds to a set of quantum observables whose value can be known simultaneously with arbitrary precision. The internal logic of such set is therefore classical, as the observables form a Boolean algebra. Let us call such choice a Boolean frame; the interesting, and the important, question concerns the interactions of these frames, this is where logic ceases to be classical. One approach to this is to introduce a collection of all possible linear subspaces of a given space, together with some ‘choice maps’ corresponding to the Boolean frames. Now whenever there is a linear map between two Boolean frames, it induces a map between the ‘choice maps’, which hopefully tells us something about the relationship between the observables in different frames. More detailed discussion would unfortunately require us to first cover some topics from category theory, which could on its own be a subject for multiple series of blog posts.

This post concludes my exploration of quantum logic in the form of a blog, which was one part of my summer research project in 2017. It by no means concludes my fascination with the subject, neither my interest to learn more.


1We do not include implication, although it can be constructed using the other operations, namely, x \Rightarrow y \equiv \neg x \lor y.

2For propositional logic, this is pretty much its definition, for linear spaces one has to prove that each axiom holds.

3The proof of this is left for the interested and the inspired, or you can look it up, it is a standard result in lattice theory.

Advertisements

A very brief introduction to logic

Imagine you are walking to a friend’s house. When you reach the right street, you realise you are not sure about the house number; you know that it is either 23 or 24, but can’t remember which one. You also remember that the house is on the left side of the road. Fortunately, you notice that the houses to the right of you all have even numbers, and the ones to the left correspondingly odd. Hence, provided that what you remember is correct, you have enough information to ring the right doorbell without having to guess. Let us break down the possible reasoning going on here:

(1) The friend’s house number is either 23 or 24.
(2) The friend’s house is on the left.
(3) All the houses on the left have an odd number.
(4) The friend’s house has an odd number. (By (3) and (2))
(5) 24 is not odd.
(6) The friend’s house is not 24. (By (4) and (5))
(7) The friend’s house is 23. (By (1) and (6))

What is remarkable about this reasoning is that if (1), (2), (3) and (5) are all true, then so must be (7), that is, the reasoning is truth-preserving. There is, of course, nothing special about houses and numbers, we could equally replace all the words by something which doesn’t even make much sense, for instance:

(1) My foot is either pink or ultramarine.
(2) My foot is stolen.
(3) All stolen feet are liked by the Holy Frog.
(4) My foot is liked by the Holy Frog. (By (3) and (2))
(5) No ultramarine foot is liked by the Holy Frog.
(6) My foot is not ultramarine. (By (4) and (5))
(7) My foot is pink. (By (1) and (6))

Formally, this is still a perfectly valid piece of reasoning. This, of course, by no means implies that the conclusion ‘My foot is pink’ is true; in this case at least (1) and (2) are certainly false, so the conclusion need not to be true. If we learn anything at all from this exercise, it is the following crucial observation; what makes the reasoning correct is its form rather that the content. This is the basic description of philosophical logic, it tries to capture the correct forms of reasoning, by correct we mean truth-preserving here. Formalisation of these rules for reasoning leads to the so called first-order logic.

While the field of mathematical logic is not limited to the first-order logic1, it is the most common one to consider in mathematics, philosophy and computer science. The reason for this is simple; first-order logic captures the reasoning we are familiar with in our everyday life. This kind of logic is intuitive and understandable for us; we are, in fact, as illustrated by the example above, constantly using this kind of inference rules without putting in much effort or paying attention to it. This is the reason why a person who starts learning programming doesn’t need to learn the ‘rules of logic’ first, they are more or less hard-wired in our interaction with the environment.

First-order logic consists of terms, sentential formulas, logical operators and quantifiers. In addition to these, one has to define a well-formed sentence and the inference rules2.  The terms can be thought of as elements of a set denoted by small letters a, b, c, ... ; a term is made into a sentential formula by specifying a property it has, that is, the set it belongs to, these are denoted by capital letters. For example, Hx means ‘x has the property H‘. The logical operators are \neg (not), \land (and), \lor (or) and \Rightarrow (implication). Finally, the quantifiers of first-order logic are \forall (for all) and \exists (there is). Using this formal language, we can now express symbolically the argument given in the example above:

(1) Ty \lor Fy
(2) Ly
(3) \forall x[Lx\Rightarrow Ox]
(4) Oy
(5) \forall x[Fx\Rightarrow \neg Ox]
(6) \neg Fy
(7) Ty

Where we have denoted: y = ‘the friend’s house’, T = ‘has number 23’, F = ‘has number 24’, L = ‘house is on the left’, O = ‘has an odd number’. Thus for example, (3) reads as ‘All houses on the left have an odd number’. To infer (4) from (3) and (2) we first use the inference rule \forall x P(x) \rightarrow P(y) to get Ly\Rightarrow Oy, which together with (2) and the inference rule A, A\Rightarrow B \rightarrow B gives (4). We can now explicitly see that it doesn’t matter what the letters above stand for, the given argument is true because we can justify each step by the inference rules of first-order logic.

The metaphysical status of first-order logic is an interesting question in philosophy, it can be summarised as ‘What makes logical truths true?’ The suggested answers to this include logical realism, asserting that logic is a property of the reality and the logical truths thus tell us something meaningful about the reality itself; and logical formalism, according to which logical truths do not as such provide any new information about how things are in the world, rather, it is their form which makes them necessarily true.3 While the latter view may sound appealing in the light of the previous example, as we are about to see, there is something about logic which seems to carry along some of our assumptions about the physical reality.

Since the inference rules of first-order logic are truth-preserving, if we start with a set of true statements about a physical system, everything we infer from this set of statements using those inference rules will also be true about the physical system in question. Or at least if this is not the case, we have a serious problem with either our physical understanding of the system, or with our logic. To illustrate this, consider the following example. We are told that a cyclist is somewhere on a road, and has a speed of 30 km/h. It is immediately obvious to us that this is equivalent to: ‘either the cyclist is on the first half of the road with the speed of 30 km/h, or the cyclist is on the second half of the road with the speed of 30 km/h’. This rephrasing is in fact so trivial that you could (rightfully) complain that this is pointless and I am just doing it to overcomplicate things. It does, however, illustrate a more general property of classical logic called distributivity. Using the formal notation defined above, distributivity can be expressed as:

\displaystyle x \land (y \lor z) = (x \land y) \lor (x \land z)

What makes this obvious property of classical logic extremely fascinating is that it no longer holds in general for quantum mechanical systems.


1One can indeed come up with an entire zoo of exotic logics in mathematics, the Wikipedia entry has a good overview of these, https://en.wikipedia.org/wiki/Mathematical_logic
2For a full list of properties defining first-order logic, see http://mathworld.wolfram.com/First-OrderLogic.html
3For further reading, see https://plato.stanford.edu/entries/logic-ontology/