#jsDisabledContent { display:none; } My Account |  Register |  Help

# Boolean algebra

Article Id: WHEBN0012351101
Reproduction Date:

 Title: Boolean algebra Author: World Heritage Encyclopedia Language: English Subject: Collection: Publisher: World Heritage Encyclopedia Publication Date:

### Boolean algebra

In mathematics and mathematical logic, Boolean algebra is the subarea of algebra in which the values of the variables are the truth values true and false, usually denoted 1 and 0 respectively. Instead of elementary algebra where the values of the variables are numbers, and the main operations are addition and multiplication, the main operations of Boolean algebra are the conjunction and, denoted ∧, the disjunction or, denoted ∨, and the negation not, denoted ¬. It is thus a formalism for describing logical relations in the same way that ordinary algebra describes numeric relations.

Boolean algebra was introduced by An Investigation of the Laws of Thought (1854).[1] According to Huntington the term "Boolean algebra" was first suggested by Sheffer in 1913.[2]

Boolean algebra has been fundamental in the development of digital electronics, and is provided for in all modern programming languages. It is also used in set theory and statistics.[3]

## Contents

• History 1
• Values 2
• Operations 3
• Basic operations 3.1
• Derived operations 3.2
• Laws 4
• Monotone laws 4.1
• Nonmonotone laws 4.2
• Completeness 4.3
• Duality principle 4.4
• Diagrammatic representations 5
• Venn diagrams 5.1
• Digital logic gates 5.2
• Boolean algebras 6
• Concrete Boolean algebras 6.1
• Subsets as bit vectors 6.2
• The prototypical Boolean algebra 6.3
• Boolean algebras: the definition 6.4
• Representable Boolean algebras 6.5
• Axiomatizing Boolean algebra 7
• Propositional logic 8
• Applications 8.1
• Deductive systems for propositional logic 8.2
• Sequent calculus 8.2.1
• Applications 9
• Two-valued logic 9.1
• Boolean operations 9.2
• Boolean searches 9.2.1
• References 11

## History

Boole's algebra predated the modern developments in abstract algebra and mathematical logic; it is however seen as connected to the origins of both fields.[4] In an abstract setting, Boolean algebra was perfected in the late 19th century by Jevons, Schröder, Huntington, and others until it reached the modern conception of an (abstract) mathematical structure.[4] For example, the empirical observation that one can manipulate expressions in the algebra of sets by translating them into expressions in Boole's algebra is explained in modern terms by saying that the algebra of sets is a Boolean algebra (note the indefinite article). In fact, M. H. Stone proved in 1936 that every Boolean algebra is isomorphic to a field of sets.

In the 1930s, while studying switching circuits, Claude Shannon observed that one could also apply the rules of Boole's algebra in this setting, and he introduced switching algebra as a way to analyze and design circuits by algebraic means in terms of logic gates. Shannon already had at his disposal the abstract mathematical apparatus, thus he cast his switching algebra as the two-element Boolean algebra. In circuit engineering settings today, there is little need to consider other Boolean algebras, thus "switching algebra" and "Boolean algebra" are often used interchangeably.[5][6][7] Efficient implementation of Boolean functions is a fundamental problem in the design of combinatorial logic circuits. Modern electronic design automation tools for VLSI circuits often rely on an efficient representation of Boolean functions known as (reduced ordered) binary decision diagrams (BDD) for logic synthesis and formal verification.[8]

Logic sentences that can be expressed in classical propositional calculus have an equivalent expression in Boolean algebra. Thus, Boolean logic is sometimes used to denote propositional calculus performed in this way.[9][10][11] Boolean algebra is not sufficient to capture logic formulas using quantifiers, like those from first order logic. Although the development of mathematical logic did not follow Boole's program, the connection between his algebra and logic was later put on firm ground in the setting of algebraic logic, which also studies the algebraic systems of many other logics.[4] The problem of determining whether the variables of a given Boolean (propositional) formula can be assigned in such a way as to make the formula evaluate to true is called the Boolean satisfiability problem (SAT), and is of importance to theoretical computer science, being the first problem shown to be NP-complete. The closely related model of computation known as a Boolean circuit relates time complexity (of an algorithm) to circuit complexity.

## Values

Whereas in elementary algebra expressions denote mainly numbers, in Boolean algebra they denote the truth values false and true. These values are represented with the bits (or binary digits), namely 0 and 1. They do not behave like the integers 0 and 1, for which 1 + 1 = 2, but may be identified with the elements of the two-element field GF(2), that is, integer arithmetic modulo 2, for which 1 + 1 = 0. Addition and multiplication then play the Boolean roles of XOR (exclusive-or) and AND (conjunction) respectively, with disjunction xy (inclusive-or) definable as x + y + xy.

Boolean algebra also deals with functions which have their values in the set {0, 1}. A sequence of bits is a commonly used such function. Another common example is the subsets of a set E: to a subset F of E is associated the indicator function that takes the value 1 on F and 0 outside F. The most general example is the elements of a Boolean algebra, with all of the foregoing being instances thereof.

As with elementary algebra, the purely equational part of the theory may be developed without considering explicit values for the variables.[12]

## Operations

### Basic operations

The basic operations of Boolean algebra are as follows.

• And (conjunction), denoted xy (sometimes x AND y or Kxy), satisfies xy = 1 if x = y = 1 and xy = 0 otherwise.
• Or (disjunction), denoted xy (sometimes x OR y or Axy), satisfies xy = 0 if x = y = 0 and xy = 1 otherwise.
• Not (negation), denoted ¬x (sometimes NOT x, Nx or !x), satisfies ¬x = 0 if x = 1 and ¬x = 1 if x = 0.

If the truth values 0 and 1 are interpreted as integers, these operation may be expressed with the ordinary operations of the arithmetic:

\begin{align} x \wedge y & = x \times y \\ x \vee y & = x + y - (x \times y) \\ \neg x & = 1 - x \end{align}

Alternatively the values of xy, xy, and ¬x can be expressed by tabulating their values with truth tables as follows.

One may consider that only the negation and one of the two other operations are basic, because of the following identities that allow to define the conjunction in terms of the negation and the disjunction, and vice versa:

\begin{align} x \wedge y & = \neg(\neg x \vee \neg y) \\ x \vee y & = \neg(\neg x \wedge \neg y) \end{align}

### Derived operations

The three Boolean operations described above are referred to as basic, meaning that they can be taken as a basis for other Boolean operations that can be built up from them by composition, the manner in which operations are combined or compounded. Operations composed from the basic operations include the following examples:

x \rightarrow y = \neg{x} \vee y
x \oplus y = (x \vee y) \wedge \neg{(x \wedge y)}
x \equiv y = \neg{(x \oplus y)}

These definitions give rise to the following truth tables giving the values of these operations for all four possible inputs.

x y x \rightarrow y x \oplus y x \equiv y
0 0 1 0 1
1 0 0 1 0
0 1 1 1 0
1 1 1 0 1

The first operation, x → y, or Cxy, is called material implication. If x is true then the value of x → y is taken to be that of y. But if x is false then the value of y can be ignored; however the operation must return some truth value and there are only two choices, so the return value is the one that entails less, namely true. (Relevance logic addresses this by viewing an implication with a false premise as something other than either true or false.)

The second operation, x ⊕ y, or Jxy, is called exclusive or to distinguish it from disjunction as the inclusive kind. It excludes the possibility of both x and y. Defined in terms of arithmetic it is addition mod 2 where 1 + 1 = 0.

The third operation, the complement of exclusive or, is equivalence or Boolean equality: x ≡ y, or Exy, is true just when x and y have the same value. Hence x ⊕ y as its complement can be understood as x ≠ y, being true just when x and y are different. Its counterpart in arithmetic mod 2 is x + y + 1.

Given two operands, each with two possible values, there are 22 = 4 possible combinations of inputs. Because each output can have two possible values, there are a total of 24 = 16 possible binary Boolean operations.

## Laws

A law of Boolean algebra is an identity such as x∨(yz) = (xy)∨z between two Boolean terms, where a Boolean term is defined as an expression built up from variables and the constants 0 and 1 using the operations ∧, ∨, and ¬. The concept can be extended to terms involving other Boolean operations such as ⊕, →, and ≡, but such extensions are unnecessary for the purposes to which the laws are put. Such purposes include the definition of a Boolean algebra as any model of the Boolean laws, and as a means for deriving new laws from old as in the derivation of x∨(yz) = x∨(zy) from yz = zy as treated in the section on axiomatization.

### Monotone laws

Boolean algebra satisfies many of the same laws as ordinary algebra when one matches up ∨ with addition and ∧ with multiplication. In particular the following laws are common to both kinds of algebra:[13]

\begin{align} &\text{Associativity of } \vee & x \vee (y \vee z) & = (x \vee y) \vee z \\ &\text{Associativity of } \wedge & x \wedge (y \wedge z) & = (x \wedge y) \wedge z \\ &\text{Commutativity of } \vee & x \vee y & = y \vee x \\ &\text{Commutativity of } \wedge & x \wedge y & = y \wedge x \\ &\text{Distributivity of } \wedge \text{ over } \vee \quad & x \wedge (y \vee z) & = (x \wedge y) \vee (x \wedge z) \\ &\text{Identity for } \vee & x \vee 0 & = x \\ &\text{Identity for } \wedge & x \wedge 1 & = x \\ &\text{Annihilator for } \wedge & x \wedge 0 & = 0 \\ \end{align}

Boolean algebra however obeys some additional laws, in particular the following:[13]

\begin{align} &\text{Idempotence of } \vee & x \vee x & = x \\ &\text{Idempotence of } \wedge & x \wedge x & = x \\ &\text{Absorption 1} & x \wedge (x \vee y) & = x \\ &\text{Absorption 2} & x \vee (x \wedge y) & = x \\ &\text{Distributivity of } \vee \text{ over } \wedge \quad & x \vee (y \wedge z) & = (x \vee y) \wedge (x \vee z) \\ &\text{Annihilator for } \vee & x \vee 1 & = 1 \end{align}

A consequence of the first of these laws is 1∨1 = 1, which is false in ordinary algebra, where 1+1 = 2. Taking x = 2 in the second law shows that it is not an ordinary algebra law either, since 2×2 = 4. The remaining four laws can be falsified in ordinary algebra by taking all variables to be 1, for example in Absorption Law 1 the left hand side is 1(1+1) = 2 while the right hand side is 1, and so on.

All of the laws treated so far have been for conjunction and disjunction. These operations have the property that changing either argument either leaves the output unchanged or the output changes in the same way as the input. Equivalently, changing any variable from 0 to 1 never results in the output changing from 1 to 0. Operations with this property are said to be monotone. Thus the axioms so far have all been for monotonic Boolean logic. Nonmonotonicity enters via complement ¬ as follows.[3]

### Nonmonotone laws

The complement operation is defined by the following two laws.

\begin{align} &\text{Complementation 1} & x \wedge \neg x & = 0 \\ &\text{Complementation 2} & x \vee \neg x & = 1 \end{align}

All properties of negation including the laws below follow from the above two laws alone.[3]

In both ordinary and Boolean algebra, negation works by exchanging pairs of elements, whence in both algebras it satisfies the double negation law (also called involution law)

\begin{align} &\text{Double negation} & \neg{(\neg{x})} & = x \end{align}

But whereas ordinary algebra satisfies the two laws

\begin{align} (-x)(-y) & = xy \\ (-x) + (-y) & = -(x + y) \end{align}

Boolean algebra satisfies axiomatization of Boolean algebra. Every law of Boolean algebra follows logically from these axioms. Furthermore Boolean algebras can then be defined as the models of these axioms as treated in the section thereon.

To clarify, writing down further laws of Boolean algebra cannot give rise to any new consequences of these axioms, nor can it rule out any model of them. In contrast, in a list of some but not all of the same laws, there could have been Boolean laws that did not follow from those on the list, and moreover there would have been models of the listed laws that were not Boolean algebras.

This axiomatization is by no means the only one, or even necessarily the most natural given that we did not pay attention to whether some of the axioms followed from others but simply chose to stop when we noticed we had enough laws, treated further in the section on axiomatizations. Or the intermediate notion of axiom can be sidestepped altogether by defining a Boolean law directly as any tautology, understood as an equation that holds for all values of its variables over 0 and 1. All these definitions of Boolean algebra can be shown to be equivalent.

Boolean algebra has the interesting property that x = y can be proved from any non-tautology. This is because the substitution instance of any non-tautology obtained by instantiating its variables with constants 0 or 1 so as to witness its non-tautologyhood reduces by equational reasoning to 0 = 1. For example the non-tautologyhood of xy = x is witnessed by x = 1 and y = 0 and so taking this as an axiom would allow us to infer 1∧0 = 1 as a substitution instance of the axiom and hence 0 = 1. We can then show x = y by the reasoning x = x∧1 = x∧0 = 0 = 1 = y∨1 = y∨0 = y.

### Duality principle

There is nothing magical about the choice of symbols for the values of Boolean algebra. We could rename 0 and 1 to say α and β, and as long as we did so consistently throughout it would still be Boolean algebra, albeit with some obvious cosmetic differences.

But suppose we rename 0 and 1 to 1 and 0 respectively. Then it would still be Boolean algebra, and moreover operating on the same values. However it would not be identical to our original Boolean algebra because now we find ∨ behaving the way ∧ used to do and vice versa. So there are still some cosmetic differences to show that we've been fiddling with the notation, despite the fact that we're still using 0s and 1s.

But if in addition to interchanging the names of the values we also interchange the names of the two binary operations, now there is no trace of what we have done. The end product is completely indistinguishable from what we started with. We might notice that the columns for xy and xy in the truth tables had changed places, but that switch is immaterial.

When values and operations can be paired up in a way that leaves everything important unchanged when all pairs are switched simultaneously, we call the members of each pair dual to each other. Thus 0 and 1 are dual, and ∧ and ∨ are dual. The Duality Principle, also called De Morgan duality, asserts that Boolean algebra is unchanged when all dual pairs are interchanged.

One change we did not need to make as part of this interchange was to complement. We say that complement is a self-dual operation. The identity or do-nothing operation x (copy the input to the output) is also self-dual. A more complicated example of a self-dual operation is (xy) ∨ (yz) ∨ (zx). There is no self-dual binary operation that depends on both its arguments. A composition of self-dual operations is a self-dual operation. For example, if f(x,y,z) = (x∧y) ∨ (y∧z) ∨ (z∧x), then f(f(x,y,z),x,t) is a self-dual operation of four arguments x,y,z,t.

The principle of duality can be explained from a group theory perspective by fact that there are exactly four functions that are one-to-one mappings (automorphisms) of the set of Boolean polynomials back to itself: the identity function, the complement function, the dual function and the contradual function (complemented dual). These four functions form a group under function composition, isomorphic to the Klein four-group, acting on the set of Boolean polynomials.[14]

## Diagrammatic representations

### Venn diagrams

A Venn diagram[15] is a representation of a Boolean operation using shaded overlapping regions. There is one region for each variable, all circular in the examples here. The interior and exterior of region x corresponds respectively to the values 1 (true) and 0 (false) for variable x. The shading indicates the value of the operation for each combination of regions, with dark denoting 1 and light 0 (some authors use the opposite convention).

The three Venn diagrams in the figure below represent respectively conjunction xy, disjunction xy, and complement ¬x.

Figure 2. Venn diagrams for conjunction, disjunction, and complement

For conjunction, the region inside both circles is shaded to indicate that xy is 1 when both variables are 1. The other regions are left unshaded to indicate that xy is 0 for the other three combinations.

The second diagram represents disjunction xy by shading those regions that lie inside either or both circles. The third diagram represents complement ¬x by shading the region not inside the circle.

While we have not shown the Venn diagrams for the constants 0 and 1, they are trivial, being respectively a white box and a dark box, neither one containing a circle. However we could put a circle for x in those boxes, in which case each would denote a function of one argument, x, which returns the same value independently of x, called a constant function. As far as their outputs are concerned, constants and constant functions are indistinguishable; the difference is that a constant takes no arguments, called a zeroary or nullary operation, while a constant function takes one argument, which it ignores, and is a unary operation.

Venn diagrams are helpful in visualizing laws. The commutativity laws for ∧ and ∨ can be seen from the symmetry of the diagrams: a binary operation that was not commutative would not have a symmetric diagram because interchanging x and y would have the effect of reflecting the diagram horizontally and any failure of commutativity would then appear as a failure of symmetry.

Idempotence of ∧ and ∨ can be visualized by sliding the two circles together and noting that the shaded area then becomes the whole circle, for both ∧ and ∨.

To see the first absorption law, x∧(xy) = x, start with the diagram in the middle for xy and note that the portion of the shaded area in common with the x circle is the whole of the x circle. For the second absorption law, x∨(xy) = x, start with the left diagram for xy and note that shading the whole of the x circle results in just the x circle being shaded, since the previous shading was inside the x circle.

The double negation law can be seen by complementing the shading in the third diagram for ¬x, which shades the x circle.

To visualize the first De Morgan's law, (¬x)∧(¬y) = ¬(xy), start with the middle diagram for xy and complement its shading so that only the region outside both circles is shaded, which is what the right hand side of the law describes. The result is the same as if we shaded that region which is both outside the x circle and outside the y circle, i.e. the conjunction of their exteriors, which is what the left hand side of the law describes.

The second De Morgan's law, (¬x)∨(¬y) = ¬(xy), works the same way with the two diagrams interchanged.

The first complement law, x∧¬x = 0, says that the interior and exterior of the x circle have no overlap. The second complement law, x∨¬x = 1, says that everything is either inside or outside the x circle.

### Digital logic gates

Digital logic is the application of the Boolean algebra of 0 and 1 to electronic hardware consisting of logic gates connected to form a circuit diagram. Each gate implements a Boolean operation, and is depicted schematically by a shape indicating the operation. The shapes associated with the gates for conjunction (AND-gates), disjunction (OR-gates), and complement (inverters) are as follows.[16]

The lines on the left of each gate represent input wires or ports. The value of the input is represented by a voltage on the lead. For so-called "active-high" logic, 0 is represented by a voltage close to zero or "ground", while 1 is represented by a voltage close to the supply voltage; active-low reverses this. The line on the right of each gate represents the output port, which normally follows the same voltage conventions as the input ports.

Complement is implemented with an inverter gate. The triangle denotes the operation that simply copies the input to the output; the small circle on the output denotes the actual inversion complementing the input. The convention of putting such a circle on any port means that the signal passing through this port is complemented on the way through, whether it is an input or output port.

The

• Boolean Algebra chapter on All About Circuits
• How Stuff Works – Boolean Logic
• Science and Technology - Boolean Algebra contains a list and proof of Boolean theorems and laws.