# A modular construction of type theories

Frédéric Blanqui, Gilles Dowek, Emilie Grienenberger, Gabriel Hondet, François Thiré

► To cite this version:

Frédéric Blanqui, Gilles Dowek, Emilie Grienenberger, Gabriel Hondet, François Thiré. A modular construction of type theories. Logical Methods in Computer Science, 2023, 19 (1), 10.46298/lmcs-19(1:12)2023 . hal-04317047

HAL Id: hal-04317047

https://inria.hal.science/hal-04317047v1

Submitted on 1 Dec 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# A MODULAR CONSTRUCTION OF TYPE THEORIES

FRÉDÉRIC BLANQUI ◦ª, GILLES DOWEK ◦ª, EMILIE GRIENENBERGERª, GABRIEL HONDETª, AND FRANÇOIS THIRÉᵇ

**ABSTRACT.** The λΠ-calculus modulo theory is a logical framework in which many type systems can be expressed as theories. We present such a theory, the theory U, where proofs of several logical systems can be expressed. Moreover, we identify a sub-theory of U corresponding to each of these systems, and prove that, when a proof in U uses only symbols of a sub-theory, then it is a proof in that sub-theory.

## 1. INTRODUCTION

The λΠ-calculus modulo theory (λΠ/≡) [CD07], that is the basis of the language DEDUKTI [ABC+16, HB20], is a logical framework, that is, a framework to define theories. It generalizes some previously proposed frameworks: Predicate logic [HA28], λ-Prolog [NM88], Isabelle [Pau93], the Edinburgh logical framework [HHP93], also called the λΠ-calculus, Deduction modulo theory [DHK03, DW03], Pure type systems [Ber88, Ter89], and Ecumenical logic [Pra15, Dow15, PR17, Gri19]. It is thus an extension of Predicate logic that provides the possibility for all symbols to bind variables, a syntax for proof-terms, a notion of computation, a notion of proof reduction for axiomatic theories, and the possibility to express both constructive and classical proofs.

λΠ/≡ enables to express all theories that can be expressed in Predicate logic, such as geometry, arithmetic, and set theory, but also Simple type theory [Chu40] and the Calculus of constructions [CH88], that are less easy to define in Predicate logic.

We present a theory in λΠ/≡, the theory U, where all proofs of Minimal, Constructive, and Ecumenical predicate logic; Minimal, Constructive, and Ecumenical simple type theory; Simple type theory with predicate subtyping, prenex predicative polymorphism, or both; the Calculus of constructions, and the Calculus of constructions with prenex predicative polymorphism can be expressed. This theory is therefore a candidate for a universal theory, where proofs developed in implementations of Classical predicate logic (such as automated theorem proving systems, SMT solvers, etc.), Classical simple type theory (such as HOL 4, Isabelle/HOL, HOL Light, etc.), the Calculus of constructions (such as Coq, Matita, Lean,

<figure><img src="image_2.png" /></figure>

<footnote>ª Université Paris-Saclay, ENS Paris-Saclay, LMF, CNRS, Inria, France
*e-mail address:* {frederic.blanqui,gilles.dowek,gabriel.hondet}@inria.fr
*e-mail address:* emilie.grienenberger@ens-paris-saclay.fr</footnote>

<footnote>ᵇ Nomadic Labs, France
*e-mail address:* francois.thire@nomadic-labs.com</footnote>

<footnote>*Key words and phrases:* logical framework, λΠ-calculus modulo rewriting, Dedukti, logic, type theory.</footnote>
etc.), and Simple type theory with predicate subtyping and prenex polymorphism (such as PVS), can be expressed.

Moreover, the proofs of the theory $\mathcal{U}$ can be classified as proofs in Minimal predicate logic, Constructive predicate logic, etc. just by identifying the axioms they use, akin to proofs in geometry that can be classified as proofs in Euclidean, hyperbolic, elliptic, neutral, etc. geometries. More precisely, we identify sub-theories of the theory $\mathcal{U}$ that correspond to each of these theories, and we prove that when a proof in $\mathcal{U}$ uses only symbols of a sub-theory, then it is a proof in that sub-theory.

In Section 2, we recall the definition of $\lambda\Pi/\equiv$ and of a theory. In Section 3, we introduce the theory $\mathcal{U}$ step by step without any (other than informal) reference to a known system. In Section 4, we provide a general theorem on sub-theories in $\lambda\Pi/\equiv$, and prove that every fragment of $\mathcal{U}$, including $\mathcal{U}$ itself, is indeed a theory, that is, it is defined by a confluent and type-preserving rewriting system. Finally, in Section 5, we detail the sub-theories of $\mathcal{U}$ that correspond to the above mentioned systems.

This paper is an extended version of [BDG$^+$21]. It provides more details on the encoding of various features (Section 3), the proof of the Fragment Theorem (Section 4), and the examples of sub-theories (Section 5).

## 2. THE $\lambda\Pi$-CALCULUS MODULO THEORY

$\lambda\Pi/\equiv$ is an extension of the Edinburgh logical framework [HHP93] with a primitive notion of computation defined with rewriting rules [DJ90, TeR03].

However, for defining terms, we use Barendregt's syntax for Pure Type Systems [Bar92]:

$$t, u = c \mid x \mid \text{TYPE} \mid \text{KIND} \mid \Pi x : t, u \mid \lambda x : t, u \mid t u$$

where c belongs to a finite or infinite set of constants $\mathcal{C}$ and x to an infinite set $\mathcal{V}$ of variables. The terms TYPE and KIND are called sorts. The term $\Pi x : t, u$ is called a product. It is dependent if the variable x occurs free in u. Otherwise, it is simply written $t \to u$. Terms are also often written A, B, etc. The set of constants of a term t is written $const(t)$.

A rewriting rule is a pair of terms $\ell \leftrightarrow r$, such that $\ell = c \ell_1 \dots \ell_n$, where c is a constant. If $\mathcal{R}$ is a set of rewriting rules, we write $\leftrightarrow_R$ for the smallest relation closed by term constructors and substitution containing $\mathcal{R}$, $\leftrightarrow_\beta$ for the usual $\beta$-reduction, $\leftrightarrow_{\beta\mathcal{R}}$ for $\leftrightarrow_\beta \cup \leftrightarrow_R$, and $\equiv_{\beta\mathcal{R}}$ for the smallest equivalence relation containing $\leftrightarrow_{\beta\mathcal{R}}$.

A relation $\leftrightarrow$ is confluent on a set of terms if, for all terms $t, u, v$ in this set such that $t \leftrightarrow^* u$ and $t \leftrightarrow^* v$, there exists a term $w$ in this set such that $u \leftrightarrow^* w$ and $v \leftrightarrow^* w$. Confluence implies that every term has at most one irreducible form.

The typing rules of $\lambda\Pi/\equiv$ are given in Figure 1. The difference with the rules of the Edinburgh logical framework is that, in the rule (conv), types are identified modulo $\equiv_{\beta\mathcal{R}}$ instead of just $\equiv_\beta$. In a typing judgement $\Gamma \vdash_{\Sigma, \mathcal{R}} t : A$, the term $t$ is given the type $A$ with respect to three parameters: a signature $\Sigma$ that assigns a type to the constants of $t$, a context $\Gamma$ that assigns a type to the free variables of $t$, and a set of rewriting rules $\mathcal{R}$. A context $\Gamma$ is a list of declarations $x_1 : B_1, \dots, x_m : B_m$ formed with a variable and a term. A signature $\Sigma$ is a list of declarations $c_1 : A_1, \dots, c_n : A_n$ formed with a constant and a closed term, that is a term with no free variables. This is why the rule (const) requires no context for typing $A$. We write $|\Sigma|$ for the set $\{c_1, \dots, c_n\}$, and $\Lambda(\Sigma)$ for the set of terms $t$ such that $const(t) \subseteq |\Sigma|$. We say that a rewriting rule $\ell \leftrightarrow r$ is in $\Lambda(\Sigma)$ if $\ell$ and $r$ are, and a context
<figure><img src="image_3.png" /><figcaption>Figure 1: Typing rules of $\lambda\Pi/\equiv$ with signature $\Sigma$ and rewriting rules $\mathcal{R}$</figcaption></figure>

$x_1 : B_1, \dots, x_m : B_m$ is in $\Lambda(\Sigma)$ if $B_1, \dots, B_m$ are. It is often convenient to group constant declarations and rules into small clusters, called “axioms”.

A relation $\leftrightarrow$ preserves typing in $(\Sigma, \mathcal{R})$ if, for all contexts $\Gamma$ and terms $t, u$ and $A$ of $\Lambda(\Sigma)$, if $\Gamma \vdash_{\Sigma, \mathcal{R}} t : A$ and $t \leftrightarrow u$, then $\Gamma \vdash_{\Sigma, \mathcal{R}} u : A$. The relation $\leftrightarrow_\beta$ preserves typing as soon as $\leftrightarrow_\beta \mathcal{R}$ is confluent (see for instance [Bla01]) for, in this case, the product is injective modulo $\equiv_{\beta \mathcal{R}}$: $\Pi x : A, B \equiv_{\beta \mathcal{R}} \Pi x : A'$, $B'$ if and only if $A \equiv_{\beta \mathcal{R}} A'$ and $B \equiv_{\beta \mathcal{R}} B'$. The relation $\leftrightarrow_R$ preserves typing if every rewriting rule $\ell \leftrightarrow r$ preserves typing, that is: for all contexts $\Gamma$, substitutions $\theta$ and terms $A$ of $\Lambda(\Sigma)$, if $\Gamma \vdash_{\Sigma, \mathcal{R}} \theta l : A$ then $\Gamma \vdash_{\Sigma, \mathcal{R}} \theta r : A$.

Although typing is defined with arbitrary signatures $\Sigma$ and sets of rewriting rules $\mathcal{R}$, we are only interested in sets $\mathcal{R}$ verifying some confluence and type-preservation properties.

**Definition 2.1** (System, theory). A system is a pair $(\Sigma, \mathcal{R})$ such that each rule of $\mathcal{R}$ is in $\Lambda(\Sigma)$. It is a theory if $\leftrightarrow_\beta \mathcal{R}$ is confluent on $\Lambda(\Sigma)$, and every rule of $\mathcal{R}$ preserves typing in $(\Sigma, \mathcal{R})$.

Therefore, in a theory, $\leftrightarrow_\beta \mathcal{R}$ preserves typing since $\leftrightarrow_\beta$ preserves typing (for $\leftrightarrow_\beta \mathcal{R}$ is confluent) and $\leftrightarrow_R$ preserves typing (for every rule preserves typing). We recall two other basic properties of $\lambda\Pi/\equiv$ we will use in Theorem 4.5:

**Lemma 2.2.** If $\Gamma \vdash_{\Sigma, \mathcal{R}} t : A$, then either $A = \text{KIND}$ or $\Gamma \vdash_{\Sigma, \mathcal{R}} A : s$ for some sort $s$. If $\Gamma \vdash_{\Sigma, \mathcal{R}} \Pi x : A, B : s$, then $\Gamma \vdash_{\Sigma, \mathcal{R}} A : \text{TYPE}$.
### 3. THE THEORY $\mathcal{U}$

Let us now present the system $\mathcal{U}$ which is formed with axioms expressed in $\lambda\Pi/\equiv$. We will prove in Theorem 4.7 that this system is indeed a theory.

**3.1. Object-terms.** The notions of term, proposition, and proof are not primitive in $\lambda\Pi/\equiv$. The first axioms of the theory $\mathcal{U}$ introduce these notions. We first define a notion analogous to the Predicate logic notion of term, to express the objects the theory speaks about, such as the natural numbers. As all expressions in $\lambda\Pi/\equiv$ are called “terms”, we shall call these expressions “object-terms”, to distinguish them from the other terms.

To build the notion of object-term in $\lambda\Pi/\equiv$ we declare a constant $I$ of type TYPE

I : TYPE (I-decl)

and constants of type $I \to ... \to I \to I$ for the function symbols, for instance a constant 0 of type $I$ and a constant $succ$ of type $I \to I$. The object-terms, for instance $(succ (succ 0))$ and $(succ x)$, are then just $\lambda\Pi/\equiv$ terms of type $I$ and, in an object-term, the variables are $\lambda\Pi/\equiv$ variables of type $I$. If we wanted to have object-terms of several sorts, like in Many-sorted predicate logic, we could just declare several constants $I_1, I_2, ..., I_n$ of type TYPE.

**3.2. Propositions.** Just like $\lambda\Pi/\equiv$ does not contain a primitive notion of object-term, it does not contain a primitive notion of proposition, but tools to define this notion. To do so, in the theory $\mathcal{U}$, we declare a constant *Prop* of type TYPE

Prop : TYPE (*Prop-decl*)

and predicate symbols, that is constants of type $I \to ... \to I \to Prop$, for instance a constant *positive* of type $I \to Prop$. Propositions are then $\lambda\Pi/\equiv$ terms, such as (*positive* (*succ* (*succ* 0))), of type *Prop*.

**3.3. Implication.** In the theory $\mathcal{U}$, we then declare a constant for implication

$\Rightarrow : Prop \to Prop \to Prop$ (written infix) ($\Rightarrow$-decl)

and we can then construct the term (*positive* (*succ* (*succ* 0))) $\Rightarrow$ (*positive* (*succ* (*succ* 0))) of type *Prop*.

**3.4. Proofs.** Predicate logic defines a language for terms and propositions, but proofs have to be defined in a second step, for instance as derivations in natural deduction, sequent calculus, etc. These derivations, like object-terms and propositions, are trees. Therefore, they can be represented as $\lambda\Pi/\equiv$ terms.

Using the Brouwer-Heyting-Kolmogorov interpretation, a proof of the proposition $A \Rightarrow B$ should be a $\lambda\Pi/\equiv$ term expressing a function mapping proofs of $A$ to proofs of $B$. Then, using the Curry-de Bruijn-Howard correspondence, the type of this term should be the proposition $A \Rightarrow B$ itself. But, this is not possible in the theory $\mathcal{U}$ yet, as the proposition $A \Rightarrow B$ has the type *Prop*, and not the type TYPE.

A strict view on the Curry-de Bruijn-Howard correspondence leads to identify *Prop* and TYPE, yielding the conclusion that all types, including $I$, and *Prop* itself, are propositions. A more moderate view leads to the introduction of an embedding *Prf* of propositions into types, mapping each proposition $A$ to the type *Prf A* of its proofs. This view is moderate in
two respects. First, the propositions themselves are not the types of their proofs: if $t$ is a proof of $A$, then it does not have the type $A$, but the type $\mathit{Prf} A$. Second, this embedding is not surjective. So not all types are types of proofs, in particular $I$ and $\mathit{Prop}$ are not.

So, in the theory $\mathcal{U}$, we declare a constant $\mathit{Prf}$

```
Prf : Prop → TYPE
``` (Prf-decl)

When assigning the type $\mathit{Prop} \to \mathit{TYPE}$ to the constant $\mathit{Prf}$, we use the fact that $\lambda\Pi/\equiv$ supports dependent types, that is the possibility to build a family of types $\mathit{Prf} x$ parameterized with a variable $x$ of type $\mathit{Prop}$, where $\mathit{Prop}$ is itself of type $\mathit{TYPE}$.

According to the Brouwer-Heyting-Kolmogorov interpretation, a proof of $A \Rightarrow A$ is a $\lambda\Pi/\equiv$ term expressing a function mapping proofs of $A$ to proofs of $A$, so that it can be both built and used as a function. In particular, the identity function $\lambda x : \mathit{Prf} A, x$ mapping each proof of $A$ to itself is a proof of $A \Rightarrow A$. According to the Curry-de Bruijn-Howard correspondence, this term should have the type $\mathit{Prf}(A \Rightarrow A)$, but it has the type $\mathit{Prf} A \to \mathit{Prf} A$. So, the types $\mathit{Prf}(A \Rightarrow A)$ and $\mathit{Prf} A \to \mathit{Prf} A$ must be identified. To do so, we use the fact that $\lambda\Pi/\equiv$ allows the declaration of rewriting rules, so that $\mathit{Prf}(A \Rightarrow A)$ rewrites to $\mathit{Prf} A \to \mathit{Prf} A$.

```
Prf (x \Rightarrow y) \leftrightarrow \mathit{Prf} x \to \mathit{Prf} y
``` (\Rightarrow-red)

This rule expresses the meaning of the constant $\Rightarrow$. It is, in $\lambda\Pi/\equiv$, the expression of the Brouwer-Heyting-Kolmogorov interpretation of proofs for implication: a proof of $x \Rightarrow y$ is a function mapping proofs of $x$ to proofs of $y$. So, in the theory $\mathcal{U}$, the Brouwer-Heyting-Kolmogorov interpretation of proofs for implication is made explicit: it is the rule (\Rightarrow-red).

**3.5. Universal quantification.** Unlike implication, the universal quantifier binds a variable. Thus, we express the proposition $\forall z A$ as the proposition $\forall (\lambda z : I, A) [\text{Chu40, NM88, Pau93, HHP93}]$, yielding the type $I \to \mathit{Prop}$ for the argument of $\forall$, hence the type $(I \to \mathit{Prop}) \to \mathit{Prop}$ for the constant $\forall$ itself.

But, in the theory $\mathcal{U}$, we allow quantification, not only over the variables of type $I$, but over variables of any type of object-terms. We could introduce a different quantifier for each type of object-terms, for instance two quantifiers of type $(I_1 \to \mathit{Prop}) \to \mathit{Prop}$ and $(I_2 \to \mathit{Prop}) \to \mathit{Prop}$ if we had two types $I_1$ and $I_2$ of object-terms. But, as in some cases, we will have an infinite number of types of object-terms, this would require the introduction of an infinite number of constants.

Thus, we rather want to have a single generic quantifier. But we cannot give the type $\Pi X : \mathit{TYPE}, (X \to \mathit{Prop}) \to \mathit{Prop}$ to this quantifier, first because in $\lambda\Pi/\equiv$ there is no way to quantify over a variable of type $\mathit{TYPE}$, but also because this would introduce the possibility to quantify over $\mathit{Prop}$ and all the types of the form $\mathit{Prf} A$, while we do not always want to consider these types as types of object-terms.

Therefore, in the theory $\mathcal{U}$, we declare a constant $\mathit{Set}$ of type $\mathit{TYPE}$ for the types of object-terms

```
Set : TYPE
``` (Set-decl)

a constant $\iota$ of type $\mathit{Set}$

```
\iota : Set
``` (\iota-decl)

a constant $\mathit{El}$ to embed the terms of type $\mathit{Set}$ into terms of type $\mathit{TYPE}$
$$ El : Set \to TYPE \qquad (El-decl) $$

and a rule that reduces the term $El \iota$ to $I$

$$ El \iota \leftrightarrow I \qquad (\iota-red) $$

The types of object-terms then have the form $El A$ and are distinguished among the other terms of type TYPE.

We can now give the type $\Pi x : Set, (El x \to Prop) \to Prop$ to the generic universal quantifier

$$ \forall : \Pi x : Set, (El x \to Prop) \to Prop \qquad (\forall-decl) $$

and write $\forall \iota (\lambda z : I, A)$ for the proposition $\forall z A$.

Just like for the implication, we declare a rewriting rule expressing that the type of the proofs of the proposition $\forall x p$ is the type of functions mapping each $z$ of type $El x$ to a proof of $p z$

$$ Prf (\forall x p) \leftrightarrow \Pi z : El x, Prf (p z) \qquad (\forall-red) $$

Again, the Brouwer-Heyting-Kolmogorov interpretation of proofs for the universal quantifier is made explicit: it is this rule $(\forall-red)$.

**3.6. Other constructive connectives and quantifiers.** The other connectives and quantifiers are defined à la Russell. For the conjunction, for example, $Prf(x \land y)$ is defined as $\Pi z : Prop, (Prf x \to Prf y \to Prf z) \to Prf z$. This definition does not use the quantifier $\forall$ of the theory $U$ (so far, in the theory $U$, we can quantify over the type $I$, but not over the type $Prop$), but the quantifier $\Pi$ of the logical framework $\lambda\Pi/\equiv$ itself.

Remark that, *per se*, the quantification on the variable $z$ of type $Prop$ is predicative, as the term $\Pi z : Prop, (Prf x \to Prf y \to Prf z) \to Prf z$ has type TYPE and not $Prop$. But, the rule rewriting $Prf(x \land y)$ to $\Pi z : Prop, (Prf x \to Prf y \to Prf z) \to Prf z$ introduces some impredicativity, as the term $x \land y$ of type $Prop$ is “defined” as the inverse image, for the embedding $Prf$, of the type $\Pi z : Prop, (Prf x \to Prf y \to Prf z) \to Prf z$, that contains a quantification on a variable of type $Prop$

$$ \top : Prop \qquad (\top-decl) $$

$$ Prf \top \leftrightarrow \Pi z : Prop, Prf z \to Prf z \qquad (\top-red) $$

$$ \bot : Prop \qquad (\bot-decl) $$

$$ Prf \bot \leftrightarrow \Pi z : Prop, Prf z \qquad (\bot-red) $$

$$ \neg : Prop \to Prop \qquad (\neg-decl) $$

$$ Prf (\neg x) \leftrightarrow Prf x \to \Pi z : Prop, Prf z \qquad (\neg-red) $$

$$ \wedge : Prop \to Prop \to Prop \quad (\wedge-decl) $$

$$ Prf (x \land y) \leftrightarrow \Pi z : Prop, (Prf x \to Prf y \to Prf z) \to Prf z \qquad (\wedge-red) $$

$$ \vee : Prop \to Prop \to Prop \quad (\vee-decl) $$

$$ Prf (x \lor y) \leftrightarrow \Pi z : Prop, (Prf x \to Prf z) \to (Prf y \to Prf z) \to Prf z \qquad (\vee-red) $$

$$ \exists : \Pi a : Set, (El a \to Prop) \to Prop \qquad (\exists-decl) $$

$$ Prf (\exists a p) \leftrightarrow \Pi z : Prop, (\Pi x : El a, Prf (p x) \to Prf z) \to Prf z \qquad (\exists-red) $$
**3.7. Infinity.** Now that we have the symbols $\top$ and $\bot$, we can express that the type *I* is infinite, that is, that there exists a non-surjective injection from this type to itself. We call this non-surjective injection *succ*. To express its injectivity, we introduce its left inverse *pred*. To express its non-surjectivity, we introduce an element *0*, that is not in its image *positive* [DW05]. This choice of notation enables the definition of natural numbers as some elements of type *I*

<table><tr><td>0 : I</td><td>(0-decl)</td></tr><tr><td>succ : I → I</td><td>(succ-decl)</td></tr><tr><td>pred : I → I</td><td>(pred-decl)</td></tr><tr><td>pred 0 ↪ → 0</td><td>(pred-red1)</td></tr><tr><td>pred (succ x) ↪ → x</td><td>(pred-red2)</td></tr><tr><td>positive : I → Prop</td><td>(positive-decl)</td></tr><tr><td>positive 0 ↪ → ⊥</td><td>(positive-red1)</td></tr><tr><td>positive (succ x) ↪ → ⊤</td><td>(positive-red2)</td></tr></table>

**3.8. Classical connectives and quantifiers.** The disjunction in constructive logic and in classical logic are governed by different deduction rules. As the deduction rules express the meaning of the connectives and quantifiers, we can conclude that the disjunction in constructive logic and in classical logic have different meanings. If these disjunctions have different meanings, they should be expressed with different symbols, for instance $\vee$ for the constructive disjunction and $\vee_c$ for the classical one, just like, in classical logic, we use two different symbols for the inclusive disjunction and the exclusive one.

The constructive and the classical disjunction need not belong to different languages, but they can coexist in the same. Ecumenical logics [Pra15, Dow15, PR17, Gri19] are logics where the constructive and classical connectives and quantifiers coexist. A proposition whose connectors and quantifiers are all constructive, is said to be “purely constructive”, and one whose connectors and quantifiers are all classical, is said to be “purely classical”. The others are said to be “mixed propositions”. Any deductive system, where a purely constructive proposition is provable if and only if it is provable in Constructive predicate logic, and where a purely classical proposition is provable if and only if it is provable in Classical predicate logic, is Ecumenical. Ecumenical logics may of course differ on mixed propositions.

Many Ecumenical logics consider the constructive connectives and quantifiers as primitive and attempt to define the classical ones from them, using the negative translation as a definition. There are several options: the classical disjunction, for instance, can be defined in any of the following ways:

$$ (1) A \lor_c B = \neg\neg(A \lor B) $$

$$ (2) A \lor_c B = (\neg\neg A) \lor (\neg\neg B) $$

$$ (3) A \lor_c B = \neg\neg(\neg\neg A) \lor (\neg\neg B) $$

and similarly for the other connectives and quantifiers.

Using these definitions, the proposition $(P \land_c Q) \Rightarrow_c P$ is then:

$$ (1) \neg\neg(\neg\neg(P \land Q)) \Rightarrow P $$

$$ (2) \neg\neg(\neg\neg P) \land \neg\neg Q) \Rightarrow \neg\neg P $$

$$ (3) \neg\neg(\neg\neg\neg(\neg\neg P) \land \neg\neg Q)) \Rightarrow \neg\neg P $$
None of them is exactly the negative translation of $(P \land Q) \Rightarrow P$ that is

$$ \neg\neg((\neg\neg((\neg\neg P) \land (\neg\neg Q)))) \Rightarrow (\neg\neg P)) $$

With Definition (1), the double negations on atomic propositions are missing. This can be repaired in two ways. Predicate symbols of the language can be duplicated [Pra15] into a constructive and a classical counterpart, the latter being the double negation of the former. Or the syntax of predicate logic can be modified [Gil18]. First, terms are defined. Then, atoms are defined as terms of the form $P(t_1, ..., t_n)$ where $P$ is a predicate symbol and $t_1, ..., t_n$ are terms. Finally, propositions are defined as either explicitly embedded atoms, conjunctions of two propositions, etc. Atoms can be constructively embedded into propositions with the symbol $▷$ or classically with a double-negation version of $▷$. This way, the proposition above is now written $(▷_c P \land _c ▷_c Q) \Rightarrow_c ▷_c P$, which is, by definition, equal to $\neg\neg((\neg\neg((\neg\neg P) \land (\neg\neg Q)))) \Rightarrow (\neg\neg P))$.

With Definition (2) [AH14], the double negation at the root of the proposition is missing. This again can be repaired [Gri19] by modifying the syntax of Predicate logic, defining first terms, then pre-propositions, that are defined like the propositions in Predicate logic and then propositions, a proposition being obtained by applying a symbol $\circ_c$ to a pre-proposition. Again, this symbol has also a classical version defined as the double negation of the constructive one. This way, the proposition above is written $\circ_c((P \land Q) \Rightarrow_c P)$ and this proposition is, by definition, equal to $\neg\neg((\neg\neg((\neg\neg P) \land (\neg\neg Q)))) \Rightarrow (\neg\neg P))$.

Definition (3) [Dow15] is closer to the negative translation except that, in some places, the two negations are replaced with four. But, as $\neg\neg\neg A$ is equivalent to $\neg A$, these extra negations can be removed. Yet, a classical atomic proposition $P$ is the same as its constructive version, while its negative translation is $\neg\neg P$, and in (1) $P_c$ or $▷_c P$ is equal to $\neg\neg P$, as well as $\circ_c P$ in (2). As atomic propositions are not provable anyway, this does not affect provability. But it affects hypothetical provability, leading to duplicate the notion of entailment.

In the theory $U$, we use Definition (2). Indeed, as we already have a distinction between the proposition $A$ and the type $Prf A$ of its proofs, we can just include the symbol $\circ_c$ into the constant $Prf$ introducing a classical version $Prf_c$ of this constant

$$ Prf_c : Prop \to TYPE \qquad (Prf_c-decl) $$

$$ Prf_c \hookrightarrow \lambda x : Prop, Prf (\neg\neg x) \qquad (Prf_c-red) $$

We can then define the classical connectives and quantifiers as follows

$$ \Rightarrow_c : Prop \to Prop \to Prop \quad (\text{written infix}) \qquad (\Rightarrow_c-decl) $$

$$ \Rightarrow_c \hookrightarrow \lambda x : Prop, \lambda y : Prop, (\neg\neg x) \Rightarrow (\neg\neg y) \qquad (\Rightarrow_c-red) $$

$$ \wedge_c : Prop \to Prop \to Prop \quad (\text{written infix}) \qquad (\wedge_c-decl) $$

$$ \wedge_c \hookrightarrow \lambda x : Prop, \lambda y : Prop, (\neg\neg x) \wedge (\neg\neg y) \qquad (\wedge_c-red) $$

$$ \vee_c : Prop \to Prop \to Prop \quad (\text{written infix}) \qquad (\vee_c-decl) $$

$$ \vee_c \hookrightarrow \lambda x : Prop, \lambda y : Prop, (\neg\neg x) \vee (\neg\neg y) \qquad (\vee_c-red) $$

$$ \forall_c : \Pi a : Set, (El a \to Prop) \to Prop \qquad (\forall_c-decl) $$

$$ \forall_c \hookrightarrow \lambda a : Set, \lambda p : (El a \to Prop), \forall a (\lambda x : El a, \neg\neg(p x)) \qquad (\forall_c-red) $$

$$ \exists_c : \Pi a : Set, (El a \to Prop) \to Prop \qquad (\exists_c-decl) $$

$$ \exists_c \hookrightarrow \lambda a : Set, \lambda p : (El a \to Prop), \exists a (\lambda x : El a, \neg\neg(p x)) \qquad (\exists_c-red) $$

Note that $\top_c$ and $\bot_c$ are $\top$ and $\bot$, by definition. Note also that $\neg\neg\neg A$ is equivalent to $\neg A$, so we do not need to duplicate negation either.
**3.9. Propositions as objects.** So far, we have mainly reconstructed the Predicate logic notions of object-term, proposition, and proof. We can now turn to two notions coming from Simple type theory: propositions as objects and functionality.

Simple type theory is often presented as an independent system, but it can be expressed in several logical frameworks, such as Predicate logic, Isabelle, Deduction modulo theory, Pure type systems, and also $\lambda\Pi/\equiv$. Yet, the relation between Predicate logic and Simple type theory is complex because

* Simple type theory can be expressed in Predicate logic

* and Predicate logic is a restriction of Simple type theory, allowing quantification on variables of type $\iota$ only.

So, in Predicate logic, we can express Simple type theory, that contains, as a restriction, Predicate logic, in which we can express Simple type theory, that contains, as a restriction, Predicate logic, in which we can express Simple type theory, that contains, etc. Stacking encodings in this way leads to nonsensical expressions of Simple type theory. But this remark shows that, after having reconstructed Predicate logic in $\lambda\Pi/\equiv$, we have a choice: we can either express Simple type theory in Predicate logic, that is itself expressed in $\lambda\Pi/\equiv$, or express Simple type theory directly in $\lambda\Pi/\equiv$, letting Predicate logic be, a posteriori, a restriction of it, that is, build Simple type theory, not in Predicate logic, but as an extension of Predicate logic.

In the theory $U$, we choose the second option that leads to a simpler expression of Simple type theory, avoiding the stacking of two encodings. Simple type theory is thus expressed by adding two axioms on top of Predicate logic: one for propositions as objects and one for functionality.

Let us start with propositions as objects. So far, the term $\iota$ is the only closed term of type `Set`. So, we can only quantify over the variables of type `El \iota`, that is `I`. In particular, we cannot quantify over propositions. To do so, we just need to declare a constant `o` of type `Set`

o : Set (o-decl)

and a rule identifying `El o` and `Prop`

El o ↪ → Prop (o-red)

Note that just like there are no terms of type $\iota$, but terms, such as `0`, which have type `El \iota`, that is `I`, there are no terms of type `o`, but terms, such as `⊤`, which have type `El o`, that is `Prop`.

Applying the constant $\forall$ to the constant `o`, we obtain a term of type `(El o → Prop) → Prop`, that is `(Prop → Prop) → Prop`, and we can express the proposition $\forall p (p \Rightarrow p)$ as $\forall o (\lambda p : Prop, p \Rightarrow p)$. The type `Prf (\forall o (\lambda p : Prop, p \Rightarrow p))` of the proofs of this proposition rewrites to $\Pi p : Prop, \Prf p \rightarrow \Prf p$. So, the term $\lambda p : Prop, \lambda x : \Prf p, x$ is a proof of this proposition.

**3.10. Functionality.** Besides $\iota$ and `o`, we introduce more types in the theory, for functions and sets. To do so, we declare a constant

$\sim : Set \rightarrow Set \rightarrow Set$ (written infix) (\sim-decl)

and a rewriting rule
$El(x \rightsquigarrow y) \hookrightarrow El x \rightarrow El y$ ($\rightsquigarrow$-red)

For instance, these rules enable the construction of the $\lambda\Pi/\equiv$ term $\iota \rightsquigarrow \iota$ of type $Set$ that expresses the simple type $\iota \rightarrow \iota$. The $\lambda\Pi/\equiv$ term $El(\iota \rightsquigarrow \iota)$ of type $TYPE$ rewrites to $I \rightarrow I$. The simply typed term $\lambda x : \iota, x$ of type $\iota \rightarrow \iota$ is then expressed as the term $\lambda x : I, x$ of type $I \rightarrow I$ that is, $El(\iota \rightsquigarrow \iota)$.

**3.11. Dependent arrow.** The axiom ($\rightsquigarrow$) enables us to give simple types to the object-terms expressing functions. We can also give them dependent types, with the dependent versions of this axiom

$\rightsquigarrow_d : \Pi x : Set, (El x \rightarrow Set) \rightarrow Set$ (written infix) ($\rightsquigarrow_d$-decl)

$El(x \rightsquigarrow_d y) \hookrightarrow \Pi z : El x, El(y z)$ ($\rightsquigarrow_d$-red)

Note that, if we apply the constant $\rightsquigarrow_d$ to a term $t$ and a term $\lambda z : El t, u$, where the variable $z$ does not occur in $u$, then $El(t \rightsquigarrow_d \lambda z : El t, u)$ rewrites to $El t \rightarrow El u$, just like $El(t \rightsquigarrow u)$. Thus, the constant $\rightsquigarrow_d$ is useful only if we can build a term $\lambda z : El t, u$ where the variable $z$ occurs in $u$. With the symbols we have introduced so far, this is not possible. The only constants that can be used to build a term of type $Set$ are $\iota$, $o$, $\rightsquigarrow$, and $\rightsquigarrow_d$, and the variable $z$ cannot occur free in a term built from these four constants and a variable $z$ of type $El t$.

Just like we have a constant $\iota$ of type $Set$, we could add a constant *array* of type $I \rightarrow Set$ such that *array* $n$ is the type of arrays of length $n$. We could then construct the term $(\iota \rightsquigarrow_d \lambda n : I, \text{array } n)$ of type $Set$. Then, the type $El(\iota \rightsquigarrow_d \lambda n : I, \text{array } n)$ that rewrites to $\Pi n : I, El(\text{array } n)$, would be the type of functions mapping a natural number $n$ to an array of length $n$.

So, this symbol $\rightsquigarrow_d$ becomes useful, only if we add such a constant *array*, object-level dependent types, or the symbols $\pi$ or $psub$ below.

**3.12. Dependent implication.** In the same way, we can add a dependent implication, where, in the proposition $A \Rightarrow B$, the proof of $A$ may occur in $B$

$\Rightarrow_d : \Pi x : \mathit{Prop}, (\mathit{Prf} x \rightarrow \mathit{Prop}) \rightarrow \mathit{Prop}$ (written infix) ($\Rightarrow_d$-decl)

$\mathit{Prf}(x \Rightarrow_d y) \hookrightarrow \Pi z : \mathit{Prf} x, \mathit{Prf}(y z)$ ($\Rightarrow_d$-red)

**3.13. Proofs in object-terms.** To construct an object-term, we sometimes want to apply a function symbol to other object-terms and also to proofs. For instance, we may want to apply the Euclidean division *div* to two numbers $t$ and $u$ and to a proof that $u$ is positive.

We would like the type of *div* to be something like

$El(\iota \rightsquigarrow \iota \rightsquigarrow_d \lambda y : I, (\mathit{positive} \ y \rightsquigarrow \iota))$

But the term $(\mathit{positive} \ y \rightsquigarrow \iota)$ is not well typed, as the constant $\rightsquigarrow$ expects, as a first argument, a term of type $Set$ and not of type $Prop$, that is, a type of object-terms and not of proofs.

Thus, we must declare another constant

$\pi : \mathit{Prop} \rightarrow Set \rightarrow Set$

and a rewriting rule

$El(\pi x y) \hookrightarrow (\mathit{Prf} x) \rightarrow (El y)$
Just like for the constant $\rightsquigarrow$ and $\Rightarrow$, we can also have a dependent version of this constant. In fact, in the theory $\mathcal{U}$, we only have this dependent version

$$ \pi : \Pi x : \mathit{Prop}, (\mathit{Prf} x \to \mathit{Set}) \to \mathit{Set} \qquad (\pi\text{-decl}) $$

$$ \mathit{El} (\pi x y) \hookrightarrow \Pi z : \mathit{Prf} x, \mathit{El} (y z) \qquad (\pi\text{-red}) $$

This way, we can give, to the constant $\mathit{div}$, the type

$$ \mathit{El} (\iota \rightsquigarrow \iota \rightsquigarrow_d \lambda y : I, \pi (\mathit{positive} y) (\lambda z : \mathit{Prf} (\mathit{positive} y), \iota)) $$

that is

$$ I \to \Pi y : I, \mathit{Prf} (\mathit{positive} y) \to I $$

In the same way, if we add a symbol $=$ of type $\Pi x : \mathit{Set}, \mathit{El} x \to \mathit{El} x \to \mathit{Prop}$, we can express the proposition

$$ \mathit{positive} y \Rightarrow_d \lambda p : \mathit{Prf} (\mathit{positive} y), (\equiv \iota (\mathit{div} x y p) (\mathit{div} x y p)) $$

enlightening the meaning of the proposition usually written

$$ y > 0 \Rightarrow x/y = x/y $$

The proposition $x/y = x/y$ is well-formed, but it contains, besides $x$ and $y$, an implicit free variable $p$, for a proof of $y > 0$. This variable is bound by the implication, that needs therefore to be a dependent implication. Hence, the only free variables in $y > 0 \Rightarrow x/y = x/y$ are $x$ and $y$.

**3.14. Proof irrelevance.** If $p$ and $q$ are two non convertible proofs of the proposition *positive 2*, the terms *div 7 2 p* and *div 7 2 q* are not convertible. As a consequence, the proposition

$$ = \iota (\mathit{div} 7 2 p) (\mathit{div} 7 2 q) $$

would not be provable.

To make these terms convertible, we embed the theory into an extended one, that contains another constant

$$ \mathit{div}^{\dagger} : \mathit{El} (\iota \rightsquigarrow \iota \rightsquigarrow \iota) $$

and a rule

$$ \mathit{div} x y p \hookrightarrow \mathit{div}^{\dagger} x y $$

and we define convertibility in this extended theory. This way, the terms *div 7 2 p* and *div 7 2 q* are convertible, as they both reduce to *div*† 7 2.

Note that, in the extended theory, the constant $\mathit{div}^{\dagger}$ enables the construction of the erroneous term $\mathit{div}^{\dagger} 1 0$. But the extended theory is only used to define the convertibility in the restricted one and this term is not a term of the restricted theory. It is not even the reduct of a term of the form $\mathit{div} 1 0 r$ [FT19, BH21].
3.15. **Dependent pairs and predicate subtyping.** Instead of declaring a constant *div* that takes three arguments: a number *t*, a number *u*, and a proof *p* that *u* is positive, we can declare a constant that takes two arguments: a number *t* and a pair *pair* *ι* *positive* *u* *p* formed with a number *u* and a proof *p* that *u* is positive.

The type of the pair *pair* *ι* *positive* *u* *p* whose first element is a number and the second a proof that this number is positive is written *psub* *ι* *positive*, or informally {$x : ι | \text{positive } x$}. It can be called “the type of positive numbers”, especially if the pair is proof-irrelevant in its second argument. It is a subtype of the type of natural numbers defined with the predicate *positive*. Therefore, the symbol *psub* introduces predicate subtyping.

We thus declare a constant *psub* and a constant *pair*

*psub* : Π*t* : *Set*, (*El* *t* → *Prop*) → *Set* (psub-decl)

*pair* : Π*t* : *Set*, Π*p* : *El* *t* → *Prop*, Π*m* : *El* *t*, *Prf* (*p* *m*) → *El* (*psub* *t* *p*) (pair-decl)

This way, instead of giving the type *El* (*ι* ~ *ι* ~ *d*) *λy* : *Prf* (*positive* *y*), *ι* to the constant *div*, we can give it the type *El* (*ι* ~ *psub* *ι* *positive* ~ *ι*).

To avoid introducing a new positive number *pair* *ι* *positive* 3 *p* with each proof *p* that 3 is positive, we make this symbol *pair* proof irrelevant by introducing a symbol *pair*† and a rewriting rule that discards the proof

*pair*† : Π*t* : *Set*, Π*p* : *El* *t* → *Prop*, *El* *t* → *El* (*psub* *t* *p*) (pair†-decl)

*pair* *t* *p* *m* *h* ↪ → *pair*† *t* *p* *m* (pair-red)

This declaration and this rewriting rule are not part of the theory *U* but of the theory *U*† used to define the conversion on the terms of *U*.

Finally, we declare the projections *fst* and *snd* together with an associated rewriting rule

*fst* : Π*t* : *Set*, Π*p* : *El* *t* → *Prop*, *El* (*psub* *t* *p*) → *El* *t* (fst-decl)

*fst* *t* *p* (*pair*† *t*′ *p*′ *m*) ↪ → *m* (fst-red)

*snd* : Π*t* : *Set*, Π*p* : *El* *t* → *Prop*, Π*m* : *El* (*psub* *t* *p*), *Prf* (*p* (*fst* *t* *p* *m*)) (snd-decl)

Note that the left hand side of the rule (*fst*-red) is not well-typed, but it can match a well-typed term *fst* *A* *B* (*pair*† *A* *B* *m*). Yet, we prefer this rule to the non linear one *fst* *t* *p* (*pair*† *t* *p* *m*) ↪ → *m* that would make confluence proofs more difficult.

Note that there is no rewriting rule for the second projection as the second element of pairs is discarded during rewriting.

3.16. **Dependent types.** When we have the axioms (*El*), (*ι*), and (*~*), the type *I* → *I* of the term *succ* is equivalent to the type *El* (*ι* ~ *ι*). Hence, this type *I* → *I* is in the image of the embedding *El*. The symbol *array* introduced in Section 3.11 has the type *I* → *Set* and similarly if we have a predicate symbol *≤* : *El* (*ι* ~ *ι* ~ *o*), the term *λn* : *I*, *psub* *ι* (*λm* : *I*, *m* ≤ *n*) also has the type *I* → *Set*. Unlike the type *I* → *I* the type *I* → *Set* is not in the image of any embedding. It is well-formed in the framework but not in the theory itself.

To make this type an element of the image of an embedding we can introduce dependent types at the level of objects-terms. To do so, we introduce a constant *Set1* of type *TYPE* and a constant *set* of type *Set1*

*Set1* : TYPE (Set1-decl)

*set* : *Set1* (set-decl)
a new arrow

```
Πx : Set, (El x → Set1) → Set1
```
($\rightsquigarrow_d$-decl)

and an embedding of *Set1* into *TYPE*, similar to the embeddings *Prf* and *El*

```
Ty : Set1 → TYPE
```
($Ty$-decl)

and we identify *Ty set* with *Set*—like *El o* is identified with *Prop*—and the dependent arrow $\rightsquigarrow_d$ with a product type

```
Ty set ↪→ Set
```
(*set*-red)

```
Ty (x $\rightsquigarrow_d$ y) ↪→ Πz : El x, Ty (y z)
```
($\rightsquigarrow_d$-red)

The type $I \to Set$, is now equivalent to $Ty (I \rightsquigarrow_d (\lambda n : I, set))$ and is thus in the image of the embedding $Ty$. One could think in simply taking *set : Set*, saving constants *Set1*, *Ty* and $\rightsquigarrow_d$ and their rewrite rules. However, such a declaration would encode the product $(\Delta, \square, \square)$ of system $\lambda U^-$ which is inconsistent [Coq86, Hur95].

3.17. **Prenex predicative type quantification in types.** Using the symbols of the theory $\mathcal{U}$ introduced so far, the symbol for equality $=$ has the type $Πx : Set, El x \to El x \to Prop$ which is not a type of object terms. This motivates the introduction of object-level polymorphism [Gir72, Rey74]. However extending Simple type theory with object-level polymorphism makes it inconsistent [Hur95, Coq86], and similarly it makes the theory $\mathcal{U}$ inconsistent. So, object-level polymorphism in $\mathcal{U}$ is restricted to prenex polymorphism.

To do so, we introduce a new constant *Scheme* of type *TYPE*

```
Scheme : TYPE
```
(*Scheme*-decl)

a constant *Els* to embed the terms of type *Scheme* into terms of type *TYPE*

```
Els : Scheme → TYPE
```
(*Els*-decl)

a constant $↑$ to embed the terms of type *Set* into terms of type *Scheme* and a rule connecting these embeddings

```
↑ : Set → Scheme
```
($↑$-decl)

```
Els (↑ x) ↪→ El x
```
($↑$-red)

We then introduce a quantifier for the variables of type *Set* in the terms of type *Scheme* and the associated rewriting rule

```
V : (Set → Scheme) → Scheme
```
($V$-decl)

```
Els (V p) ↪→ Πx : Set, Els (p x)
```
($V$-red)

This way, the type of the identity function is *Els* ($V (\lambda x : Set, ↑ (x \rightsquigarrow x))$). It reduces to $Πx : Set, El x \to El x$. Therefore, it is inhabited by the term $\lambda x : Set, \lambda y : El x, y$. In a similar way, the symbol $=$ can then be given the type *Els* ($V (\lambda x : Set, ↑ (x \rightsquigarrow x \rightsquigarrow o))$) that reduces to $Πx : Set, El x \to El x \to Prop$.
**3.18. Prenex predictive type quantification in propositions.** When we express the
reflexivity of the polymorphic equality, we need also to quantify over a type variable, but
now in a proposition. To be able to do so, we introduce another quantifier and its associated
rewriting rule

$$ \forall : (\mathcal{S} \to \mathcal{P} \mathcal{O}) \to \mathcal{P} \mathcal{O} \qquad (\forall\text{-decl}) $$

$$ \mathrm{Prf}(\forall p) \hookrightarrow \Pi x : \mathcal{S} \mathrm{, } \mathrm{Prf}(p x) \qquad (\forall\text{-red}) $$

This way, the reflexivity of equality can be expressed as $(\forall (\lambda s : \mathcal{S}, \forall s (\lambda x : \mathcal{E}l s, = s x x)))$.

**3.19. The theory U: putting everything together.** As mentioned in Section 2, we call
“axiom” a constant declaration together with its rewrite rules if any. Hence, in the following,
we denote by (ι) the axiom consisting of (ι-decl) and (ι-red), and similarly for all the other
axioms.

The theory $\mathcal{U}$ is then formed with 43 axioms: (I), (Set), (El), (ι), (Prop), (Prf), (⇒), (∀), (⊤), (⊥), (¬), (∧), (∨), (∃), (Prf<sub>c</sub>), (⇒<sub>c</sub>), (∧<sub>c</sub>), (∨<sub>c</sub>), (∀<sub>c</sub>), (∃<sub>c</sub>), (o), (≈), (≈<sub>d</sub>), (⇒<sub>d</sub>), (π), (0), (succ), (pred), (positive), (psub), (pair), (pair<sup>†</sup>), (fst), (snd), (Set1), (set), (≈<sub>d</sub>), (Ty), (Scheme), (Els), (↑), (∨), (∧).

Note that, strictly speaking, the declaration (pair<sup>†</sup>-decl) and the rule (pair-red) are not part of the theory $\mathcal{U}$, but of its extension $\mathcal{U}^†$ used to define the conversion on the terms of $\mathcal{U}$.

Among these axioms, 14 only have a constant declaration, 27 have a constant declaration and one rewriting rule, and 2 have a constant declaration and two rewriting rules. So $\Sigma_{\mathcal{U}}$ contains 43 declarations and $\mathcal{R}_{\mathcal{U}}$ 31 rules.

This large number of axioms is explained by the fact that $\lambda\Pi/\equiv$ is a weaker framework than Predicate logic. The 20 first axioms are needed just to construct notions that are primitive in Predicate logic: terms, propositions, with their 13 constructive and classical connectives and quantifiers, and proofs. So the theory $\mathcal{U}$ is just 23 axioms on top of the definition of Predicate logic.

It is also explained by the fact that axioms are more atomic than in Predicate logic: 4 axioms are needed to express “the” axiom of infinity: (0), (succ), (pred), and (positive); 5 to express predicate subtyping: (psub), (pair), (pair<sup>†</sup>), (fst), and (snd); 4 to express dependent types: (Set1), (set), (≈<sub>d</sub>), (Ty); and 5 to express prenex polymorphism: (Scheme), (Els), (↑), (∨), and (∧). The 5 remaining axioms express propositions as objects (o); various forms of functionality: (≈), (≈<sub>d</sub>), and (π); and dependent implication (⇒<sub>d</sub>).

## 4. SUB-THEORIES

Not all proofs require all these axioms. Many proofs can be expressed in sub-theories built by bringing together some of the axioms of $\mathcal{U}$, but not all.

Given subsets $\Sigma_S$ of $\Sigma_{\mathcal{U}}$ and $\mathcal{R}_S$ of $\mathcal{R}_{\mathcal{U}}$, we would like to be sure that a proof in $\mathcal{U}$, using only constants in $\Sigma_S$, is a proof in $(\Sigma_S, \mathcal{R}_S)$. Such a result is trivial in Predicate logic: for instance, a proof in ZFC which does not use the axiom of choice is a proof in ZF, but it is less straightforward in $\lambda\Pi/\equiv$, because $(\Sigma_S, \mathcal{R}_S)$ might not be a theory. So we should not consider any pair $(\Sigma_S, \mathcal{R}_S)$. For instance, as *Set* occurs in the type of *El*, if we want *El* in $\Sigma_S$, we must take *Set* as well. In the same way, as *positive* (*succ* x) rewrites to $\top$, if we want (*positive*) and (*succ*) in $\Sigma_S$, we must include $\top$ in $\Sigma_S$ and the rule rewriting *positive* (*succ* x) to $\top$ in $\mathcal{R}_S$.
This leads to a definition of a notion of sub-theory and to prove that, if $(\Sigma_1, \mathcal{R}_1)$ is a sub-theory of a theory $(\Sigma_0, \mathcal{R}_0)$, $\Gamma$, $t$ and $A$ are in $\Lambda(\Sigma_1)$, and $\Gamma \vdash_{\Sigma_0, \mathcal{R}_0} t : A$, then $\Gamma \vdash_{\Sigma_1, \mathcal{R}_1} t : A$.

This property implies that, if $\pi$ is a proof of $A$ in $\mathcal{U}$ and both $A$ and $\pi$ are in $\Lambda(\Sigma_1)$, then $\pi$ is a proof of $A$ in $(\Sigma_1, \mathcal{R}_1)$, but it does not imply that if $A$ is in $\Lambda(\Sigma_1)$ and $A$ has a proof in $\mathcal{U}$, then it has a proof in $(\Sigma_1, \mathcal{R}_1)$.

### 4.1. Fragments.

**Definition 4.1 (Fragment).** A signature $\Sigma_1$ is included in a signature $\Sigma_0$, denoted $\Sigma_1 \subseteq \Sigma_0$, if each declaration $c : A$ of $\Sigma_1$ is a declaration of $\Sigma_0$.

A system $(\Sigma_1, \mathcal{R}_1)$ is a fragment of a system $(\Sigma_0, \mathcal{R}_0)$, if the following conditions are satisfied:

* $\Sigma_1 \subseteq \Sigma_0$ and $\mathcal{R}_1 \subseteq \mathcal{R}_0$;

* for all $(c : A) \in \Sigma_1$, $\text{const}(A) \subseteq |\Sigma_1|$;

* for all $\ell \mapsto r \in \mathcal{R}_0$, if $\text{const}(\ell) \subseteq |\Sigma_1|$, then $\text{const}(r) \subseteq |\Sigma_1|$ and $\ell \mapsto r \in \mathcal{R}_1$.

We write $\vdash_i$ for $\vdash_{\Sigma_i, \mathcal{R}_i}$, $\mapsto_i$ for $\mapsto_{\beta \mathcal{R}_i}$, and $\equiv_i$ for $\equiv_{\beta \mathcal{R}_i}$.

**Lemma 4.2 (Preservation of reduction).** If $(\Sigma_1, \mathcal{R}_1)$ is a fragment of $(\Sigma_0, \mathcal{R}_0)$, $t \in \Lambda(\Sigma_1)$ and $t \mapsto_0 u$, then $t \mapsto_1 u$ and $u \in \Lambda(\Sigma_1)$.

*Proof.* By induction on the position where the rule is applied. We only detail the case of a top reduction, the other cases easily follow by induction hypothesis.

So, let $\ell \mapsto r$ be the rule used to rewrite $t$ in $u$ and $\theta$ such that $t = \theta\ell$ and $u = \theta r$. As $t \in \Lambda(\Sigma_1)$, we have $\ell \in \Lambda(\Sigma_1)$ and, for all $x$ free in $\ell$, $\theta x \in \Lambda(\Sigma_1)$. Thus, as $(\Sigma_1, \mathcal{R}_1)$ is a fragment of $(\Sigma_0, \mathcal{R}_0)$, $r \in \Lambda(\Sigma_1)$ and $\ell \mapsto r \in \mathcal{R}_1$. Therefore $t \mapsto_1 u$ and $u = \theta r \in \Lambda(\Sigma_1)$. $\square$

**Lemma 4.3 (Preservation of confluence).** Every fragment of a confluent system is confluent.

*Proof.* Let $(\Sigma_1, \mathcal{R}_1)$ be a fragment of a confluent system $(\Sigma_0, \mathcal{R}_0)$. We prove that $\mapsto_1$ is confluent on $\Lambda(\Sigma_1)$. Assume that $t, u, v \in \Lambda(\Sigma_1)$, $t \mapsto_1^* u$ and $t \mapsto_1^* v$. Since $|\Sigma_1| \subseteq |\Sigma_0|$, we have $t, u, v \in \Lambda(\Sigma_0)$. Since $\mathcal{R}_1 \subseteq \mathcal{R}_0$, we have $t \mapsto_0^* u$ and $t \mapsto_0^* v$. By confluence of $\mapsto_0$ on $\Lambda(\Sigma_0)$, there exists a $w$ in $\Lambda(\Sigma_0)$ such that $u \mapsto_0^* w$ and $v \mapsto_0^* w$. Since $u, v \in \Lambda(\Sigma_1)$, by Lemma 4.2, $w \in \Lambda(\Sigma_1)$, $u \mapsto_1^* w$ and $v \mapsto_1^* w$. $\square$

**Definition 4.4 (Sub-theory).** A system $(\Sigma_1, \mathcal{R}_1)$ is a sub-theory of a theory $(\Sigma_0, \mathcal{R}_0)$, if it is a fragment of $(\Sigma_0, \mathcal{R}_0)$ and it is a theory.

As we already know that $\mathcal{R}_1$ is confluent, this amounts to say that each rule of $\mathcal{R}_1$ preserves typing in $(\Sigma_1, \mathcal{R}_1)$.

### 4.2. The fragment theorem.

**Theorem 4.5.** Let $(\Sigma_0, \mathcal{R}_0)$ be a confluent system and $(\Sigma_1, \mathcal{R}_1)$ be a sub-theory of $(\Sigma_0, \mathcal{R}_0)$.

* If the judgement $\Gamma \vdash_0 t : D$ is derivable, $\Gamma \in \Lambda(\Sigma_1)$ and $t \in \Lambda(\Sigma_1)$, then there exists $D' \in \Lambda(\Sigma_1)$ such that $D \mapsto_0^* D'$ and the judgement $\Gamma \vdash_1 t : D'$ is derivable.

* If the judgement $\Gamma \vdash_0 \Gamma$ well-formed is derivable and $\Gamma \in \Lambda(\Sigma_1)$, then the judgement $\vdash_1 \Gamma$ well-formed is derivable.
*Proof.* By mutual induction on the derivations, and by case analysis on the last typing rule. Before detailing each case, note that the most difficult cases are (abs), (app), and (conv), the other cases are a simple application of the induction hypothesis.

* If the last rule of the derivation is

$$ \frac{\Gamma \vdash_0 A : \mathbf{TYPE} \quad \Gamma, x : A \vdash_0 B : s \quad \Gamma, x : A \vdash_0 t : B}{\Gamma \vdash_0 \lambda x : A, t : \Pi x : A, B} \quad (\text{abs}) $$

as $\Gamma$, $A$, and $t$ are in $\Lambda(\Sigma_1)$, by induction hypothesis, there exists $A'$ in $\Lambda(\Sigma_1)$ such that $\mathbf{TYPE} \hookrightarrow_0^* A'$ and $\Gamma \vdash_1 A : A'$ is derivable, and there exists $B'$ in $\Lambda(\Sigma_1)$ such that $B \hookrightarrow_0^* B'$ and $\Gamma, x : A \vdash_1 t : B'$ is derivable. As $\mathbf{TYPE}$ is a sort, $A' = \mathbf{TYPE}$. Therefore, $\Gamma \vdash_1 A : \mathbf{TYPE}$ is derivable.

As $B$ is typable and every subterm of a typable term is typable, KIND does not occur in $B$. As $B \hookrightarrow_0^* B'$ and no rule contains KIND, KIND does not occur in $B'$ as well. Hence, $B' \neq \text{KIND}$. By Lemma 2.2, as $\Gamma, x : A \vdash_1 t : B'$ is derivable and $B' \neq \text{KIND}$, there exists a sort $s'$ such that $\Gamma, x : A \vdash_1 B' : s'$ is derivable.

Thus, by the rule (abs), $\Gamma \vdash_1 \lambda x : A, t : \Pi x : A, B'$ is derivable. So there is $D' = \Pi x : A, B'$ in $\Lambda(\Sigma_1)$ such that $\Pi x : A, B \hookrightarrow_0^* D'$ and $\Gamma \vdash_1 \lambda x : A, t : D'$ is derivable.

* If the last rule of the derivation is

$$ \frac{\Gamma \vdash_0 t : \Pi x : A, B \quad \Gamma \vdash_0 u : A}{\Gamma \vdash_0 t u : (u/x)B} \quad (\text{app}) $$

as $\Gamma, t$, and $u$ are in $\Lambda(\Sigma_1)$, by induction hypothesis, there exist $C$ and $A_2$ in $\Lambda(\Sigma_1)$, such that $\Pi x : A, B \hookrightarrow_0^* C$, $\Gamma \vdash_1 t : C$ is derivable, $A \hookrightarrow_0^* A_2$, and $\Gamma \vdash_1 u : A_2$ is derivable. As $\Pi x : A, B \hookrightarrow_0^* C$ and rewriting rules are of the form $(c l_1 \dots l_n \hookrightarrow r)$, there exist $A_1$ and $B_1$ in $\Lambda(\Sigma_1)$ such that $C = \Pi x : A_1, B_1$, $A \hookrightarrow_0^* A_1$, and $B \hookrightarrow_0^* B_1$. By confluence of $\hookrightarrow_0$, there exists $A'$ such that $A_1 \hookrightarrow_0^* A'$ and $A_2 \hookrightarrow_0^* A'$. By Lemma 4.2, as $A_1 \in \Lambda(\Sigma_1)$ and $A_1 \hookrightarrow_0^* A'$, we have $A' \in \Lambda(\Sigma_1)$ and $A_1 \hookrightarrow_1^* A'$. In a similar way, as $A_2 \in \Lambda(\Sigma_1)$ and $A_2 \hookrightarrow_0^* A'$, we have $A_2 \hookrightarrow_1^* A'$. By Lemma 2.2, as $\Gamma \vdash_1 t : \Pi x : A_1, B_1$ is derivable and $\Pi x : A_1, B_1 \neq \text{KIND}$, there exists a sort $s$ such that $\Gamma \vdash_1 \Pi x : A_1, B_1 : s$ is derivable. Thus, by Lemma 2.2, $\Gamma \vdash_1 A_1 : \mathbf{TYPE}$ is derivable.

As $\Gamma \vdash_1 \Pi x : A_1, B_1 : s$, $\Pi x : A_1, B_1 \hookrightarrow_1^* \Pi x : A', B_1$, and $(\Sigma_1, \mathcal{R}_1)$ preserves typing, $\Gamma \vdash_1 \Pi x : A', B_1 : s$ is derivable. In a similar way, as $\Gamma \vdash_1 A_1 : \mathbf{TYPE}$ is derivable, and $A_1 \hookrightarrow_1^* A'$, $\Gamma \vdash_1 A' : \mathbf{TYPE}$ is derivable. Therefore, by the rule (conv), $\Gamma \vdash_1 t : \Pi x : A', B_1$ and $\Gamma \vdash_1 u : A'$ are derivable. Therefore, by the rule (app), $\Gamma \vdash_1 t u : (u/x)B_1$ is derivable. So there exists $D' = (u/x)B_1$ in $\Lambda(\Sigma_1)$, such that $(u/x)B \hookrightarrow_0^* D'$ and $\Gamma \vdash_1 t u : D'$ is derivable.

* If the last rule of the derivation is

$$ \frac{\Gamma \vdash_0 t : A \quad \Gamma \vdash_0 B : s}{\Gamma \vdash_0 t : B} \quad (\text{conv}) \quad A \equiv_{\beta \mathcal{R}_0} B $$

as $\Gamma$ and $t$ are in $\Lambda(\Sigma_1)$, by induction hypothesis, there exists $A'$ in $\Lambda(\Sigma_1)$ such that $A \hookrightarrow_0^* A'$ and $\Gamma \vdash_1 t : A'$ is derivable. By confluence of $\hookrightarrow_0$, there exists $C$ such that $A' \hookrightarrow_0^* C$ and $B \hookrightarrow_0^* C$. As $A' \in \Lambda(\Sigma_1)$ and $A' \hookrightarrow_0^* C$ we have, by Lemma 4.2, $C \in \Lambda(\Sigma_1)$ and $A' \hookrightarrow_1^* C$.

As $B$ is typable and every subterm of a typable term is typable, KIND does not occur in $B$. As $B \hookrightarrow_0^* C$ and no rule contains KIND, KIND does not occur in $C$ as well. Thus $C \neq \text{KIND}$. As $A' \hookrightarrow_0^* C$, $A' \neq \text{KIND}$. By Lemma 2.2, as $\Gamma \vdash_1 t : A'$ and $A' \neq \text{KIND}$, there exists a sort $s'$ such that $\Gamma \vdash_1 A' : s'$ is derivable. Thus, as $A' \hookrightarrow_1^* C$, and $(\Sigma_1, \mathcal{R}_1)$
preserves typing, $\Gamma \vdash_1 C : s'$ is derivable. a As $\Gamma \vdash_1 t : A'$ and $\Gamma \vdash_1 C : s'$ are derivable and $A' \to_1 C$, by the rule (conv), $\Gamma \vdash_1 t : C$ is derivable. Thus there exists $D' = C$ in $\Lambda(\Sigma_1)$ such that $\Gamma \vdash_1 t : D'$ is derivable and $B \to_0^* D'$.

* If the last rule of the derivation is

$$ \vdash_0 [] \text{ well-formed} \quad (\text{empty}) $$

by the rule (empty), $\vdash_1 []$ well-formed is derivable.

* If the last rule of the derivation is

$$ \frac{\Gamma \vdash_0 A : s}{\vdash_0 \Gamma, x : A \text{ well-formed}} \quad (\text{decl}) $$

as $\Gamma$ and $A$ are in $\Lambda(\Sigma_1)$, by induction hypothesis, there exist $A'$ in $\Lambda(\Sigma_1)$ such that $s \to_0^* A'$ and $\Gamma \vdash_1 A : A'$ is derivable. As $s$ is a sort, $A' = s$. Therefore, $\Gamma \vdash_1 A : s$ is derivable and, by the rule (decl), $\vdash_1 \Gamma, x : A$ well-formed is derivable.

* If the last rule of the derivation is

$$ \frac{\vdash_0 \Gamma \text{ well-formed}}{\Gamma \vdash_0 \text{ TYPE : KIND}} \quad (\text{sort}) $$

as $\Gamma$ is in $\Lambda(\Sigma_1)$, by induction hypothesis, $\vdash_1 \Gamma$ well-formed is derivable. Thus, by the rule (sort), $\Gamma \vdash_1 \text{ TYPE : KIND}$ is derivable. So there exists $D' = \text{ KIND}$ in $\Lambda(\Sigma_1)$ such that $\text{ KIND} \to_0^* D'$ and $\Gamma \vdash_1 \text{ TYPE : D'}$.

* If the last rule of the derivation is

$$ \frac{\vdash_0 \Gamma \text{ well-formed} \quad \vdash_0 A : s}{\Gamma \vdash_0 c : A} \quad (\text{const}) \quad c : A \in \Sigma_0 $$

as $\Gamma$ is in $\Lambda(\Sigma_1)$, by induction hypothesis, $\vdash_1 \Gamma$ well-formed is derivable. And as $c$ is in $\Lambda(\Sigma_1)$, it is in $|\Sigma_1|$, thus $c : A$ is in $\Sigma_1$ and, since $(\Sigma_1, \mathcal{R}_1)$ is a fragment of $(\Sigma_0, \mathcal{R}_0)$, $A \in \Lambda(\Sigma_1)$.

Thus, by induction hypothesis, there exists $A'$ such that $\vdash_1 A : A'$ is derivable and $s \to_0^* A'$. As $s$ is a sort, $A' = s$. So $\vdash_1 A : s$ is derivable. Thus, by the rule (const), $\Gamma \vdash_1 c : A$ is derivable. So, there exists $D' = A$ in $\Lambda(\Sigma_1)$ such that $A \to_0^* D'$ and $\Gamma \vdash_1 c : D'$ is derivable.

* If the last rule of the derivation is

$$ \frac{\vdash_0 \Gamma \text{ well-formed}}{\Gamma \vdash_0 x : A} \quad (\text{var}) \quad x : A \in \Gamma $$

as $\Gamma$ is in $\Lambda(\Sigma_1)$, by induction hypothesis, $\vdash_1 \Gamma$ well-formed is derivable. Thus, by the rule (var), $\Gamma \vdash_1 x : A$ is derivable. So there exists $D' = A$ in $\Lambda(\Sigma_1)$ such that $A \to_0^* D'$ and $\Gamma \vdash_1 x : D'$.

* If the last rule of the derivation is

$$ \frac{\Gamma \vdash_0 A : \text{TYPE} \quad \Gamma, x : A \vdash_0 B : s}{\Gamma \vdash_0 \Pi x : A, B : s} \quad (\text{prod}) $$

as $\Gamma$, $A$, and $B$ are in $\Lambda(\Sigma_1)$, by induction hypothesis, there exists $A'$ in $\Lambda(\Sigma_1)$ such that $\text{TYPE} \to_0^* A'$ and $\Gamma \vdash_1 A : A'$ is derivable and there exists $B'$ in $\Lambda(\Sigma_1)$ such that $s \to_0^* B'$ and $\Gamma, x : A \vdash_1 B : B'$ is derivable. As $\text{TYPE}$ and $s$ are sorts, $A' = \text{TYPE}$ and $B' = s$. Therefore, $\Gamma \vdash_1 A : \text{TYPE}$ and $\Gamma, x : A \vdash_1 B : s$ are derivable. Thus, by the rule (prod), $\Gamma \vdash_1 \Pi x : A, B : s$ is derivable. So there exists $D' = s$ in $\Lambda(\Sigma_1)$ such that $s \to_0^* D'$ and $\Gamma \vdash_1 \Pi x : A, B : D'$ is derivable. $\square$
**Corollary 4.6.** Let $(\Sigma_0, \mathcal{R}_0)$ be a confluent system, $(\Sigma_1, \mathcal{R}_1)$ be a sub-theory of $(\Sigma_0, \mathcal{R}_0)$.
If $\Gamma \vdash_0 t : D$, $\Gamma \in \Lambda(\Sigma_1)$, $t \in \Lambda(\Sigma_1)$, and $D \in \Lambda(\Sigma_1)$, then $\Gamma \vdash_1 t : D$.

In particular, if $(\Sigma_0, \mathcal{R}_0)$ is a theory, $(\Sigma_1, \mathcal{R}_1)$ is a sub-theory of $(\Sigma_0, \mathcal{R}_0)$, $\Gamma \vdash_0 t : D$, $\Gamma \in \Lambda(\Sigma_1)$, $t \in \Lambda(\Sigma_1)$, and $D \in \Lambda(\Sigma_1)$, then $\Gamma \vdash_1 t : D$.

*Proof.* There is a $D' \in \Lambda(\Sigma_1)$ such that $D \stackrel{*}{\to}_0 D'$ and $\Gamma \vdash_1 t : D'$. As $D \in \Lambda(\Sigma_1)$ and $D \stackrel{*}{\to}_0 D'$. By Lemma 4.2 we have $D \stackrel{*}{\to}_1 D'$, and we conclude with the rule (conv). □

**Theorem 4.7 (Sub-theories of $\mathcal{U}$).** Every fragment $(\Sigma_1, \mathcal{R}_1)$ of $\mathcal{U}$ (including $\mathcal{U}$ itself) is a theory, that is, is confluent and preserves typing.

*Proof.* The relation $\stackrel{\beta}{\to}_{\mathcal{R}_{\mathcal{U}}}$ is confluent on $\Lambda(\Sigma_{\mathcal{U}})$ since it is an orthogonal combinatory reduction system [KvOvR93]. Hence, after the fragment theorem, it is sufficient to prove that every rule of $\mathcal{R}_{\mathcal{U}}$ preserves typing in any fragment $(\Sigma_1, \mathcal{R}_1)$ containing the symbols of the rule.

To this end, we will use the criterion described in [Bla20, Theorem 19] which consists in computing the equations that must be satisfied for a rule left-hand side to be typable, which are system-independent, and then check that the right-hand side has the same type modulo these equations in the desired system: for all rules $l \stackrel{\leftrightarrow}{\to} r \in \Lambda(\Sigma_1)$, sets of equations $\mathcal{E}$ and terms $T$, if the inferred type of $l$ is $T$, the typability constraints of $l$ are $\mathcal{E}$, and $r$ has type $T$ in the system $\Lambda(\Sigma_1)$ whose conversion relation $\equiv_{\beta\mathcal{R}\mathcal{E}}$ has been enriched with $\mathcal{E}$, then $l \stackrel{\leftrightarrow}{\to} r$ preserves typing in $\Lambda(\Sigma_1)$.

This criterion can easily be checked for all the rules but (*pred*-red2) and (*fst*-red) because, except in those two cases, the left-hand side and the right-hand side have the same type.

In (*pred*-red2), *pred* (*succ* $x$) $\stackrel{\leftrightarrow}{\to} x$, the left-hand side has type *I* if the equation *type*($x$) = *I* is satisfied. Modulo this equation, the right-hand side has type *I* in any fragment containing the symbols of the rule.

In (*fst*-red), *fst* $t$ *p* (*pair*$^\dagger$ $t'$ $p'$ *m*) $\stackrel{\leftrightarrow}{\to} *m$, the left-hand side has type *El* $t$ if *type*($t$) = *Set*, *type*(*p*) = *El* $t \to$ *Prop*, *El* (*psub* $t' p'$) = *El* (*psub* $t$ *p*), *type*($t'$) = *Set*, *type*(*p')* = *El* $t' \to$ *Prop*, and *type*(*m*) = *El* $t'$. But, in $\mathcal{U}$, there is no rule of the form *El* (*psub* $t$ *p*) $\stackrel{\leftrightarrow}{\to} *r$. Hence, by confluence, the equation *El* (*psub* $t' p'$) = *El* (*psub* $t$ *p*) is equivalent to the equations $t' = t$ and $p' = *p$. Therefore, the right-hand side is of type *El* $t$ in every fragment of $\mathcal{U}$ containing the symbols of the rule. □

## 5. EXAMPLES OF SUB-THEORIES OF THE THEORY $\mathcal{U}$

We finally identify 15 sub-theories of the theory $\mathcal{U}$, that correspond to known theories. For each of these sub-theories $(\Sigma_S, \mathcal{R}_S)$, according to the Corollary 4.6, if $\Gamma$, $t$, and $A$ are in $\Lambda(\Sigma_S)$, and $\Gamma \vdash_{\Sigma_{\mathcal{U}}, \mathcal{R}_{\mathcal{U}}} t : A$, then $\Gamma \vdash_{\mathcal{R}_S, \Sigma_S} t : A$.
<figure><img src="image_4.png" /><figcaption>Figure 2: **The wind rose.** In black: Minimal, Constructive, and Ecumenical predicate logic. In orange: Minimal, Constructive, and Ecumenical simple type theory. In green: Simple type theory with prenex polymorphism. In blue: Simple type theory with predicate subtyping. In cyan: Simple type theory with predicate subtyping and prenex polymorphism. In pink: the Calculus of constructions with a constant $ι$, without and with prenex polymorphism.</figcaption></figure>

### 5.1. Minimal predicate logic.
The 8 axioms (I), (Set), (El), ($ι$), (Prop), (Prf), ($⇒$), and ($∀$) define Minimal predicate logic ($Σ_M, R_M$).

I : TYPE
Set : TYPE
El : Set → TYPE
ι : Set
El ι ↪ → I
Prop : TYPE
Prf : Prop → TYPE
⇒ : Prop → Prop → Prop
Prf (x ⇒ y) ↪ → Prf x → Prf y
∀ : Πx : Set, (El x → Prop) → Prop
Prf (∀ x p) ↪ → Πz : El x, Prf (p z)

We could save the declaration (I-decl) and the rule ($ι$-red) by using `El ι` instead of `I`.

This theory can be proven equivalent to more common formulations of Minimal predicate logic. To do so, consider a language $\mathcal{L}$ in predicate logic. We define a corresponding $λΠ/≡$ context $Γ_\mathcal{L}$ containing for each constant $f$ of $\mathcal{L}$ a constant $f$ of type $I \to \dots \to I \to I$ and for each predicate symbol $P$ of $\mathcal{L}$ a constant $P$ of type $I \to \dots \to I \to \text{Prop}$. A term (resp. a proposition) of minimal predicate logic $t$ of $\mathcal{L}$ translates in the natural way to a $λΠ/≡$ term of type $I$ (resp. $\text{Prop}$) in the theory ($Σ_M, R_M$) and in the context $Γ_\mathcal{L}, \Delta$, where $\Delta$ contains, for each variable $x$ free in $t$, a variable $x$ of type $I$. We use the same notation for the term (resp. the proposition) and its translation.
**Theorem 5.1.** Let $\mathcal{L}$ be a language and $A_1, ..., A_n \vdash B$ be a sequent of minimal predicate logic in $\mathcal{L}$. Let $\Gamma_\mathcal{L}$ containing for each constant $f$ of $\mathcal{L}$ a constant $f$ of type $I \to \dots \to I \to I$ and for each predicate symbol $P$ of $\mathcal{L}$ a constant $P$ of type $I \to \dots \to I \to \text{Prop}$. Let $\Delta$ be a context containing for each variable $x$ free in $A_1, ..., A_n \vdash B$, a variable $x$ of type $I$. Let $\Delta'$ be a context containing, for each hypothesis $A_i$, a variable $a_i$ of type $\text{Prf } A_i$.

Then, the sequent $A_1, ..., A_n \vdash B$ has a proof in minimal logic, if and only if there exists a $\lambda\Pi/\equiv$ term $\pi$ such that $\Gamma_\mathcal{L}, \Delta, \Delta' \vdash_{\Sigma_M, \mathcal{R}_M} \pi : \text{Prf } B$.

*Proof.* The left-to-right implication is a trivial induction on the structure of the proof.

For the converse, it is enough to consider an irreducible term $\pi$ of type $\text{Prf } B$ since one can prove that $\leftrightarrow_{\beta\mathcal{R}_M}$ terminates, by applying [BGH19] for instance. We then prove, by induction on $\pi$, that the sequent $A_1, ..., A_n \vdash B$ has a proof in minimal logic. As $\pi$ has the type $\text{Prf } B$, it is neither a sort, nor a product, thus it is either an abstraction or a term of the form $z \rho_1 ... \rho_p$.

* If $\pi$ is an abstraction then $\text{Prf } B$ is equivalent to a product. Hence, $B$ either has the form $C \Rightarrow D$ or $\forall \iota \lambda x : I, D$. In the first case $\pi = \lambda x : \text{Prf } C, \pi'$ and $\pi'$ is a term of type $\text{Prf } D$ in $\Gamma_\mathcal{L}, \Delta, \Delta', x : \text{Prf } C$. By induction hypothesis, the sequent $A_1, ..., A_n, C \vdash D$ has a proof and so does the sequent $A_1, ..., A_n \vdash C \Rightarrow D$. In the second $\pi = \lambda x : I, \pi'$ and $\pi'$ is a term of type $\text{Prf } D$ in $\Gamma_\mathcal{L}, \Delta, x : I, \Delta'$. By induction hypothesis, the sequent $A_1, ..., A_n \vdash D$ has a proof and so does the sequent $A_1, ..., A_n \vdash \forall \iota \lambda x : I, D$.

* If $\pi$ has the form $z \rho_1 ... \rho_p$, then as it has the type $\text{Prf } B$, $z$ can neither be a constant of $\Sigma_M$, nor a variable of $\Gamma_\mathcal{L}, \Delta$. Hence, it is a variable of $\Delta'$. Thus, it has the type $\text{Prf } A_i$ for some $i$. We prove, by induction on $j$ that the term $z \rho_1 ... \rho_j$ has the type $\text{Prf } C$ for some proposition $C$, such that the sequent $A_1, ..., A_n \vdash C$ has a proof. For $j = 0$, the sequent $A_1, ..., A_n \vdash A_i$ has a proof. Assume the property holds for $j$. Then, as the term $z \rho_1 ... \rho_j \rho_{j+1}$ is well typed, the type $\text{Prf } C$ is a product type and $C$ either has the form $D \Rightarrow E$ or $\forall \iota \lambda x : I, E$. In the first case $\rho_{j+1}$ is a term of type $\text{Prf } D$, by induction hypothesis, the sequent $A_1, ..., A_n \vdash D$ has a proof, hence the term $z \rho_1 ... \rho_j \rho_{j+1}$ has the type $\text{Prf } E$ and the sequent $A_1, ..., A_n \vdash E$ has a proof. In the second case, $\rho_{j+1}$ is an irreducible term of type $I$, thus it is an object-term, the term $z \rho_1 ... \rho_j \rho_{j+1}$ has the type $\text{Prf } (\rho_{j+1}/x)E$, and the sequent $A_1, ..., A_n \vdash (\rho_{j+1}/x)E$ has a proof. $\square$

As Minimal predicate logic is itself a logical framework, it must be complemented with more axioms, such as the axioms of geometry, arithmetic, etc.

**5.2. Constructive predicate logic.** The 14 axioms $(I), (\text{Set}), (\text{El}), (\iota), (\text{Prop}), (\text{Prf}), (\Rightarrow), (\forall), (\top), (\bot), (\neg), (\wedge), (\vee)$, and $(\exists)$ define Constructive predicate logic. This theory can be proven equivalent to more common formulations of Constructive predicate logic [Dor10, ABC$^{+}$16].

**5.3. Ecumenical predicate logic.** The 20 axioms $(I), (\text{Set}), (\text{El}), (\iota), (\text{Prop}), (\text{Prf}), (\Rightarrow), (\forall), (\top), (\bot), (\neg), (\wedge), (\vee), (\exists), (\text{Prf}_c), (\Rightarrow_c), (\wedge_c), (\vee_c), (\forall_c)$, and $(\exists_c)$ define Ecumenical predicate logic. This theory can be proven equivalent to more common formulations of Ecumenical predicate logic [Gri21].

Note that classical predicate logic is not a sub-theory of the theory $\mathcal{U}$, because the classical connectives and quantifiers depend on the constructive ones. Yet, it is known that if
a proposition contains only classical connectives and quantifiers, it is provable in Ecumenical predicate logic if and only if it is provable in classical predicate logic.

### 5.4. Minimal simple type theory.
Adding the two axioms (*o*) and (*✓*) to Predicate logic defines Simple type theory. Indeed, Simple type theory is the theory of propositional contents and functions. A simple type *T* is naturally translated to λΠ/≡ as a term *T* of type *Set*, using types *ι* and *o* and the arrow construction *✓*. The higher order terms are shallowly translated: λ-abstractions and applications are translated using respectively λΠ/≡'s λ-abstractions and applications.

The 10 axioms (*I*), (*Set*), (*ι*), (*El*), (*Prop*), (*Prf*), (⇒), (∀), (*o*), and (*✓*) define Minimal simple type theory. And this theory can be proven equivalent to more common formulations of Minimal simple type theory [Ass15, ABC⁺16]. Just like we can save the declaration (*I*-decl) and the rule (*ι*-red) by replacing everywhere *I* with *El* *ι*, we could save the declaration (*Prop*-decl) and the rule (*o*-red) by replacing everywhere *Prop* with *El* *o*. This presentation is the usual presentation of Simple type theory in λΠ/≡ [ABC⁺16] with 8 declarations and 3 reduction rules. However, doing so, the obtained presentation of Simple type theory is not an extension of Minimal predicate logic anymore.

### 5.5. Constructive simple type theory.
The 16 axioms (*I*), (*Set*), (*El*), (*ι*), (*Prop*), (*Prf*), (⇒), (∀), (⊤), (⊥), (¬), (∧), (∨), (∃), (*o*) and (*✓*) define Constructive simple type theory.

### 5.6. Ecumenical simple type theory.
The 22 axioms (*I*), (*Set*), (*El*), (*ι*), (*Prop*), (*Prf*), (⇒), (∀), (⊤), (⊥), (¬), (∧), (∨), (∃), (*Prf*<sub>c</sub>), (⇒<sub>c</sub>), (∧<sub>c</sub>), (∨<sub>c</sub>), (∀<sub>c</sub>), (∃<sub>c</sub>), (*o*) and (*✓*) define Ecumenical simple type theory. And this theory can be proven equivalent to more common formulations of Ecumenical simple type theory [Gri21].

### 5.7. Simple type theory with predicate subtyping.
Adding to the 10 axioms of Minimal simple type theory the 5 axioms of predicate subtyping yields Minimal simple type theory with predicate subtyping, formed with the 15 axioms (*I*), (*Set*), (*ι*), (*El*), (*Prop*), (*Prf*), (⇒), (∀), (*o*), (*✓*), (*psub*), (*pair*), (*pair*<sup>†</sup>), (*fst*), and (*snd*). This theory has been studied by F. Gilbert [Gil18] as a verifiable language for a minimal and idealised version of the type system of the PVS proof assistant. It can be proven equivalent to more common formulations of Minimal simple type theory with predicate subtyping [Gil18, BH21]. Such formulations like PVS [OS97] often use predicate subtyping implicitly to provide a lighter syntax without (*pair*), (*pair*<sup>†</sup>), (*fst*) nor (*snd*) but at the expense of losing uniqueness of type and making type-checking undecidable. In these cases, terms generally do not hold the proofs needed to be of a sub-type, which provides proof irrelevance. Our implementation of proof irrelevance of Section 3.14 extends the conversion in order to ignore these proofs.

### 5.8. Simple type theory with prenex predictive polymorphism.
Adding to the 10 axioms of Minimal simple type theory the 5 axioms of prenex predictive polymorphism yields Simple type theory with prenex predictive polymorphism (STT∀) [Thi18, Thi20] formed with the 15 axioms (*I*), (*Set*), (*El*), (*ι*), (*Prop*), (*Prf*), (⇒), (∀), (*o*), (*✓*), (*Scheme*), (*Els*), (↑), (∨), and (∧).
### 5.9. Simple type theory with predicate subtyping and prenex polymorphism.
Adding to the 10 axioms of Minimal simple type theory both the 5 axioms of predicate subtyping and the 5 axioms of prenex polymorphism yields a sub-theory with 20 axioms which is a subsystem of PVS [OS97] handling both predicate subtyping and prenex polymorphism.

### 5.10. The Calculus of constructions.
Pure type systems [Ber88, Ter89, Bar92] are a family of typed λ-calculi. An example is the λΠ-calculus, the λ-calculus with dependent types, which is at the basis of λΠ/≡ itself. As we have seen, in λΠ/≡, we have two constants, TYPE and KIND, TYPE has type KIND, and we can build a product type Πx: A, B when both A and B have type TYPE, in which case the product type Πx: A, B itself has type TYPE or when A has type TYPE and B has type KIND, in which case the result has type KIND.

A Pure type system, in general, is defined with a set of symbols, such as TYPE and KIND, called “sorts”, a set of axioms of the form ⟨s₁, s₂⟩, expressing that the sort s₁ has type s₂, for example ⟨TYPE, KIND⟩, and a set of rules of the form ⟨s₁, s₂, s₃⟩, expressing that we can build the product type Πx: A, B, when A has type s₁ and B has type s₂, and that the product type itself has type s₃, for example ⟨TYPE, TYPE, TYPE⟩ and ⟨TYPE, KIND, KIND⟩. When the set of axioms is functional, each sort has at most one type and when the set of rules is functional, each product type has at most one type. In this case the Pure type system is said to be “functional”.

To have more compact notation, we often write * for the sort TYPE and □ for the sort KIND. So the λΠ-calculus is defined with the sorts * and □, the axiom ⟨*, □⟩, and the rules ⟨*, *, *⟩ and ⟨*, □, □⟩. Adding the rules ⟨□, *, *⟩ and ⟨□, □, □⟩ yields the Calculus of constructions [CH88].

All functional Pure type systems can be expressed in λΠ/≡ [CD07]: for each sorts s, we introduce two constants $U_s$ of type TYPE and $\varepsilon_s$ of type $U_s \to$ TYPE, for each axiom $\langle s_1, s_2 \rangle$, a constant $\dot{s}_1$ of type $U_{s2}$, and a reduction rule

$$ \varepsilon_{s_2} \dot{s}_1 \hookrightarrow U_{s_1} $$

and for each rule $\langle s_1, s_2, s_3 \rangle$, a constant $\dot{\Pi}_{\langle s_1, s_2, s_3 \rangle}$ of type $\Pi x: U_{s_1}, (\varepsilon_{s_1} x \to U_{s_2}) \to U_{s_3}$ and a reduction rule

$$ \varepsilon_{s_3} (\dot{\Pi}_{\langle s_1, s_2, s_3 \rangle} x y) \hookrightarrow \Pi z: \varepsilon_{s_1} x, \varepsilon_{s_2} (y z) $$

We obtain this way a correct and conservative expression of the Pure type system [CD07, ABC$^+$16]. For instance, the expression of the Calculus of constructions yields 9 declarations and 5 rules. Writing *Prop* for $U_*$, *Prf* for $\varepsilon_*$, *Set* for $U_\square$, *El* for $\varepsilon_\square$, *o* for $\dot*$, $\Rightarrow_d$ for $\dot{\Pi}_{\langle*,*,*\rangle}$, $\forall$ for $\dot{\Pi}_{\langle\square,*,*\rangle}$, $\pi$ for $\dot{\Pi}_{\langle*,\square,\square\rangle}$, and $\rightsquigarrow_d$ for $\dot{\Pi}_{\langle\square,\square,\square\rangle}$ we get exactly the 9 axioms (*Prop*), (*Prf*), (*Set*), (*El*), (*o*), ($\Rightarrow_d$), ($\pi$), ($\forall$), and ($\rightsquigarrow_d$) and this theory is equivalent to more common formulations of the Calculus of constructions.

As $\Rightarrow_d$ is $\dot{\Pi}_{\langle*,*,*\rangle}$, $\forall$ is $\dot{\Pi}_{\langle\square,*,*\rangle}$, $\pi$ is $\dot{\Pi}_{\langle*,\square,\square\rangle}$, and $\rightsquigarrow_d$ is $\dot{\Pi}_{\langle\square,\square,\square\rangle}$, using the terminology of Barendregt's λ-cube [Bar92], the axiom ($\pi$) expresses dependent types, the axiom ($\forall$) polymorphism, and the axiom ($\rightsquigarrow_d$) type constructors.

Note that these constants have similar types

$$ \Rightarrow_d : \Pi x : \mathit{Prop}, (\mathit{Prf} x \to \mathit{Prop}) \to \mathit{Prop} $$

$$ \pi : \Pi x : \mathit{Prop}, (\mathit{Prf} x \to \mathit{Set}) \to \mathit{Set} $$

$$ \forall : \Pi x : \mathit{Set}, (\mathit{El} x \to \mathit{Prop}) \to \mathit{Prop} $$

$$ \rightsquigarrow_d : \Pi x : \mathit{Set}, (\mathit{El} x \to \mathit{Set}) \to \mathit{Set} $$
So if $\Gamma$ is a context and $A$ is a term in the Calculus of constructions then $A$ is inhabited in $\Gamma$ in the Calculus of constructions if and only if the translation $\|A\|$ of $A$ in $\lambda\Pi/\equiv$ is inhabited in the translation $\|\Gamma\|$ of $\Gamma$ in $\lambda\Pi/\equiv$ [CD07, ABC$^+$16]. So, the formulation of the Calculus of constructions in $\lambda\Pi/\equiv$ is a conservative extension of the original formulation of the Calculus of constructions. In the context $\|\Gamma\|$, variables have a $\lambda\Pi/\equiv$ type of the form $\mathit{Prf} u$ or $\mathit{El} u$, and none of them can have the type $\mathit{Set}$. However, in $\lambda\Pi/\equiv$, nothing prevents from declaring a variable of type $\mathit{Set}$. Hence, in $\lambda\Pi/\equiv$, the judgement $x : \mathit{Set} \vdash x : \mathit{Set}$ can be derived, but it is not in the image of the encoding.

**5.11. The Calculus of constructions with variables of type $\square$**. To allow the declaration of variables of type $\square$ in the Calculus of constructions, a possibility is to add a sort $\Delta$ and an axiom $\square : \Delta$ [Geu95], making the sort $\Delta$ a singleton sort that contains only one closed irreducible term: $\square$.

Expressing this Pure type system in $\lambda\Pi/\equiv$ introduces two declarations for the sort $\Delta$ and one declaration and one rule for the axiom $\square : \Delta$:

* $U_\Delta : \text{TYPE}$

* $\varepsilon_\Delta : U_\Delta \to \text{TYPE}$

* $\sqcap : U_\Delta$

* $\varepsilon_\Delta \sqcap \to \mathit{Set}$

and the variables in a context $\|\Gamma\|$ now have the type $\mathit{Prf} u$, $\mathit{El} u$, or $\varepsilon_\Delta u$. Just like $U_*$ is written $\mathit{Prop}$ in $U$, $U_\Delta$ is written $\mathit{Set}1$, $\varepsilon_\Delta$ is written $\mathit{Ty}$, and $\sqcap$ is written $\mathit{set}$.

But this theory can be simplified. Indeed, just like $\square$ is the only closed irreducible term of type $\Delta$, $\mathit{set}$ is the only closed irreducible term of type $\mathit{Set}1$ and thus for any closed term $t$ of type $\mathit{Set}1$, the term $\mathit{Ty} t$ reduces to $\mathit{Set}$. So, we can replace everywhere the terms of the form $\mathit{Ty} t$ with $\mathit{Set}$ and drop the symbols $\mathit{Ty}$ and $\mathit{set}$ and the rule $\mathit{Ty} \mathit{set} \to \mathit{Set}$. Then, we can drop the symbol $\mathit{Set}1$ as well.

So the only difference with the Calculus of constructions without $\Delta$ is that translations of contexts now contain variables of type $\mathit{Set}$, that translate the variables of type $\square$.

**5.12. The Calculus of constructions with a constant $\iota : \square$**. Adding the axiom ($\iota$) to the Calculus of constructions yields a sub-theory with the 10 axioms (*Set*), (*El*), ($\iota$), (*Prop*), (*Prf*), ($\Rightarrow_d$), ($\forall$), (*o*), ($\rightsquigarrow_d$), and ($\pi$). It corresponds to the Calculus of constructions with an extra constant $\iota$ of type $\square$. Adding a constant of type $\mathit{Set}$ in $\lambda\Pi/\equiv$, like adding variables of type $\mathit{Set}$ does not require to introduce an extra sort $\Delta$.

Some developments in the Calculus of constructions choose to declare the types of mathematical objects such as $\iota$, *nat*, etc. in *, that would correspond to $\iota : \mathit{Prop}$, fully identifying types and propositions. The drawback of this choice is that it gives the type * to the type $\iota$ of the constant 0, and the type $\square$ to the type $\iota \to *$ of the constant *positive*, while, in Simple type theory, both $\iota$ and $\iota \to o$ are simple types. This is the reason why, in the theory $U$, we give the type $\mathit{Set}$ and not the type $\mathit{Prop}$ to the constant $\iota$. So, the expression of the simple type $\iota \to o$ uses the constant $\rightsquigarrow_d$, that is, type constructors, as both $\iota$ and $o$ have type $\mathit{Set}$, and not the constant $\pi$, dependent types, that would be used if $\iota$ had the type $\mathit{Prop}$ and $o$ the type $\mathit{Set}$. Dependent types, the constant $\pi$, are thus marginalized to type functions mapping proofs to terms.
5.13. **The Minimal sub-theory.** Adding the axioms ($\Rightarrow$) and ($\rightleftharpoons$) yields a sub-theory with the 12 axioms (*Set*), (*El*), ($ι$), (*Prop*), (*Prf*), ($\Rightarrow$), ($\forall$), (*o*), ($\rightleftharpoons$), ($\rightleftharpoons_d$), ($\Rightarrow_d$), and ($π$) called the "Minimal sub-theory" of the theory $\mathcal{U}$. It contains both the 10 axioms of the Calculus of constructions and the 9 axioms of Minimal simple type theory. It is a formulation of the Calculus of constructions where dependent and non dependent arrows are distinguished. It is not a genuine extension of the Calculus of constructions as, each time we use a non dependent constant $\rightleftharpoons$ or $\Rightarrow$, we can use the dependent ones instead: a term of the form $t \rightleftharpoons u$ can always been replaced with the term $t \rightleftharpoons_d \lambda x : El t, u$, where the variable $x$ does not occur in $u$, and similarly for the implication. Thus, any proof expressed in the Minimal sub-theory, in particular any proof expressed in Minimal simple type theory, can always be translated to the Calculus of constructions.

Conversely, a proof expressed in the Calculus of constructions can be expressed in this theory. In a proof, every symbol $\rightleftharpoons_d$ or $\Rightarrow_d$ that uses a dummy dependency can be replaced with a symbol $\rightleftharpoons$ or $\Rightarrow$. Every proof that does not use $\rightleftharpoons_d$, $\Rightarrow_d$ and $\pi$, can be expressed in Minimal simple type theory.

5.14. **The Calculus of constructions with dependent types at the object level.** In the Calculus of constructions with a constant $ι$ of type $\square$, there are no dependent types at the object level. We have types $ι \to ι$ and $ι \to *$, thanks to the rule $\langle\square, \square, \square\rangle$, but no type $ι \to \square$. We can introduce such dependent types by adding an extra sort $\Delta$, together with an axiom $\square : \Delta$ and a rule $\langle\square, \Delta, \Delta\rangle$. We obtain this way a Pure type system whose expression in $\lambda\Pi/\equiv$ [CD07] contains 13 declarations and 7 rules.

Using the same notations as above, *Prop* for $U_*$, *Set* for $U_\square$, *Set1* for $U_\Delta$, etc., we get exactly the 13 axioms (*Prop*), (*Prf*), (*Set*), (*El*), (*Set1*), (*Ty*), (*o*), (*set*), ($\Rightarrow_d$), ($\pi$), ($\forall$), ($\rightleftharpoons_d$), and ($\rightleftharpoons$). The theory formed with these 13 axioms is thus equivalent to more common formulations of the Calculus of constructions with dependent types at that object level.

5.15. **The Calculus of constructions with prenex predictive polymorphism.** In the Calculus of constructions with an extra sort $\Delta$, polymorphism at the object level can be added with the rule $\langle\Delta, \square, \square\rangle$ that allows to build terms of the form $\Pi x : \square, x \to x : \square$ at the expense of making the system inconsistent [Hur95, Coq86]. Thus, just like in Simple type theory, we restrict to prenex predictive polymorphism: so, besides the sort $\Delta$, whose only closed irreducible element is $\square$, we introduce a sort $\diamond$ for schemes and two rules $\langle\Delta, \square, \diamond\rangle$ to build schemes by quantifying over an element of $\Delta$, that is, over $\square$, in a type and $\langle\Delta, \diamond, \diamond\rangle$ to build schemes by quantifying over $\square$ in another scheme. We also add a rule $\langle\Delta, *, *\rangle$ to quantify over $\square$ in a proposition.

Alternatively, the Calculus of constructions with prenex predictive polymorphism can be defined as a cumulative type system [Bar99], making $\square$ a subsort of $\diamond$ and having just one rule $\langle\Delta, \diamond, \diamond\rangle$ to quantify over a variable of type $\square$ in a scheme and a rule $\langle\Delta, *, *\rangle$ to quantify over $\square$ in a proposition. As there is no function whose co-domain is $\square$, this subtyping does not need to propagate to product types.

Expressing this Cumulative type system in $\lambda\Pi/\equiv$ introduces 8 declarations and 4 rules on top of the Calculus of constructions: 2 declarations for the sort $\Delta$

* a constant $U_\Delta$ of type *TYPE*,

* and a constant $\varepsilon_\Delta$ of type $U_\Delta \to TYPE$,

1 declaration and 1 rule for the axiom $\square : \Delta$
• a constant $\square$ of type $U_\Delta$,

• and a rule $\varepsilon_\Delta \sqsubseteq \sqcup \to Set$ (remember that $Set$ is $U_\square$),

2 declarations for the sort $\diamond$

• a constant $U_\diamond$, that we write *Scheme*, of type **TYPE**,

• and a constant $\varepsilon_\diamond$, that we write *Els*, of type *Scheme* → **TYPE**,

1 declaration and 1 rule to express that $\square$ is a subtype of $\diamond$

• a constant $\uparrow$ of type $Set \to Scheme$,

• and a rule *Els* ($\uparrow x$) $\mapsto$ *El x* (remember that *El* is $\varepsilon_\square$),

1 declaration and 1 rule for the rule $\langle\Delta, \diamond, \diamond\rangle$

• a constant $\dot{\Pi}_{\langle\Delta,\diamond,\diamond\rangle}$, that we write $\mathcal{V}$, of type $\Pi z : U_\Delta, (\varepsilon_\Delta z \to Scheme) \to Scheme$,

• and a rule *Els* ($\mathcal{V} x y$) $\mapsto$ $\Pi z : \varepsilon_\Delta x, *Els* (y z)$,

and 1 declaration and 1 rule for the rule $\langle\Delta, *, *\rangle$

• $\dot{\Pi}_{\langle\Delta,*,*\rangle}$, that we write $\mathcal{V}$, of type $\Pi z : U_\Delta, (\varepsilon_\Delta z \to Prop) \to Prop$,

• and a rule *Prf* ($\mathcal{V} x y$) $\mapsto$ $\Pi z : \varepsilon_\Delta x, *Prf* (y z)$.

But, again, this theory can be simplified. Indeed, just like $\square$ is the only closed irreducible term of type $\Delta$, $\sqsubseteq$ is the only closed irreducible term of type $U_\Delta$ and thus for any closed term $t$ of type $U_\Delta$, the term $\varepsilon_\Delta t$ reduces to *Set*. So in the type of the constants $\mathcal{V}$ and $\mathcal{V}$: $\Pi z : U_\Delta, (\varepsilon_\Delta z \to Scheme) \to Scheme$ and $\Pi z : U_\Delta, (\varepsilon_\Delta z \to Prop) \to Prop$, we can replace the expression $\varepsilon_\Delta z$ with *Set*. Then, as there is no point in building a function space whose domain is a singleton, we can simplify these type further to $(Set \to Scheme) \to Scheme$ and $(Set \to Prop) \to Prop$. Accordingly, the associated reduction rules simplify to

$$ *Els* (\mathcal{V} y) \mapsto \Pi z : *Set*, *Els* (y z) $$

and

$$ *Prf* (\mathcal{V} y) \mapsto \Pi z : *Set*, *Prf* (y z) $$

Then we can drop the symbols $\varepsilon_\Delta$ and $\sqsubseteq$, the rule $\varepsilon_\Delta \sqsubseteq \sqcup \to Set$, and the symbol $U_\Delta$. We are left with the 5 declaration and 3 rules

• *Scheme* : **TYPE** (Scheme-decl)

• *Els* : *Scheme* → **TYPE** (Els-decl)

• $\uparrow : Set \to Scheme$ ($\uparrow$-decl)

• *Els* ($\uparrow x$) $\mapsto$ *El x* ($\uparrow$-red)

• $\mathcal{V} : (Set \to Scheme) \to Scheme$ ($\mathcal{V}$-decl)

• *Els* ($\mathcal{V} y$) $\mapsto$ $\Pi z : *Set*, *Els* (y z) ($\mathcal{V}$-red)

• $\mathcal{V} : (Set \to Prop) \to Prop$ ($\mathcal{V}$-decl)

• *Prf* ($\mathcal{V} y$) $\mapsto$ $\Pi z : *Set*, *Prf* (y z) ($\mathcal{V}$-red)

that is, the 5 axioms (*Scheme*), (*Els*), ($\uparrow$), ($\mathcal{V}$), and ($\mathcal{V}$). Adding these 5 axioms to the 10 axioms defining the Calculus of constructions yields the 15 axioms (*Set*), (*El*), ($\iota$), (*Prop*), (*Prf*), ($\Rightarrow_d$), ($\mathcal{V}$), (*o*), ($\rightsquigarrow_d$), ($\pi$), (*Scheme*), (*Els*), ($\uparrow$), ($\mathcal{V}$), and ($\mathcal{V}$) defining the Calculus of constructions with prenex predicative polymorphism [Thi20].
## 6. CONCLUSION

The theory $\mathcal{U}$ is thus a candidate for a universal theory where proofs developed in various proof systems: HOL Light, Isabelle/HOL, HOL 4, Coq, Matita, Lean, PVS, etc. can be expressed. This theory can be complemented with other axioms to handle inductive types, recursive functions, universes, etc. [Ass15, Thi20, Gen20]. Note however that the various axioms currently proposed for encoding recursive functions are based on rewriting and may be difficult to translate to systems requiring termination proofs. Using recursors should make this much easier.

Each proof expressed in the theory $\mathcal{U}$ can use a sub-theory of the theory $\mathcal{U}$, as if the other axioms did not exist: the classical connectives do not impact the constructive ones, propositions as objects and functionality do not impact predicate logic, dependent types and predicate subtyping do not impact simple types, etc.

The proofs in the theory $\mathcal{U}$ can be classified according to the axioms they use, independently of the system they have been developed in. Finally, some proofs using classical connectives and quantifiers, propositions as objects, functionality, dependent types, or predicate subtyping may be translated into smaller fragments and used in systems different from the ones they have been developed in, making the theory $\mathcal{U}$ a tool to improve the interoperability between proof systems.

In some cases, a proof can be directly transferred from one system to the other if it does not use some axioms. For instance, [Wan16] showed that many proofs coming from HOL were in fact constructive. However, we usually need to apply some transformations on proofs to transfer them from one sub-theory to the other. For instance, by replacing a dependent arrow by a non-dependent one when the second argument is not actually dependent, by applying some morphism on type universes [Thi20], or by trying to eliminate some uses of the excluded middle [Cau16], which is part of the axioms of Isabelle/HOL [Pau21], Lean [Car19] and automated theorem provers.

Some of the sub-theories of $\mathcal{U}$ are known to be consistent, but one may wonder whether the theory $\mathcal{U}$ itself is consistent. We conjecture that it is but leave this difficult problem for future work. A solution may be to extend the model developed by the second author in [Dow17] for proving the consistency of the encoding of HOL.

**Acknowledgments.** The authors want to thank Michael Färber, César Muñoz, Thiago Felicissimo, and Makarius Wenzel for helpful remarks on a first version of this paper, as well as the anonymous reviewers for their useful comments.

## REFERENCES

[ABC<sup>+</sup>16] A. Assaf, G. Burel, R. Cauderlier, D. Delahaye, G. Dowek, C. Dubois, F. Gilbert, P. Halmagrand, O. Hermant, and R. Saillard. Dedukti: a logical framework based on the lambda-Pi-calculus modulo theory. Manuscript, 2016.

[AH14] L. Allali and O. Hermant. Semantic A-translation and super-consistency entail classical cut elimination. CoRR, abs/1401.0998, 2014. arXiv:1401.0998.

[Ass15] A. Assaf. *A framework for defining computational higher-order logics*. PhD thesis, École polytechnique, 2015.

[Bar92] H. Barendregt. Lambda calculi with types. In S. Abramsky, D. M. Gabbay, and T. S. E. Maibaum, editors, *Handbook of logic in computer science. Volume 2. Background: computational structures*, pages 117–309. Oxford University Press, 1992.
[Bar99] B. Barras. *Auto-validation d'un système de preuves avec familles inductives*. PhD thesis, Université Paris 7, France, 1999.

[BDG+21] F. Blanqui, G. Dowek, E. Grienenberger, G. Hondet, and F. Thiré. Some axioms for mathematics. In *Proceedings of the 6th International Conference on Formal Structures for Computation and Deduction*, Leibniz International Proceedings in Informatics 195, 2021.

[Ber88] S. Berardi. Towards a mathematical analysis of the Coquand-Huet calculus of constructions and the other systems in Barendregt's cube. Manuscript, 1988.

[BGH19] F. Blanqui, G. Genestier, and O. Hermant. Dependency Pairs Termination in Dependent Type Theory Modulo Rewriting. In *Proceedings of the 4th International Conference on Formal Structures for Computation and Deduction*, Leibniz International Proceedings in Informatics 131, 2019.

[BH21] F. Blanqui and G. Hondet. Encoding of predicate subtyping and proof irrelevance in the λπ-calculus modulo theory. In *Proceedings of the 26th International Conference on Types for Proofs and Programs*, Leibniz International Proceedings in Informatics 188, 2021.

[Bla01] F. Blanqui. *Type theory and rewriting*. PhD thesis, Université Paris-Sud, France, 2001.

[Bla20] F. Blanqui. Type Safety of Rewrite Rules in Dependent Types. In *Proceedings of the 5th International Conference on Formal Structures for Computation and Deduction*, Leibniz International Proceedings in Informatics 167, 2020.

[Car19] M. Carneiro. The type theory of Lean. https://github.com/digama0/lean-type-theory/releases/download/v1.0/main.pdf, 2019.

[Cau16] R. Cauderlier. A rewrite system for proof constructivization. In *Proceedings of the 11th International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice*, ACM International Conference Proceeding Series, 2016. doi:10.1145/2966268.2966270.

[CD07] D. Cousineau and G. Dowek. Embedding pure type systems in the lambda-Pi-calculus modulo. In *Proceedings of the 8th International Conference on Typed Lambda Calculi and Applications*, Lecture Notes in Computer Science 4583, 2007.

[CH88] Th. Coquand and G. Huet. The calculus of constructions. *Information and Computation*, 76(2):95–120, 1988.

[Chu40] A. Church. A formulation of the simple theory of types. *The Journal of Symbolic Logic*, 5(2):56–68, 1940.

[Coq86] Th. Coquand. An analysis of Girard's paradox. Technical Report RR-0531, Inria, 1986. URL: https://hal.inria.fr/inria-00076023.

[DHK03] G. Dowek, T. Hardin, and C. Kirchner. Theorem proving modulo. *Journal of Automated Reasoning*, 31:33–72, 2003.

[DJ90] N. Dershowitz and J.-P. Jouannaud. Rewrite systems. In J. van Leeuwen, editor, *Handbook of Theoretical Computer Science. Volume B: Formal Models and Semantics*, chapter 6, pages 243–320. North-Holland, 1990.

[Dor10] A. Dorra. équivalence de curry-howard entre le λΠ calcul et la logique intuitionniste. Internship report, 2010.

[Dow15] G. Dowek. On the definition of the classical connectives and quantifiers. In E.H. Haeusler, W. de Campos Sanz, and B. Lopes, editors, *Why is this a Proof?, Festschrift for Luiz Carlos Pereira*. College Publications, 2015.

[Dow17] G. Dowek. Models and Termination of Proof Reduction in the λΠ-Calculus Modulo Theory. In *Proceedings of the 44th International Colloquium on Automata, Languages and Programming*, Leibniz International Proceedings in Informatics 80, 2017.

[DW03] G. Dowek and B. Werner. Proof normalization modulo. *Journal of Symbolic Logic*, 68(4):1289–1316, 2003.

[DW05] G. Dowek and B. Werner. Arithmetic as a theory modulo. In Jürgen Giesl, editor, *Term Rewriting and Applications, 16th International Conference, RTA 2005, Nara, Japan, April 19-21, 2005, Proceedings*, volume 3467 of *Lecture Notes in Computer Science*, pages 423–437. Springer, 2005.

[FT19] Gaspard Férey and François Thiré. Proof Irrelevance in LambdaPi Modulo Theory. https://eutypes.cs.ru.nl/eutypes_pmwiki/uploads/Main/books-of-abstracts-TYPES2019.pdf, 2019.

[Gen20] G. Genestier. *Dependently-Typed Termination and Embedding of Extensional Universe-Polymorphic Type Theory using Rewriting*. PhD thesis, Université Paris-Saclay, 2020.
[Geu95] H. Geuvers. The Calculus of Constructions and Higher Order Logic. In Ph. de Groote, editor, *The Curry-Howard isomorphism*, volume 8 of *Cahiers du Centre de logique*, pages 139-191. Université catholique de Louvain, 1995.

[Gil18] F. Gilbert. *Extending higher-order logic with predicate subtyping: Application to PVS. (Extension de la logique d'ordre supérieur avec le sous-typage par prédicats)*. PhD thesis, Sorbonne Paris Cité, France, 2018.

[Gir72] J.-Y. Girard. *Interprétation fonctionelle et élimination des coupures de l'arithmétique d'ordre supérieur*. PhD thesis, Université de Paris VII, 1972.

[Gri19] É. Grienenberger. A logical system for an Ecumenical formalization of mathematics, 2019. Manuscript.

[Gri21] É. Grienenberger. Expressing Ecumenical systems in the lambda-pi-calculus modulo theory, 2021. In preparation.

[HA28] D. Hilbert and W. Ackermann. *Grundzüge der theoretischen Logik*. Springer-Verlag, 1928.

[HB20] G. Hondet and F. Blanqui. The New Rewriting Engine of Dedukti. In *Proceedings of the 5th International Conference on Formal Structures for Computation and Deduction*, Leibniz International Proceedings in Informatics 167, 2020.

[HHP93] R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. *Journal of the ACM*, 40(1):143-184, 1993. doi:10.1145/138027.138060.

[Hur95] A. J. C. Hurkens. A simplification of Girard's paradox. In M. Dezani-Ciancaglini and G. Plotkin, editors, *Typed Lambda Calculi and Applications*, pages 266-278, Berlin, Heidelberg, 1995. Springer Berlin Heidelberg.

[KvOvR93] J. W. Klop, V. van Oostrom, and F. van Raamsdonk. Combinatory reduction systems: introduction and survey. *Theoretical Computer Science*, 121:279-308, 1993.

[NM88] G. Nadathur and D. Miller. An overview of lambda-prolog. In *Logic Programming, Proceedings of the Fifth International Conference and Symposium, Seattle, Washington, USA, August 15-19, 1988 (2 Volumes)*, pages 810-827, 1988.

[OS97] Sam Owre and Natarajan Shankar. *The Formal Semantics of PVS*. SRI International, SRI International, Computer Science Laboratory, Menlo Park CA 94025 USA, 1997.

[Pau93] L.C. Paulson. Isabelle: The next 700 theorem provers. CoRR, cs.LO/9301106, 1993.

[Pau21] L. Paulson. Isabelle's logics, 2021.

[PR17] L.C. Pereira and R.O. Rodriguez. Normalization, soundness and completeness for the propositional fragment of Prawitz'Ecumenical system. *Revista Portuguesa de Filosofia*, 73(3-4):1153-1168, 2017.

[Pra15] D. Prawitz. Classical versus intuitionistic logic. In E.H. Haeusler, W. de Campos Sanz, and B. Lopes, editors, *Why is this a Proof?, Festschrift for Luiz Carlos Pereira*. College Publications, 2015.

[Rey74] J. C. Reynolds. Towards a theory of type structure. In *Programming Symposium*, pages 408-425. Springer, 1974.

[Ter89] J. Terlouw. Een nadere bewijstheoretische analyse van GSTT's. Manuscript, 1989.

[TeR03] TeReSe. *Term rewriting systems*, volume 55 of *Cambridge Tracts in Theoretical Computer Science*. Cambridge University Press, 2003.

[Thi18] F. Thiré. Sharing a Library between Proof Assistants: Reaching out to the HOL Family. In Frédéric Blanqui and Giselle Reis, editors, *Proceedings of the 13th International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, LFMTP@FSCD 2018, Oxford, UK, 7th July 2018*, volume 274 of *EPTCS*, pages 57-71, 2018.

[Thi20] F. Thiré. *Interoperability between proof systems using the Dedukti logical framework*. PhD thesis, Université Paris-Saclay, France, 2020.

[Wan16] S. Wang. Higher order proof engineering: Proof collaboration, transformation, checking and retrieval. https://hal.inria.fr/hal-01250197/document, 2016. Presented at AITP'16.