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. It is also the tensor unit for the smash product in the monoidal category of pointed sets.

###### 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

As an inductive type, the boolean domain is given by

Inductive Bool : Type
| zero : Bool
| one : Bool

This says that the type is inductively constructed from two terms in the type Bool, whose interpretation is as the two points of the type.

#### As a positive type

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{Bool} \; \mathrm{type}}$

term introduction rules for the boolean domain:

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

term elimination rules for the boolean domain:

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

computation rules for the boolean domain:

• judgmental computation rules

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

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

uniqueness rules for the boolean domain:

• judgmental uniqueness rules
$\frac{\Gamma, x:\mathrm{Bool} \vdash C(x) \; \mathrm{type}}{\Gamma, c:\prod_{x:\mathrm{Bool}} C(x), p:\mathrm{Bool} \vdash \mathrm{ind}_\mathrm{Bool}^C(c(0), c(1), p) \equiv c(p):C(p)}$
• typal uniqueness rules
$\frac{\Gamma, x:\mathrm{Bool} \vdash C(x) \; \mathrm{type}}{\Gamma, c:\prod_{x:\mathrm{Bool}} C(x), p:\mathrm{Bool} \vdash \eta_\mathrm{Bool}(c, p):\mathrm{Id}_{C(p)}(\mathrm{ind}_\mathrm{Bool}^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 can be simplified to the following rule:

$\frac{\Gamma, x:\mathrm{Bool} \vdash C(x) \; \mathrm{type}}{\Gamma, c_0:C(0), c_1:C(1)\vdash \mathrm{up}_\mathrm{Bool}^C(c_0, c_1):\exists!c:\prod_{x:\mathrm{Bool}} 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 type theories with a separate type judgment where not all types are elements of universes, one has to additionally add the following elimination and computation rules:

Elimination rules:

$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma, x:\mathrm{Bool} \vdash \mathrm{typerec}_{\mathrm{Bool}}^{A, B}(x) \; \mathrm{type}}$

Computation rules:

• judgmental computation rules
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash \mathrm{typerec}_{\mathrm{Bool}}^{A, B}(0) \equiv A \; \mathrm{type}}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash \mathrm{typerec}_{\mathrm{Bool}}^{A, B}(1) \equiv B \; \mathrm{type}}$
• typal computation rules
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash \beta_{\mathrm{Bool}}^{0, A, B}:\mathrm{typerec}_{\mathrm{Bool}}^{A, B}(0) \simeq A}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type}}{\Gamma \vdash \beta_{\mathrm{Bool}}^{1, A, B}:\mathrm{typerec}_{\mathrm{Bool}}^{A, B}(1) \simeq B}$

#### As the type of decidable propositions

The boolean domain can also be defined as the type of decidable propositions. Suppose that we have a type of propositions $\mathrm{Prop}$. Then, the type of booleans is defined as

$\mathrm{Bool} \equiv \sum_{P:\mathrm{Prop}} P \vee \neg P$

where $A \vee B$ is the disjunction of two types $A$ and $B$ and $\neg A \equiv A \to \emptyset$ is the negation of the type $A$. Both disjunctions and the empty set can be directly defined from $\mathrm{Prop}$, dependent function types, and product types.

One can also define directly the boolean domain as the type of all decidable propositions, provided one already has disjunctions defined in the type theory. Similarly to the type of all propositions, the boolean domain can be presented either as a Russell universe or a Tarski universe. The difference between the two is that in the former, every decidable proposition in the type theory is literally an element of the boolean domain, while in the latter, elements of $\mathrm{Bool}$ are only indices of a (-1)-truncated type family $\mathrm{El}$; every decidable proposition in the type theory is only essentially $\mathrm{Bool}$-small for weak Tarski universes or judgmentally equal to an $\mathrm{El}(P)$ for $P:\mathrm{Bool}$ for strict Tarski universes.

##### As a strict Tarski universe

As a strict Tarski universe, the boolean domain is given by the following natural deduction inference rules:

Formation rules for the boolean domain:

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

Introduction rules for the boolean domain:

$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toBool}_A:\mathrm{isProp}(A) \to (A \vee \neg A) \to \mathrm{Bool}}$

Elimination rules for the boolean domain:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{El}(A) \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{proptrunc}(A):\mathrm{isProp}(\mathrm{El}(A))} \qquad \frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{lem}(A):\mathrm{El}(A) \vee \neg \mathrm{El}(A)}$

Computation rules for the boolean domain:

$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{El}(\mathrm{toBool}_A(p)(q)) \equiv A \; \mathrm{type}}$
• Judgmental computation rules:
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{proptrunc}(\mathrm{toBool}_A(p)(q)) \equiv p:\mathrm{isProp}(A)}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{lem}(\mathrm{toBool}_A(p)(q)) \equiv q:A \vee \neg A}$
• Typal computation rules:
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \beta_{\mathrm{Bool}}^{\mathrm{proptrunc}, A}(p, q):\mathrm{Id}_{\mathrm{isProp}(A)}(\mathrm{proptrunc}(\mathrm{toBool}_A(p)(q)), p)}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \beta_{\mathrm{Bool}}^{\mathrm{lem}, A}(p, q):\mathrm{Id}_{A \vee \neg A}(\mathrm{lem}(\mathrm{toBool}_A(p)(q)), q)}$

Uniqueness rules for the boolean domain:

• Judgmental computation rules:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{toBool}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)) \equiv A:\mathrm{Bool}}$
• Typal computation rules:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \eta_{\mathrm{Bool}}(A):\mathrm{Id}_{\mathrm{Bool}}(\mathrm{toProp}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)), A)}$

Extensionality principle for the boolean domain:

$\frac{\Gamma \vdash A:\mathrm{Bool} \quad \Gamma \vdash B:\mathrm{Bool}} {\Gamma \vdash \mathrm{ext}_\mathrm{Bool}(A, B):\mathrm{isEquiv}(\mathrm{transport}^\mathrm{El}(A, B))}$
##### As a weak Tarski universe

As a weak Tarski universe, the boolean domain is given by the following natural deduction inference rules:

Formation rules for the boolean domain:

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

Introduction rules for the boolean domain:

$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toBool}_A:\mathrm{isProp}(A) \to (A \vee \neg A) \to \mathrm{Bool}}$

Elimination rules for the boolean domain:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{El}(A) \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{proptrunc}(A):\mathrm{isProp}(\mathrm{El}(A))} \qquad \frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{lem}(A):\mathrm{El}(A) \vee \neg \mathrm{El}(A)}$

Computation rules for the boolean domain:

$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \beta_\mathrm{Bool}^{\mathrm{El}, A}(p, q):\mathrm{El}(\mathrm{toBool}_A(p)(q)) \simeq A}$
• Judgmental computation rules:
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{congform}_\mathrm{isProp}(\beta_\mathrm{Bool}^{\mathrm{El}, A}(p, q))(\mathrm{proptrunc}(\mathrm{toBool}_A(p)(q))) \equiv p:\mathrm{isProp}(A)}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{congform}_{(-) \vee \neg (-)}(\beta_\mathrm{Bool}^{\mathrm{El}, A}(p, q))(\mathrm{lem}(\mathrm{toBool}_A(p)(q))) \equiv q:A \vee \neg A}$
• Typal computation rules:
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \beta_{\mathrm{Bool}}^{\mathrm{proptrunc}, A}(p, q):\mathrm{Id}_{\mathrm{isProp}(A)}(\mathrm{congform}_\mathrm{isProp}(\beta_\mathrm{Bool}^{\mathrm{El}, A}(p, q))(\mathrm{proptrunc}(\mathrm{toBool}_A(p)(q))), p)}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \beta_{\mathrm{Bool}}^{\mathrm{proptrunc}, A}(p, q):\mathrm{Id}_{A \vee \neg A}(\mathrm{congform}_{(-) \vee \neg (-)}(\beta_\mathrm{Bool}^{\mathrm{El}, A}(p, q))(\mathrm{lem}(\mathrm{toBool}_A(p)(q))), q)}$

where the equivalences

$\mathrm{congform}_\mathrm{isProp}(\beta_\mathrm{Bool}^{\mathrm{El}, A}(p, q)):\mathrm{isProp}(\mathrm{El}(\mathrm{toProp}_A(p)(q))) \simeq \mathrm{isProp}(A)$
$\mathrm{congform}_{(-) \vee \neg (-)}(\beta_\mathrm{Bool}^{\mathrm{El}, A}(p, q)):(\mathrm{El}(\mathrm{toProp}_A(p)(q)) \vee \neg \mathrm{El}(\mathrm{toProp}_A(p)(q))) \simeq (A \vee \neg A)$

can always be constructed in a type theory with dependent product types, dependent sum types, identity types, disjunctions, and negations, as given types $A$ and $B$ and an equivalence $e:A \simeq B$, it is possible to form the equivalences

$\mathrm{congform}_\mathrm{isProp}(e):\mathrm{isProp}(A) \simeq \mathrm{isProp}(B)$
$\mathrm{congform}_{(-) \vee \neg (-)}(e):(A \vee \neg A) \simeq (B \vee \neg B)$

through application of equivalences to identifications and the typal congruence rules of function types, dependent product types, product types, dependent sum types, disjunctions, and negations.

Uniqueness rules for the boolean domain:

• Judgmental computation rules:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash\mathrm{toBool}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)) \equiv A:\mathrm{Bool}}$
• Typal computation rules:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \eta_{\mathrm{Bool}}(A):\mathrm{Id}_{\mathrm{Bool}}(\mathrm{toProp}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)), A)}$

Extensionality principle for the boolean domain:

$\frac{\Gamma \vdash A:\mathrm{Bool} \quad \Gamma \vdash B:\mathrm{Bool}} {\Gamma \vdash \mathrm{ext}_\mathrm{Bool}(A, B):\mathrm{isEquiv}(\mathrm{transport}^\mathrm{El}(A, B))}$
##### As a Russell universe

As a Russell universe, the boolean domain is given by the following natural deduction inference rules:

Formation rules for the boolean domain:

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

Introduction rules for the boolean domain:

$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toBool}_A:\mathrm{isProp}(A) \to (A \vee \neg A) \to \mathrm{Bool}}$

Elimination rules for the boolean domain:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash A \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{proptrunc}(A):\mathrm{isProp}(A)} \qquad \frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{lem}(A):A \vee \neg A}$

Computation rules for the boolean domain:

$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{toBool}_A(p)(q) \equiv A \; \mathrm{type}}$
• Judgmental computation rules:
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{proptrunc}(\mathrm{toBool}_A(p)(q)) \equiv p:\mathrm{isProp}(A)}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \mathrm{lem}(\mathrm{toBool}_A(p)(q)) \equiv q:A \vee \neg A}$
• Typal computation rules:
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \beta_{\mathrm{Bool}}^{\mathrm{proptrunc}, A}:\mathrm{Id}_{\mathrm{isProp}(A)}(\mathrm{proptrunc}(\mathrm{toBool}_A(p)(q)), p)}$
$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A) \quad \Gamma \vdash q:A \vee \neg A}{\Gamma \vdash \beta_{\mathrm{Bool}}^{\mathrm{lem}, A}:\mathrm{Id}_{A \vee \neg A}(\mathrm{lem}(\mathrm{toBool}_A(p)(q)), q)}$

Uniqueness rules for the boolean domain:

• Judgmental computation rules:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{toBool}_{A}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)) \equiv A:\mathrm{Bool}}$
• Typal computation rules:

$\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \eta_{\mathrm{Bool}}(A):\mathrm{Id}_{\mathrm{Bool}}(\mathrm{toBool}_{A}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)), A)}$

Extensionality principle for the boolean domain:

$\frac{\Gamma \vdash A:\mathrm{Bool} \quad \Gamma \vdash B:\mathrm{Bool}} {\Gamma \vdash \mathrm{ext}_\mathrm{Bool}(A, B):\mathrm{isEquiv}(\mathrm{idToEquiv}(A, B))}$

### 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: ## Properties

### Extensionality principle of the boolean domain

The elements of the boolean domain represent certain truth values or propositions, namely, true and false. By the principle of propositions as some types, truth values or propositions are represented as certain types: specifically, true or $1$ is represented by the unit type $\mathbb{1}$, and false or $0$ is represented by the empty type $\mathbb{0}$. The boolean domain becomes a Tarski universe via type recursion:

$x:\mathrm{Bool} \vdash \mathrm{typerec}_{\mathrm{Bool}}^{\mathbb{0}, \mathbb{1}}(x) \; \mathrm{type}$

The extensionality principle of the boolean domain is then given by the univalence axiom:

$\frac{\Gamma \; \mathrm{ctx}}{\Gamma, x:\mathrm{Bool}, y:\mathrm{Bool} \vdash \mathrm{ua}(x, y):\mathrm{Id}_\mathrm{Bool}(x, y) \simeq (\mathrm{typerec}_{\mathrm{Bool}}^{\mathbb{0}, \mathbb{1}}(x) \simeq \mathrm{typerec}_{\mathrm{Bool}}^{\mathbb{0}, \mathbb{1}}(y))}$

Since the empty type is not equivalent to the unit type, this automatically implies that $0$ is not equal to $1$.

### Relation to sum types

The sum types can be defined in terms of the boolean domain and the dependent sum type. Given types $A$ and $B$, the sum type $A + B$ is defined as

$A + B \coloneqq \sum_{x:\mathrm{Bool}} \mathrm{typerec}_{\mathrm{Bool}}^{A, B}(x)$

### Boolean logic

One could recursively define the logical functions on $\mathrm{Bool}$ as follows

• For negation $\neg$
• $\neg 0 := 1$
• $\neg 1 := 0$
• For conjunction $\wedge$
• $0 \wedge a := 0$
• $1 \wedge a := a$
• For disjunction $\vee$
• $0 \vee a := a$
• $1 \vee a := 1$
• For implication $\implies$
• $0 \implies a := 1$
• $1 \implies a := a$
• For the biconditional $\iff$
• $0 \iff a := \neg a$
• $1 \iff a := a$

One could prove that $(\mathrm{Bool}, 0, 1, \neg, \wedge, \vee, \implies)$ form a Boolean algebra. The poset structure is given by implication.

One could also inductively define observational equality on the booleans $\mathrm{Eq}_\mathrm{Bool}(x, y)$ as an indexed inductive type on the boolean type $\mathrm{Bool}$ with the following constructors

$\mathrm{eq}_0: \mathrm{Eq}_\mathbb{2}(0, 0)$
$\mathrm{eq}_1: \mathrm{Eq}_\mathbb{2}(1, 1)$

A boolean predicate valued in a type $T$ is a function $P: T \rightarrow \mathrm{Bool}$, and the type $T \to \mathrm{Bool}$ is a boolean function algebra for finite types $T$, and if path types exist, for all types $T$. Thus the functor $F: U \to BoolAlg$, $F(T) = T \to \mathrm{Bool}$ for a type universe $U$ is a Boolean hyperdoctrine, and one could do classical first-order logic inside $U$ if $\mathrm{Bool}$ and path types exist in $U$.

In fact, just with dependent sum types, dependent product types, empty type, unit type, and the two-valued type in a type universe $U$, any two-valued logic could be done inside $U$. Furthermore, since binary disjoint coproducts exist when $\mathrm{Bool}$ exists, all finite types exist in $U$, and any finitely-valued logic?, such as the internal logic of a finite cartesian power of Set, could be done inside $U$.

For finite types, one could also inductively define specific functions

$\forall a \in A.(-)(a):(A \to \mathrm{Bool}) \to \mathrm{Bool}$
$\exists a \in A.(-)(a):(A \to \mathbf{2}) \to \mathrm{Bool}$

from the type of boolean predicates on $A$ and $\mathrm{Bool}$ such that they behave like existential quantification and universal quantification.

### Other properties

$\mathrm{Bool} \cong \sum_{P:\mathcal{U}} isProp(P) \times isDecidable(P)$

As a result, sometimes the boolean domain is called a decidable subset classifier.