arXiv:2610.25085math.LOOct 2026

Manuscript Offprint

arXiv:2610.25085

A sound pure type system with ranks as sorts and Type-in-Type

Pavel Sokolov, Alexander Kuklev

Pavel Sokolov 1^{1} ppsokolov@hse.ru

Alexander Kuklev 2^{2} a@kuklev.com

1^{1}HSE University, Laboratory of Theoretical Computer Science

2^{2}Radboud Univ. Nijmegen, Department of Software Science

ABSTRACT. We present a dependently typed pure type system that contains a circular axiom s:ss : s for a certain sort ss and is nonetheless strongly normalizing. Girard's paradox is avoided because our sorts are not closed under a Π\Pi-former: function types are placed in sorts according to their rank. Turns out that this system has a unique set of characteristics: it has similar normalization behaviour as STLC (so complexity of normalization is TOWER-complete) while at the same time allowing non-uniform representation of arbitrary elementary recursive functions; furthermore, it has a nontrivial set-theoretical model in ZF+GCH and allows to carry out nontrivial proof developments. Base normalization proof is surprisingly simple (modulo general metatheoretical properties of pure type systems) and has been fully formalized in vanilla Rocq (formerly Coq) without additional axioms.

1. Introduction

Pure type systems (PTS) are a family of minimalistic typed λ-calculi introduced independently by Berardi [Ber88] and Terlouw [Ter89]. Their abstract grammar includes only variables x∈Varx \in \text{Var}, abstraction λ(x:T).u\lambda(x : T).u, application utut, dependent function types Π(x:T).U\Pi(x : T).U (where UU might depend on xx) and sorts s∈Ss \in \mathcal{S} that act as “types of types”.

Variable x∈Xx \in X

Sort s∈Ss \in S

Term T,U,t,u∴=xT, U, t, u \quad \therefore = x variable

ss sort as type

Π(x:T).U\Pi(x: T).U type of dependent functions

λ(x:T).u\lambda(x: T).u anonymous function

utut function application

FIGURE 1. Grammar of pure type systems

Common syntax conventions to make it more lightweight are the following: application associates to the left, so abca b c is understood as (ab)c(a b) c; in a sequence of abstractions, all λ\lambda symbols except the first can be omitted; T→UT \to U is an alias for Π(x:T).U\Pi(x : T).U (where UU does not depend on xx); (→)(\rightarrow) is right-associative, so T→U→VT \to U \to V is understood as T→(U→V)T \to (U \to V). In addition, even though abstractions are always annotated with a type of an argument, we are going to omit it on paper whenever they are clear from the context. Also note that there is no syntactical distinction between terms and types — they are defined by a single grammar; an expression can act both as a term and as a type depending on a side where it stands next to the colon in the typing judgement Γ⊢_\Gamma \vdash \_: __.

Date: October 16, 2026.

2020 Mathematics Subject Classification. 03B38, 03D15, 03B70, 03B40, 68N18.

A single PTS is determined by two relations:

  • axiom relation Ax⊆S×S\text{Ax} \subseteq \mathcal{S} \times \mathcal{S} determines “to which sort(s) a given sort belongs as an element”; instead of (s,s′)∈Ax(s, s') \in \text{Ax} it is customary to write simply s:s′s : s'.

  • rule relation Rule ⊆S2×S\subseteq \mathcal{S}^2 \times \mathcal{S} places types of functions Π(x:T).U\Pi(x: T).U into sorts accounting for the sorts where TT and UU are situated.

AxΓ⊢s:s′(s,s′)∈AxRULEΓ⊢T:sTΓ,x:T⊢U:sUΓ⊢Π(x:T).U:s(sT,sU,s)∈Rule\frac{\mathrm{A x}}{\Gamma\vdash s:s^{\prime}}(s,s^{\prime})\in\mathrm{A x}\qquad\begin{array}{l}\mathrm{R U L E}\\\frac{\Gamma\vdash T:s_{T}\qquad\Gamma,x:T\vdash U:s_{U}}{\Gamma\vdash\Pi(x:T).U:s}(s_{T},s_{U},s)\in\mathrm{R u l e}\end{array} VARΓ⊢x:Tx:T∈ΓABSΓ⊢T:sTΓ,x:T⊢u:UΓ⊢λ(x:T).u:Π(x:T).U\frac{\mathrm{VAR}}{\Gamma\vdash x:T}x:T\in\Gamma\qquad\begin{array}{l}\mathrm{ABS}\\\frac{\Gamma\vdash T:s_{T}\qquad\Gamma,x:T\vdash u:U}{\Gamma\vdash\lambda(x:T).u:\Pi(x:T).U}\end{array} APPΓ⊢u:Π(x:T).UΓ⊢t:TCONVΓ⊢t:TΓ⊢U:sT=βU\frac{\mathrm{APP}}{\Gamma\vdash u:\Pi(x:T).U\qquad\Gamma\vdash t:T}\qquad\frac{\mathrm{CONV}}{\Gamma\vdash t:T\qquad\Gamma\vdash U:s\qquad T=\beta U} Γ⊢ut:U[t/x]\Gamma\vdash u t:U[t/x] Γ⊢t:U\Gamma\vdash t:U

FIGURE 2. Typing rules of pure type systems

Systems from Barendregt's lambda cube [Bar91; Bar92] fit naturally into the framework: for example, simply typed lambda calculus (STLC) [Chu40] can be viewed as a pure type system with a single sort , no axioms and a single rule (,,). In general, however, pure type systems are dependently typed since Π\Pi allows the codomain type to depend on the value of an argument — Coquand's Calculus of Constructions (CoC) [CH88] sits comfortably at the top of lambda cube and is modelled as a pure type system with two sorts {},□}, a single axiom * : □ and four rules corresponding to simple functions (,,), polymorphic functions (□,,), type operators (□,□,□) and dependent types (*,□,□).

Both STLC and CoC are strongly normalizing and sound with respect to their set-theoretical semantics [Tai67; CG90; GN91], but it is not true for arbitrary PTS.

Theorem (Girard'72 [Gir72; Hur95]). The following PTS called System U is not normalizing:

S={∗,□,△},Ax={(∗,□),(□,△)},\mathcal{S}=\{*,\Box,\triangle\},\quad\mathsf{A x}=\{(*,\Box),(\Box,\triangle)\}, Rule={(∗,∗,∗),(□,∗,∗),(△,∗,∗),(□,□,□),(△,□,□)}\mathsf{R u l e}=\{(*,*,*),(\Box,*,*),(\triangle,*,*),(\Box,\Box,\Box),(\triangle,\Box,\Box)\}

Furthermore, the offending term has type Π(P:∗)\Pi(P:*).P.

This result is dubbed “Girard’s paradox” since it renders System U inconsistent with respect to its intended logical semantics: inhabitedness of Π(P:∗)\Pi(P:*).P would mean that every proposition is provable. Thus, any system where System U embeds is inconsistent, too; in particular, an original version [Mar71] of Martin-Löf’s Intuitionistic Type Theory [Mar84] embeds the following PTS known as “Type-in-Type” which is inconsistent due to Girard’s paradox:

S={∗},Ax={∗:∗},Rule={(∗,∗,∗)}.\mathcal{S}=\{*\},\quad\mathsf{A x}=\{*:*\},\quad\mathsf{R u l e}=\{(*,*,*)\}.

For a pure type system with usual set-theoretical semantics, it is natural to expect that a sort of small types * is closed under Π\Pi, thus we cannot forbid the rule (,,*); then, a circular axiom * : * has to go. Long story short, it motivates an introduction of a universe hierarchy [Mar75; HP91] S={Uk}k∈N\mathcal{S} = \{\mathcal{U}_k\}_{k \in \mathbb{N}} with axioms Uk:Uk+1\mathcal{U}_k : \mathcal{U}_{k+1} and rules (Uk,Ul,Uk∨l)(\mathcal{U}_k, \mathcal{U}_l, \mathcal{U}_{k \vee l}) for each k,lk, l; when interpreted in sets, [Uk][\mathcal{U}_k] is taken to be the kk-th inaccessible cardinal [Wer97; Acz99].

Observing this, we took an interest in the following two questions:

  • If we were to drop the rule (∗,∗,∗)(*,*,*) and keep the axiom ∗:∗* : * instead, can we find a nontrivial consistent pure type system?

  • Is there a consistent pure type system with total relations Ax and Rule whose natural set-theoretical semantics do not involve the assumption of inaccessible cardinals?

Turns out that, for both questions, the answer is “yes”. Furthermore, both yes-s are witnessed by a single PTS, which we dub PTS-rk:

S={rkr}r∈NAx={(rkr,rk0)}r∈NRule={(rkr,rks,rk(r+1)∨s)}r,s∈N\mathcal{S}=\left\{\mathsf{r k}_{r}\right\}_{r\in\mathbb{N}}\quad\mathsf{A x}=\left\{\left(\mathsf{r k}_{r},\mathsf{r k}_{0}\right)\right\}_{r\in\mathbb{N}}\quad\mathsf{R u l e}=\left\{\left(\mathsf{r k}_{r},\mathsf{r k}_{s},\mathsf{r k}_{(r+1)\vee s}\right)\right\}_{r,s\in\mathbb{N}}

(Naming “rk” comes from rank, since rules compute precisely the rank of functions, which is the maximal nesting of Π\Pi in the domain type.)

Indeed, there is a circular axiom rk0:rk0\mathsf{rk}_0 : \mathsf{rk}_0, and System U is not embeddable since rkr\mathsf{rk}_r is not closed under Π\Pi for any rr. Also, as we will see in Section 3, our PTS-rk is strongly normalizing despite an intuition that rkr:rk0\mathsf{rk}_r : \mathsf{rk}_0 might “feel wrong”. Modulo general metatheory of pure type systems laid out in Section 2, a normalization proof turned out to be suspiciously simple, even more so in comparison with normalization proofs of other dependently typed systems [GN91; Bar99; AÖV18]. To dispel our own doubts, we formalized a proof of normalization in Rocq (formerly Coq) without using any additional axioms, yielding a fully constructive proof; our journey in formalization is summarized in Section 3.1 and the whole development is available at https://github.com/TurtlePU/pts-rk.

Having completed the proof, we noticed that it exposes a primitive recursive procedure to normalize terms of PTS-rk; we dug further and discovered that, actually, there is an intimate connection between a class of elementary recursive functions [Kal43; Ros84a] and our system, as seen in Sections 4-5. As a byproduct of our study on complexity, we built a sound set-theoretic model for PTS-rk (see Section 6) which assumes Generalized Continuum Hypothesis [Jec03; Hau08; Göd38; Göd40] which is an unusual pick for dependently typed systems where inaccessible cardinals are a more common assumption [Wer97; LW11]. Before concluding, we provide a sneak peek into what it is like to write proofs in PTS-rk and provide a full interpretation of Tarski–Mostowski–Robinson arithmetic R (Section 7).

1.1. Use of artificial intelligence. At various points in our research, we interacted with GPT-6 Astra [Ope26] to prove something for us. Sometimes it was a rehash of previously established results; sometimes it presented something new. In case we used the ideas hinted by LLM, we explicitly state so right next to the proof; even so, the text is completely human written since we wanted to make sure we completely understood the results (in addition, generated proofs always required additional explanations or a complete rewrite to make them understandable and simpler to read). We also used Claude Fable 5.1 [Ant26] to identify additional points of reference.

1.2. Formalization status. Every result up to the proof of strong normalization for PTS-rk was formally verified in Rocq using handwritten proofs. Such proofs are marked with a ☐; each icon is a hyperlink to the statement and proof in Rocq with the version pinned at the moment of submission.

Results after that were formalized in Rocq as well, albeit not by us but rather by GPT-6 Astra. Such results are marked with ✉; just as with handwritten results, each icon is a hyperlink to the statement and proof in Rocq with the version pinned at the moment of submission. Where only a component of a paper claim is checked, a note explaining what exactly is formalized accompanies the badge.

References (64)