type of finite types

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Universes
+-- {: .hide}
[[!include universe - contents]]
=--
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

\tableofcontents

## Idea

In [[dependent type theory]], the *type of finite types* is the [[type universe]] $\mathrm{FinType}$ which contains the [[finite types]] of the type theory, in the sense of [[finite set]] in set theory. The type of finite types is important in the field of [[combinatorics]], as well as for defining mathematical structures like [[finite-dimensional vector spaces]].

## Definition

In [[dependent type theory]], given a type $A$, there are many different ways of defining the [[mere proposition]] $\mathrm{isFinite}(A)$ which indicates that $A$ is a [[finite type]].

* Given a [[natural numbers type]] $\mathbb{N}$, a type $A$ is finite if [[existential quantifier|there merely exists]] a natural number $n:\mathbb{N}$ such that $A$ is equivalent to the standard finite type $\mathrm{Fin}(n)$ (see at [[family of finite types]]):

$$\mathrm{isFinite}(A) \equiv \exists n:\mathbb{N}.A \simeq \mathrm{Fin}(n)$$

* Given a [[type of propositions]] $\mathrm{Prop}$, a type $A$ is finite if for all [[subtypes]] $S:(A \to \mathrm{Prop}) \to \mathrm{Prop}$ of the [[power set]] of $A$, if the [[empty subset|empty subtype]] $\lambda x:A.\bot$ is in $S$, and for all subtypes $P:A \to \mathrm{Prop}$ and $Q:A \to \mathrm{Prop}$ of $A$ such that $P$ being in $S$, $Q$ being a singleton subtype, and $P$ and $Q$ being [[disjoint subset|disjoint]] together imply that the [[union]] $P \cup Q$ is in $S$, then the [[improper subset|improper subtype]] $\lambda x:A.\top$ is in $S$.

$$
\mathrm{isFinite}(A) \equiv
\begin{array}{c}
\prod_{S:(A \to \mathrm{Prop}) \to \mathrm{Prop}} (((\lambda x:A.\bot) \in S) \times \prod_{P:A \to \mathrm{Prop}} \prod_{Q:A \to \mathrm{Prop}} (P \in S) \\
\times (\exists!x:A.x \in Q) \times (P \cap Q =_{A \to \mathrm{Prop}} \lambda x:A.\bot) \to (P \cup Q \in S)) \to ((\lambda x:A.\top) \in S)
\end{array}
$$

* Alternatively, if we don't have either a [[natural numbers type]] or a [[type of all propositions]], given the [[boolean domain]] $\mathrm{Bool}$, a type $A$ is finite if for all [[decidable subtypes]] $S:(A \to \mathrm{Bool}) \to \mathrm{Bool}$ of the set of decidable subtypes of $A$, if the [[empty subset|empty decidable subtype]] $\lambda x:A.\bot$ is in $S$, and for all decidable subtypes $P:A \to \mathrm{Bool}$ and $Q:A \to \mathrm{Bool}$ of $A$ such that $P$ being in $S$, $Q$ being a singleton decidable subtype, and $P$ and $Q$ being [[disjoint subset|disjoint]] together imply that the [[union]] $P \cup Q$ is in $S$, then the [[improper subset|improper decidable subtype]] $\lambda x:A.\top$ is in $S$.

$$
\mathrm{isFinite}(A) \equiv
\begin{array}{c}
\prod_{S:(A \to \mathrm{Bool}) \to \mathrm{Bool}} (((\lambda x:A.\bot) \in S) \times \prod_{P:A \to \mathrm{Bool}} \prod_{Q:A \to \mathrm{Bool}} (P \in S) \\
\times (\exists!x:A.x \in Q) \times (P \cap Q =_{A \to \mathrm{Bool}} \lambda x:A.\bot) \to (P \cup Q \in S)) \to ((\lambda x:A.\top) \in S)
\end{array}
$$

The membership relation and the subtype operations used above are defined in the nLab article on [[subtypes]].

The definitions of the various different types of finite types are agnostic regarding the definition of $\mathrm{isFinite}$, as they uses $\mathrm{isFinite}$ directly rather than a particular definition.

### The type of all finite types

Unlike the case for the [[type of all types]] $\mathrm{Type}$, the type of all finite types $\mathrm{FinType}$ doesn't run into [[Girard's paradox]], because neither $\mathrm{FinType}$ nor its set truncation is itself a finite type, and so isn't an element of itself.

The **type of all finite types** $\mathrm{FinType}$ in a [[dependent type theory]] could be presented either as a [[Russell universe]] or a [[Tarski universe]]. The difference between the two is that in the former, every [[finite type]] in the type theory is literally an element of the type of finite types, while in the latter, elements of $\mathrm{FinType}$ are only indices of a type family $\mathrm{El}$; every [[finite type]] in the type theory is only [[essentially small type|essentially $\mathrm{FinType}$-small]] for [[weak Tarski universes]] or [[judgmentally equal]] to an $\mathrm{El}(P)$ for $P:\mathrm{FinType}$ for [[strict Tarski universes]].

#### As a strict Tarski universe

As a [[strict Tarski universe]], the type of all finite types is given by the following [[natural deduction]] [[inference rules]]:

Formation rules for the type of all finite types:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{FinType} \; \mathrm{type}}$$

Introduction rules for the type of all finite types:
$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toElem}_A:\mathrm{isFinite}(A) \to \mathrm{FinType}}$$

Elimination rules for the type of all finite types:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \mathrm{El}(A) \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \mathrm{finWitn}(A):\mathrm{isFinite}(\mathrm{El}(A))}$$

Computation rules for the type of all finite types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \mathrm{El}(\mathrm{toElem}_A(p)) \equiv A \; \mathrm{type}}$$

* Judgmental computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \mathrm{finWitn}(\mathrm{toElem}_A(p)) \equiv p:\mathrm{isFinite}(A)}$$

* Typal computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \beta_\mathrm{FinType}^{\mathrm{finWitn},A}(p):\mathrm{finWitn}(\mathrm{toElem}_A(p)) =_{\mathrm{isFinite}(A)} p}$$

Uniqueness rules for the type of all finite types:

* Judgmental computation rules:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \mathrm{toElem}_{\mathrm{El}(A)}(\mathrm{finWitn}(A)) \equiv A:\mathrm{FinType}}$$

* Typal computation rules:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \eta_{\mathrm{FinType}}(A):\mathrm{toElem}_{\mathrm{El}(A)}(\mathrm{finWitn}(A)) =_{\mathrm{FinType}} A}$$

[[univalence axiom|Extensionality principle]] of the type of all finite types:
$$\frac{\Gamma \vdash A:\mathrm{FinType} \quad \Gamma \vdash B:\mathrm{FinType}} {\Gamma \vdash \mathrm{ext}_\mathrm{FinType}(A, B):\mathrm{isEquiv}(\mathrm{transport}^\mathrm{El}(A, B))}$$

#### As a weak Tarski universe

As a [[weak Tarski universe]], the type of all finite types is given by the following [[natural deduction]] [[inference rules]]:

Formation rules for the type of all finite types:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{FinType} \; \mathrm{type}}$$

Introduction rules for the type of all finite types:
$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toElem}_A:\mathrm{isFinite}(A) \to \mathrm{FinType}}$$

Elimination rules for the type of all finite types:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \mathrm{El}(A) \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \mathrm{finWitn}(A):\mathrm{isFinite}(\mathrm{El}(A))}$$

Computation rules for the type of all finite types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \beta_\mathrm{FinType}^{\mathrm{El}, A}(p):\mathrm{El}(\mathrm{toElem}_A(p)) \simeq A \; \mathrm{type}}$$

* Judgmental computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \mathrm{congform}_\mathrm{isFinite}(\beta_\mathrm{FinType}^{\mathrm{El}, A}(p))(\mathrm{finWitn}(\mathrm{toElem}_A(p))) \equiv p:\mathrm{isFinite}(A)}$$

* Typal computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \beta_\mathrm{FinType}^{\mathrm{finWitn},A}(p):\mathrm{congform}_\mathrm{isFinite}(\beta_\mathrm{FinType}^{\mathrm{El}, A}(p))(\mathrm{finWitn}(\mathrm{toElem}_A(p))) =_{\mathrm{isFinite}(A)} p}$$

where the equivalence
$$\mathrm{congform}_\mathrm{isFinite}(\beta_\mathrm{FinType}^{\mathrm{El}, A}(p)):\mathrm{isFinite}(\mathrm{El}(\mathrm{toElem}_A(p))) \simeq \mathrm{isFinite}(A)$$
can always be constructed in a type theory with [[dependent product types]], [[dependent sum types]], [[identity types]], and a [[type of all propositions]], as given types $A$ and $B$ and an equivalence $e:A \simeq B$, it is possible to form the equivalence $\mathrm{congform}_\mathrm{isFinite}(e):\mathrm{isFinite}(A) \simeq \mathrm{isFinite}(B)$ through [[function application to identifications|application of equivalences to identifications]] and the typal congruence rules of [[function types]], [[dependent product types]], [[product types]], and [[dependent sum types]].

Uniqueness rules for the type of all finite types:

* Judgmental computation rules:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash A \equiv \mathrm{toElem}_{\mathrm{El}(A)}(\mathrm{finWitn}(A)):\mathrm{FinType}}$$

* Typal computation rules:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \eta_{\mathrm{FinType}}(A):A =_{\mathrm{FinType}} \mathrm{toElem}_{\mathrm{El}(A)}(\mathrm{finWitn}(A))}$$

[[univalence axiom|Extensionality principle]] of the type of all finite types:
$$\frac{\Gamma \vdash A:\mathrm{FinType} \quad \Gamma \vdash B:\mathrm{FinType}} {\Gamma \vdash \mathrm{ext}_\mathrm{FinType}(A, B):\mathrm{isEquiv}(\mathrm{transport}^\mathrm{El}(A, B))}$$

#### As a Russell universe

As a [[Russell universe]], the type of all finite types is given by the following [[natural deduction]] [[inference rules]]:

Formation rules for the type of all finite types:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{FinType} \; \mathrm{type}}$$

Introduction rules for the type of all finite types:
$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toElem}_A:\mathrm{isFinite}(A) \to \mathrm{FinType}}$$

Elimination rules for the type of all finite types:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash A \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \mathrm{finWitn}(A):\mathrm{isFinite}(A)}$$

Computation rules for the type of all finite types:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \mathrm{toElem}_A(p) \equiv A \; \mathrm{type}}$$

* Judgmental computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \mathrm{finWitn}(\mathrm{toElem}_A(p)) \equiv p:\mathrm{isFinite}(A)}$$

* Typal computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isFinite}(A)}{\Gamma \vdash \beta_\mathrm{FinType}^{\mathrm{finWitn},A}(p):\mathrm{finWitn}(\mathrm{toElem}_A(p)) =_{\mathrm{isFinite}(A)} p}$$

Uniqueness rules for the type of all finite types:

* Judgmental computation rules:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \mathrm{toElem}_{A}(\mathrm{finWitn}(A)) \equiv A:\mathrm{FinType}}$$

* Typal computation rules:
$$\frac{\Gamma \vdash A:\mathrm{FinType}}{\Gamma \vdash \eta_{\mathrm{FinType}}(A):\mathrm{toElem}_{A}(\mathrm{finWitn}(A)) =_{\mathrm{FinType}} A}$$

[[univalence axiom|Extensionality principle]] of the type of all finite types:
$$\frac{\Gamma \vdash A:\mathrm{FinType} \quad \Gamma \vdash B:\mathrm{FinType}} {\Gamma \vdash \mathrm{ext}_\mathrm{FinType}(A, B):\mathrm{isEquiv}(\mathrm{idToEquiv}(A, B))}$$

### Type of small finite types

Given an already existing [[Russell universe]] $U$, the type of $U$-small finite types is given by the [[dependent sum type]]

$$\sum_{A:U} \mathrm{isFinite}(A)$$

Similarly, given an already existing [[Tarski universe]] $(U, T)$, the type of $U$-small finite types is given by the [[dependent sum type]]

$$\sum_{A:U} \mathrm{isFinite}(T(A))$$

## Properties

### Closure under type formers

The type of finite types is closed under the [[empty type]], the [[unit type]], [[function types]],  [[dependent product types]], [[product types]], [[dependent sum types]], and [[sum types]].

### Relation to the natural numbers type

The [[natural numbers type]] is equivalent to the [[set truncation]] of the type of finite types:

$$\mathbb{N} \simeq [\mathrm{FinType}]_0$$

This is the type theoretic analogue of the [[decategorification]] of the [[permutation category]] resulting in the set of [[natural numbers]].

This also means that the [[axiom of infinity]] for a [[type universe]] $U$ could be defined as a resizing axiom similar to [[propositional resizing]], since [[set truncations]] could be defined from $\mathrm{Prop}_U$ the [[type of propositions]] in $U$:

$$\mathrm{axinf}_U:\sum_{\mathbb{N}:U} \mathbb{N} \simeq \left[\sum_{A:U} \mathrm{isFinite}(A)\right]_0$$

$$\mathrm{axinf}_U:\sum_{\mathbb{N}:U} T(\mathbb{N}) \simeq \left[\sum_{A:U} \mathrm{isFinite}(T(A))\right]_0$$

The arithmetic operations and order relations on the [[natural numbers type]] can be defined by induction on [[set truncation]]:

For all finite types $A:\mathrm{FinType}$ and $B:\mathrm{FinType}$ and finite families $C:A \to \mathrm{FinType}$, we have

$$0 =_\mathbb{N} [\emptyset]_0 \quad 1 =_\mathbb{N} [\mathbb{1}]_0$$
$$[A]_0 + [B]_0 =_\mathbb{N} [A + B]_0$$
$$\sum_{x = 1}^{[A]_0} [C]_0(x) =_\mathbb{N} \left[\sum_{x:A} C(x)\right]_0$$
$$[A]_0 \cdot [B]_0 =_\mathbb{N} [A \times B]_0$$
$$\prod_{x = 1}^{[A]_0} [C]_0(x) =_\mathbb{N} \left[\prod_{x:A} C(x)\right]_0$$
$$[B]_0^{[A]_0} =_\mathbb{N} [A \to B]_0$$

$$[A]_0 =_\mathbb{N} [B]_0 \coloneqq [A \simeq B]_{(-1)} \; \mathrm{or} \; [A =_\mathrm{FinType} B]_{(-1)}$$
$$[A]_0 \leq [B]_0 \coloneqq [A \hookrightarrow B]_{(-1)}$$

## Categorical semantics

The categorical semantics of the type of finite types is the finite object classifier, the [[object classifier]] which classifies [[finite objects]] of a [[category]].

## Related concepts

* [[type of propositions]]

* [[type universe]]

* [[natural numbers type]]

* [[axiom of infinity]]

## References

For the fact that binary sum types, finite dependent sum types, and binary product types of finite types are finite types, see section 16.3 of:

* [[Egbert Rijke]], *[[Introduction to Homotopy Type Theory]]*, Cambridge Studies in Advanced Mathematics, Cambridge University Press ([arXiv:2212.11082](https://arxiv.org/abs/2212.11082))

For the fact that function types between finite types are finite types, see Exercise 16.1 of the above reference. These imply that the type of finite types are closed under binary sum types, finite dependent sum types, binary product types, and function types.

[[!redirects type of finite types]]
[[!redirects types of finite types]]

[[!redirects Russell type of finite types]]
[[!redirects Russell types of finite types]]
[[!redirects Tarski type of finite types]]
[[!redirects Tarski types of finite types]]
[[!redirects weak Tarski type of finite types]]
[[!redirects weak Tarski types of finite types]]
[[!redirects strict Tarski type of finite types]]
[[!redirects strict Tarski types of finite types]]

[[!redirects universe of finite types]]
[[!redirects universes of finite types]]
[[!redirects Russell universe of finite types]]
[[!redirects Russell universes of finite types]]
[[!redirects Tarski universe of finite types]]
[[!redirects Tarski universes of finite types]]
[[!redirects weak Tarski universe of finite types]]
[[!redirects weak Tarski universes of finite types]]
[[!redirects strict Tarski universe of finite types]]
[[!redirects strict Tarski universes of finite types]]

[[!redirects type of all finite types]]
[[!redirects types of all finite types]]

[[!redirects Russell type of all finite types]]
[[!redirects Russell types of all finite types]]
[[!redirects Tarski type of all finite types]]
[[!redirects Tarski types of all finite types]]
[[!redirects weak Tarski type of all finite types]]
[[!redirects weak Tarski types of all finite types]]
[[!redirects strict Tarski type of all finite types]]
[[!redirects strict Tarski types of all finite types]]

[[!redirects FinType]]


type of h-sets

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Universes
+-- {: .hide}
[[!include universe - contents]]
=--
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

$$
  \vdash \sum_{X : Type} isHSet(X) : Type
$$

## Related concepts

* [[type of propositions]]

* **type of h-sets**

* [[type of types]]


type of n-types

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Universes
+-- {: .hide}
[[!include universe - contents]]
=--
=--
=--

$$
  \vdash \sum_{X : Type} isNTruncated(X) : Type
$$


type of propositions

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Universes
+-- {: .hide}
[[!include universe - contents]]
=--
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

\tableofcontents

## Idea

In [[type theory]] a _type of propositions_ --- typically denoted  $Prop$ or $\Omega$ --- corresponds, under [[categorical semantics]], roughly to a *[[subobject classifier]]*.

> (To be precise, depending on the type theoretic rules and axioms this may not be quite true: one needs [[propositional resizing]], [[propositional extensionality]], and --- in some type theories where "proposition" is not defined as an [[h-proposition]], such as the [[calculus of constructions]] --- the [[principle of unique choice]].)

Its generalization from [[propositions]] to general [[types]] is a *[[type universe]]*.

The [[subtypes]] of a [[type]] $A$ may typically be identified with the [[function types]] into the type of propositions

$$
  Sub(A)
  \;\;
  =
  \;\;
  Prop_A
  \;\;
  \equiv
  \;\;
  A \to Prop
  \;\;
  \equiv
  \;\;
  A \to \Omega
  \,.
$$

In [[dependent type theory]] such a $P \,\colon\, A \to Prop$ is equivalently an $A$-[[dependent type|dependent]] [[proposition]], to be understood as assingning to any [[term]] $a \colon A$ the assertion that "$a$ is contained in the given subtype".

## Definition

There are many different ways of defining the [[isProp]] [[modality]] in dependent type theory. Some of them include

$$\mathrm{isProp}(A) \coloneqq \prod_{x:A} \prod_{y:A} x =_A y$$
$$\mathrm{isProp}(A) \coloneqq \prod_{x:A} \prod_{y:A} \mathrm{isContr}(x =_A y)$$
$$\mathrm{isProp}(A) \coloneqq A \to \mathrm{isContr}(A)$$

We shall be agnostic about the different definitions of $\mathrm{isProp}(A)$, and just directly use $\mathrm{isProp}(A)$.

### The type of all propositions

The **type of all propositions** $\mathrm{Prop}$ in a [[dependent type theory]] could be presented either as a [[Russell universe]] or a [[Tarski universe]]. The difference between the two is that in the former, every [[mere proposition]] in the type theory is literally an element of the type of all propositions, while in the latter, elements of $\mathrm{Prop}$ are only indices of a (-1)-truncated type family $\mathrm{El}$; every [[mere proposition]] in the type theory is only [[essentially small type|essentially $\mathrm{Prop}$-small]] for [[weak Tarski universes]] or [[judgmentally equal]] to an $\mathrm{El}(P)$ for $P:\mathrm{Prop}$ for [[strict Tarski universes]].

#### As a strict Tarski universe

As a [[strict Tarski universe]], the type of all propositions is given by the following [[natural deduction]] [[inference rules]]:

Formation rules for the type of all propositions:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{Prop} \; \mathrm{type}}$$

Introduction rules for the type of all propositions:
$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toProp}_A:\mathrm{isProp}(A) \to \mathrm{Prop}}$$

Elimination rules for the type of all propositions:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \mathrm{El}(A) \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \mathrm{proptrunc}(A):\mathrm{isProp}(\mathrm{El}(A))}$$

Computation rules for the type of all propositions:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \mathrm{El}(\mathrm{toProp}_A(p)) \equiv A \; \mathrm{type}}$$

* Judgmental computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \mathrm{proptrunc}(\mathrm{toProp}_A(p)) \equiv p:\mathrm{isProp}(A)}$$

* Typal computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \beta_\mathrm{Prop}^{\mathrm{proptrunc},A}(p):\mathrm{proptrunc}(\mathrm{toProp}_A(p)) =_{\mathrm{isProp}(A)} p}$$

Uniqueness rules for the type of all propositions:

* Judgmental computation rules:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash A \equiv \mathrm{toProp}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A)):\mathrm{Prop}}$$

* Typal computation rules:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \eta_{\mathrm{Prop}}(A):A =_{\mathrm{Prop}} \mathrm{toProp}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A))}$$

Extensionality principle of the type of all propositions:
$$\frac{\Gamma \vdash A:\mathrm{Prop} \quad \Gamma \vdash B:\mathrm{Prop}} {\Gamma \vdash \mathrm{ext}_\mathrm{Prop}(A, B):\mathrm{isEquiv}(\mathrm{transport}^\mathrm{El}(A, B))}$$

#### As a weak Tarski universe

As a [[weak Tarski universe]], the type of all propositions is given by the following [[natural deduction]] [[inference rules]]:

Formation rules for the type of all propositions:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{Prop} \; \mathrm{type}}$$

Introduction rules for the type of all propositions:
$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toProp}_A:\mathrm{isProp}(A) \to \mathrm{Prop}}$$

Elimination rules for the type of all propositions:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \mathrm{El}(A) \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \mathrm{proptrunc}(A):\mathrm{isProp}(\mathrm{El}(A))}$$

Computation rules for the type of all propositions:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \beta_\mathrm{Prop}^{\mathrm{El}, A}(p):\mathrm{El}(\mathrm{toProp}_A(p)) \simeq A \; \mathrm{type}}$$

* Judgmental computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \mathrm{congform}_\mathrm{isProp}(\beta_\mathrm{Prop}^{\mathrm{El}, A}(p))(\mathrm{proptrunc}(\mathrm{toProp}_A(p))) \equiv p:\mathrm{isProp}(A)}$$

* Typal computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \beta_\mathrm{Prop}^{\mathrm{proptrunc},A}(p):\mathrm{congform}_\mathrm{isProp}(\beta_\mathrm{Prop}^{\mathrm{El}, A}(p))(\mathrm{proptrunc}(\mathrm{toProp}_A(p))) =_{\mathrm{isProp}(A)} p}$$

where the equivalence
$$\mathrm{congform}_\mathrm{isProp}(\beta_\mathrm{Prop}^{\mathrm{El}, A}(p)):\mathrm{isProp}(\mathrm{El}(\mathrm{toProp}_A(p))) \simeq \mathrm{isProp}(A)$$
can always be constructed in a type theory with [[dependent product types]], [[dependent sum types]], and [[identity types]], and [[function extensionality]], as given types $A$ and $B$ and an equivalence $e:A \simeq B$, it is always possible to form the equivalence
$$\mathrm{congform}_\mathrm{isProp}(e):\mathrm{isProp}(A) \simeq \mathrm{isProp}(B)$$

For example, for $\mathrm{isProp}$ defined as the dependent product type $\prod_{x:A} \prod_{y:A} x =_A y$, we have that the [[function application to identifications|application]] of the equivalence $e:A \simeq B$ to identifications is itself an equivalence:
$$\mathrm{ap}_e(x, y):(x =_A y) \simeq (e(x) =_B e(y))$$
Then by the [[typal congruence rules]] of [[dependent function types]], there is an equivalence
$$\mathrm{congform}_\mathrm{isProp}(e) \equiv \mathrm{congform}_{\prod}(e, \lambda x:A.\mathrm{congform}_{\prod}(e, \lambda y:A.\mathrm{ap}_e(x, y))):\left(\prod_{x:A} \prod_{y:A} x =_A y\right) \simeq \left(\prod_{x:B} \prod_{y:B} x =_B y\right)$$
And for any other definition of $\mathrm{isProp}$, we have an equivalence $\delta_{\mathrm{isProp}(A)}:\mathrm{isProp}(A) \simeq \prod_{x:A} \prod_{y:A} x =_A y$ for type $A$, and so there is an equivalence
$$\mathrm{congform}_\mathrm{isProp}(e) \equiv \delta_{\mathrm{isProp}(B)}^{-1} \circ \mathrm{congform}_{\prod}(e, \lambda x:A.\mathrm{congform}_{\prod}(e, \lambda y:A.\mathrm{ap}_e(x, y))) \circ \delta_{\mathrm{isProp}(A)}:\mathrm{isProp}(A) \simeq \mathrm{isProp}(B)$$

Uniqueness rules for the type of all propositions:

* Judgmental computation rules:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash A \equiv \mathrm{toProp}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A)):\mathrm{Prop}}$$

* Typal computation rules:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \eta_{\mathrm{Prop}}(A):A =_{\mathrm{Prop}} \mathrm{toProp}_{\mathrm{El}(A)}(\mathrm{proptrunc}(A))}$$

Extensionality principle of the type of all propositions:
$$\frac{\Gamma \vdash A:\mathrm{Prop} \quad \Gamma \vdash B:\mathrm{Prop}} {\Gamma \vdash \mathrm{ext}_\mathrm{Prop}(A, B):\mathrm{isEquiv}(\mathrm{transport}^\mathrm{El}(A, B))}$$

#### As a Russell universe

As a [[Russell universe]], the type of all propositions is given by the following [[natural deduction]] [[inference rules]]:

Formation rules for the type of all propositions:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{Prop} \; \mathrm{type}}$$

Introduction rules for the type of all propositions:
$$\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash \mathrm{toProp}_A:\mathrm{isProp}(A) \to \mathrm{Prop}}$$

Elimination rules for the type of all propositions:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash A \; \mathrm{type}} \qquad \frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \mathrm{proptrunc}(A):\mathrm{isProp}(A)}$$

Computation rules for the type of all propositions:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \mathrm{toProp}_A(p) \equiv A \; \mathrm{type}}$$

* Judgmental computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \mathrm{proptrunc}(\mathrm{toProp}_A(p)) \equiv p:\mathrm{isProp}(A)}$$

* Typal computation rules:

$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash p:\mathrm{isProp}(A)}{\Gamma \vdash \beta_\mathrm{Prop}^{\mathrm{proptrunc},A}(p):\mathrm{proptrunc}(\mathrm{toProp}_A(p)) =_{\mathrm{isProp}(A)} p}$$

Uniqueness rules for the type of all propositions:

* Judgmental computation rules:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash A \equiv \mathrm{toProp}_{A}(\mathrm{proptrunc}(A)):\mathrm{Prop}}$$

* Typal computation rules:
$$\frac{\Gamma \vdash A:\mathrm{Prop}}{\Gamma \vdash \eta_{\mathrm{Prop}}(A):A =_{\mathrm{Prop}} \mathrm{toProp}_{A}(\mathrm{proptrunc}(A))}$$

Extensionality principle for the type of all propositions:
$$\frac{\Gamma \vdash A:\mathrm{Prop} \quad \Gamma \vdash B:\mathrm{Prop}} {\Gamma \vdash \mathrm{ext}_\mathrm{Prop}(A, B):(A =_\mathrm{Prop} B) \simeq (A \simeq B)}$$

### Other types of propositions

Other types of propositions include

* the [[boolean domain]], which is the type of *decidable propositions*.

* any [[dominance]], which is the type of *open propositions*, or the type of *semi-decidable propositions*.

* For a [[Russell universe]] $U$, the type $\sum_{A:U} \mathrm{isProp}(A)$ is the type of *$U$-small propositions*. Similarly, for a [[Tarski universe]] $(U, T)$, the type $\sum_{A:U} \mathrm{isProp}(T(A))$ is the type of *$U$-small propositions*

* [[sProp]], which is the *type of strict propositions*

* any [[contractible type]], which is (equivalent to) the *type of pointed propositions* or the *type of contractible types*.

In general, these types of propositions can also be distinguished between their Russell and Tarski variants, where elements of the type of propositions are actual types, or indices for the type family $\mathrm{El}$.

Most generally, a **type of propositions** is a [[type]] $\Omega$ with a [[type family]] $T$ such that

* for every elements $P:\Omega$, the type $T(P)$ is an [[h-proposition]]:
$$\prod_{P:\Omega} \prod_{a:T(P)} \prod_{b:T(P)} a =_{T(P)} b$$
* the [[transport]] function
$$\mathrm{trans}^T(P, Q):P =_\Omega Q \to (T(P) \simeq T(Q))$$
is an equivalence of types for all elements $P:\Omega$ and $Q:\Omega$
$$\prod_{P:\Omega} \prod_{Q:\Omega} \mathrm{isEquiv}(\mathrm{trans}^T(P, Q))$$

These axioms imply that $(\Omega, T)$ satisfy [[propositional extensionality]] and thus that $\Omega$ is an [[h-set]].

## Predicate logic

In this section, we assume that [[function extensionality]] or [[weak function extensionality]] is true for all dependent function types.

### The empty type and falsehood

For Russell types of all propositions, the type $\prod_{P:\mathrm{Prop}} P$ is the [[empty type]] $\emptyset$, which by weak function extensionality is a proposition, so is already in the type of all propositions $\left(\prod_{P:\mathrm{Prop}} P\right):\mathrm{Prop}$. Similarly, for Tarski types of all propositions, the type $\prod_{P:\mathrm{Prop}} \mathrm{El}(P)$ is the [[empty type]], which by weak function extensionality is a proposition, and so one has the element $\left(\prod_{P:\mathrm{Prop}} \mathrm{El}(P)\right)_\mathrm{Prop}:\mathrm{Prop}$.

In either case, the definition implies that if the empty type has an element, then every proposition has an element and is thus contractible. This implies that the empty type represents falsehood $\bot$ in the type of all propositions.

### The type of pointed propositions and truth

The type of pointed propositions $\mathrm{Prop}_*$ is given by the type $\sum_{P:\mathrm{Prop}} P$ for Russell types of propositions and $\sum_{P:\mathrm{Prop}} \mathrm{El}(P)$ for Tarski types of propositions, and because pointed propositions are contractible types, pointed propositions are equivalent to each other, and thus by the extensionality principle of $\mathrm{Prop}$, they are equal to each other; thus, the type of pointed propositions is a proposition.

Because $\mathrm{Prop}_*$ is itself a proposition, $\mathrm{Prop}_*$ is an element of itself, and thus a pointed proposition and a contractible type. This implies that the type of pointed propositions represents [[truth]] $\top$ in the type of all propositions.

### Propositional truncations

Given the type of all propositions $\mathrm{Prop}$ and given a type $A$, the [[propositional truncation]] of a type $A$, which turns $A$ into an element of $\mathrm{Prop}$, is given for Russell types of all propositions by the type

$$[A] \equiv \prod_{P:\mathrm{Prop}} (A \to P) \to P$$

and for Tarski types of all propositions by the type

$$[A] \equiv \prod_{P:\mathrm{Prop}} (A \to \mathrm{El}(P)) \to \mathrm{El}(P)$$

By weak function extensionality, both of these types are propositions.

### Universal quantification

Given any type $A$ and family of propositions $P(x)$ indexed by $x:A$, by [[weak function extensionality]], the [[dependent function type]] $\prod_{x:A} P(x)$ is also a [[proposition]]. This means that the propositional truncation of $\prod_{x:A} P(x)$ is equivalent to $\prod_{x:A} P(x)$, and the dependent function type is used as the [[universal quantifier]].

More generally, given any type $A$ and family of propositions $B(x)$ indexed by $x:A$, the universal quantifier is given by [[propositional truncation]] of the [[dependent product type]]:

$$\forall x:A.B(x) \equiv \left[\prod_{x:A} B(x)\right]$$

### Implication and negation

Given any proposition $Q$ and $P$, by [[weak function extensionality]], the [[function type]] $Q \to P$ is also a [[proposition]]. This means that the propositional truncation of $A \to P$ is equivalent to $Q \to P$, and the function type is used as [[implication]]. If $P$ is the empty type or falsehood defined above, then the function type represents the [[negation]] of $Q$, $\neg Q \equiv Q \to \emptyset$.

More generally, given any type $A$ and $B$, implication is given by [[propositional truncation]] of the [[function type]]:

$$A \implies B \equiv \left[A \to B\right]$$

### Biconditionals

Given any proposition $P$ and $Q$, by [[weak function extensionality]], the [[equivalence type]] $P \simeq Q$ is also a [[proposition]]. This means that the propositional truncation of $P \simeq Q$ is equivalent to $P \simeq Q$, and the equivalence type is used as the biconditional.

More generally, given any type $A$ and $B$, the biconditional is given by [[propositional truncation]] of the [[equivalence type]]:

$$A \iff B \equiv \left[A \simeq B\right]$$

### Existential quantification

Given any type $A$ and family of types $B(x)$ indexed by $x:A$, the [[existential quantifier]] is given by the type

$$\exists x:A.B(x) \equiv \prod_{P:\mathrm{Prop}} \left(\prod_{x:A} B(x) \to P\right) \to P$$

for Russell types of propositions and
$$\exists x:A.B(x) \equiv \prod_{P:\mathrm{Prop}} \left(\prod_{x:A} B(x) \to \mathrm{El}(P)\right) \to \mathrm{El}(P)$$
for Tarski types of propositions.

If the type theory also has [[dependent sum types]], the existential quantifier is equivalently given by the propositional truncation of the [[dependent sum type]]

$$\exists x:A.B(x) \equiv \left[\sum_{x:A} B(x)\right]$$

since by [[currying]] there is an equivalence

$$\left(\left(\sum_{x:A} B(x)\right) \to P\right) \simeq \left(\prod_{x:A} B(x) \to P\right)$$

### Conjunction

Given types $A$ and $B$, the [[conjunction]] of $A$ and $B$ is given by the type

$$A \wedge B \equiv \prod_{P:\mathrm{Prop}} \left(A \to (B \to P)\right) \to P$$

for Russell types of propositions and
$$A \wedge B \equiv \prod_{P:\mathrm{Prop}} \left(A \to (B \to \mathrm{El}(P))\right) \to \mathrm{El}(P)$$
for Tarski types of propositions.

If the type theory also has [[product types]], the existential quantifier is equivalently given by the propositional truncation of the [[product type]]

$$A \wedge B \equiv \left[A \times B\right]$$

since by [[currying]] there is an equivalence

$$\left((A \times B) \to P\right) \simeq \left(A \to (B \to P)\right)$$

### Disjunctions

Given types $A$ and $B$, the [[disjunction]] of $A$ and $B$ is given by the type

$$A \vee B \equiv \prod_{P:\mathrm{Prop}} (A \to P) \to (B \to P) \to P$$

for Russell types of propositions and
$$A \vee B \equiv \prod_{P:\mathrm{Prop}} (A \to \mathrm{El}(P)) \to (B \to \mathrm{El}(P)) \to \mathrm{El}(P)$$
for Tarski types of propositions.

If the type theory also has [[product types]], the existential quantifier is equivalently given by the type

$$A \vee B \equiv \prod_{P:\mathrm{Prop}} ((A \to P) \times (B \to P)) \to P$$

for Russell types of propositions and
$$A \vee B \equiv \prod_{P:\mathrm{Prop}} ((A \to \mathrm{El}(P)) \times (B \to \mathrm{El}(P))) \to \mathrm{El}(P)$$
for Tarski types of propositions,

and if the type theory also has [[coproduct types]], the existential quantifier is equivalently given by the propositional truncation of the [[coproduct type]]

$$A \vee B \equiv \left[A + B\right]$$

since by [[currying]] there is an equivalence

$$\left((A \to P) \times (B \to P)\right) \simeq \left((A + B) \to P\right)$$

### Decidable propositions and booleans

A [[decidable proposition]] is a proposition $P$ with a witness $p:P \vee \neg P$ that the disjunction of $P$ and its negation holds.

The [[type of booleans]] is the type of all decidable propositions in $\mathrm{Prop}$,
$$\mathrm{Bool} \equiv \sum_{P:\mathrm{Prop}} P \vee \neg P$$
for Russell types of propositions, and
$$\mathrm{Bool} \equiv \sum_{P:\mathrm{Prop}} \mathrm{El}(P) \vee \neg \mathrm{El}(P)$$
for Tarski types of propositions.

The [[law of excluded middle]] states that every proposition is decidable $\mathrm{lem}:\prod_{P:\mathrm{Prop}} P \vee \neg P$, or equivalently that there is an equivalence $\mathrm{lem}':\mathrm{Bool} \simeq \mathrm{Prop}$ between the type of propositions and the type of booleans.

## Categorical semantics

The [[categorical semantics]] of the type of all propositions is the [[subobject classifier]].

## Related concepts

* [[boolean domain]]

* [[subtype]], [[subobject]]

* [[subobject classifier]]

* [[dominance]]

* [[propositional extensionality]]

* [[type universe]]

* [[type of classes]]

* [[type of strict propositions]]

* [[propositional logic as a dependent type theory]]

* [[type of entire relations]]

## References

* {#UFP13} [[Univalent Foundations Project]], *[[Homotopy Type Theory -- Univalent Foundations of Mathematics]]* (2013) [[web](http://homotopytypetheory.org/book/), [pdf](http://hottheory.files.wordpress.com/2013/03/hott-online-323-g28e4374.pdf)]

Detailed discussion of the type of propositions in [[Coq]] is in

* [[Adam Chlipala]], _[Certified programming with dependent types](http://adam.chlipala.net/cpdt/)_ -- _[Library Universes](http://adam.chlipala.net/cpdt/html/Universes.html)_

[[!redirects type of propositions]]
[[!redirects types of propositions]]
[[!redirects weak type of propositions]]
[[!redirects weak types of propositions]]
[[!redirects strict type of propositions]]
[[!redirects strict types of propositions]]

[[!redirects Russell type of propositions]]
[[!redirects Russell types of propositions]]
[[!redirects weak Russell type of propositions]]
[[!redirects weak Russell types of propositions]]
[[!redirects strict Russell type of propositions]]
[[!redirects strict Russell types of propositions]]

[[!redirects Tarski type of propositions]]
[[!redirects Tarski types of propositions]]
[[!redirects weak Tarski type of propositions]]
[[!redirects weak Tarski types of propositions]]
[[!redirects strict Tarski type of propositions]]
[[!redirects strict Tarski types of propositions]]

[[!redirects universe of propositions]]
[[!redirects universes of propositions]]
[[!redirects weak universe of propositions]]
[[!redirects weak universes of propositions]]
[[!redirects strict universe of propositions]]
[[!redirects strict universes of propositions]]

[[!redirects Russell universe of propositions]]
[[!redirects Russell universes of propositions]]
[[!redirects weak Russell universe of propositions]]
[[!redirects weak Russell universes of propositions]]
[[!redirects strict Russell universe of propositions]]
[[!redirects strict Russell universes of propositions]]

[[!redirects Tarski universe of propositions]]
[[!redirects Tarski universes of propositions]]
[[!redirects weak Tarski universe of propositions]]
[[!redirects weak Tarski universes of propositions]]
[[!redirects strict Tarski universe of propositions]]
[[!redirects strict Tarski universes of propositions]]

[[!redirects type of all propositions]]
[[!redirects types of all propositions]]
[[!redirects weak type of all propositions]]
[[!redirects weak types of all propositions]]
[[!redirects strict type of all propositions]]
[[!redirects strict types of all propositions]]

[[!redirects Russell type of all propositions]]
[[!redirects Russell types of all propositions]]
[[!redirects weak Russell type of all propositions]]
[[!redirects weak Russell types of all propositions]]
[[!redirects strict Russell type of all propositions]]
[[!redirects strict Russell types of all propositions]]

[[!redirects Tarski type of all propositions]]
[[!redirects Tarski types of all propositions]]
[[!redirects weak Tarski type of all propositions]]
[[!redirects weak Tarski types of all propositions]]
[[!redirects strict Tarski type of all propositions]]
[[!redirects strict Tarski types of all propositions]]

[[!redirects Prop]]


type of strict propositions

\tableofcontents

## Idea

In [[dependent type theory]] the type $\mathrm{sProp}$ is a type of [[strict propositions]].

The type of strict proposition is used to formalize [[logic over type theory]] in [[dependent type theory]] without having to postulate a separate proposition judgment, since strict propositions are judgmentally proof irrelevant, and thus behave as propositions in traditional [[propositional logic]].

## Definition

### The type of all strict propositions

The **type of all strict propositions** $\mathrm{sProp}$ in a [[dependent type theory]] could be presented either as a [[Russell universe]] or a [[Tarski universe]]. The difference between the two is that in the former, every [[strict proposition]] in the type theory is literally an element of the type of all strict propositions, while in the latter, elements of $\mathrm{sProp}$ are only indices of a type family $\Box$ of strict propositions; every [[strict proposition]] in the type theory is only [[essentially small type|essentially $\mathrm{sProp}$-small]] for [[weak Tarski universes]] or [[judgmentally equal]] to an $\Box P$ for $P:\mathrm{sProp}$ for [[strict Tarski universes]].

#### As a Russell universe

As a [[Russell universe]], the type of all strict propositions is given by the following rules:

Formation rules:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{sProp} \; \mathrm{type}}$$

Type reflection:
$$\frac{\Gamma \vdash A:\mathrm{sProp}}{\Gamma \vdash A \; \mathrm{type}}$$

Strictness for each type reflection
$$\frac{\Gamma \vdash A:\mathrm{sProp}}{\Gamma, x:A, y:A \vdash x \equiv y:A}$$

Introduction rule:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A, y:A \vdash x \equiv y:A}{\Gamma \vdash A:\mathrm{sProp}}$$

Univalence:
$$\frac{\Gamma \vdash A:\mathrm{sProp} \quad \Gamma \vdash B:\mathrm{sProp}} {\Gamma \vdash \mathrm{univalence}(A, B):\mathrm{Id}_\mathrm{sProp}(A, B) \simeq (A \simeq B)}$$

#### As a Tarski universe

As a [[Tarski universe]], the type of all propositions is given by the following rules:

Formation rules:
$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{sProp} \; \mathrm{type}}$$

Type reflection:
$$\frac{\Gamma \vdash A:\mathrm{sProp}}{\Gamma \vdash \Box A \; \mathrm{type}}$$

Strictness for each type reflection
$$\frac{\Gamma \vdash A:\mathrm{sProp}}{\Gamma, x:A, y:A \vdash x \equiv y:A}$$

Introduction rule:
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A, y:A \vdash x \equiv y:A}{\Gamma \vdash A_\Omega:\mathrm{sProp}}$$

[[essentially small type|Essential smallness]] of propositions (for weak types of all propositions) or [[judgmental equality]] (for strict types of all propositions):
$$\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A, y:A \vdash x \equiv y:A}{\Gamma \vdash \delta_A:\Box A_\Omega \simeq A}\mathrm{weak} \quad \frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A, y:A \vdash x \equiv y:A}{\Gamma \vdash \Box A_\Omega \equiv A \; \mathrm{type}}\mathrm{strict}$$

Univalence:
$$\frac{\Gamma \vdash A:\mathrm{sProp} \quad \Gamma \vdash B:\mathrm{sProp}} {\Gamma \vdash \mathrm{univalence}(A, B):\mathrm{isEquiv}(\mathrm{transport}^\box(A, B))}$$

#### The empty proposition and falsehood

To ensure that the type of all strict propositions isn't a [[contractible type]], one could include the following axiom, which states that there exists a strict proposition satisfying [[ex falso quodlibet]]:

$$\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{axempty}:\sum_{\bot:\mathrm{sProp}} \prod_{C:\bot \to \mathrm{sProp}} \prod_{x:\bot} C(x)}\mathrm{Russell} \qquad \frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathrm{axempty}:\sum_{\bot:\mathrm{sProp}} \prod_{C:\Box \bot \to \mathrm{sProp}} \prod_{x:\Box \bot} \Box C(x)}\mathrm{Tarski}$$

## Related concepts

* [[judgmental equality]]

* [[type of propositions]]

* [[strict proposition]]

* [[squash type]]

## References

* [[Gaëtan Gilbert]], [[Jesper Cockx]], [[Matthieu Sozeau]], [[Nicolas Tabareau]], *Definitional Proof-Irrelevance without K*. Proceedings of the ACM on Programming Languages, Volume 3, Issue POPL, Article 3, pp 1–28, January 2019. ([doi:10.1145/3290316](https://doi.org/10.1145/3290316))

[[!redirects sProp]]

[[!redirects type of strict propositions]]
[[!redirects types of strict propositions]]

[[!redirects type of all strict propositions]]
[[!redirects types of all strict propositions]]


type preservation

Type preservation is an important property of a type system and operational semantics. Informally, an operational semantics $t \longrightarrow t\prime$ preserves types if the evaluation of $t$ does not change its type.

More formally, if $\Gamma \vdash t : A$ and $t \longrightarrow t\prime$, then $\Gamma \vdash t\prime : A$.


type refinement

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

[[type|Types]] enable the restriction of the [[domain]] and [[codomain]] of [[computer programs]], but they may not always be precise enough. Refining the [[type system]] of a language involves introducing [[subtypes]] while retaining the [[syntax]] of its [[terms]]. For instance, predicate subtyping can be used to limit `head` to non-empty [[lists]] (`list{ l : len(l) > 0}`) and `div` to non-zero arguments (`int{ n : n <> 0 }`).

More precisely, in [Greenberg 2015](#Greenberg15), [[Frank Pfenning]] describes *type refinement* as a long-term research program with the following goals:

* capture more precise properties of [[programs]],

* retain the good theoretical and practical properties of the simpler disciplines,

* retain usability, modularity, elegance, etc.

Works in this program include:

* *datasort refinements* (types are named *refinement types*) of Freeman, Davies, and Pfenning, which refine the set of available constructors for a type;

* *predicate subtyping* (types are named *refined types* or *predicate subtypes*), where predicates are taken from a tractable domain (see for example *index refinements* of Xi and Pfenning);

but don't include general [[subset types]], as type checking becomes undecidable.

Predicate subtyping is found in languages like [[Liquid Haskell]] and [[F*]].

## Related concepts

* [[subset type]], [[subtype]]
* [[intrinsic and extrinsic views of typing]]

## References

* {#Greenberg15} Michael Greenberg, _A refinement type by any other name_, 2015, ([blog post](http://www.weaselhat.com/2015/03/16/a-refinement-type-by-any-other-name/)).
* [[Jana Dunfield]], _Combining Two Forms of Type Refinements_, 2002, ([report](https://research.cs.queensu.ca/home/jana/papers/combining/Dunfield02_combining.pdf)).
* [[Robert Atkey]], [[Patricia Johann]], [[Neil Ghani]], _When is a Type Refinement an Inductive Type?_, ([pdf](https://bentnib.org/inductive-refinement.pdf)).

On datasort refinements:

* Tim Freeman, [[Frank Pfenning]], _Refinement types for ML_, Proceedings of the ACM Conference on Programming Language Design and Implementation, 1991, pp. 268–277, ([pdf](https://www.cs.cmu.edu/~fp/papers/pldi91.pdf)).
* [[Frank Pfenning]], _Church and Curry: Combining Intrinsic and Extrinsic Typing_, ([pdf](https://www.cs.cmu.edu/~fp/papers/andrews08.pdf)).

On predicate subtyping:

* Ranjit Jhala, Niki Vazou, _Refinement Types: A Tutorial_, ([arXiv:2010.07763](https://arxiv.org/abs/2010.07763)).
* Yitzhak Mandelbaum, David Walker, [[Robert Harper]], _An Effective Theory of Type Refinements_, ([pdf](http://www.cs.cmu.edu/~rwh/papers/effref/icfp03.pdf)).
* Susumu Hayashi, _Logic of refinement types_, Proceedings of the Workshop on Types for Proofs and Programs, 1993, pp. 157-172.

On index refinements in particular:

* Hongwei Xi, Frank Pfenning, _Dependent types in practical programming_, in A. Aiken, editor, Conference Record of the 26th Symposium on Principles of Programming Languages (POPL'99),pages 214–227. ACM Press, January 1999.

On refinement systems as [[functors]]:

* [[Paul-André Melliès]], [[Noam Zeilberger]], _Type refinement and monoidal closed bifibrations_, [arXiv:1310.0263](http://arxiv.org/abs/1310.0263).
* [[Paul-André Melliès]], [[Noam Zeilberger]], _Functors are Type Refinement Systems_, ([pdf](http://noamz.org/papers/funts.pdf) , [HAL](https://hal.inria.fr/hal-01096910)).
* [[Paul-André Melliès]], [[Noam Zeilberger]], _An Isbell Duality Theorem for Type Refinement Systems_, ([pdf](https://www.irif.fr/~mellies/papers/an-isbell-duality-theorem-for-type-refinement-systems.pdf)).

[[!redirects datasort refinement]]
[[!redirects datasort refinements]]
[[!redirects index refinement]]
[[!redirects index refinements]]
[[!redirects predicate subtype]]
[[!redirects predicate subtypes]]
[[!redirects predicate subtyping]]
[[!redirects refined type]]
[[!redirects refined types]]
[[!redirects refinement type]]
[[!redirects refinement types]]


type telescope

> This entry is about a notion in [[dependent type theory]]. For the notion in [[homotopy theory]] see at *[[mapping telescope]]*.

***

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

In [[dependent type theory]],  by a *telescope type* or just *telescope* (terminology due to [[Nicolaas de Bruijn|de Bruijn]]'s work on *[[Automath]]* in the early 1970s) one means [[Zucker (1975, §10.2)](#Zucker75), [de Bruijn (1991)](#deBruijn91)] an iterated [[dependent pair]]-[[type]], hence (in the notation [[dependent functions and dependent pairs -- table|here]]) a type of the form

$$
  \Gamma
  \;\;\;\;\;\;
    \vdash
  \;\;\;\;\;\;
  \big(
    d_1 \colon D_1
  \big)
  \times
  \big(
    d_2 \colon D_2(d_1)
  \big)
  \times
  \big(
    d_3 \colon D_3(d_1, d_2)
  \big)
  \times
  \cdots
  \times
  \big(
    d_{n+1} \colon D_{n+1}(d_1, \cdots , d_{n})
  \big)
  \;\;\;
  \colon
  \;\;\;
  Type
  \,.
$$

The notion was motivated by and still plays a key role in the formalization of data structures/[[mathematical structures]] in [[dependent type theory|dependently typed]] [[proof assistants]], which typically appear as such *telescope types* (also: "record types", "type classes", cf. [Coen & Tassi (2008, p. 2)](#CoenTassi08), [Garillot, Gonthier, Mahboubi & Rideau (2009, §2.3)](#GarillotGonthierMahboubiRideau09)) starting with an underlying data base type and successively adding access functions and then consistency certificates: see the examples listed [there](structure#InDependentTypeTheory).

## See also

* [[term in context]]

* [[dependent type]]

* [[structure]], [[structure identity principle]]

## References

The notion of telescope types in the sense of iterated [[dependent pairs]] goes back to [[Nicolaas de Bruijn]]'s axiomatization of [[mathematical structures]] via the [[Automath]] [[proof assistant]] in the early 1970s, as such referenced in:

* {#Zucker75} [[Jeffery Zucker]], §10.2 of *Formalization of Classical Mathematics in Automath*, Colloques Internationaux du Centre National de la Recherche Scientifique **249** (1975) 135-145 [[web](https://www.win.tue.nl/automath/archive/webversion/aut042/aut042.html), [pdf](https://www.win.tue.nl/automath/archive/pdf/aut042.pdf)]

  also in: Studies in Logic and the Foundations of Mathematics **133** (1994) 127-139 [doi:10.1016/S0049-237X(08)70202-7]

> [[Zucker (1975, §10.2)](#Zucker1975):] Now a general framework in which to view linear orders, or other algebraic  structures, has been proposed by de Bruijn. It uses the notion of “telescope”. [...] A telescope therefore functions like a “generalized $\sum$”.

and eventually published by de Bruijn in:

* {#deBruijn91} [[Nicolaas de Bruijn]], *Telescopic mappings in typed lambda calculus*, Information and Computation **91** 2 (1991) 189-204 [doi:10.1016/0890-5401(91)90066-B]

The notion is used in much of the [[dependent type theory|dependent type theoretic]] [literature](structure#ReferencesInDependentTypeTheory) on formalizing [[mathematical structures]], e.g.:

* {#CoenTassi08} Claudio Sacerdoti Coen, Enrico Tassi, p. 2 of: *Working with Mathematical Structures in Type Theory*, in: *Types for Proofs and Programs. TYPES 2007*, Lecture Notes in Computer Science **4941** Springer (2008) [[doi:10.1007/978-3-540-68103-8_11](https://doi.org/10.1007/978-3-540-68103-8_11), [pdf](https://www.cs.unibo.it/~sacerdot/PAPERS/types07.pdf)]

* {#GarillotGonthierMahboubiRideau09} François Garillot, Georges Gonthier, Assia Mahboubi, Laurence Rideau, §2.3 in: *Packaging Mathematical Structures*, in: *Theorem Proving in Higher Order Logics. TPHOLs 2009*, Lecture Notes in Computer Science **5674**, Springer (2009) [[doi:10.1007/978-3-642-03359-9_23](https://doi.org/10.1007/978-3-642-03359-9_23)]

and more widely, often without attribution, for instance in:

* {#Winterhalter20} [[Théo Winterhalter]], p. 100, 111 in: *Formalisation and Meta-Theory of Type Theory*, Nantes (2020) [[pdf](https://github.com/TheoWinterhalter/phd-thesis/releases/download/v1.2.1/TheoWinterhalter-PhD-v1.2.1.pdf), [github](https://github.com/TheoWinterhalter/phd-thesis)]

* {#Shulman22} [[Mike Shulman]], p. 5-6 in *Towards a Third-Generation HOTT* Part 2 (2022) [slides [pdf](https://www.cmu.edu/dietrich/philosophy/hott/slides/shulman-2022-05-05.pdf), [video](https://www.youtube.com/watch?v=5ciDNfmvMdU)]

* {#KS23} [[Astra Kolomatskaia]], [[Michael Shulman]], p. 16-18 in *Displayed Type Theory and Semi-Simplicial Types* [[arXiv:2311.18781](https://arxiv.org/abs/2311.18781)]

[[!redirects type telescopes]]

[[!redirects telescope]]
[[!redirects telescopes]]

[[!redirects telescope type]]
[[!redirects telescope types]]

[[!redirects record]]
[[!redirects records]]


type theoretic axiom of choice

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Foundations
+-- {: .hide}
[[!include foundations - contents]]
=--
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea

In [[dependent type theory]], the **type theoretic axiom of choice** is a version of [[axiom of choice]] which does not use any [[bracket types]] in the theorem, as it uses the [[propositions as types]] interpretation of dependent type theory. Despite its name, the type theoretic axiom of choice is provable in dependent type theory from the [[inference rules]] of dependent product types, dependent sum types, and [[identity types]], and so really deserves to be called the **type theoretic principle of choice**. This is in contrast to what is referred to as the *[[propositional axiom of choice]]* or simply *[[axiom of choice]]* which does use [[bracket types]] via the [[propositions as subsingletons]] interpretation of dependent type theory and is just the usual [[axiom of choice]] expressed in dependent type theory.

## Statement

The type theoretic axiom of choice is the statement that given types $A$ and $B$ and type family $x:A, y:B \vdash R(x, y)$, one can construct

$$\mathrm{ac}_R \coloneqq \lambda g.(\lambda x.\pi_1(g(x)), \lambda x.\pi_2(g(x))):\left(\prod_{x:A} \sum_{y:B} R(x, y)\right) \to \left(\sum_{f:A \to B} \prod_{x:A} R(x, f(x))\right)$$

The [[propositions as types]] interprets [[disjunction]] and [[existential quantification]] directly as the [[sum type]] and [[dependent sum type]] respectively, and the statement of the axiom of choice comes out as simply the statement that products distribute over coproducts. (See [[distributivity pullback]] for a discussion in terms of the internal type theory of a locally cartesian closed category.)

The equivalent form of the axiom of choice involving cartesian products of inhabited types then becomes in type theory the statement that "any [[dependent product]] of any [[family]] of [[pointed types]] is [[pointed]]". and is just the [[identity function]] on the dependent product type.

## Related concepts

* [[axiom of choice]]

* [[propositional axiom of choice]]

## References

The type theoretic axiom of choice is found in:

* {#HoTTBook} [[Univalent Foundations Project]], section 1.6, of _[[Homotopy Type Theory -- Univalent Foundations of Mathematics]]_

[[!redirects type-theoretic axiom of choice]]
[[!redirects type theoretic axiom of choice]]

[[!redirects type-theoretic principle of choice]]
[[!redirects type theoretic principle of choice]]


type theoretic axiom of replacement

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
### Context
#### Universes
+-- {: .hide}
[[!include universe - contents]]
=--
#### Type theory
+-- {: .hide}
[[!include type theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Definition ##

In [[homotopy type theory]], the __axiom of replacement__ states that given a [[type universe]] $U$, for every [[essentially small type|essentially $U$-small]] type $A$, every [[locally small type|locally $U$-small]] type $B$, and every function $f:A \to B$, the [[image]] $\mathrm{im}(f)$ is essentially $U$-small.

Equivalently, given types $A$ and $B$ and [[Tarski universe]] $(U, T)$, there is a function

$$\mathrm{axrepl}_U^{A, B}:\left(\sum_{C:U} T(C) \simeq A\right) \times \left(\sum_{R:B \times B \to U} \prod_{a:B} \prod_{b:B} T(R(a, b)) \simeq (a =_B b)\right) \to \left(\sum_{I:(A \to B) \to U} \prod_{f:A \to B} T(I(f)) \simeq \mathrm{im}(f)\right)$$

## See also ##

* [[type universe]]

* [[essentially small type]]

* [[locally small type]]

* [[axiom of replacement]]

## References ##

* [[Egbert Rijke]], *The join construction*, 26 Jan 2017, ([arXiv:1701.07538](https://arxiv.org/abs/1701.07538))

* [[Marc Bezem]], [[Ulrik Buchholtz]], [[Pierre Cagne]], [[Bjørn Ian Dundas]], [[Daniel R. Grayson]], Section 2.19 in: *[[Symmetry]]* (2021) $[$[pdf](https://unimath.github.io/SymmetryBook/book.pdf)$]$

[[!redirects type-theoretic axiom of replacement]]