Concept

Truth function

A rule computing the truth value of a compound statement from the truth values of its parts and nothing else. There are sixteen of them on two inputs, and a single one can generate all the rest.

Named by 9 essays across one field — each of them below, with the objects they name alongside it.

(p ∨ q) ∧ ¬r, drawn on the cube of 8 assignments. The assignments as corners of a cube, joined when they differ in one variable, with the satisfying corners filled.

A formula is a corner of a cube

A formula about three letters is a set of eight rows. Written as a table that is a list; drawn on a cube it is a shape — and the shape is what almost every later question in this field turns out to be about.

logic · Truth functions
Post's five classes, and which connectives escape them. A table of connectives against the five closed classes, with the completeness verdict for each.

One connective is enough

Of the sixteen ways to combine two truth values, exactly two can build all the others by themselves. Which two is not obvious, and the reason turns out to be five properties that a connective either has or escapes.

logic · Truth functions
((p ∧ q) ∨ (r ∧ s)) ∨ (¬p ∧ ¬r), covered by 3 rectangles. A grid of the assignments arranged so that neighbouring squares differ in one variable.

The map that puts neighbours side by side

Reorder the rows of a truth table so that neighbouring squares differ in one letter, and finding a short formula stops being algebra and becomes the problem of covering a shape with rectangles.

logic · Truth functions
Smallest circuits for four functions of three letters. Four small circuit diagrams, each with three inputs feeding a few two-input gates, computing parity, a selector, majority and exactly-one-true with two, three, four and four gates.

How many gates a truth table needs

Every truth function can be built from gates, and the natural measure of a function is the fewest gates that build it. For three letters the whole answer can be computed: no function needs more than four. For n letters, a count shows that almost every function needs about 2ⁿ/n gates, and a construction shows that none needs more. And for any function anyone can actually write down, the best proof in fifty years says it needs 3.1n.

logic · Truth functions
Six formulas on the interval of truth values. Graphs on [0, 1] of six one-variable formulas of Łukasiewicz logic, each a zigzag of whole-number slopes with values 0 or 1 at the ends.

The zigzags a formula can draw

Let truth be any number from 0 to 1, and Łukasiewicz's connectives turn every formula in one variable into a graph. Every graph that appears is a zigzag of straight pieces with whole-number slopes, ending at 0 or 1 — and McNaughton proved in 1951 that every such zigzag appears. A logic of degrees of truth turns out to be a theory of piecewise-linear functions with integer coefficients.

logic · Non classical logic
Three truth values, two of which count as holding. Truth tables of negation, conjunction and disjunction in the logic of paradox, with the values that count as holding — both and true — shaded.

A contradiction that stays where it is

In classical logic one contradiction proves everything: from p and not-p, any q at all. Add a third truth value — both true and false — and count it as holding, and the explosion stops. The classical laws all survive as laws; what goes is exactly the reasoning that carries a contradiction somewhere it was not. Run the other way, the same three tables make a logic of gaps instead of gluts.

logic · Non classical logic
Fourteen truth functions of three letters. table 00000000: 2; table 01101001: 2; table 00001111: 6; table 00111100: 6; table 00010111: 8; table 00011000: 8; table 00000001: 16; table 00010110: 16; table 00000011: 24; table 00000110: 24; table 00011011: 24; table 00011110: 24; table 00000111: 48; table 00011001: 48.

Truth tables up to renaming

There are 256 truth functions of three letters, but many differ only in which letter is called what, or whether a letter or the answer is negated. Counted up to such renamings there are fourteen. For four letters there are 222, for five 616,126 — and almost every function of many letters is changed by every renaming, so the count settles into a simple division.

logic · Truth functions
What each connective of two letters can express on its own. Three-letter fragment sizes of the clones generated by single binary connectives: false 4, nor 256, not x but y 38, not x 6, x but not y 38, not y 6, xor 8, nand 256, and 7, iff 8, y 3, if x then y 38, x 3, if y then x 38, or 7, true 4.

What an incomplete set of connectives can say

Nand alone can express every truth function, and Post's five properties say exactly which sets of connectives can. That answers the question at the top. Below it lies a whole landscape: and alone expresses 7 of the 256 functions of three letters, xor 8, implication 38, and the sixty-four sets that can be drawn from and, or, not, xor and the two constants fall into just 22 different classes of expressible functions. The classes fit together into Emil Post's lattice of 1941 — countably infinite, completely described, and on three letters small enough to draw.

logic · Truth functions
The twenty monotone functions of three letters. All 20 monotone Boolean functions of three letters drawn on the cube of inputs, from the constant false to the constant true.

Functions that only go up

Of the 256 logical functions of three letters, only twenty never turn off when a letter is turned on. Dedekind asked in 1897 how many such monotone functions there are for n letters. Computing the count is hard enough that the answer has advanced one letter every twenty-five years or so, and the ninth arrived in 2023, from two groups in the same month, at forty-two digits. Almost everything about the number comes from a single layer of the cube.

logic · Truth functions

Named alongside it

The objects these essays reach for when they reach for this one.

Exhaustive searchHypercubeNormal formTruth tableConnectiveCounting argumentDualityFunctional completenessMany valued logicParityAffine functionAlgebra

All concepts