95 research outputs found
Parametricity in an Impredicative Sort
Reynold\u27s 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\u27 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
The Refined Calculus of Inductive Construction: Parametricity and Abstraction
We present a refinement of the Calculus of Inductive Constructions in which
one can easily define a notion of relational parametricity. It provides a new
way to automate proofs in an interactive theorem prover like Coq
Relational parametricity for higher kinds
Reynolds’ notion of relational parametricity has been extremely influential and well studied for polymorphic programming languages and type theories based on System F. The extension of relational parametricity to higher kinded polymorphism, which allows quantification over type operators as well as types, has not received as much attention. We present a model of relational parametricity for System Fω, within the impredicative Calculus of Inductive Constructions, and show how it forms an instance of a general class of models defined by Hasegawa. We investigate some of the consequences of our model and show that it supports the definition of inductive types, indexed by an arbitrary kind, and with reasoning principles provided by initiality
Relational Parametricity and Control
We study the equational theory of Parigot's second-order
λμ-calculus in connection with a call-by-name continuation-passing
style (CPS) translation into a fragment of the second-order λ-calculus.
It is observed that the relational parametricity on the target calculus induces
a natural notion of equivalence on the λμ-terms. On the other hand,
the unconstrained relational parametricity on the λμ-calculus turns
out to be inconsistent with this CPS semantics. Following these facts, we
propose to formulate the relational parametricity on the λμ-calculus
in a constrained way, which might be called ``focal parametricity''.Comment: 22 pages, for Logical Methods in Computer Scienc
Syntax for free: representing syntax with binding using parametricity
We show that, in a parametric model of polymorphism, the type ∀ α. ((α → α) → α) → (α → α → α) → α is isomorphic to closed de Bruijn terms. That is, the type of closed higher-order abstract syntax terms is isomorphic to a concrete representation. To demonstrate the proof we have constructed a model of parametric polymorphism inside the Coq proof assistant. The proof of the theorem requires parametricity over Kripke relations. We also investigate some variants of this representation
Predicativity and parametric polymorphism of Brouwerian implication
A common objection to the definition of intuitionistic implication in the
Proof Interpretation is that it is impredicative. I discuss the history of that
objection, argue that in Brouwer's writings predicativity of implication is
ensured through parametric polymorphism of functions on species, and compare
this construal with the alternative approaches to predicative implication of
Goodman, Dummett, Prawitz, and Martin-L\"of.Comment: Added further references (Pistone, Poincar\'e, Tabatabai, Van Atten
Proof-relevant parametricity
Parametricity is one of the foundational principles which underpin our understanding of modern programming languages. Roughly speaking, parametricity expresses the hidden invariants that programs satisfy by formalising the intuition that programs map related inputs to related outputs. Traditionally parametricity is formulated with proofirrelevant relations but programming in Type Theory requires an extension to proof-relevant relations. But then one might ask: can our proofs that polymorphic functions are parametric be parametric themselves? This paper shows how this can be done and, excitingly, our answer requires a trip into the world of higher dimensional parametricity
Trocq: Proof Transfer for Free, With or Without Univalence
Libraries of formalized mathematics use a possibly broad range of different
representations for a same mathematical concept. Yet light to major manual
input from users remains most often required for obtaining the corresponding
variants of theorems, when such obvious replacements are typically left
implicit on paper. This article presents Trocq, a new proof transfer framework
for dependent type theory. Trocq is based on a novel formulation of type
equivalence, used to generalize the univalent parametricity translation. This
framework takes care of avoiding dependency on the axiom of univalence when
possible, and may be used with more relations than just equivalences. We have
implemented a corresponding plugin for the Coq proof assistant, in the CoqElpi
meta-language. We use this plugin on a gallery of representative examples of
proof transfer issues in interactive theorem proving, and illustrate how Trocq
covers the spectrum of several existing tools, used in program verification as
well as in formalized mathematics in the broad sense
Extending Equational Monadic Reasoning with Monad Transformers
There is a recent interest for the verification of monadic programs using proof assistants. This line of research raises the question of the integration of monad transformers, a standard technique to combine monads. In this paper, we extend Monae, a Coq library for monadic equational reasoning, with monad transformers and we explain the benefits of this extension. Our starting point is the existing theory of modular monad transformers, which provides a uniform treatment of operations. Using this theory, we simplify the formalization of models in Monae and we propose an approach to support monadic equational reasoning in the presence of monad transformers. We also use Monae to revisit the lifting theorems of modular monad transformers by providing equational proofs and explaining how to patch a known bug using a non-standard use of Coq that combines impredicative polymorphism and parametricity
- …