HOME

TheInfoList




In
mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ...
and
mathematical logic Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of formal sys ...
, Boolean algebra is the branch of
algebra Algebra (from ar, الجبر, lit=reunion of broken parts, bonesetting, translit=al-jabr) is one of the areas of mathematics, broad areas of mathematics, together with number theory, geometry and mathematical analysis, analysis. In its most ge ...

algebra
in which the values of the variables are the
truth value In logic and mathematics, a truth value, sometimes called a logical value, is a value indicating the relation of a proposition to truth. Computing In some programming languages, any Expression (computer science), expression can be evaluated ...
s ''true'' and ''false'', usually denoted 1 and 0, respectively. Instead of
elementary algebra Elementary algebra encompasses some of the basic concepts of algebra, one of the main branches of mathematics. It is typically taught to secondary school students and builds on their understanding of arithmetic. Whereas arithmetic deals with spec ...
, where the values of the variables are numbers and the prime operations are addition and multiplication, the main operations of Boolean algebra are the
conjunction Conjunction may refer to: * Conjunction (astronomy), in which two astronomical bodies appear close together in the sky * Conjunction (astrology), astrological aspect in horoscopic astrology * Conjunction (grammar), a part of speech * Logical conjun ...
(''and'') denoted as ∧, the
disjunction In logic, disjunction is a logical connective typically notated \lor whose meaning either refines or corresponds to that of natural language expressions such as "or". In classical logic, it is given a truth functional semantics of logic, sema ...
(''or'') denoted as ∨, and the
negation In logic Logic is an interdisciplinary field which studies truth and reasoning Reason is the capacity of consciously making sense of things, applying logic Logic (from Ancient Greek, Greek: grc, wikt:λογική, λογική, ...

negation
(''not'') denoted as ¬. It is thus a formalism for describing
logical operation In logic Logic is an interdisciplinary field which studies truth and reasoning Reason is the capacity of consciously making sense of things, applying logic Logic (from Ancient Greek, Greek: grc, wikt:λογική, λογική, la ...
s, in the same way that elementary algebra describes numerical operations. Boolean algebra was introduced by
George Boole George Boole (; 2 November 1815 – 8 December 1864) was a largely self-taught English mathematician, philosopher and logician, most of whose short career was spent as the first professor of mathematics at Queen's College, Cork in Irelan ...

George Boole
in his first book ''The Mathematical Analysis of Logic'' (1847), and set forth more fully in his '' An Investigation of the Laws of Thought'' (1854). According to
Huntington
Huntington
, the term "Boolean algebra" was first suggested by Sheffer in 1913, although
Charles Sanders Peirce Charles Sanders Peirce ( ; September 10, 1839 – April 19, 1914) was an American philosopher, ian, mathematician and scientist who is sometimes known as "the father of ". He was known as a somewhat unusual character. Educated as a chemist an ...

Charles Sanders Peirce
gave the title "A Boolean Algebra with One Constant" to the first chapter of his "The Simplest Mathematics" in 1880. Boolean algebra has been fundamental in the development of
digital electronics Digital electronics is a field of electronics The field of electronics is a branch of physics and electrical engineering that deals with the emission, behaviour and effects of electrons The electron is a subatomic particle In physica ...
, and is provided for in all modern programming languages. It is also used in
set theory Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory, as a branch of mathematics, i ...
and
statistics Statistics is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data Data (; ) are individual facts, statistics, or items of information, often numeric. In a more technical sens ...

statistics
.


History

A precursor of Boolean algebra was
Gottfried Wilhelm Leibniz Gottfried Wilhelm (von) Leibniz ; see inscription of the engraving depicted in the " 1666–1676" section. ( – 14 November 1716) was a German polymath A polymath ( el, πολυμαθής, ', "having learned much"; Latin Latin (, or , ...

Gottfried Wilhelm Leibniz
's
algebra of concepts Gottfried Wilhelm (von) Leibniz ; see inscription of the engraving depicted in the " 1666–1676" section. (; or ; – 14 November 1716) was a prominent German polymath A polymath ( el, πολυμαθής, ', "having learned much"; Latin ...
. Leibniz's algebra of concepts is deductively equivalent to the Boolean algebra of sets. Boole's algebra predated the modern developments in
abstract algebra In algebra, which is a broad division of mathematics, abstract algebra (occasionally called modern algebra) is the study of algebraic structures. Algebraic structures include group (mathematics), groups, ring (mathematics), rings, field (mathema ...
and
mathematical logic Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of formal sys ...
; it is however seen as connected to the origins of both fields. In an abstract setting, Boolean algebra was perfected in the late 19th century by
Jevons
Jevons
, Schröder,
Huntington
Huntington
and others, until it reached the modern conception of an (abstract)
mathematical structure In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
. For example, the empirical observation that one can manipulate expressions in the
algebra of sets In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). I ...
, 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 In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...
(note the
indefinite article Indefinite may refer to: * the opposite of definite in grammar ** indefinite article ** indefinite pronoun An indefinite pronoun is a pronoun In linguistics Linguistics is the science, scientific study of language. It encompasses the ...
). In fact, M. H. Stone proved in 1936 that every Boolean algebra is
isomorphic In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). I ...

isomorphic
to a
field of sets In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
. In the 1930s, while studying
switching circuit Switching circuit theory is the mathematical study of the properties of networks of idealized switches. Such networks may be strictly combinational logic, in which their output state is only a function of the present state of their inputs; or may a ...
s,
Claude Shannon Claude Elwood Shannon (April 30, 1916 – February 24, 2001) was an American mathematician A mathematician is someone who uses an extensive knowledge of mathematics Mathematics (from Greek: ) includes the study of such topics as numbe ...
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 gate A logic gate is an idealized model of computation A model is an informative representation of an object, person or system. The term originally denoted the plan A plan is typically any diagram or list of steps with details of timing and resourc ...
s. Shannon already had at his disposal the abstract mathematical apparatus, thus he cast his switching algebra as the
two-element Boolean algebra In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...
. In modern circuit engineering settings, there is little need to consider other Boolean algebras, thus "switching algebra" and "Boolean algebra" are often used interchangeably.
online sample
/ref> Efficient implementation of
Boolean function In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ge ...
s is a fundamental problem in the
design A design is a plan or specification for the construction of an object or system or for the implementation of an activity or process, or the result of that plan or specification in the form of a prototype A prototype is an early sample, mode ...
of
combinational logic In automata theory Automata theory is the study of abstract machines and automaton, automata, as well as the computational problems that can be solved using them. It is a theory in theoretical computer science. The word ''automata'' (the plural ...
circuits. Modern
electronic design automation Electronic design automation (EDA), also referred to as electronic computer-aided design (ECAD), is a category of software tools A programming tool or software development tool is a that s use to create, debug, maintain, or otherwise support ...
tools for VLSI circuits often rely on an efficient representation of Boolean functions known as (reduced ordered)
binary decision diagram In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of , , ...
s (BDD) for
logic synthesis In computer engineering Computer engineering (CoE or CpE) is a branch of engineering Engineering is the use of scientific principles to design and build machines, structures, and other items, including bridges, tunnels, roads, vehic ...
and
formal verification In the context of hardware and software system A software system is a system A system is a group of interacting Interaction is a kind of action that occurs as two or more objects have an effect upon one another. The idea of a two-way e ...
. Logic sentences that can be expressed in classical
propositional calculus Propositional calculus is a branch of logic Logic is an interdisciplinary field which studies truth and reasoning. Informal logic seeks to characterize Validity (logic), valid arguments informally, for instance by listing varieties of fal ...
have an equivalent expression in Boolean algebra. Thus, Boolean logic is sometimes used to denote propositional calculus performed in this way. Boolean algebra is not sufficient to capture logic formulas using
quantifiers Quantifier may refer to: * Quantifier (linguistics), an indicator of quantity * Quantifier (logic) * Quantification (science) See also

*Quantification (disambiguation) {{disambiguation ...
, like those from
first order logic First-order logic—also known as predicate logic, quantificational logic, and first-order predicate calculus—is a collection of formal system A formal system is used for inferring theorems from axioms according to a set of rules. These rules, wh ...
. 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 In mathematical logic, algebraic logic is the reasoning obtained by manipulating equations with Free variables and bound variables, free variables. What is now usually called classical algebraic logic focuses on the identification and algebraic de ...
, which also studies the algebraic systems of many other logics. 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 In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) is the problem of determining if there exists an Interpretation (logic), interpr ...
(SAT), and is of importance to
theoretical computer science Theoretical computer science (TCS) is a subset of general computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for the ...

theoretical computer science
, being the first problem shown to be
NP-complete In computational complexity theory Computational complexity theory focuses on classifying computational problem In theoretical computer science An artistic representation of a Turing machine. Turing machines are used to model general computi ...
. The closely related
model of computation A model is an informative representation of an object, person or system. The term originally denoted the Plan_(drawing), plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin ''modulus'', a meas ...
known as a
Boolean circuit In computational complexity theory and circuit complexity, a Boolean circuit is a mathematical model for combinational digital logic circuits. A formal language In mathematics Mathematics (from Ancient Greek, Greek: ) includes the stu ...
relates
time complexity In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application. Computer science is the study of com ...
(of an
algorithm In and , an algorithm () is a finite sequence of , computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are always and are used as specifications for performing s, , , and other ...

algorithm
) to
circuit complexity In theoretical computer science, circuit complexity is a branch of computational complexity theory in which Boolean functions are classified according to the size or depth of the Boolean circuits that compute them. A related notion is the circuit ...
.


Values

Whereas expressions denote mainly
number A number is a mathematical object A mathematical object is an abstract concept arising in mathematics. In the usual language of mathematics, an ''object'' is anything that has been (or could be) formally defined, and with which one may do deduct ...

number
s in elementary algebra, in Boolean algebra, they denote the
truth values In logic Logic is an interdisciplinary field which studies truth and reasoning Reason is the capacity of consciously making sense of things, applying logic Logic (from Ancient Greek, Greek: grc, wikt:λογική, λογική, lab ...
''false'' and ''true''. These values are represented with the
bit The bit is a basic unit of information in computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm of an algorithm (Euclid's algo ...
s (or binary digits), namely 0 and 1. They do not behave like the
integer An integer (from the Latin Latin (, or , ) is a classical language A classical language is a language A language is a structured system of communication Communication (from Latin ''communicare'', meaning "to share" or "to ...
s 0 and 1, for which , but may be identified with the elements of the two-element field GF(2), that is, integer arithmetic modulo 2, for which . Addition and multiplication then play the Boolean roles of XOR (exclusive-or) and AND (conjunction), respectively, with disjunction (inclusive-or) definable as . Boolean algebra also deals with
functions Function or functionality may refer to: Computing * Function key A function key is a key on a computer A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...
which have their values in the set . A sequence of bits is a commonly used for such functions. Another common example is the subsets of a set ''E'': to a subset ''F'' of ''E'', one can define the
indicator function Image:Indicator function illustration.png, A three-dimensional plot of an indicator function, shown over a square two-dimensional domain (set ): the 'raised' portion overlays those two-dimensional points which are members of the 'indicated' subs ...
that takes the value 1 on ''F'', and 0 outside ''F''. The most general example is the elements of a
Boolean algebra In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...
, 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.


Operations


Basic operations

The basic operations of Boolean algebra are as follows: *AND (
conjunction Conjunction may refer to: * Conjunction (astronomy), in which two astronomical bodies appear close together in the sky * Conjunction (astrology), astrological aspect in horoscopic astrology * Conjunction (grammar), a part of speech * Logical conjun ...
), denoted ''x''∧''y'' (sometimes ''x'' AND ''y'' or K''xy''), satisfies ''x''∧''y'' = 1 if ''x'' = ''y'' = 1, and ''x''∧''y'' = 0 otherwise. *OR (
disjunction In logic, disjunction is a logical connective typically notated \lor whose meaning either refines or corresponds to that of natural language expressions such as "or". In classical logic, it is given a truth functional semantics of logic, sema ...
), denoted ''x''∨''y'' (sometimes ''x'' OR ''y'' or A''xy''), satisfies ''x''∨''y'' = 0 if ''x'' = ''y'' = 0, and ''x''∨''y'' = 1 otherwise. *NOT (
negation In logic Logic is an interdisciplinary field which studies truth and reasoning Reason is the capacity of consciously making sense of things, applying logic Logic (from Ancient Greek, Greek: grc, wikt:λογική, λογική, ...

negation
), denoted ¬''x'' (sometimes NOT ''x'', N''x'', x̅, ''x'' ' or !''x''), satisfies ¬''x'' = 0 if ''x'' = 1 and ¬''x'' = 1 if ''x'' = 0. Alternatively the values of ''x''∧''y'', ''x''∨''y'', and ¬''x'' can be expressed by tabulating their values with truth tables as follows: If the truth values 0 and 1 are interpreted as integers, these operations may be expressed with the ordinary operations of arithmetic (where ''x'' + ''y'' uses addition and ''xy'' uses multiplication), or by the minimum/maximum functions: : \begin x \wedge y & = xy = \min(x,y)\\ x \vee y & = x + y - xy = \max(x,y)\\ \neg x & = 1 - x \end One might consider that only negation and one of the two other operations are basic, because of the following identities that allow one to define conjunction in terms of negation and the disjunction, and vice versa (
De Morgan's laws In propositional calculus, propositional logic and Boolean algebra, De Morgan's laws are a pair of transformation rules that are both Validity (logic), valid rule of inference, rules of inference. They are named after Augustus De Morgan, a 19th ...
): : \begin x \wedge y & = \neg(\neg x \vee \neg y) \\ x \vee y & = \neg(\neg x \wedge \neg y) \end


Secondary 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: :\begin x \rightarrow y &= \neg \vee y \\ x \oplus y &= \neg (x \equiv y) = (x \vee y) \wedge (\neg x \vee \neg y) = (x \wedge \neg y) \vee (\neg x \wedge y) \\ x \equiv y &= \neg = (x \wedge y) \vee (\neg x \wedge \neg y) \end These definitions give rise to the following truth tables giving the values of these operations for all four possible inputs. : The first operation, ''x'' → ''y'', or C''xy'', is called material implication. If ''x'' is true, then the value of ''x'' → ''y'' is taken to be that of ''y'' (e.g. if ''x'' is true and ''y'' is false, then ''x'' → ''y'' is also false). But if ''x'' is false, then the value of ''y'' can be ignored; however, the operation must return ''some'' boolean value and there are only two choices. So by definition, ''x'' → ''y'' is ''true'' when x is false. (
relevance logicRelevance logic, also called relevant logic, is a kind of non-classical logicClassical logic (or standard logic) is the intensively studied and most widely used class of deductive logic. Classical logic has had much influence on analytic philosophy, ...
suggests this definition, by viewing an implication with a
false premise A false premise is an incorrect proposition In linguistics and logic, a proposition is the meaning of a declarative sentence. In philosophy, "Meaning (philosophy), meaning" is understood to be a non-linguistic entity which is shared by all sen ...
as something other than either true or false.) The second operation, ''x'' ⊕ ''y'', or J''xy'', is called
exclusive or Exclusive or or exclusive disjunction is a Logical connective, logical operation that is true if and only if its arguments differ (one is true, the other is false). It is Table of logic symbols, symbolized by the prefix operator J and by the ...
(often abbreviated as XOR) to distinguish it from disjunction as the inclusive kind. It excludes the possibility of both ''x'' and ''y being'' true (e.g. see table): if both are true then result is false. Defined in terms of arithmetic it is addition where mod 2 is 1 + 1 = 0. The third operation, the complement of exclusive or, is equivalence or Boolean equality: ''x'' ≡ ''y'', or E''xy'', 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. Thus, its counterpart in arithmetic mod 2 is ''x'' + ''y''. Equivalence's 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. Any such operation or function (as well as any Boolean function with more inputs) can be expressed with the basic operations from above. Hence the basic operations are functionally complete.


Laws

A law of Boolean algebra is an
identity Identity may refer to: Social sciences * Identity (social science), personhood or group affiliation in psychology and sociology Group expression and affiliation * Cultural identity, a person's self-affiliation (or categorization by others ...
such as 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 In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...
as any
model In general, a model is an informative representation of an object, person or system. The term originally denoted the plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin ''modulus'', a measure. ...
of the Boolean laws, and as a means for deriving new laws from old as in the derivation of from (as treated in ').


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: : The following laws hold in Boolean algebra, but not in ordinary algebra: : Taking in the third law above shows that it is not an ordinary algebra law, since . The remaining five laws can be falsified in ordinary algebra by taking all variables to be 1. For example, in Absorption Law 1, the left hand side would be , while the right hand side would be 1 (and so on). All of the laws treated thus 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 thus far have all been for monotonic Boolean logic. Nonmonotonicity enters via complement ¬ as follows.


Nonmonotone laws

The complement operation is defined by the following two laws. : \begin &\text & x \wedge \neg x & = 0 \\ &\text & x \vee \neg x & = 1 \end All properties of negation including the laws below follow from the above two laws alone. 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 &\text & \neg & = x \end But whereas ''ordinary algebra'' satisfies the two laws : \begin (-x)(-y) & = xy \\ (-x) + (-y) & = -(x + y) \end Boolean algebra satisfies
De Morgan's laws In propositional calculus, propositional logic and Boolean algebra, De Morgan's laws are a pair of transformation rules that are both Validity (logic), valid rule of inference, rules of inference. They are named after Augustus De Morgan, a 19th ...
: : \begin &\text & \neg x \wedge \neg y & = \neg \\ &\text & \neg x \vee \neg y & = \neg \end


Completeness

The laws listed above define Boolean algebra, in the sense that they entail the rest of the subject. The laws ''Complementation'' 1 and 2, together with the monotone laws, suffice for this purpose and can therefore be taken as one possible ''complete'' set of laws or
axiomatization In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
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 '. 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 '. 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.


Duality principle

Principle: If is a
poset In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
, then is also a poset. 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 and 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 In propositional logic Propositional calculus is a branch of logic Logic (from Ancient Greek, Greek: grc, wikt:λογική, λογική, label=none, lit=possessed of reason, intellectual, dialectical, argumentative, translit=logikḗ) ...
, 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 . 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 , then is a self-dual operation of four arguments ''x'', ''y'', ''z'', ''t''. The principle of duality can be explained from a
group theory In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ...
perspective by the fact that there are exactly four functions that are one-to-one mappings (
automorphism In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

automorphism
s) 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 A group is a number A number is a mathematical object used to counting, count, measurement, measure, and nominal number, label. The original examples are the natural numbers 1, 2, 3, 4, and so forth. Numbers can be represented in language with ...
under
function composition In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...
, isomorphic to the
Klein four-group In mathematics, the Klein four-group is a Group (mathematics), group with four elements, in which each element is Involution (mathematics), self-inverse (composing it with itself produces the identity) and in which composing any two of the three ...
,
acting Acting is an activity in which a story is told by means of its Enactment (psychology), enactment by an actor or actress who adopts a Character (arts), character—in theatre, television, film, radio, or any other medium that makes use of the ...
on the set of Boolean polynomials. Walter Gottschalk remarked that consequently a more appropriate name for the phenomenon would be the ''principle'' (or ''square'') ''of quaternality''.


Diagrammatic representations


Venn diagrams

A
Venn diagram A Venn diagram is a widely used diagram A diagram is a symbolic representation Representation may refer to: Law and politics *Representation (politics) Political representation is the activity of making citizens "present" in public policy ...
can be used as 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 ''x''∧''y'', disjunction ''x''∨''y'', and complement ¬''x''. For conjunction, the region inside both circles is shaded to indicate that ''x''∧''y'' is 1 when both variables are 1. The other regions are left unshaded to indicate that ''x''∧''y'' is 0 for the other three combinations. The second diagram represents disjunction ''x''∨''y'' 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 Idempotence (, ) is the property of certain operations Operation or Operations may refer to: Science and technology * Surgical operation Surgery ''cheirourgikē'' (composed of χείρ, "hand", and ἔργον, "work"), via la, chirurgiae, m ...
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''∧(''x''∨''y'') = ''x'', start with the diagram in the middle for ''x''∨''y'' 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''∨(''x''∧''y'') = ''x'', start with the left diagram for ''x''∧''y'' 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'') = ¬(''x''∨''y''), start with the middle diagram for ''x''∨''y'' 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'') = ¬(''x''∧''y''), 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 A logic gate is an idealized model of computation or physical electronic device implementing a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output. Depending on the context, the te ...
connected to form a
circuit diagram A circuit diagram (wiring diagram, electrical diagram, elementary diagram, electronic schematic) is a graphical representation of an electrical circuit An electrical network is an interconnection of electrical component An electroni ...

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. 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 Duality Principle, or
De Morgan's laws In propositional calculus, propositional logic and Boolean algebra, De Morgan's laws are a pair of transformation rules that are both Validity (logic), valid rule of inference, rules of inference. They are named after Augustus De Morgan, a 19th ...
, can be understood as asserting that complementing all three ports of an AND gate converts it to an OR gate and vice versa, as shown in Figure 4 below. Complementing both ports of an inverter however leaves the operation unchanged. More generally one may complement any of the eight subsets of the three ports of either an AND or OR gate. The resulting sixteen possibilities give rise to only eight Boolean operations, namely those with an odd number of 1's in their truth table. There are eight such because the "odd-bit-out" can be either 0 or 1 and can go in any of four positions in the truth table. There being sixteen binary Boolean operations, this must leave eight operations with an even number of 1's in their truth tables. Two of these are the constants 0 and 1 (as binary operations that ignore both their inputs); four are the operations that depend nontrivially on exactly one of their two inputs, namely ''x'', ''y'', ¬''x'', and ¬''y''; and the remaining two are ''x''⊕''y'' (XOR) and its complement ''x''≡''y''.


Boolean algebras

The term "algebra" denotes both a subject, namely the subject of
algebra Algebra (from ar, الجبر, lit=reunion of broken parts, bonesetting, translit=al-jabr) is one of the areas of mathematics, broad areas of mathematics, together with number theory, geometry and mathematical analysis, analysis. In its most ge ...

algebra
, and an object, namely an
algebraic structure In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
. Whereas the foregoing has addressed the subject of Boolean algebra, this section deals with mathematical objects called Boolean algebras, defined in full generality as any model of the Boolean laws. We begin with a special case of the notion definable without reference to the laws, namely concrete Boolean algebras, and then give the formal definition of the general notion.


Concrete Boolean algebras

A concrete Boolean algebra or
field of sets In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
is any nonempty set of subsets of a given set ''X'' closed under the set operations of union,
intersection The line (purple) in two points (red). The disk (yellow) intersects the line in the line segment between the two red points. In mathematics, the intersection of two or more objects is another, usually "smaller" object. Intuitively, the inter ...
, and
complement A complement is often something that completes something else, or at least adds to it in some useful way. Thus it may be: * Complement (linguistics), a word or phrase having a particular syntactic role ** Subject complement, a word or phrase addi ...

complement
relative to ''X''. (As an aside, historically ''X'' itself was required to be nonempty as well to exclude the degenerate or one-element Boolean algebra, which is the one exception to the rule that all Boolean algebras satisfy the same equations since the degenerate algebra satisfies every equation. However this exclusion conflicts with the preferred purely equational definition of "Boolean algebra," there being no way to rule out the one-element algebra using only equations— 0 ≠ 1 does not count, being a negated equation. Hence modern authors allow the degenerate Boolean algebra and let ''X'' be empty.) Example 1. The
power set In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
2''X'' of ''X'', consisting of all subsets of ''X''. Here ''X'' may be any set: empty, finite, infinite, or even
uncountable In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...

uncountable
. Example 2. The empty set and ''X''. This two-element algebra shows that a concrete Boolean algebra can be finite even when it consists of subsets of an infinite set. It can be seen that every field of subsets of ''X'' must contain the empty set and ''X''. Hence no smaller example is possible, other than the degenerate algebra obtained by taking ''X'' to be empty so as to make the empty set and ''X'' coincide. Example 3. The set of finite and
cofinite In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
sets of integers, where a cofinite set is one omitting only finitely many integers. This is clearly closed under complement, and is closed under union because the union of a cofinite set with any set is cofinite, while the union of two finite sets is finite. Intersection behaves like union with "finite" and "cofinite" interchanged. Example 4. For a less trivial example of the point made by Example 2, consider a
Venn diagram A Venn diagram is a widely used diagram A diagram is a symbolic representation Representation may refer to: Law and politics *Representation (politics) Political representation is the activity of making citizens "present" in public policy ...
formed by ''n'' closed curves the diagram into 2''n'' regions, and let ''X'' be the (infinite) set of all points in the plane not on any curve but somewhere within the diagram. The interior of each region is thus an infinite subset of ''X'', and every point in ''X'' is in exactly one region. Then the set of all 22''n'' possible unions of regions (including the empty set obtained as the union of the empty set of regions and ''X'' obtained as the union of all 2''n'' regions) is closed under union, intersection, and complement relative to ''X'' and therefore forms a concrete Boolean algebra. Again we have finitely many subsets of an infinite set forming a concrete Boolean algebra, with Example 2 arising as the case ''n'' = 0 of no curves.


Subsets as bit vectors

A subset ''Y'' of ''X'' can be identified with an
indexed family In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...
of bits with
index set In mathematics, an index set is a set whose members label (or index) members of another set. For instance, if the elements of a Set (mathematics), set may be ''indexed'' or ''labeled'' by means of the elements of a set , then is an index set. Th ...
''X'', with the bit indexed by ''x'' ∈ ''X'' being 1 or 0 according to whether or not ''x'' ∈ ''Y''. (This is the so-called
characteristic functionIn mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ha ...
notion of a subset.) For example, a 32-bit computer word consists of 32 bits indexed by the set , with 0 and 31 indexing the low and high order bits respectively. For a smaller example, if ''X'' = where ''a, b, c'' are viewed as bit positions in that order from left to right, the eight subsets , , , , , , , and of ''X'' can be identified with the respective bit vectors 000, 001, 010, 011, 100, 101, 110, and 111. Bit vectors indexed by the set of natural numbers are infinite
sequence In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

sequence
s of bits, while those indexed by the reals in the
unit interval In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). I ...
,1are packed too densely to be able to write conventionally but nonetheless form well-defined indexed families (imagine coloring every point of the interval ,1either black or white independently; the black points then form an arbitrary subset of ,1. From this bit vector viewpoint, a concrete Boolean algebra can be defined equivalently as a nonempty set of bit vectors all of the same length (more generally, indexed by the same set) and closed under the bit vector operations of bitwise ∧, ∨, and ¬, as in 1010∧0110 = 0010, 1010∨0110 = 1110, and ¬1010 = 0101, the bit vector realizations of intersection, union, and complement respectively.


The prototypical Boolean algebra

The set and its Boolean operations as treated above can be understood as the special case of bit vectors of length one, which by the identification of bit vectors with subsets can also be understood as the two subsets of a one-element set. We call this the prototypical Boolean algebra, justified by the following observation. :The laws satisfied by all nondegenerate concrete Boolean algebras coincide with those satisfied by the prototypical Boolean algebra. This observation is easily proved as follows. Certainly any law satisfied by all concrete Boolean algebras is satisfied by the prototypical one since it is concrete. Conversely any law that fails for some concrete Boolean algebra must have failed at a particular bit position, in which case that position by itself furnishes a one-bit counterexample to that law. Nondegeneracy ensures the existence of at least one bit position because there is only one empty bit vector. The final goal of the next section can be understood as eliminating "concrete" from the above observation. We shall however reach that goal via the surprisingly stronger observation that, up to isomorphism, all Boolean algebras are concrete.


Boolean algebras: the definition

The Boolean algebras we have seen so far have all been concrete, consisting of bit vectors or equivalently of subsets of some set. Such a Boolean algebra consists of a set and operations on that set which can be ''shown'' to satisfy the laws of Boolean algebra. Instead of showing that the Boolean laws are satisfied, we can instead postulate a set ''X'', two binary operations on ''X'', and one unary operation, and ''require'' that those operations satisfy the laws of Boolean algebra. The elements of ''X'' need not be bit vectors or subsets but can be anything at all. This leads to the more general ''abstract'' definition. :A Boolean algebra is any set with binary operations ∧ and ∨ and a unary operation ¬ thereon satisfying the Boolean laws. For the purposes of this definition it is irrelevant how the operations came to satisfy the laws, whether by fiat or proof. All concrete Boolean algebras satisfy the laws (by proof rather than fiat), whence every concrete Boolean algebra is a Boolean algebra according to our definitions. This axiomatic definition of a Boolean algebra as a set and certain operations satisfying certain laws or axioms ''by fiat'' is entirely analogous to the abstract definitions of
group A group is a number A number is a mathematical object used to counting, count, measurement, measure, and nominal number, label. The original examples are the natural numbers 1, 2, 3, 4, and so forth. Numbers can be represented in language with ...
, ring,
field Field may refer to: Expanses of open ground * Field (agriculture), an area of land used for agricultural purposes * Airfield, an aerodrome that lacks the infrastructure of an airport * Battlefield * Lawn, an area of mowed grass * Meadow, a grassl ...
etc. characteristic of modern or
abstract algebra In algebra, which is a broad division of mathematics, abstract algebra (occasionally called modern algebra) is the study of algebraic structures. Algebraic structures include group (mathematics), groups, ring (mathematics), rings, field (mathema ...
. Given any complete axiomatization of Boolean algebra, such as the axioms for a complemented
distributive lattice In mathematics, a distributive lattice is a lattice (order), lattice in which the operations of join and meet distributivity, distribute over each other. The prototypical examples of such structures are collections of sets for which the lattice ope ...
, a sufficient condition for an
algebraic structure In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
of this kind to satisfy all the Boolean laws is that it satisfy just those axioms. The following is therefore an equivalent definition. :A Boolean algebra is a complemented distributive lattice. The section on
axiomatization In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
lists other axiomatizations, any of which can be made the basis of an equivalent definition.


Representable Boolean algebras

Although every concrete Boolean algebra is a Boolean algebra, not every Boolean algebra need be concrete. Let ''n'' be a
square-free{{no footnotes, date=December 2015 In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (math ...
positive integer, one not divisible by the square of an integer, for example 30 but not 12. The operations of
greatest common divisor In mathematics, the greatest common divisor (GCD) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers ''x'', ''y'', the greatest common divisor of ''x'' and ''y'' is ...

greatest common divisor
,
least common multiple In arithmetic Arithmetic (from the Ancient Greek, Greek wikt:en:ἀριθμός#Ancient Greek, ἀριθμός ''arithmos'', 'number' and wikt:en:τική#Ancient Greek, τική wikt:en:τέχνη#Ancient Greek, έχνη ''tiké échne', 'a ...

least common multiple
, and division into ''n'' (that is, ¬''x'' = ''n''/''x''), can be shown to satisfy all the Boolean laws when their arguments range over the positive divisors of ''n''. Hence those divisors form a Boolean algebra. These divisors are not subsets of a set, making the divisors of ''n'' a Boolean algebra that is not concrete according to our definitions. However, if we ''represent'' each divisor of ''n'' by the set of its prime factors, we find that this nonconcrete Boolean algebra is
isomorphic In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). I ...

isomorphic
to the concrete Boolean algebra consisting of all sets of prime factors of ''n'', with union corresponding to least common multiple, intersection to greatest common divisor, and complement to division into ''n''. So this example while not technically concrete is at least "morally" concrete via this representation, called an
isomorphism In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...

isomorphism
. This example is an instance of the following notion. :A Boolean algebra is called representable when it is isomorphic to a concrete Boolean algebra. The obvious next question is answered positively as follows. :Every Boolean algebra is representable. That is, up to isomorphism, abstract and concrete Boolean algebras are the same thing. This quite nontrivial result depends on the
Boolean prime ideal theorem In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
, a choice principle slightly weaker than the
axiom of choice In mathematics, the axiom of choice, or AC, is an axiom of set theory equivalent to the statement that ''a Cartesian product#Infinite Cartesian products, Cartesian product of a collection of non-empty sets is non-empty''. Informally put, the a ...

axiom of choice
, and is treated in more detail in the article
Stone's representation theorem for Boolean algebras In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
. This strong relationship implies a weaker result strengthening the observation in the previous subsection to the following easy consequence of representability. :The laws satisfied by all Boolean algebras coincide with those satisfied by the prototypical Boolean algebra. It is weaker in the sense that it does not of itself imply representability. Boolean algebras are special here, for example a
relation algebra In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
is a Boolean algebra with additional structure but it is not the case that every relation algebra is representable in the sense appropriate to relation algebras.


Axiomatizing Boolean algebra

The above definition of an abstract Boolean algebra as a set and operations satisfying "the" Boolean laws raises the question, what are those laws? A simple-minded answer is "all Boolean laws," which can be defined as all equations that hold for the Boolean algebra of 0 and 1. Since there are infinitely many such laws this is not a terribly satisfactory answer in practice, leading to the next question: does it suffice to require only finitely many laws to hold? In the case of Boolean algebras the answer is yes. In particular the finitely many equations we have listed above suffice. We say that Boolean algebra is finitely axiomatizable or finitely based. Can this list be made shorter yet? Again the answer is yes. To begin with, some of the above laws are implied by some of the others. A sufficient subset of the above laws consists of the pairs of associativity, commutativity, and absorption laws, distributivity of ∧ over ∨ (or the other distributivity law—one suffices), and the two complement laws. In fact this is the traditional axiomatization of Boolean algebra as a complemented
distributive lattice In mathematics, a distributive lattice is a lattice (order), lattice in which the operations of join and meet distributivity, distribute over each other. The prototypical examples of such structures are collections of sets for which the lattice ope ...
. By introducing additional laws not listed above it becomes possible to shorten the list yet further; for instance, with the vertical bar representing the
Sheffer stroke In Boolean functions and propositional calculus, the Sheffer stroke denotes a logical operation that is equivalent to the logical negation, negation of the logical conjunction, conjunction operation, expressed in ordinary language as "not both". ...
operation, the single axiom ((a\mid b)\mid c) \mid (a\mid((a\mid c)\mid a)) = c is sufficient to completely axiomatize Boolean algebra. It is also possible to find longer single axioms using more conventional operations; see
Minimal axioms for Boolean algebra Minimal may refer to: * Minimal (music genre) Minimal music (also called minimalism)"Minimalism in music has been defined as an aesthetic, a style, and a technique, each of which has been a suitable description of the term at certain points in t ...
.


Propositional logic

Propositional logic Propositional calculus is a branch of logic Logic is an interdisciplinary field which studies truth and reasoning. Informal logic seeks to characterize Validity (logic), valid arguments informally, for instance by listing varieties of fal ...
is a
logical system A formal system is an abstract structure used for inferring theorems from axioms according to a set of rules. These rules, which are used for carrying out the inference of theorems from axioms, are the logical calculus of the formal system. A form ...
that is intimately connected to Boolean algebra. Many syntactic concepts of Boolean algebra carry over to propositional logic with only minor changes in notation and terminology, while the semantics of propositional logic are defined via Boolean algebras in a way that the tautologies (theorems) of propositional logic correspond to equational theorems of Boolean algebra. Syntactically, every Boolean term corresponds to a
propositional formulaIn propositional logic, a propositional formula is a type of syntactic Formula (mathematical logic), formula which is well formed formula, well formed and has a truth value. If the values of all variables in a propositional formula are given, it dete ...
of propositional logic. In this translation between Boolean algebra and propositional logic, Boolean variables ''x,y''... become
propositional variable In mathematical logic Mathematical logic, also called formal logic, is a subfield of mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (alge ...
s (or atoms) ''P,Q'',..., Boolean terms such as ''x''∨''y'' become propositional formulas ''P''∨''Q'', 0 becomes ''false'' or ⊥, and 1 becomes ''true'' or T. It is convenient when referring to generic propositions to use Greek letters Φ, Ψ,... as metavariables (variables outside the language of propositional calculus, used when talking ''about'' propositional calculus) to denote propositions. The semantics of propositional logic rely on truth assignments. The essential idea of a truth assignment is that the propositional variables are mapped to elements of a fixed Boolean algebra, and then the
truth value In logic and mathematics, a truth value, sometimes called a logical value, is a value indicating the relation of a proposition to truth. Computing In some programming languages, any Expression (computer science), expression can be evaluated ...
of a propositional formula using these letters is the element of the Boolean algebra that is obtained by computing the value of the Boolean term corresponding to the formula. In classical semantics, only the two-element Boolean algebra is used, while in
Boolean-valued semanticsIn mathematical logic Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical prop ...
arbitrary Boolean algebras are considered. A tautology is a propositional formula that is assigned truth value ''1'' by every truth assignment of its propositional variables to an arbitrary Boolean algebra (or, equivalently, every truth assignment to the two element Boolean algebra). These semantics permit a translation between tautologies of propositional logic and equational theorems of Boolean algebra. Every tautology Φ of propositional logic can be expressed as the Boolean equation Φ = 1, which will be a theorem of Boolean algebra. Conversely every theorem Φ = Ψ of Boolean algebra corresponds to the tautologies (Φ∨¬Ψ) ∧ (¬Φ∨Ψ) and (Φ∧Ψ) ∨ (¬Φ∧¬Ψ). If → is in the language these last tautologies can also be written as (Φ→Ψ) ∧ (Ψ→Φ), or as two separate theorems Φ→Ψ and Ψ→Φ; if ≡ is available then the single tautology Φ ≡ Ψ can be used.


Applications

One motivating application of propositional calculus is the analysis of propositions and deductive arguments in natural language. Whereas the proposition "if ''x'' = 3 then ''x''+1 = 4" depends on the meanings of such symbols as + and 1, the proposition "if ''x'' = 3 then ''x'' = 3" does not; it is true merely by virtue of its structure, and remains true whether "''x'' = 3" is replaced by "''x'' = 4" or "the moon is made of green cheese." The generic or abstract form of this tautology is "if ''P'' then ''P''", or in the language of Boolean algebra, "''P'' → ''P''". Replacing ''P'' by ''x'' = 3 or any other proposition is called instantiation of ''P'' by that proposition. The result of instantiating ''P'' in an abstract proposition is called an instance of the proposition. Thus "''x'' = 3 → ''x'' = 3" is a tautology by virtue of being an instance of the abstract tautology "''P'' → ''P''". All occurrences of the instantiated variable must be instantiated with the same proposition, to avoid such nonsense as ''P'' → ''x'' = 3 or ''x'' = 3 → ''x'' = 4. Propositional calculus restricts attention to abstract propositions, those built up from propositional variables using Boolean operations. Instantiation is still possible within propositional calculus, but only by instantiating propositional variables by abstract propositions, such as instantiating ''Q'' by ''Q''→''P'' in ''P''→(''Q''→''P'') to yield the instance ''P''→((''Q''→''P'')→''P''). (The availability of instantiation as part of the machinery of propositional calculus avoids the need for metavariables within the language of propositional calculus, since ordinary propositional variables can be considered within the language to denote arbitrary propositions. The metavariables themselves are outside the reach of instantiation, not being part of the language of propositional calculus but rather part of the same language for talking about it that this sentence is written in, where we need to be able to distinguish propositional variables and their instantiations as being distinct syntactic entities.)


Deductive systems for propositional logic

An axiomatization of propositional calculus is a set of tautologies called
axioms An axiom, postulate or assumption is a statement that is taken to be truth, true, to serve as a premise or starting point for further reasoning and arguments. The word comes from the Greek ''axíōma'' () 'that which is thought worthy or fit' or ...
and one or more inference rules for producing new tautologies from old. A ''proof'' in an axiom system ''A'' is a finite nonempty sequence of propositions each of which is either an instance of an axiom of ''A'' or follows by some rule of ''A'' from propositions appearing earlier in the proof (thereby disallowing circular reasoning). The last proposition is the theorem proved by the proof. Every nonempty initial segment of a proof is itself a proof, whence every proposition in a proof is itself a theorem. An axiomatization is sound when every theorem is a tautology, and complete when every tautology is a theorem.


Sequent calculus

Propositional calculus is commonly organized as a
Hilbert system :''In mathematical physics, ''Hilbert system'' is an infrequently used term for a physical system described by a C*-algebra.'' In logic, especially mathematical logic, a Hilbert system, sometimes called Hilbert calculus, Hilbert-style deductive sys ...
, whose operations are just those of Boolean algebra and whose theorems are Boolean tautologies, those Boolean terms equal to the Boolean constant 1. Another form is
sequent calculusIn mathematical logic, sequent calculus is a style of formal logical argumentation in which every line of a formal proof, proof is a conditional tautology (logic), tautology (called a sequent by Gerhard Gentzen) instead of an unconditional tautology. ...
, which has two sorts, propositions as in ordinary propositional calculus, and pairs of lists of propositions called
sequent In mathematical logic, a sequent is a very general kind of conditional assertion. : A_1,\,\dots,A_m \,\vdash\, B_1,\,\dots,B_n. A sequent may have any number ''m'' of condition Well-formed formula, formulas ''Ai'' (called "Antecedent (logic), ante ...
s, such as ''A''∨''B'', ''A''∧''C'',... \vdash ''A'', ''B''→''C'',.... The two halves of a sequent are called the antecedent and the succedent respectively. The customary metavariable denoting an antecedent or part thereof is Γ, and for a succedent Δ; thus Γ,''A'' \vdash Δ would denote a sequent whose succedent is a list Δ and whose antecedent is a list Γ with an additional proposition ''A'' appended after it. The antecedent is interpreted as the conjunction of its propositions, the succedent as the disjunction of its propositions, and the sequent itself as the
entailment Logical consequence (also entailment) is a fundamental concept Concepts are defined as abstract ideas A mental representation (or cognitive representation), in philosophy of mind Philosophy of mind is a branch of philosophy that studies th ...
of the succedent by the antecedent. Entailment differs from implication in that whereas the latter is a binary ''operation'' that returns a value in a Boolean algebra, the former is a binary ''relation'' which either holds or does not hold. In this sense entailment is an ''external'' form of implication, meaning external to the Boolean algebra, thinking of the reader of the sequent as also being external and interpreting and comparing antecedents and succedents in some Boolean algebra. The natural interpretation of \vdash is as ≤ in the partial order of the Boolean algebra defined by ''x'' ≤ ''y'' just when ''x''∨''y'' = ''y''. This ability to mix external implication \vdash and internal implication → in the one logic is among the essential differences between sequent calculus and propositional calculus.


Applications

Boolean algebra as the calculus of two values is fundamental to computer circuits, computer programming, and mathematical logic, and is also used in other areas of mathematics such as set theory and statistics.


Computers

In the early 20th century, several electrical engineers intuitively recognized that Boolean algebra was analogous to the behavior of certain types of electrical circuits.
Claude Shannon Claude Elwood Shannon (April 30, 1916 – February 24, 2001) was an American mathematician A mathematician is someone who uses an extensive knowledge of mathematics Mathematics (from Greek: ) includes the study of such topics as numbe ...
formally proved such behavior was logically equivalent to Boolean algebra in his 1937 master's thesis, '' A Symbolic Analysis of Relay and Switching Circuits''. Today, all modern general purpose
computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets of operations known as Computer program, programs. These ...

computer
s perform their functions using two-value Boolean logic; that is, their electrical circuits are a physical manifestation of two-value Boolean logic. They achieve this in various ways: as voltages on wires in high-speed circuits and capacitive storage devices, as orientations of a
magnetic domain A magnetic domain is a region within a magnetic material in which the magnetization is in a uniform direction. This means that the individual magnetic moment The magnetic moment is the magnetic strength and orientation of a magnet or other obje ...
in ferromagnetic storage devices, as holes in
punched card A punched card (also punch cardSteven Pinker, in ''The Stuff of Thought'', Viking, 2007, p.362, notes the loss of ''-ed'' in pronunciation ''as it did in ice cream, mincemeat, and box set, formerly iced cream, minced meat, and boxed set.'' or p ...

punched card
s or
paper tape Five- and eight-hole punched paper tape file:Harwell-dekatron-witch-10.jpg, Paper tape reader on the Harwell computer with a small piece of five-hole tape connected in a circle – creating a physical program loop Punched tape or perforated pape ...

paper tape
, and so on. (Some early computers used decimal circuits or mechanisms instead of two-valued logic circuits.) Of course, it is possible to code more than two symbols in any given medium. For example, one might use respectively 0, 1, 2, and 3 volts to code a four-symbol alphabet on a wire, or holes of different sizes in a punched card. In practice, the tight constraints of high speed, small size, and low power combine to make noise a major factor. This makes it hard to distinguish between symbols when there are several possible symbols that could occur at a single site. Rather than attempting to distinguish between four voltages on one wire, digital designers have settled on two voltages per wire, high and low. Computers use two-value Boolean circuits for the above reasons. The most common computer architectures use ordered sequences of Boolean values, called bits, of 32 or 64 values, e.g. 01101000110101100101010101001011. When programming in
machine code In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a particular task. Programming involves tasks such as analysis, ge ...
,
assembly language In computer programming Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a particular task. Programming involves tasks such as analysis, gene ...
, and certain other
programming languages A programming language is a formal language comprising a set of Formal language#Words over an alphabet, strings that produce various kinds of Machine code, machine code output. Programming languages are one kind of computer language, and are us ...
, programmers work with the low-level digital structure of the data registers. These registers operate on voltages, where zero volts represents Boolean 0, and a reference voltage (often +5 V, +3.3 V, +1.8 V) represents Boolean 1. Such languages support both numeric operations and logical operations. In this context, "numeric" means that the computer treats sequences of bits as
binary number In mathematics and digital electronics Digital electronics is a field of electronics The field of electronics is a branch of physics and electrical engineering that deals with the emission, behaviour and effects of electrons The electr ...
s (base two numbers) and executes arithmetic operations like add, subtract, multiply, or divide. "Logical" refers to the Boolean logical operations of disjunction, conjunction, and negation between two sequences of bits, in which each bit in one sequence is simply compared to its counterpart in the other sequence. Programmers therefore have the option of working in and applying the rules of either numeric algebra or Boolean algebra as needed. A core differentiating feature between these families of operations is the existence of the carry operation in the first but not the second.


Two-valued logic

Other areas where two values is a good choice are the law and mathematics. In everyday relaxed conversation, nuanced or complex answers such as "maybe" or "only on the weekend" are acceptable. In more focused situations such as a court of law or theorem-based mathematics however it is deemed advantageous to frame questions so as to admit a simple yes-or-no answer—is the defendant guilty or not guilty, is the proposition true or false—and to disallow any other answer. However much of a straitjacket this might prove in practice for the respondent, the principle of the simple yes-no question has become a central feature of both judicial and mathematical logic, making two-valued logic deserving of organization and study in its own right. A central concept of set theory is membership. Now an organization may permit multiple degrees of membership, such as novice, associate, and full. With sets however an element is either in or out. The candidates for membership in a set work just like the wires in a digital computer: each candidate is either a member or a nonmember, just as each wire is either high or low. Algebra being a fundamental tool in any area amenable to mathematical treatment, these considerations combine to make the algebra of two values of fundamental importance to computer hardware, mathematical logic, and set theory. Two-valued logic can be extended to
multi-valued logicIn logic Logic (from Ancient Greek, Greek: grc, wikt:λογική, λογική, label=none, lit=possessed of reason, intellectual, dialectical, argumentative, translit=logikḗ)Also related to (''logos''), "word, thought, idea, argument, acc ...
, notably by replacing the Boolean domain with the unit interval ,1 in which case rather than only taking values 0 or 1, any value between and including 0 and 1 can be assumed. Algebraically, negation (NOT) is replaced with 1 − ''x'', conjunction (AND) is replaced with multiplication (xy), and disjunction (OR) is defined via
De Morgan's law In propositional calculus, propositional logic and Boolean algebra, De Morgan's laws are a pair of transformation rules that are both Validity (logic), valid rule of inference, rules of inference. They are named after Augustus De Morgan, a 19th-c ...

De Morgan's law
. Interpreting these values as logical
truth value In logic and mathematics, a truth value, sometimes called a logical value, is a value indicating the relation of a proposition to truth. Computing In some programming languages, any Expression (computer science), expression can be evaluated ...
s yields a multi-valued logic, which forms the basis for
fuzzy logic In fuzzy mathematics, fuzzy logic is a form of many-valued logic in which the truth value Truth is the property of being in accord with fact or reality.Merriam-Webster's Online Dictionarytruth 2005 In everyday language, truth is typically ...

fuzzy logic
and
probabilistic logicThe aim of a probabilistic logic (also probability logic and probabilistic reasoning) is to combine the capacity of probability theory to handle uncertainty with the capacity of deductive logic to exploit structure of formal proof, formal argument. ...
. In these interpretations, a value is interpreted as the "degree" of truth – to what extent a proposition is true, or the probability that the proposition is true.


Boolean operations

The original application for Boolean operations was
mathematical logic Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of formal sys ...
, where it combines the truth values, true or false, of individual formulas.


Natural language

Natural languages such as English have words for several Boolean operations, in particular conjunction (''and''), disjunction (''or''), negation (''not''), and implication (''implies''). ''But not'' is synonymous with ''and not''. When used to combine situational assertions such as "the block is on the table" and "cats drink milk," which naively are either true or false, the meanings of these
logical connective In logic Logic is an interdisciplinary field which studies truth and reasoning Reason is the capacity of consciously making sense of things, applying logic Logic (from Ancient Greek, Greek: grc, wikt:λογική, λογική, la ...
s often have the meaning of their logical counterparts. However, with descriptions of behavior such as "Jim walked through the door", one starts to notice differences such as failure of commutativity, for example the conjunction of "Jim opened the door" with "Jim walked through the door" in that order is not equivalent to their conjunction in the other order, since ''and'' usually means ''and then'' in such cases. Questions can be similar: the order "Is the sky blue, and why is the sky blue?" makes more sense than the reverse order. Conjunctive commands about behavior are like behavioral assertions, as in ''get dressed and go to school''. Disjunctive commands such ''love me or leave me'' or ''fish or cut bait'' tend to be asymmetric via the implication that one alternative is less preferable. Conjoined nouns such as ''tea and milk'' generally describe aggregation as with set union while ''tea or milk'' is a choice. However context can reverse these senses, as in ''your choices are coffee and tea'' which usually means the same as ''your choices are coffee or tea'' (alternatives). Double negation as in "I don't not like milk" rarely means literally "I do like milk" but rather conveys some sort of hedging, as though to imply that there is a third possibility. "Not not P" can be loosely interpreted as "surely P", and although ''P'' necessarily implies "not not ''P''" the converse is suspect in English, much as with
intuitionistic logic Intuitionistic logic, sometimes more generally called constructive logic, refers to systems of symbolic logic that differ from the systems used for classical logic by more closely mirroring the notion of constructive proof. In particular, systems of ...
. In view of the highly idiosyncratic usage of conjunctions in natural languages, Boolean algebra cannot be considered a reliable framework for interpreting them.


Digital logic

Boolean operations are used in
digital logic A logic gate is an idealized model of computation In computer science Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their app ...
to combine the bits carried on individual wires, thereby interpreting them over . When a vector of ''n'' identical binary gates are used to combine two bit vectors each of ''n'' bits, the individual bit operations can be understood collectively as a single operation on values from a
Boolean algebra In mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...
with 2''n'' elements.


Naive set theory

Naive set theory Naive set theory is any of several theories of sets used in the discussion of the foundations of mathematics Foundations of mathematics is the study of the philosophical and logical and/or algorithmic basis of mathematics, or, in a broader sens ...
interprets Boolean operations as acting on subsets of a given set ''X''. As we saw earlier this behavior exactly parallels the coordinate-wise combinations of bit vectors, with the union of two sets corresponding to the disjunction of two bit vectors and so on.


Video cards

The 256-element free Boolean algebra on three generators is deployed in computer displays based on
raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
, which use
bit blit Bit blit (also written BITBLT, BIT BLT, BitBLT, Bit BLT, Bit Blt etc., which stands for ''bit block transfer'') is a data operation commonly used in computer graphics in which several bitmaps are combined into one using a '' boolean function. The ...
to manipulate whole regions consisting of
pixels In digital imaging Digital imaging or digital image acquisition is the creation of a representation of the visual characteristics of an object, such as a physical scene or the interior structure of an object. The term is often assumed to imp ...

pixels
, relying on Boolean operations to specify how the source region should be combined with the destination, typically with the help of a third region called the
mask A mask is an object normally worn on the face The face is the front of an animal's head that features the eyes Eyes are organs An organ is a group of tissues with similar functions. Plant life and animal life rely on many organ ...
. Modern
video cards A graphics card (also called a video card, display card, graphics adapter, video adapter, or display adapter) is an expansion card Modern EEPROM chip suitable for storing expansion card configuration electronically In computing Comput ...
offer all 223 = 256 ternary operations for this purpose, with the choice of operation being a one-byte (8-bit) parameter. The constants SRC = 0xaa or 10101010, DST = 0xcc or 11001100, and MSK = 0xf0 or 11110000 allow Boolean operations such as (SRC^DST)&MSK (meaning XOR the source and destination and then AND the result with the mask) to be written directly as a constant denoting a byte calculated at compile time, 0x60 in the (SRC^DST)&MSK example, 0x66 if just SRC^DST, etc. At run time the video card interprets the byte as the raster operation indicated by the original expression in a uniform way that requires remarkably little hardware and which takes time completely independent of the complexity of the expression.


Modeling and CAD

Solid modeling Solid modeling (or modelling) is a consistent set of principles for mathematical and computer modeling of three-dimensional solids. Solid modeling is distinguished from related areas of geometric modeling and computer graphics by its emphasis o ...
systems for
computer aided design Computer-aided design (CAD) is the use of computer A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets of operations known as C ...
offer a variety of methods for building objects from other objects, combination by Boolean operations being one of them. In this method the space in which objects exist is understood as a set ''S'' of
voxel In 3D computer graphics 3D computer graphics, sometimes called CGI, 3DCG or three-dimensional computer graphics (in contrast to 2D computer graphics 2D computer graphics is the Computer-generated imagery, computer-based generation of digita ...

voxel
s (the three-dimensional analogue of pixels in two-dimensional graphics) and shapes are defined as subsets of ''S'', allowing objects to be combined as sets via union, intersection, etc. One obvious use is in building a complex shape from simple shapes simply as the union of the latter. Another use is in sculpting understood as removal of material: any grinding, milling, routing, or drilling operation that can be performed with physical machinery on physical materials can be simulated on the computer with the Boolean operation ''x'' ∧ ¬''y'' or ''x'' − ''y'', which in set theory is set difference, remove the elements of ''y'' from those of ''x''. Thus given two shapes one to be machined and the other the material to be removed, the result of machining the former to remove the latter is described simply as their set difference.


Boolean searches

Search engine queries also employ Boolean logic. For this application, each web page on the Internet may be considered to be an "element" of a "set". The following examples use a syntax previously supported by
Google Google LLC is an American multinational Multinational may refer to: * Multinational corporation, a corporate organization operating in multiple countries * Multinational force, a military body from multiple countries * Multinational stat ...

Google
. * Doublequotes are used to combine whitespace-separated words into a single search term.Doublequote-delimited search terms are called "exact phrase" searches in the Google documentation. * Whitespace is used to specify logical AND, as it is the default operator for joining search terms: "Search term 1" "Search term 2" * The OR keyword is used for logical OR: "Search term 1" OR "Search term 2" * A prefixed minus sign is used for logical NOT: "Search term 1" −"Search term 2"


See also

*
Binary number In mathematics and digital electronics Digital electronics is a field of electronics The field of electronics is a branch of physics and electrical engineering that deals with the emission, behaviour and effects of electrons The electr ...
*
Boolean algebra (structure) In abstract algebra In algebra, which is a broad division of mathematics, abstract algebra (occasionally called modern algebra) is the study of algebraic structures. Algebraic structures include group (mathematics), groups, ring (mathematics), ...
*
Boolean algebras canonically defined :''Boolean algebras are models of the equational theory of two values; this definition is equivalent to the lattice and ring definitions.'' Boolean algebra In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such t ...
* Boolean differential calculus * Booleo * Heyting algebra * Intuitionistic logic * List of Boolean algebra topics * Logic design * ''Principia Mathematica'' * Propositional calculus * Relation algebra * Three-valued logic * Vector logic


References


Sources

*


Further reading

* Suitable introduction for students in applied fields. * * * Józef Maria Bocheński, Bocheński, Józef Maria (1959). ''A Précis of Mathematical Logic''. Translated from the French and German editions by Otto Bird. Dordrecht, South Holland: D. Reidel.


Historical perspective

*
George Boole George Boole (; 2 November 1815 – 8 December 1864) was a largely self-taught English mathematician, philosopher and logician, most of whose short career was spent as the first professor of mathematics at Queen's College, Cork in Irelan ...

George Boole
(1848).
The Calculus of Logic
" ''Cambridge and Dublin Mathematical Journal III: 183–98.'' * * , several relevant chapters by Hailperin, Valencia, and Grattan-Guinness * , chapter 1, "Algebra of Classes and Propositional Calculus" * Burris, Stanley, 2009
The Algebra of Logic Tradition
Stanford Encyclopedia of Philosophy. *


External links


Boolean Algebra
chapter on All About Circuits


Science and Technology - Boolean Algebra
contains a list and proof of Boolean theorems and laws. {{Authority control Boolean algebra, 1847 introductions Algebraic logic Articles with example code