Contents

# Contents

## Idea

The boolean domain or boolean field (often just: $Bool$) is a $2$-element set, say $\mathbb{B} = \{ 0, 1 \}$ (“bits”) or $\mathbb{B} = \{ \bot, \top \}$ (“bottom”, “top”), whose elements may be interpreted as truth values.

Note that $\mathbb{B}$ is the set of all truth values in classical logic, but this cannot be assumed in non-classical logic such as intuitionistic logic.

The Boolean domain plays the role of the subobject classifier in the Boolean topos of Sets.

If we think of the classical $\mathbb{B}$ as a pointed set equipped with the true element, then there is an effectively unique boolean domain.

A boolean variable $x$ is a variable that takes its value in a boolean domain, as $x \in \mathbb{B}$. If this variable depends on parameters, then it is (or defines) a Boolean-valued function, that is a function whose target is $\mathbb{B}$.

An element of $\mathbb{B}$ is a binary digit, or bit.

The boolean domain is the initial set with two elements. It is also the initial set with an element and an involution.

###### Remark

(relation to boolean algebra)
The term ‘boolean field’ (or just ‘field’, depending on the context) is sometimes used more generally for any boolean algebra. In fact, the boolean domain is the initial boolean algebra. If we interpret a boolean algebra as a boolean ring, then the boolean domain is the finite field with $2$ elements.

## Definition

### In type theory

Assuming that identification types and dependent product types exist in the type theory, the boolean domain is the inductive type generated by two elements, and is defined by the following inference rules:

type formation rules for the boolean domain

$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{Bit} \; \mathrm{type}}$

term introduction rules for the boolean domain:

$\frac{\Gamma \; \mathrm{ctx}}{\vdash 0:\mathrm{Bit}} \qquad \frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash 1:\mathrm{Bit}}$

term elimination rules for the boolean domain:

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1), p:\mathrm{Bit} \vdash \mathrm{ind}_\mathrm{Bit}^C(c_0, c_1, p):C(p)}$

computation rules for the boolean domain:

• judgmental computation rules

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1) \vdash \mathrm{ind}_\mathrm{Bit}^C(c_0, c_1, 0) \equiv c_0:C(0)}$
$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1) \vdash \mathrm{ind}_\mathrm{Bit}^C(c_0, c_1, 1) \equiv c_1:C(1)}$
• propositional computation rules

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1) \vdash \mathrm{ind}_\mathrm{Bit}^C(c_0, c_1, 0) =_{C(0)} c_0 \; \mathrm{true}}$
$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1) \vdash \mathrm{ind}_\mathrm{Bit}^C(c_0, c_1, 1) =_{C(1)} c_1 \; \mathrm{true}}$
• typal computation rules

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1) \vdash \beta_\mathrm{Bit}^0(c_0, c_1):\mathrm{Id}_{C(0)}(\mathrm{ind}_\mathrm{Bit}^C(c_0, c_1, 0), c_0)}$
$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1) \vdash \beta_\mathrm{Bit}^1(c_0, c_1, 1):\mathrm{Id}_{C(1)}(\mathrm{ind}_\mathrm{Bit}^C(c_0, c_1, 1), c_1)}$

uniqueness rules for the boolean domain:

• judgmental uniqueness rules

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c:\prod_{x:\mathrm{Bit}} C(x), p:\mathrm{Bit} \vdash \mathrm{ind}_\mathrm{Bit}^C(c(0), c(1), p) \equiv c(p):C(p)}$
• propositional uniqueness rules

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c:\prod_{x:\mathrm{Bit}} C(x), p:\mathrm{Bit} \vdash \mathrm{ind}_\mathrm{Bit}^C(c(0), c(1), p) =_{C(p)} c(p) \; \mathrm{true}}$
• typal uniqueness rules

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c:\prod_{x:\mathrm{Bit}} C(x), p:\mathrm{Bit} \vdash \eta_\mathrm{Bit}(c, p):\mathrm{Id}_{C(p)}(\mathrm{ind}_\mathrm{Bit}^C(c(0), c(1), p), c(p))}$

The elimination, typal computation, and typal uniqueness rules for the boolean domain state that the boolean domain satisfies the dependent universal property of the boolean domain. If the dependent type theory also has dependent sum types and product types, allowing one to define the uniqueness quantifier, the dependent universal property of the boolean domain could be simplified to the following rule:

$\frac{\Gamma, x:\mathrm{Bit} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1)\vdash \mathrm{up}_\mathrm{Bit}^C(c_0, c_1):\exists!c:\prod_{x:\mathrm{Bit}} C(x).\mathrm{Id}_{C(0)}(c(0), c_0) \times \mathrm{Id}_{C(1)}(c(1), c_1)}$

The judgmental computation and uniqueness rules imply the typal computation and uniqueness rules and thus imply the dependent universal property of the boolean domain.

### In homotopy type theory

In homotopy type theory the type of booleans / bits looks as above (using judgemental equality, propositional equality, or typal equality for the computation rule and uniqueness rule) but now it may equivalently be thought of as the sphere type of the 0-sphere and as such as the beginning of the suspension type-tower of types of “higher homotopy bits” — the $n$-sphere types: 