empty type in nLab
Context
Type theory
Contents
Idea
In type theory the empty type is the type with no term.
In a model by categorical semantics (cf. relation between type theory and category theory), this is an initial object. In set theory, it is an empty set. In logic, especially via the propositions as types interpretation of type theory, it represents falsehood; and constructing a term of an empty type represents a contradiction; thus functions into the empty type are regarded as the negation of their domain proposition.
Definition
Like all type constructors in type theory, to characterize the empty type we must specify how to build it, how to construct elements of it, how to use such elements, and the computation rules.
To start with, since the empty type is not dependent, its type formation rule just says that it exists:
∅:Type\frac{ }{\emptyset\colon Type}
As a positive type
The empty type is most naturally presented as a positive type, so that the constructor rules are primary. However, since the empty type is supposed to contain no elements, there are no constructor rules.
In fact one may understand the positively defined empty type as that inductive type which is given by no constructors.
Therefore, in programming languages supporting a calculus of constructions, such as Coq, the empty type may be defined by the following syntax for inductive data types using literally an empty string of constructors on the right:
Inductive empty : Type :=
Recursion principle
We start by considering the recursion principle of the empty type, hence its un-dependent elimination rule:
The eliminator rules are derived from the constructor rules in the usual way: to use a term x:∅x \,\colon\, \varnothing, given any D:TypeD \,\colon\, Type, it suffices to specify what should be done for all the ways that x:∅x \,\colon\, \varnothing could have been constructed. But for the empty type there are no such ways and hence – assuming x:∅x \,\colon\, \varnothing – we obtain a term of any type DD under no further conditions:
D:Typex:∅⊢ind D(x):D \frac{ D \,\colon\, Type } { x \,\colon\, \varnothing \;\; \vdash \;\; ind_D(x) \,\colon\, D }
Some ways to read this recursion principle:
- Understood as a statement in propositional logic (regarding propositions as types), this says that from a false assumption every proposition DD is implied (ex falso quodlibet):
False⇒D. False \;\Rightarrow\; D \,.
- Understood in the categorical semantics (cf. the relation between type theory and category theory) this translates to the first part of the characterization of an initial object, namely the existence of morphisms into any codomain object:
∅→∃D. \varnothing \xrightarrow{\exists} D \,.
What is not manifest from the above rule is the (essential) uniqueness of these morphisms; on that point see also the eta conversion rule, below.
Induction principle
In dependent type theory the elimination rule of an inductive type is a dependent induction principle which involves any ∅\varnothing-dependent type.
Applying the general rules for inductive types to the case of no generators, one obtains the following inference rules:
| |∅:Type \frac{ }{ \mathclap{\phantom{\vert^{\vert}}} \varnothing \,\colon\, Type }
--- none --- \text{--- none ---}
x:∅⊢D(x):Type| |ind (D):∏x:∅D(x) \frac{ x \,\colon\, \varnothing \;\vdash\;\; D(x) \,:\, Type }{ \mathclap{\phantom{\vert^{\vert}}} ind_{(D)} \,\colon\, \underset{x \colon \varnothing}{\prod} D(x) }
--- none --- \text{--- none ---}
Notice that the induction principle entails the recursion principle above (cf. e.g. MHE, §2.6), as for any inductive type:
D:Type((x:∅)↦D):(∅→Type)ind (x↦D):(x:∅)→D \frac{ \frac{ D \,\colon\, Type } { \big( (x \,\colon\, \varnothing) \mapsto D \big) \,\colon\, (\varnothing \to Type) } }{ ind_{ (x \mapsto D) } \,\colon\, (x \colon \varnothing) \to D }
Eta-conversion
Notice that there is no beta-reduction rule for the positive empty type, since there are no constructors to compose with the eliminator.
However, one may consider an eta-conversion rule, which says that for any term e:∅⊢c:Ce \,\colon\, \varnothing \;\;\vdash\;\; c \,\colon\, C in a context including a term of type ∅\emptyset, we have
abort C(e)↔ ηc. abort_C(e) \;\;\; \leftrightarrow_\eta \;\;\; c \,.
As with the η \eta -conversion rule for the negative presentation of the unit type, this is ill-defined as a reduction (since we cannot determine cc from abort C(e)abort_C(e)), but makes sense as an expansion. . Notice that Coq implements the beta reduction rule, but not the eta conversion (although eta equivalence is provable for the inductively defined identity types, using the dependent eliminator mentioned above).
As a negative type
As for binary sum types, it is possible to present the empty type as a negative type as well, but only if we allow sequents with multiple conclusions. This is common in sequent calculus presentations of classical logic, but not as common in type theory and almost unheard of in dependent type theory.
The two definitions are provably equivalent, but only using the contraction rule and the weakening rule. Thus, in linear logic they become distinct; the positive empty type is “zero” 0\mathbf{0} and the negative one is “bottom” ⊥\bot.
Using a type of propositions
Suppose that the dependent type theory has a type of propositions Prop\mathrm{Prop}, such as the one derived from a type universe UU - ∑ A:UisProp(A)\sum_{A:U} \mathrm{isProp}(A). Then the empty type is defined as the dependent function type
∅≡∏ P:PropP\emptyset \equiv \prod_{P:\mathrm{Prop}} P
whose elements are witnesses that all propositions are pointed types (and thus contractible types).
By weak function extensionality, the empty type is a proposition, and if it has an element, then every proposition in Prop\mathrm{Prop} has an element and is contractible.
Properties
Equivalence of the definitions of the empty type
Theorem
The inductive definition of the empty type and the definition of the empty type in terms of dependent product types and the type of propositions are equivalent to each other.
Proof
Since the empty type is a proposition, it is equivalent to its own propositional truncation ∅≃[∅]\emptyset \simeq [\emptyset].
Meanwhile, the propositional truncation of a type AA is equivalent to the dependent product type
[A]≃∏ P:Prop(A→P)→P[A] \simeq \prod_{P:\mathrm{Prop}} (A \to P) \to P
Substituting the empty type for AA, we have
[∅]≃∏ P:Prop(∅→P)→P[\emptyset] \simeq \prod_{P:\mathrm{Prop}} (\emptyset \to P) \to P
By the recursion principle of the empty type, for every type PP, the type ∅→P\emptyset \to P is contractible, and for every contractible type II, the type I→PI \to P is equivalent to PP. Thus, we have equivalences of types
∅≃[∅]≃(∏ P:Prop(∅→P)→P)≃(∏ P:PropP)\emptyset \simeq [\emptyset] \simeq \left(\prod_{P:\mathrm{Prop}} (\emptyset \to P) \to P\right) \simeq \left(\prod_{P:\mathrm{Prop}} P\right)
References
-
Univalent Foundations Project, §1.7 and §A.28 in: Homotopy Type Theory – Univalent Foundations of Mathematics (2013) [web, pdf]
-
Egbert Rijke, Def. 3.2.1 in: Inductive types and the universe, Lecture 3 in: Introduction to Homotopy Type Theory 2018 [pdf]
The definition of the empty type from the type of propositions and dependent product types can be found in:
- Madeleine Birchfield, Constructing coproduct types and boolean types from universes, MathOverflow (web)
In Agda:
- Martín Hötzel Escardó, §2.6 in Introduction to Univalent Foundations of Mathematics with Agda (2019-2022)
See also:
- Wikipedia, Principle of explosion
Last revised on April 30, 2024 at 01:49:13. See the history of this page for a list of all contributions to it.