Truth table (source code)

= Truth table
{wiki}

A truth table lists a <propositional formula>'s value for every <Boolean valuation> of its distinct primitive <propositions>. With $k$ primitive <propositions>, there are $2^k$ rows: each independently receives T or F. Evaluate compound columns from their subexpressions using the classical rules for <logical connectives>. This is exhaustive checking, so a formula true on every row is valid in <classical propositional logic>.

For a computed example over the <natural numbers>, let $A(n)$ mean that $n$ is an <even number> and $B(n)$ mean $n>2$. The choices $n=4,2,3,1$ realize respectively $(A,B)=(\mathrm T,\mathrm T),(\mathrm T,\mathrm F),(\mathrm F,\mathrm T),(\mathrm F,\mathrm F)$: all four possible inputs.

\Image[/logical-implication-truth-table.png]
{title=Classical <logical implication>, its <contrapositive>, and its <converse implication> on all four inputs}

The <logical implication> $A\to B$ and its <contrapositive> agree on every row; the <converse implication> $B\to A$ differs on two rows. A <truth table> therefore checks equivalence or supplies a <counterexample>. Classical truth conditions are given in https://forallx.openlogicproject.org/html/Ch31.html[forall x: Calgary, section 31.2]. These two-valued <truth tables> do not characterize validity in <Intuitionistic propositional logic>.