nLab type of booleans

Context

Universes

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Contents

 Idea

The boolean domain in dependent type theory.

Definition

The type of booleans, denoted Bool\mathrm{Bool}, 𝟚\mathbb{2}, or 2\mathbf{2}, can be defined in a dependent type theory in many different ways:

As an inductive 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

ΓctxΓBooltype\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{Bool} \; \mathrm{type}}


term introduction rules for the type of booleans:

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


term elimination rules for the type of booleans:

Γ,x:BoolC(x)typeΓ,c 0:C(0),c 1:C(1),p:Boolind Bool C(c 0,c 1,p):C(p)\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 type of booleans:

  • judgmental computation rules

    Γ,x:BoolC(x)typeΓ,c 0:C(0),c 1:C(1)ind Bool C(c 0,c 1,0)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, 0) \equiv c_0:C(0)}
    Γ,x:BoolC(x)typeΓ,c 0:C(0),c 1:C(1)ind Bool C(c 0,c 1,1)c 1:C(1)\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

    Γ,x:BoolC(x)typeΓ,c 0:C(0),c 1:C(1)β Bool 0(c 0,c 1):Id C(0)(ind 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}^0(c_0, c_1):\mathrm{Id}_{C(0)}(\mathrm{ind}_\mathrm{Bool}^C(c_0, c_1, 0), c_0)}
    Γ,x:BoolC(x)typeΓ,c 0:C(0),c 1:C(1)β Bool 1(c 0,c 1,1):Id C(1)(ind Bool C(c 0,c 1,1),c 1)\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 type of booleans:

  • judgmental uniqueness rules
    Γ,x:BoolC(x)typeΓ,c: x:BoolC(x),p:Boolind Bool C(c(0),c(1),p)c(p):C(p)\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
    Γ,x:BoolC(x)typeΓ,c: x:BoolC(x),p:Boolη Bool(c,p):Id C(p)(ind Bool C(c(0),c(1),p),c(p))\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 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:

Γ,x:BoolC(x)typeΓ,c 0:C(0),c 1:C(1)up Bool C(c 0,c 1):!c: x:BoolC(x).Id C(0)(c(0),c 0)×Id C(1)(c(1),c 1)\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 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:

ΓAtypeΓBtypeΓ,x:Booltyperec Bool A,B(x)type\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
ΓAtypeΓBtypeΓtyperec Bool A,B(0)Atype\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}}
ΓAtypeΓBtypeΓtyperec Bool A,B(1)Btype\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
ΓAtypeΓBtypeΓβ Bool 0,A,B:typerec Bool A,B(0)A\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}
ΓAtypeΓBtypeΓβ Bool 1,A,B:typerec Bool A,B(1)B\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 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

Suppose that we have a type of propositions Prop\mathrm{Prop}. Then, the type of booleans is defined as

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

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

As a homotopy-terminal type

A univalent family of decidable propositions consists of a type AA and a type family (B(x)) x:A(B(x))_{x:A} such that

A morphism of univalent families of decidable propositions between univalent families of decidable propositions (A,B)(A, B) and (A,B)(A', B') consists of a function f A:AAf_A:A \to A' and a family of functions f B(x):B(x)B(f A(x))f_B(x):B(x) \to B'(f_A(x)).

The type of booleans (Bool,El)(\mathrm{Bool}, \mathrm{El}) is the homotopy-terminal univalent family of decidable propositions: given any other univalent family of decidable propositions (A,B)(A, B), there exists a unique function u A:ABoolu_A:A \to \mathrm{Bool} and a unique family of functions u B(x):B(x)El(u A(x))u_B(x):B(x) \to \mathrm{El}(u_A(x)).

As a type universe

The type of booleans Bool\mathrm{Bool} 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 AtypeA \; \mathrm{type}

  • a witness p:isProp(A)×(A¬A)p:\mathrm{isProp}(A) \times (A \vee \neg A) that AA 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

A la Tarski

The type of booleans a la Tarski is given by the following natural deduction inference rules:

Formation rules for the type of booleans:

ΓctxΓBooltype\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{Bool} \; \mathrm{type}}

Introduction rules for the type of booleans:

ΓAtypeΓtoBool A:isProp(A)(A¬A)Bool\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 type of booleans:

ΓA:BoolΓEl(A)typeΓA:BoolΓproptrunc(A):isProp(El(A))ΓA:BoolΓlem(A):El(A)¬El(A)\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 type of booleans:

ΓAtypeΓp:isProp(A)Γq:A¬AΓEl(toBool A(p)(q))Atype\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}}
ΓAtypeΓp:isProp(A)Γq:A¬AΓproptrunc(toBool A(p)(q))p: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{proptrunc}(\mathrm{toBool}_A(p)(q)) \equiv p:\mathrm{isProp}(A)}
ΓAtypeΓp:isProp(A)Γq:A¬AΓlem(toBool A(p)(q))q:A¬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}

Uniqueness rules for the type of booleans:

ΓA:BoolΓtoBool El(A)(proptrunc(A))(lem(A))A:Bool\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{toBool}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)) \equiv A:\mathrm{Bool}}

Extensionality principle for the type of booleans:

ΓA:BoolΓB:BoolΓext Bool(A,B):isEquiv(transport El(A,B))\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))}
A la Russell

The type of all propositions a la Russell is given by the following natural deduction inference rules:

Formation rules for the type of booleans:

ΓctxΓBooltype\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{Bool} \; \mathrm{type}}

Introduction rules for the type of booleans:

ΓAtypeΓtoBool A:isProp(A)(A¬A)Bool\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 type of booleans:

ΓA:BoolΓAtypeΓA:BoolΓproptrunc(A):isProp(A)ΓA:BoolΓlem(A):A¬A\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 type of booleans:

ΓAtypeΓp:isProp(A)Γq:A¬AΓtoBool A(p)(q)Atype\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}}
ΓAtypeΓp:isProp(A)Γq:A¬AΓproptrunc(toBool A(p)(q))p: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{proptrunc}(\mathrm{toBool}_A(p)(q)) \equiv p:\mathrm{isProp}(A)}
ΓAtypeΓp:isProp(A)Γq:A¬AΓlem(toBool A(p)(q))q:A¬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}

Uniqueness rules for the type of booleans:

ΓA:BoolΓtoBool A(proptrunc(A))(lem(A))A:Bool\frac{\Gamma \vdash A:\mathrm{Bool}}{\Gamma \vdash \mathrm{toBool}_{A}(\mathrm{proptrunc}(A))(\mathrm{lem}(A)) \equiv A:\mathrm{Bool}}

Extensionality principle for the type of booleans:

ΓA:BoolΓB:BoolΓext Bool(A,B):isEquiv(idToEquiv(A,B))\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))}

As the 0-sphere type

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 n n -sphere types:


Properties

Descent and large recursion

The descent for the type of booleans states that given any types AA and BB one can construct a type family x:𝟚descFam 𝟚 A,B(x)x:\mathbb{2} \vdash \mathrm{descFam}_\mathbb{2}^{A, B}(x) with equivalences of types

descEquiv A:descFam 𝟚 A,B(0)AanddescEquiv B:descFam 𝟚 A,B(1)B\mathrm{descEquiv}_A:\mathrm{descFam}_\mathbb{2}^{A, B}(0) \simeq A \quad \mathrm{and} \quad \mathrm{descEquiv}_B:\mathrm{descFam}_\mathbb{2}^{A, B}(1) \simeq B

Large recursion for the type of booleans strengthens the equivalences of types in descent to judgmental equality of types

descFam 𝟚 A,B(0)AanddescFam 𝟚 A,B(1)B\mathrm{descFam}_\mathbb{2}^{A, B}(0) \equiv A \quad \mathrm{and} \quad \mathrm{descFam}_\mathbb{2}^{A, B}(1) \equiv B

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:

descId A:descFam 𝟚 A,B(0)=AanddescId B:descFam 𝟚 A,B(1)=B\mathrm{descId}_A:\mathrm{descFam}_\mathbb{2}^{A, B}(0) = A \quad \mathrm{and} \quad \mathrm{descId}_B:\mathrm{descFam}_\mathbb{2}^{A, B}(1) = B

Extensionality principle 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 11 is represented by the unit type 𝟙\mathbb{1}, and false or 00 is represented by the empty type 𝟘\mathbb{0}. The type of booleans is a Tarski universe through the following type family:

x:BoolEl(x)(x= Bool1)׬(x= Bool0)x:\mathrm{Bool} \vdash \mathrm{El}(x) \coloneqq (x =_\mathrm{Bool} 1) \times \neg (x =_\mathrm{Bool} 0)

The extensionality principle of the type of booleans is then given by the univalence axiom:

ΓctxΓ,x:Bool,y:Boolua(x,y):Id Bool(x,y)(El(x)El(y))\frac{\Gamma \; \mathrm{ctx}}{\Gamma, x:\mathrm{Bool}, y:\mathrm{Bool} \vdash \mathrm{ua}(x, y):\mathrm{Id}_\mathrm{Bool}(x, y) \simeq (\mathrm{El}(x) \simeq \mathrm{El}(y))}

Since the empty type is not equivalent to the unit type, this automatically implies that 00 is not equal to 11. The extensionality principle of the type of booleans can be proven from descent of the type of booleans, see Sattler 2023 for a proof.

Relation to sum types

The sum types can be defined in terms of the type of booleans and the dependent sum type. Given types AA and BB, the sum type A+BA + B is defined as

A+B x:Bool((x= Bool1)A)×((x= Bool0)B)A + B \coloneqq \sum_{x:\mathrm{Bool}} ((x =_\mathrm{Bool} 1) \to A) \times ((x =_\mathrm{Bool} 0) \to B)

Boolean logic

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

  • For negation ¬\neg
    • ¬0:=1\neg 0 := 1
    • ¬1:=0\neg 1 := 0
  • For conjunction \wedge
    • 0a:=00 \wedge a := 0
    • 1a:=a1 \wedge a := a
  • For disjunction \vee
    • 0a:=a0 \vee a := a
    • 1a:=11 \vee a := 1
  • For implication \implies
    • 0a:=10 \implies a := 1
    • 1a:=a1 \implies a := a
  • For the biconditional \iff
    • 0a:=¬a0 \iff a := \neg a
    • 1a:=a1 \iff a := a

One could prove that (Bool,0,1,¬,,,)(\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 Eq Bool(x,y)\mathrm{Eq}_\mathrm{Bool}(x, y) as an indexed inductive type on the boolean type Bool\mathrm{Bool} with the following constructors

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

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

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

For finite types, one could also inductively define specific functions

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

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

Other properties

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

As a result, sometimes the type of booleans is called a decidable subtype classifier.

References

Discussion in type theory as a simple example of an inductive type:

Discussion in homotopy type theory:

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.