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
In type theory the unit type is the type with a unique term. It is the special case of a product type with no factors.
In a model by categorical semantics, this is a terminal object. In set theory, it is a singleton.
Like any type in type theory, the unit type is specified by rules saying when we can introduce it as a type, how to introduce terms of that type, how to use or eliminate terms of that type, and how to compute when we combine the constructors with the eliminators.
The unit type, like the binary product type, can be presented both as a positive type and as a negative type. There are typically two foundations in which the unit type is specified in, natural deduction and lambda-calculus.
We assume that our unit types have typal conversion rules, as those are the most general of the conversion rules. Both the propositional and judgmental conversion rules imply the typal conversion rules by the structural rules for propositional and judgmental equality respectively.
For both the positive unit type and the negative unit type, the formation and introduction rules are the same.
The formation rule for the unit type is given by
and the introduction rule for the unit type is given by
The positive unit type says that satisfies singleton induction. The negative unit type says that the element is the center of contraction of .
Singleton induction for a type and term states that the type has the following elimination rule, computation rule, and uniqueness rule:
Thus, the unit type satisfies singleton induction.
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:
As a negative type, there are no elimination rules or computation rules for . The uniqueness rule states that is the center of contraction of and is given by:
Thus, the unit type is a contractible type.
Let denote the positive unit type, and let and be elements of . Then the identity type is a contractible type.
Given an element , we can define the family of types for all . The elimination and computation rules for the positive unit type imply that is a contractible type with center of contraction which is equal to .
The uniqueness rule for the positive unit type states that given a family of terms indexed by and , for all elements , elements , and witnesses that is equal to in , there is a witness that is equal to in .
Thus, the identity type is a contractible type for all elements and , with element .
The positive unit type is a contractible type.
Since the identity type is a contractible type for all elements and , with element , it follows that is an h-proposition. Since is also pointed with element , it is thus a contractible type.
There is an equivalence of types between two contractible types and .
By the definition of contractible type, there are elements and , and thus, an element and a witness that is a center of contraction of , and an element and a witness that is a center of contraction of . By the uniqueness principle of contractible types, it suffices to define a function at . We define it as . Now, all that’s left is to prove that the fiber of at all elements is contractible. But by the uniqueness principle of contractible types, it suffices to prove it for the center of contraction . The canonical element is in the fiber of at , and since is the center of contraction of , the fiber of at is contractible, and thus the fiber of at every element is contractible. Thus, is an equivalence of types between the contractible types and .
The positive and negative unit types are equivalent to each other.
Since the negative unit type is contractible by definition, and the positive unit type is contractible, they are equivalent to each other.
Then we could derive the extensionality principle for the unit type:
Given elements and , there is an equivalence of types between the identity type and itself.
Since every identity type is contractible for elements and , and itself is contractible, this implies that every identity type is equivalent to .
In set theory, regular and inaccessible cardinals are useful in determining size issues in strongly predicative and weakly predicative/impredicative mathematics respectively. Some definitions of regular and inaccessible cardinals do not have a requirement that the cardinals be infinite; thus finite cardinals such as and could be considered to be regular and inaccessible cardinals. Univalent universes in type theory which are closed under dependent sum types are the type theoretic equivalent of regular cardinals, and univalent universe which are additionally closed under power sets are the type theoretic equivalent of inaccessible cardinals.
We inductively define the type family by defining
The extensionality principle for the unit type then is simply the univalence axiom:
The unit type represents the trivial universe, the universe with only one element up to identification, where every type in the universe is a contractible type and thus every contractible type is essentially -small. The equivalence type between the two contractible types and is itself contractible and thus equivalent to itself. As proven in the previous section, is equivalent to for any and . Thus the univalence axiom for is true.
In addition, given any type , functions into the unit type are families of contractible types. The universe is also closed under dependent sum types, as for any family of contractible types ,
This makes the unit type into a Tarski universe representing a finite regular cardinal.
If the dependent type theory also has weak function extensionality, then the universe above is also closed under dependent product types, as weak function extensionality states that for any family of contractible types ,
making the unit type into a Tarski universe representing a finite product-regular cardinal.
As a universe, the unit type also satisfies propositional resizing: the type of all -small propositions is simply the unit type itself as a weakly Tarski universe, which is essentially -small. Thus, in the context of weak function extensionality, power sets exist in the unit type, making the unit type impredicative: power sets are just function types into the unit type. This makes the unit type into a Tarski universe representing a finite inaccessible cardinal.
The unit type is also the only universe which contains itself, as any univalent universe which contains the empty type and itself makes the entire dependent type theory inconsistent.
In lambda-calculus, for both the positive unit type and the negative unit type, the rule for building the unit type is the same, namely “it exists”:
Regarded as a positive type, we give primacy to the constructors, of which there is exactly one, denoted or .
The eliminator now says that to use something of type , it suffices to say what to do in the case when that thing is .
Obviously this is not very interesting, but this is what we get from the general rules of type theory in this degenerate case. In dependent type theory, we should also allow to depend on the unit type .
We then have the ∞-reduction? rule:
and (if we wish) the ∞-reduction? rule:
The -reduction rule is simple. The -reduction rule says that if is an expression involving a variable of type , and we substitute for in and use that (with the eliminator) to define a term involving another term of type , then the result is the same as what we would get by substituting for in directly.
The positive presentation of the unit type is naturally expressed as an inductive type. In Coq syntax:
Inductive unit : Type :=
| tt : unit.
(Coq then implements beta-reduction, but not eta-reduction. However, eta-equivalence is provable with the internally defined identity type, using the dependent eliminator mentioned above.)
A negative type is characterized by its eliminators, which is a little subtle for the unit type. But by analogy with binary product types, which have two eliminators and when presented negatively, the negative unit type (a nullary product) should have no eliminators at all.
To derive the constructors from this, we follow the general rule for negative types that to construct an element of , it should suffice to specify how that element behaves under all the eliminators. Since there are no eliminators, this means we have nothing to do; thus we have exactly one way to construct an element of , by doing nothing:
There is no -reduction rule, since there are no eliminators to compose with the constructor. However, there is an -conversion rule. In general, an -redex? consists of a constructor whose inputs are all obtained from eliminators. Here we have a constructor which has no inputs, so it is not a problem that we have no eliminators to fill them in with. Thus, the term is an “-redex”, and it “reduces” to any term of type at all:
This is obviously not a well-defined “operation”, so in this case it is better to view -conversion in terms of expansion:
In ordinary “nonlinear” type theory, the positive and negative unit types are equivalent. They manifestly have the same constructor, while we can define the positive eliminator in a trivial way as
Note that just as for binary product types, in order for this to be a well-typed definition of the dependent eliminator in dependent type theory, we need to assume the -conversion rule for the assumed negative unit type (at least, propositionally).
Of course, the positive -reduction rule holds by definition for the above defined eliminator.
For the -conversion rules, if we start from the negative presentation and define the positive eliminator as above, then is precisely , which is convertible to by the negative -conversion rule .
Conversely, if we start from the positive presentation, then we have
where in the first conversion we use and in the second we use .
As in the case of binary product types, these translations require the contraction rule and the weakening rule; that is, they duplicate and discard terms. In linear logic these rules are disallowed, and therefore the positive and negative unit types become different. The positive product becomes “one” , while the negative product becomes “top” .
There are two interpretations of the unit type, corresponding to the positive and negative unit types. Namely:
The negative unit type corresponds to a terminal object in a category
The positive unit type with both -conversion and -conversion corresponds to an initial object with a point, a morphism from some unit object to the object corresponding to the unit type, in a category.
These two conditions are the same if the syntactic category is a cartesian monoidal category, where the points are the global elements and the unit is the terminal object. In general, however, the points may not be defined out of the terminal object. In linear logic, therefore, the categorical terminal object interprets “top” , while the unit object of an additional monoidal structure interprets “one” .
On the unit type as an inductive type satisfying singleton induction:
Univalent Foundations Project, p. 30 Homotopy Type Theory – Univalent Foundations of Mathematics (2013) [web, pdf]
Egbert Rijke, Def. 3.1.1 in: Introduction to Homotopy Type Theory, lecture notes, CMU (2018) [pdf, pdf, webpage]
homotopy level | n-truncation | homotopy theory | higher category theory | higher topos theory | homotopy type theory |
---|---|---|---|---|---|
h-level 0 | (-2)-truncated | contractible space | (-2)-groupoid | true/unit type/contractible type | |
h-level 1 | (-1)-truncated | contractible-if-inhabited | (-1)-groupoid/truth value | (0,1)-sheaf/ideal | mere proposition/h-proposition |
h-level 2 | 0-truncated | homotopy 0-type | 0-groupoid/set | sheaf | h-set |
h-level 3 | 1-truncated | homotopy 1-type | 1-groupoid/groupoid | (2,1)-sheaf/stack | h-groupoid |
h-level 4 | 2-truncated | homotopy 2-type | 2-groupoid | (3,1)-sheaf/2-stack | h-2-groupoid |
h-level 5 | 3-truncated | homotopy 3-type | 3-groupoid | (4,1)-sheaf/3-stack | h-3-groupoid |
h-level | -truncated | homotopy n-type | n-groupoid | (n+1,1)-sheaf/n-stack | h--groupoid |
h-level | untruncated | homotopy type | ∞-groupoid | (∞,1)-sheaf/∞-stack | h--groupoid |
Last revised on October 22, 2023 at 03:42:33. See the history of this page for a list of all contributions to it.