arXiv:2610.20356cs.PLOct 2026

Manuscript Offprint

arXiv:2610.20356

Typechecking without Minimum Types: Finite Bases and Backward Checking for F<:⊤F_{<:}^{\top}

Mingkun Xiao, Yixuan Sun

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

MINGKUN XIAO, Capital Normal University

YIXUAN SUN, Kean University

System F<⊤F_{<}^{\top} has decidable subtyping but lacks minimum types. We prove that typechecking is decidable for arbitrary explicitly annotated terms with unrestricted subsumption. The difficulty is that type abstraction uses a variable's declared bound to type its body, while quantified subtyping forgets that bound. We construct finite covers that preserve all required subtype comparisons across this change of context. These covers yield a compositional finite typing basis and a decision procedure.

We then derive a backward checker that propagates acceptable targets without constructing the complete typing basis. Rectangularity of typing families gives a uniform elimination domain while retaining every result type, even when the canonical type is not least. Finite inverse families transport targets through type substitution. The same inverse specification recovers bound forgetting and yields finite type-avoidance families. Both typechecking procedures are total Rocq functions proved equivalent to the original typing judgment. For a separate symbolic word-RAM realization, we prove a quartic worst-case work bound. We measure family representation sizes and comparison storage in independent OCaml prototypes on synthetic checking judgments.

CCS Concepts: • Theory of computation → Type theory.

Additional Key Words and Phrases: bounded quantification, subtyping, decidability, finite type bases, inverse substitution, type avoidance

1 Introduction

Decidable subtyping does not by itself provide a typechecking algorithm. A subtype checker compares two given types. Typechecking must also choose types for intermediate expressions, even when all parameter types and type arguments are explicit. Subsumption permits replacing an assigned type by a supertype before the next typing rule is applied. A computable minimum type, an assignable type below every other assignable type, controls these choices: compute that type, then compare it with the target [10].

For System F<⊤F_{<}^{\top}, Castagna and Pierce establish decidable subtyping, but their corrigendum exhibits terms without a minimum type and leaves general typechecking open [6, 7]. Laird later proves decidability for β\beta-normal terms of the original system [18, Corollary 8.6]. A normal form may have a type that the original term lacks, so normalizing the input does not extend this result to arbitrary terms (Section 9.1).

We prove that typechecking is decidable for arbitrary explicitly annotated terms of the original F<⊤F_{<}^{\top} calculus. We compute a finite collection of assignable types such that every assignable target is above at least one member. We then derive a backward checker that uses the requested target to avoid constructing the complete collection.

Why one type is not enough. In F<⊤F_{<}^{\top}, a type abstraction’s body can use the declared bound of its type variable. Comparing two quantified types instead treats that variable as having bound ⊤\top. To see what this changes, take an outer variable β<:⊤\beta <: \top and the term

Λα<:β.λx:α.x.\Lambda\alpha<:\beta.\lambda x:\alpha.x.

The inner function can return xx at type α\alpha or, using the bound α<:β\alpha <: \beta, at type β\beta. Thus the term has both types ∀α<:β\forall \alpha <: \beta. α→α\alpha \to \alpha and ∀α<:β\forall \alpha <: \beta. α→β\alpha \to \beta. Comparing these quantified types forgets the

Authors' Contact Information: Mingkun Xiao, Capital Normal University, 1230604016@cnu.edu.cn; Yixuan Sun, Kean University, sunyixua@kean.edu.

Mingkun Xiao and Yixuan Sun

bound that related their bodies. Ghelli’s example rules out a common subtype of the two types in the outer context [7], so no minimum type can cover both. Section 2.2 gives the inversion argument.

Decidability from finite representatives. Keeping both body types preserves the two typings in this example. For a general abstraction, we need enough assignable body types that, after its bound is forgotten for comparison, every type of the abstraction remains above one of the resulting quantified candidates. The corrigendum suggests using finite sets of minimal types; what is needed is a construction that covers all the choices subsumption permits.

We prove that the required finite covers can be computed for every well-formed type and context. They preserve the necessary comparisons after bound forgetting. For instance, to cover a variable's supertypes, we retain the variable and representatives obtained from its bound. The full construction combines these alternatives according to the type constructors. Applying it at type abstraction lets us compute a finite collection for each term from the collections for its subterms. We call the result a typing basis. Write Δ\Delta for type-variable bounds and Γ\Gamma for term-variable typings. For a term s in these contexts, the computed basis satisfies

Δ;Γ⊢s:T⟺∃B∈BΔ;Γ(s).Δ⊢B<:T.(1)\Delta;\Gamma\vdash s:T\quad\Longleftrightarrow\quad\exists B\in\mathcal{B}_{\Delta;\Gamma}(s).\Delta\vdash B<:T. \tag{1}

Every candidate is assignable to s, and an empty basis records failure to type the term. Checking a requested target therefore requires only finitely many subtype tests. The candidates need not be minimal.

Checking from a target. A finite basis establishes decidability, but its construction must retain enough candidates to cover every assignable type. Constructing and combining these candidates can require substantial work, even when a checking request asks about only one target. This motivates a backward checker that uses the requested target to determine which requirements to pass to subterms, without first constructing the complete basis.

At an application fuf u, the target TT specifies the required result type but leaves the parameter type undetermined. We must choose a type AA such that ff can be checked at A→TA \to T and uu at AA. The challenge is to make this choice without losing any valid typing.

We show that whenever f can be used as a function, one computable parameter type is sufficient. It is a supertype of every admissible parameter type. Any result type available at one of those parameter types remains available at the chosen one. The checker can therefore fix the argument check while leaving all result choices available. We call this separation rectangularity. It holds even for functions without a minimum type. At type application, a corresponding property fixes the bound against which to check the explicit type argument.

At a type application, the desired result constrains the body of the function’s quantified type: after the explicit type argument is substituted, that body must be a subtype of the target. We represent these acceptable body types by a finite cover, allowing the requirement to be passed back to the function. We call this operation finite inverse substitution. Together, the fixed parameter types and these finite covers give a complete checker by recursion on the original term.

The inverse construction also recovers the bound-forgetting covers used in the decidability proof. Applied to a change of variable scope, it computes finite covers of the supertypes and subtypes expressible without a local type variable. Section 8 develops this type-avoidance result and the requirements for transferring the method to another calculus.

The contributions are:

  • Decidable typechecking without minimum types. We construct effective finite covers under bound forgetting and use them to compute a complete typing basis. This decides the original judgment for arbitrary explicitly annotated terms, including β\beta-redexes and unrestricted subsumption (Sections 3 and 4).

  • Complete backward checking by inverse substitution. We prove rectangularity of typing families and exact finite inverse substitution, yielding a complete checker that propagates targets without constructing the full typing basis (Section 5). Shared representations support queries without enumeration (Section 6); a separate word-RAM realization has a quartic charged-work bound (Appendix D).

The two semantic checkers are total Rocq functions proved equivalent to the original declarative judgment. Section 7 describes their verification and evaluates handwritten OCaml prototypes on complete synthetic checking judgments. The experiments examine symbolic family sizes and comparison storage.

References (23)