Jump to content

Two-element Boolean algebra: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
Undid revision 1241332837 by 70.31.237.192 (talk): \overline means negation
 
(103 intermediate revisions by 66 users not shown)
Line 1: Line 1:
{{short description|Boolean algebra}}
The '''[[two-element Boolean algebra]]''' is the simplest [[Boolean algebra]], one having just two elements, named 1 and 0 by convention. [[Paul Halmos]]'s name for this algebra, '''2''', has some following among mathematicians and will be employed here.
In [[mathematics]] and [[abstract algebra]], the '''two-element Boolean algebra''' is the [[Boolean algebra (structure)|Boolean algebra]] whose ''underlying set'' (or [[Universe (mathematics)|universe]] or ''carrier'') ''B'' is the [[Boolean domain]]. The elements of the Boolean domain are 1 and 0 by convention, so that ''B'' = {0, 1}. [[Paul Halmos]]'s name for this algebra "'''2'''" has some following in the literature, and will be employed here.


==Definition==
Associated with any Boolean algebra is a [[partial order|partially ordered set]] ''B'' called the [[carrier]], such that the [[operation]]s of the Boolean algebra are mappings from ''Bn'' to ''B''. The carrier is [[bounded set|bounded]] by its distinguished members 0 and 1. '''2''' is simply the Boolean algebra whose carrier is identical to the set of its bounds, so that ''B''={0,1}.
''B'' is a [[partial order|partially ordered set]] and the elements of ''B'' are also its [[Bounded set#Boundedness in order theory|bounds]].


There are several names and notations for the two binary operations of Boolean algebra. We will call them 'sum' and 'product', for which the infix notation is '+' and '.', respectively. '.' is often omitted, in which case the operands simply concatenate. '+' and '.' commute and associate, as in real-valued algebra <!--"real valued" is the term I propose for the algebra we all learned in high school.-->. '.' precedes '+', but brackets may override. Hence ''A.B+C'' is parsed as ''(A.B)+C'' not ''A.(B+C)''. The unary operation is always referred to as 'complementation', notated herein by placing an overbar over its argument. In the language of [[universal algebra]], all Boolean algebras are then <math><B,+,.,\overline{..},1,0></math> algebras of type <math><2,2,1,0,0></math>.
An [[operation (mathematics)|operation]] of [[arity]] ''n'' is a [[map (mathematics)|mapping]] from ''B''<sup>n</sup> to ''B''. Boolean algebra consists of two [[binary operation]]s and [[unary operation|unary]] [[Complement (order theory)|complementation]]. The binary operations have been named and notated in various ways. Here they are called 'sum' and 'product', and notated by infix '+' and '', respectively. Sum and product [[commutativity|commute]] and [[associativity|associate]], as in the usual [[elementary algebra|algebra of real numbers]]. As for the [[order of operations]], brackets are decisive if present. Otherwise '' precedes '+'. Hence {{math|''A'' ∙ ''B'' + ''C''}} is parsed as {{math|(''A'' ∙ ''B'') + ''C''}} and not as {{math|1=''A'' ∙ (''B'' + ''C)''}}. [[Boolean algebra (logic)|Complementation]] is denoted by writing an overbar over its argument. The numerical analog of the complement of {{mvar|X}} is {{math|1=1 &minus; ''X''}}. In the language of [[universal algebra]], a Boolean algebra is a <math>\langle B,+,</math>∙<math>,\overline{..},1,0\rangle</math> [[algebraic structure|algebra]] of [[arity|type]] <math>\langle 2,2,1,0,0\rangle</math>.

Interpreting one of 0 and 1 as ''True'' and the other as ''False'' yields classical [[bivalent logic]] in equational form. In this case, '+' is read as [[logical OR|OR]], '.' as [[logical AND|AND]], and complementation as [[logical NOT|NOT]]. The numerical analog of the complement of ''x'' is 1-''x''.
Either [[one-to-one correspondence]] between {0,1} and {''True'',''False''} yields classical [[bivalent logic]] in equational form, with complementation read as [[logical NOT|NOT]]. If 1 is read as ''True'', '+' is read as [[logical OR|OR]], and '' as [[logical AND|AND]], and vice versa if 1 is read as ''False''. These two operations define a commutative [[semiring]], known as the [[Boolean semiring]].


==Some basic identities==
==Some basic identities==
'''2''' can be seen as grounded in the following trivial "Boolean" arithmetic:
'''2''' can be seen as grounded in the following trivial "Boolean" arithmetic:

* 1+1 = 1+0 = 0+1 = 1
:<math>
* 0+0 = 0
\begin{align}
* 0.0 = 0.1 = 1.0 = 0
* 1.1 = 1
&1 + 1 = 1 + 0 = 0 + 1 = 1 \\
&0 + 0 = 0 \\
* <math>\overline{1} = 0</math>
&0\cdot0 = 0\cdot1 = 1\cdot0 = 0 \\
* <math>\overline{0} = 1</math>
&1\cdot1 = 1 \\
&\overline{1} = 0 \\
&\overline{0} = 1
\end{align}
</math>

Note that:
Note that:
* '+' and .' work exactly as in numerical arithmetic, except that 1+1=1.'+' and '.' are derived by analogy from numerical arithmetic; simply set any nonzero number to 1.
* '+' and '∙' work exactly as in numerical arithmetic, except that 1+1=1. '+' and '' are derived by analogy from numerical arithmetic; simply set any nonzero number to 1.
* Swapping 0 and 1, and '+' and '.' preserves truth; this is the essence of the [[duality]] pervading all Boolean algebras.
* Swapping 0 and 1, and '+' and '' preserves truth; this is the essence of the [[Duality (order theory)|duality]] pervading all Boolean algebras.
This Boolean arithmetic suffices to verify any equation of '''2''', including any axiom, by examining every possible assignment of 0s and 1s to each variable (see [[decision procedure]]).
This Boolean arithmetic suffices to verify any equation of '''2''', including the axioms, by examining every possible assignment of 0s and 1s to each variable (see [[decision procedure]]).


The following equations may now be verified:
A little known but powerful axiom set (''basis'') for '''2''' is:
* A.B.C = B.C.A.
* <math>\overline{A}.A=1</math>
* <math>A.\overline{A.B}=A.\overline{B}</math>
This basis, plus the identity A+1=1 below, make for an easy approach to proof, called ''calculation'' in the entry [[Laws of Form]].


:<math>
The following equations are now verifiable:
\begin{align}
* <math>A.A=A</math>
* <math>A+A=A</math>
&A + A = A \\
&A \cdot A = A \\
* <math>A+0=A</math>
&A + 0 = A \\
* <math>A+1=1</math>
&A + 1 = 1 \\
* <math>A.0=0</math>
&A \cdot 0 = 0 \\
* <math>A.1=A</math>
* <math>\overline\overline{A}=A</math>
&\overline{\overline{A}} = A
\end{align}
* <math>A.B=\overline{\overline{A}+\overline{B}}</math>
</math>
* <math>A+B=\overline{\overline{A}.\overline{B}}</math>


Each of '+' and '.' distributes over the other. That is, A.(B+C) = A.B + B.B and A+B.C = (A+B).(A+C). That '.' distributes over '+' is in accord with real-valued algebra, but not '+' over '.'. For this and other reasons, a sum of products (which leads to a [[NAND]] synthesis) is more commonly employed than a product of sums (which leads to a [[NOR]] synthesis).
Each of '+' and '' [[distributivity|distributes]] over the other:
*<math>\ A \cdot (B+C) = A \cdot B + A \cdot C;</math>
*<math>\ A+(B \cdot C) = (A+B) \cdot (A+C).</math>
That '' distributes over '+' agrees with [[elementary algebra]], but not '+' over ''. For this and other reasons, a sum of products (leading to a [[Sheffer stroke|NAND]] synthesis) is more commonly employed than a product of sums (leading to a [[Logical NOR|NOR]] synthesis).


Each of '+' and '∙' can be defined in terms of the other and complementation:
Note that each of '+' and '.' can be defined in terms of the other and complementation. Moreover, '.' can be replaced by concatenation. Hence concatenation and overbar suffice to notate '''2''' and [[Quine]]'s [[Boolean term schemata]]. Letting (''X'') denote the complement of ''X'' and "()" denote either 0 or 1 yields the ''primary algebra'', described in [[Laws of Form]].
* <math>A \cdot B=\overline{\overline{A}+\overline{B}}</math>
* <math>A+B=\overline{\overline{A} \cdot \overline{B}}.</math>
We only need one binary operation, and [[concatenation]] suffices to denote it. Hence concatenation and overbar suffice to notate '''2'''. This notation is also that of [[Willard Van Orman Quine|Quine]]'s [[Boolean term schemata]]. Letting (''X'') denote the complement of ''X'' and "()" denote either 0 or 1 yields the [[syntax]] of the primary algebra of [[G. Spencer-Brown]]'s ''[[Laws of Form]]''.


A ''basis'' for '''2''' is a set of equations, called [[axiom]]s, from which all of the above equations (and more) can be derived. There are many known bases for all Boolean algebras and hence for '''2'''. An elegant basis notated using only concatenation and overbar is:
==A bit of metatheory==
# <math>\ ABC = BCA</math> (Concatenation commutes, associates)
[[De Morgan's theorem]] states that if you do the following, in the given order, to any Boolean function:
# <math>\overline{A}A = 1</math> ('''2''' is a [[Complement (order theory)|complemented]] lattice, with an [[bounded set|upper bound]] of 1)
#<math>\ A0 = A</math> (0 is the [[bounded set|lower bound]]).
# <math>A\overline{AB} = A\overline{B}</math> ('''2''' is a [[distributive lattice]])

Where concatenation = OR, 1 = true, and 0 = false, or concatenation = AND, 1 = false, and 0 = true. (overbar is negation in both cases.)

If 0=1, (1)-(3) are the axioms for an [[abelian group]].

(1) only serves to prove that concatenation commutes and associates. First assume that (1) associates from either the left or the right, then prove commutativity. Then prove association from the other direction. Associativity is simply association from the left and right combined.

This basis makes for an easy approach to proof, called "calculation" in ''[[Laws of Form]]'', that proceeds by simplifying expressions to 0 or 1, by invoking axioms (2)&ndash;(4), and the elementary identities <math>AA=A, \overline{\overline{A}}=A, 1+A = 1</math>, and the distributive law.

==Metatheory==
[[De Morgan's theorem]] states that if one does the following, in the given order, to any [[Boolean function]]:
* Complement every variable;
* Complement every variable;
* Swap + and . operators (taking care to add brackets to ensure the order of operations remains the same);
* Swap '+' and '∙' operators (taking care to add brackets to ensure the order of operations remains the same);
* Complement the result,
* Complement the result,
the result is logically equivalent to what you started with. Repeated application of De Morgan's theorem to parts of a function can be used to drive all complements down to the individual variables.
the result is [[Logical equivalence|logically equivalent]] to what you started with. Repeated application of De Morgan's theorem to parts of a function can be used to drive all complements down to the individual variables.


A powerful and nontrivial [[metatheorem]] states that any theorem of '''2''' holds for all Boolean algebras. This theorem is useful because any equation in '''2''' can be verified by a [[decision procedure]]. Logicians refer to this fact as "'''2''' is decidable". In practice, the number of steps required to verify an equation via a decision procedure increases exponentially along with the number of its variables.
A powerful and nontrivial [[metatheorem]] states that any identity of '''2''' holds for all Boolean algebras.<ref>{{Cite book |doi = 10.1007/978-0-387-68436-9|title = Introduction to Boolean Algebras|series = Undergraduate Texts in Mathematics|year = 2009|last1 = Halmos|first1 = Paul|last2 = Givant|first2 = Steven|isbn = 978-0-387-40293-2}}</ref> Conversely, an identity that holds for an arbitrary nontrivial Boolean algebra also holds in '''2'''. Hence all identities of Boolean algebra are captured by '''2'''. This theorem is useful because any equation in '''2''' can be verified by a [[decision procedure]]. Logicians refer to this fact as "'''2''' is [[decidability (logic)|decidable]]". All known [[decision procedure]]s require a number of steps that is an [[exponential function]] of the number of variables ''N'' appearing in the equation to be verified. Whether there exists a decision procedure whose steps are a [[polynomial function]] of ''N'' falls under the [[P&nbsp;=&nbsp;NP]] conjecture.


The above metatheorem does not hold if we consider the validity of more general [[first-order logic]] formulas instead of only atomic positive equalities. As an example consider the formula {{math|1=(''x'' = 0) ∨ (''x'' = 1)}}. This formula is always true in a two-element Boolean algebra. In a four-element Boolean algebra whose domain is the powerset of {{tmath|\{0,1\} }}, this formula corresponds to the statement {{math|1=(''x'' = ∅) ∨ (''x'' = {{mset|0,1}})}} and is false when ''x'' is {{tmath|\{1\} }}. The decidability for the [[first-order theory]] of many classes of [[Boolean algebras]] can still be shown, using [[quantifier elimination]] or small model property (with the domain size computed as a function of the formula and generally larger than 2).
<!--==Minterms and minimum two level forms==
<!--==Minterms and minimum two level forms==
Any Boolean expresion can be written as a series of [[minterm]]s added together-->
Any Boolean expression can be written as a series of [[minterm]]s added together-->

==See also==
*[[Boolean algebra]]
*[[Bounded set]]
*[[Lattice (order)]]
*[[Order theory]]

==References==
{{Reflist}}

==Further reading==
Many elementary texts on Boolean algebra were published in the early years of the computer era. Perhaps the best of the lot, and one still in print, is:
* Mendelson, Elliot, 1970. ''Schaum's Outline of Boolean Algebra''. McGraw&ndash;Hill.

The following items reveal how the two-element Boolean algebra is mathematically nontrivial.
* [[Stanford Encyclopedia of Philosophy]]: "[http://plato.stanford.edu/entries/boolalg-math/ The Mathematics of Boolean Algebra]," by J. Donald Monk.
* Burris, Stanley N., and H.P. Sankappanavar, H. P., 1981. ''[http://www.thoralf.uwaterloo.ca/htdocs/ualg.html A Course in Universal Algebra.]'' Springer-Verlag. {{isbn|3-540-90578-2}}.

[[Category:Elementary algebra]]
[[Category:Boolean algebra]]

Latest revision as of 05:46, 21 August 2024

In mathematics and abstract algebra, the two-element Boolean algebra is the Boolean algebra whose underlying set (or universe or carrier) B is the Boolean domain. The elements of the Boolean domain are 1 and 0 by convention, so that B = {0, 1}. Paul Halmos's name for this algebra "2" has some following in the literature, and will be employed here.

Definition

[edit]

B is a partially ordered set and the elements of B are also its bounds.

An operation of arity n is a mapping from Bn to B. Boolean algebra consists of two binary operations and unary complementation. The binary operations have been named and notated in various ways. Here they are called 'sum' and 'product', and notated by infix '+' and '∙', respectively. Sum and product commute and associate, as in the usual algebra of real numbers. As for the order of operations, brackets are decisive if present. Otherwise '∙' precedes '+'. Hence AB + C is parsed as (AB) + C and not as A ∙ (B + C). Complementation is denoted by writing an overbar over its argument. The numerical analog of the complement of X is 1 − X. In the language of universal algebra, a Boolean algebra is a algebra of type .

Either one-to-one correspondence between {0,1} and {True,False} yields classical bivalent logic in equational form, with complementation read as NOT. If 1 is read as True, '+' is read as OR, and '∙' as AND, and vice versa if 1 is read as False. These two operations define a commutative semiring, known as the Boolean semiring.

Some basic identities

[edit]

2 can be seen as grounded in the following trivial "Boolean" arithmetic:

Note that:

  • '+' and '∙' work exactly as in numerical arithmetic, except that 1+1=1. '+' and '∙' are derived by analogy from numerical arithmetic; simply set any nonzero number to 1.
  • Swapping 0 and 1, and '+' and '∙' preserves truth; this is the essence of the duality pervading all Boolean algebras.

This Boolean arithmetic suffices to verify any equation of 2, including the axioms, by examining every possible assignment of 0s and 1s to each variable (see decision procedure).

The following equations may now be verified:

Each of '+' and '∙' distributes over the other:

That '∙' distributes over '+' agrees with elementary algebra, but not '+' over '∙'. For this and other reasons, a sum of products (leading to a NAND synthesis) is more commonly employed than a product of sums (leading to a NOR synthesis).

Each of '+' and '∙' can be defined in terms of the other and complementation:

We only need one binary operation, and concatenation suffices to denote it. Hence concatenation and overbar suffice to notate 2. This notation is also that of Quine's Boolean term schemata. Letting (X) denote the complement of X and "()" denote either 0 or 1 yields the syntax of the primary algebra of G. Spencer-Brown's Laws of Form.

A basis for 2 is a set of equations, called axioms, from which all of the above equations (and more) can be derived. There are many known bases for all Boolean algebras and hence for 2. An elegant basis notated using only concatenation and overbar is:

  1. (Concatenation commutes, associates)
  2. (2 is a complemented lattice, with an upper bound of 1)
  3. (0 is the lower bound).
  4. (2 is a distributive lattice)

Where concatenation = OR, 1 = true, and 0 = false, or concatenation = AND, 1 = false, and 0 = true. (overbar is negation in both cases.)

If 0=1, (1)-(3) are the axioms for an abelian group.

(1) only serves to prove that concatenation commutes and associates. First assume that (1) associates from either the left or the right, then prove commutativity. Then prove association from the other direction. Associativity is simply association from the left and right combined.

This basis makes for an easy approach to proof, called "calculation" in Laws of Form, that proceeds by simplifying expressions to 0 or 1, by invoking axioms (2)–(4), and the elementary identities , and the distributive law.

Metatheory

[edit]

De Morgan's theorem states that if one does the following, in the given order, to any Boolean function:

  • Complement every variable;
  • Swap '+' and '∙' operators (taking care to add brackets to ensure the order of operations remains the same);
  • Complement the result,

the result is logically equivalent to what you started with. Repeated application of De Morgan's theorem to parts of a function can be used to drive all complements down to the individual variables.

A powerful and nontrivial metatheorem states that any identity of 2 holds for all Boolean algebras.[1] Conversely, an identity that holds for an arbitrary nontrivial Boolean algebra also holds in 2. Hence all identities of Boolean algebra are captured by 2. This theorem is useful because any equation in 2 can be verified by a decision procedure. Logicians refer to this fact as "2 is decidable". All known decision procedures require a number of steps that is an exponential function of the number of variables N appearing in the equation to be verified. Whether there exists a decision procedure whose steps are a polynomial function of N falls under the P = NP conjecture.

The above metatheorem does not hold if we consider the validity of more general first-order logic formulas instead of only atomic positive equalities. As an example consider the formula (x = 0) ∨ (x = 1). This formula is always true in a two-element Boolean algebra. In a four-element Boolean algebra whose domain is the powerset of , this formula corresponds to the statement (x = ∅) ∨ (x = {0,1}) and is false when x is . The decidability for the first-order theory of many classes of Boolean algebras can still be shown, using quantifier elimination or small model property (with the domain size computed as a function of the formula and generally larger than 2).

See also

[edit]

References

[edit]
  1. ^ Halmos, Paul; Givant, Steven (2009). Introduction to Boolean Algebras. Undergraduate Texts in Mathematics. doi:10.1007/978-0-387-68436-9. ISBN 978-0-387-40293-2.

Further reading

[edit]

Many elementary texts on Boolean algebra were published in the early years of the computer era. Perhaps the best of the lot, and one still in print, is:

  • Mendelson, Elliot, 1970. Schaum's Outline of Boolean Algebra. McGraw–Hill.

The following items reveal how the two-element Boolean algebra is mathematically nontrivial.