(in category theory/type theory/computer science)
of all homotopy types
of (-1)-truncated types/h-propositions
natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
The boolean domain in dependent type theory.
The type of booleans, denoted , , or , can be defined in a dependent type theory in many different ways:
as a positive inductive type representing the homotopy-initial type with two elements.
as the type of decidable propositions, itself defined in multiple different ways
as the 0-sphere type, the suspension type of the empty type
Assuming that identification types and dependent product types exist in the type theory, the type of booleans is the inductive type generated by two elements, and is defined by the following inference rules:
type formation rules for the type of booleans
term introduction rules for the type of booleans:
term elimination rules for the type of booleans:
computation rules for the type of booleans:
judgmental computation rules
typal computation rules
uniqueness rules for the type of booleans:
The elimination, typal computation, and typal uniqueness rules for the type of booleans state that the type of booleans satisfies the dependent universal property of the type of booleans. 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 type of booleans can be simplified to the following rule:
The judgmental computation and uniqueness rules imply the typal computation and uniqueness rules and thus imply the dependent universal property of the type of booleans.
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:
Computation rules:
The type of booleans can also be defined as the type of all decidable propositions, provided one already has disjunctions and the negations defined in the type theory:
using the type of all propositions, as the subuniverse of decidable propositions.
as a homotopy-terminal univalent type family of decidable propositions, suitably defined.
as a type universe, with inference rules that mimic that of the negative dependent sum type or respectively, but for all types, not just the -small types.
Suppose that we have a type of propositions . Then, the type of booleans is defined as
where is the disjunction of two types and and is the negation of the type . Both disjunctions and the empty set can be directly defined from , dependent function types, and product types.
A univalent family of decidable propositions consists of a type and a type family such that
is a decidable proposition for all ,
the transport function
is an equivalence of types for all and
A morphism of univalent families of decidable propositions between univalent families of decidable propositions and consists of a function and a family of functions .
The type of booleans is the homotopy-terminal univalent family of decidable propositions: given any other univalent family of decidable propositions , there exists a unique function and a unique family of functions .
The type of booleans is a type universe of all decidable propositions. It behaves as a record type where one of the fields is a type, consisting of
a type
a witness that is a decidable proposition.
Similar to other type universes and record types with type fields, the type of booleans can be presented a la Tarski or a la Russell
The type of booleans a la Tarski is given by the following natural deduction inference rules:
Formation rules for the type of booleans:
Introduction rules for the type of booleans:
Elimination rules for the type of booleans:
Computation rules for the type of booleans:
Uniqueness rules for the type of booleans:
Extensionality principle for the type of booleans:
The type of all propositions a la Russell is given by the following natural deduction inference rules:
Formation rules for the type of booleans:
Introduction rules for the type of booleans:
Elimination rules for the type of booleans:
Computation rules for the type of booleans:
Uniqueness rules for the type of booleans:
Extensionality principle for the type of booleans:
In dependent type theory with pushout types, the type of booleans / bits can be defiend 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 -sphere types:
The descent for the type of booleans states that given any types and one can construct a type family with equivalences of types
Large recursion for the type of booleans strengthens the equivalences of types in descent to judgmental equality of types
If one is working in a dependent type theory with type variables which has identity types between types, then one can also use identifications of types instead of equivalences of types to express large recursion of the type of booleans:
The elements of the type of booleans 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 is represented by the unit type , and false or is represented by the empty type . The type of booleans is a Tarski universe through the following type family:
The extensionality principle of the type of booleans is then given by the univalence axiom:
Since the empty type is not equivalent to the unit type, this automatically implies that is not equal to . The extensionality principle of the type of booleans can be proven from descent of the type of booleans, see Sattler 2023 for a proof.
The sum types can be defined in terms of the type of booleans and the dependent sum type. Given types and , the sum type is defined as
One could recursively define the logical functions on as follows
One could prove that form a Boolean algebra. The poset structure is given by implication.
One could also inductively define observational equality on the booleans as an indexed inductive type on the boolean type with the following constructors
A boolean predicate valued in a type is a function , and the type is a boolean function algebra for finite types , and if path types exist, for all types . Thus the functor , for a type universe is a Boolean hyperdoctrine, and one could do classical first-order logic inside if and path types exist in .
In fact, just with dependent sum types, dependent product types, empty type, unit type, and the two-valued type in a type universe , any two-valued logic could be done inside . Furthermore, since binary disjoint coproducts exist when exists, all finite types exist in , and any finitely-valued logic?, such as the internal logic of a finite cartesian power of Set, could be done inside .
For finite types, one could also inductively define specific functions
from the type of boolean predicates on and such that they behave like existential quantification and universal quantification.
The type of booleans is the suspension type of the empty type, and the suspension of the type of booleans is the circle type. Geometrically, the type of booleans is a zero-dimensional sphere.
The type of booleans is homotopy equivalent to the type of decidable propositions in a universe .
As a result, sometimes the type of booleans is called a decidable subtype classifier.
Discussion in type theory as a simple example of an inductive type:
Discussion in homotopy type theory:
Steve Awodey, Nicola Gambino, Kristina Sojakova, §3.1 in: Inductive types in homotopy type theory, LICS’12 (2012) 95–104 [arXiv:1201.3898, doi:10.1109/LICS.2012.21]
Univalent Foundations Project, Homotopy Type Theory – Univalent Foundations of Mathematics (2013)
Egbert Rijke, Exc. 4.2 (pp. 35) in: Introduction to Homotopy Type Theory (2023) [arXiv:2212.11082]
…
Large recursion and descent of the type of booleans can be found in
Last revised on May 16, 2025 at 06:18:13. See the history of this page for a list of all contributions to it.