Many of the binary logic operators satisfy algebraic properties like associativity, closure, and having an inverse. I was wondering if you could form a group, or any other algebraic structure using one (or more) of these gates.
2026-04-08 00:44:32.1775609072
On
Is there a logic gate (NAND, OR, etc.) which forms a group under the set $\{0,1\}?$
785 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
3
There are 3 best solutions below
0
On
Actually the set $\{0,1\}$ with AND, OR and NOT is an example (and the most basic nontrivial one) of a Boolean algebra. Its associated Boolean ring $(\{0,1\}, XOR, AND)$ is isomorphic in this case to $(\mathbb Z_2, +_2, \cdot_2)$.
In fact you can form every algebraic structure the set $2 = \{ 0, 1 \}$ possesses using compositions of logic gates. This is because, by functional completeness, the standard logic gates can express every Boolean function $2^n \to 2$.
So it's natural to ask: what is the structure on $2$ given by all of the Boolean functions together? This is the "maximally general algebraic structure" that $2$ can possess. The answer is that it is equivalent to the structure of a Boolean algebra (using AND, OR, and NOT) or equivalently a Boolean ring (using XOR, NOT, and AND). Specializations of this structure include
There are other more exotic specializations given by Post's lattice.
Another interesting question is: what algebraic structure do the logic gates themselves form? The answer is that they form what is called a Lawvere theory; see this blog post for some details.