[Paper Review] Parametricity in an Impredicative Sort
This paper introduces a refined version of the Calculus of Inductive Constructions (CIC), called CIC_r, which separates computational content from propositional content by introducing a new predicative hierarchy of sorts (Set₀, Set₁, ...), enabling parametricity relations to live in the impredicative sort Prop. The key contribution is a formalization of relational parametricity and the abstraction theorem within this framework, allowing for a reflexive Coq tactic that automatically generates proofs by parametricity, with all outputs type-checked by Coq’s kernel for soundness.
Reynold's abstraction theorem is now a well-established result for a large class of type systems. We propose here a definition of relational parametricity and a proof of the abstraction theorem in the Calculus of Inductive Constructions (CIC), the underlying formal language of Coq, in which parametricity relations' codomain is the impredicative sort of propositions. To proceed, we need to refine this calculus by splitting the sort hierarchy to separate informative terms from non-informative terms. This refinement is very close to CIC, but with the property that typing judgments can distinguish informative terms. Among many applications, this natural encoding of parametricity inside CIC serves both theoretical purposes (proving the independence of propositions with respect to the logical system) as well as practical aspirations (proving properties of finite algebraic structures). We finally discuss how we can simply build, on top of our calculus, a new reflexive Coq tactic that constructs proof terms by parametricity.
Motivation & Objective
- To formalize relational parametricity and the abstraction theorem in a type theory where parametricity relations inhabit the impredicative sort Prop.
- To distinguish computationally meaningful terms from non-informative ones in Coq by refining the sort hierarchy, separating Set and Type from Prop.
- To enable practical automation in Coq by building a reflexive tactic that constructs proof terms by parametricity, leveraging deep embeddings and reification.
- To support formal reasoning about finite algebraic structures and independence of propositions from the logical system via natural encoding of parametricity.
- To lay the foundation for an internal realizability theory within Coq by connecting parametricity with syntactic realizability.
Proposed method
- Refine CIC by introducing a new predicative hierarchy of sorts (Set₀, Set₁, ...) to isolate computational content, while preserving the impredicative Prop for parametricity relations.
- Define relational parametricity using inductive logical relations over types, with relations valued in Prop, ensuring they are proof-irrelevant and suitable for logical reasoning.
- Prove the abstraction theorem within CIC_r, showing that any closed term is related to itself under the relation induced by its type, using structural induction on types.
- Implement a reflexive Coq tactic that reifies terms from shallow embedding to deep embedding (via OCaml ASTs), computes parametricity proofs, and reflects them back into Coq for type-checking.
- Use computational reflection to enable the tactic to inspect term structure and generate proof terms automatically, relying on Coq’s kernel for soundness.
- Embed CIC_r into standard CIC via a forgetful translation, ensuring compatibility and minimal disruption to existing Coq code.
Experimental results
Research questions
- RQ1Can parametricity relations be naturally and soundly encoded within the impredicative sort Prop in a refined version of CIC?
- RQ2How can a clear separation between computational and non-computational terms be achieved in Coq’s type system without breaking existing features?
- RQ3Can a reflexive Coq tactic be built that automatically generates proofs by parametricity using computational reflection?
- RQ4What are the limitations of parametricity when applied to large inductive types, particularly regarding proof irrelevance and set-theoretic interpretation?
- RQ5Is it possible to build a realizability theory inside Coq based on parametricity, using the refined type system?
Key findings
- The refinement of CIC into CIC_r successfully isolates computational content in the Set hierarchy, ensuring that only Set-type terms survive program extraction.
- Parametricity relations can be naturally defined and used within the impredicative sort Prop, enabling their use in logical reasoning and proof construction.
- The abstraction theorem is formally established in CIC_r, guaranteeing that any closed term is related to itself under its type-induced relation.
- A reflexive Coq tactic is implemented that reifies terms, computes parametricity proofs, and reflects them back into Coq, with all outputs verified by Coq’s kernel.
- The approach supports practical applications such as proving properties of finite algebraic structures and establishing independence of propositions from the logical system.
- The authors conjecture that parametric relations for large inductive types are not proof-irrelevant, suggesting a fundamental limitation in interpreting them as set-theoretic relations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.