Skip to main content
QUICK REVIEW

[Paper Review] A Sound and Complete Substitution Algorithm for Multimode Type Theory

Joris Ceulemans, Andreas Nuyts|arXiv (Cornell University)|Jan 1, 2024
Power Systems and TechnologiesEngineering1 citations
TL;DR

This paper presents a sound and complete substitution algorithm for Multimode Type Theory (MMTT), formalized in a variant called WSMTT. It defines a full set of typing and equivalence rules for expressions and substitutions, proves the correctness of the embedding translation from SFMTT to WSMTT, and establishes that substitution is preserved under this translation, ensuring type safety and semantic fidelity in multimodal type systems.

ABSTRACT

Multimode Type Theory (MTT) is a generic type theory that can be instantiated with an arbitrary mode theory to model features like parametricity, cohesion and guarded recursion. However, the presence of modalities in MTT significantly complicates the substitution calculus of this system. Moreover, MTT’s syntax has explicit substitutions with an axiomatic system - not an algorithm - governing the connection between an explicitly substituted term and the resulting term in which variables have actually been replaced. So far, the only results on eliminating explicit substitutions in MTT rely on normalisation by evaluation and hence also immediately normalise a term. In this paper, we present a substitution algorithm for MTT that is completely separated from normalisation. To this end, we introduce Substitution-Free Multimode Type Theory (SFMTT): a formulation of MTT without explicit substitutions, but for which we are able to give a structurally recursive substitution algorithm, suitable for implementation in a total programming language or proof assistant. On the usual formulation of MTT, we consider σ-equality, the congruence generated solely by equality rules for explicit substitutions. There is a trivial embedding from SFMTT to MTT, and a converse translation that eliminates the explicit substitutions. We prove soundness and completeness of our algorithm with respect to σ-equivalence and thus establish that MTT with σ-equality has computable σ-normal forms, given by the terms of SFMTT.

Motivation & Objective

  • To design a substitution algorithm that is both sound and complete for Multimode Type Theory (MMTT), ensuring type safety and semantic correctness.
  • To formalize a well-scoped variant of MTT (WSMTT) with full rules for expression and substitution constructors, including booleans and modal types.
  • To define σ-equivalence for expressions and substitutions, establishing reflexivity, symmetry, transitivity, and functoriality.
  • To prove that the embedding of SFMTT expressions and substitutions into WSMTT preserves substitution, ensuring semantic fidelity.
  • To formally verify that the translation from SFMTT to WSMTT respects substitution and equivalence, enabling correct type checking in multimodal settings.

Proposed method

  • Define WSMTT with a full set of expression and substitution constructors, including booleans, dependent function types, and modal types.
  • Introduce σ-equivalence as a structural equivalence relation for expressions and substitutions, with rules for reflexivity, symmetry, transitivity, and congruence.
  • Define a translation function J_K from SFMTT to WSMTT and an embedding function embed(_) from WSMTT to SFMTT, ensuring type-level correspondence.
  • Prove that the embedding preserves substitution via key lemmas (e.g., Lemma 31, 33) and Proposition 34, showing embed(t[σ]) ≡σ embed(t)[embed(σ)].
  • Establish soundness via structural induction on expressions and substitutions, proving that embed(JtK) ≡σ t and embed(JσK) ≡σ σ for all t and σ.
  • Use lifting operations (e.g., σ+ := (σ ◦ π).v0) and category-theoretic principles (e.g., associativity, unit laws) to reason about substitution composition and equivalence.

Experimental results

Research questions

  • RQ1Is the substitution algorithm in WSMTT sound and complete with respect to the underlying type theory?
  • RQ2Does the embedding of SFMTT expressions and substitutions into WSMTT preserve substitution equivalence?
  • RQ3Are the σ-equivalence rules for expressions and substitutions sufficient to ensure that substitution is well-behaved and type-safe?
  • RQ4Can the translation from SFMTT to WSMTT be proven correct using structural induction and embedding preservation?
  • RQ5How do modal type constructors (e.g., ⟨µ|A⟩, modµ(t)) interact with substitution and equivalence in the multimodal setting?

Key findings

  • The substitution algorithm in WSMTT is proven sound: for any WSMTT expression t, embed(JtK) ≡σ t holds under σ-equivalence.
  • The substitution algorithm is complete: for any WSMTT substitution σ, embed(JσK) ≡σ σ holds, ensuring full correspondence between SFMTT and WSMTT substitutions.
  • The embedding function preserves substitution: embed(t[σ]) ≡σ embed(t)[embed(σ)] for all expressions t and substitutions σ, as formalized in Proposition 34.
  • The full set of σ-equivalence rules—including reflexivity, symmetry, transitivity, and congruence—has been formally defined and proven consistent.
  • The translation from SFMTT to WSMTT is correct: the embedding of the translation of any SFMTT term or substitution is σ-equivalent to the original term or substitution.
  • The proof relies on structural induction and key lemmas (e.g., Lemma 31, 33) that establish the behavior of embedding under substitution and lifting operations.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.