22 research outputs found
Proofs for free - parametricity for dependent types
Reynolds' abstraction theorem shows how a typing judgement in System F can be translated into a relational statement (in second order predicate logic) about inhabitants of the type. We obtain a similar result for pure type systems: for any PTS used as a programming language, there is a PTS that can be used as a logic for parametricity. Types in the source PTS are translated to relations (expressed as types) in the target. Similarly, values of a given type are translated to proofs that the values satisfy the relational interpretation. We extend the result to inductive families. We also show that the assumption that every term satisfies the parametricity condition generated by its type is consistent with the generated logic
Dynamic IFC Theorems for Free!
We show that noninterference and transparency, the key soundness theorems for
dynamic IFC libraries, can be obtained "for free", as direct consequences of
the more general parametricity theorem of type abstraction. This allows us to
give very short soundness proofs for dynamic IFC libraries such as faceted
values and LIO. Our proofs stay short even when fully mechanized for Agda
implementations of the libraries in terms of type abstraction.Comment: CSF 2021 final versio
Foundational Extensible Corecursion
This paper presents a formalized framework for defining corecursive functions
safely in a total setting, based on corecursion up-to and relational
parametricity. The end product is a general corecursor that allows corecursive
(and even recursive) calls under well-behaved operations, including
constructors. Corecursive functions that are well behaved can be registered as
such, thereby increasing the corecursor's expressiveness. The metatheory is
formalized in the Isabelle proof assistant and forms the core of a prototype
tool. The corecursor is derived from first principles, without requiring new
axioms or extensions of the logic
Simple Noninterference from Parametricity
In this paper we revisit the connection between parametricity and noninterference. Our primary contribution is a proof of noninterference for a polyvariant variation of the Dependency Core Calculus of in the Calculus of Constructions. The proof is modular: it leverages parametricity for the Calculus of Constructions and the encoding of data abstraction using existential types. This perspective gives rise to simple and understandable proofs of noninterference from parametricity. All our contributions have been mechanised in the Agda proof assistant
Large and Infinitary Quotient Inductive-Inductive Types
Quotient inductive-inductive types (QIITs) are generalized inductive types
which allow sorts to be indexed over previously declared sorts, and allow usage
of equality constructors. QIITs are especially useful for algebraic
descriptions of type theories and constructive definitions of real, ordinal and
surreal numbers. We develop new metatheory for large QIITs, large elimination,
recursive equations and infinitary constructors. As in prior work, we describe
QIITs using a type theory where each context represents a QIIT signature.
However, in our case the theory of signatures can also describe its own
signature, modulo universe sizes. We bootstrap the model theory of signatures
using self-description and a Church-coded notion of signature, without using
complicated raw syntax or assuming an existing internal QIIT of signatures. We
give semantics to described QIITs by modeling each signature as a finitely
complete CwF (category with families) of algebras. Compared to the case of
finitary QIITs, we additionally need to show invariance under algebra
isomorphisms in the semantics. We do this by modeling signature types as
isofibrations. Finally, we show by a term model construction that every QIIT is
constructible from the syntax of the theory of signatures
From parametricity to conservation laws, via Noether's Theorem
Invariance is of paramount importance in programming languages and in physics. In programming languages, John Reynolds' theory of relational parametricity demonstrates that parametric polymorphic programs are invariant under change of data representation, a property that yields "free" theorems about programs just from their types. In physics, Emmy Noether showed that if the action of a physical system is invariant under change of coordinates, then the physical system has a conserved quantity: a quantity that remains constant for all time. Knowledge of conserved quantities can reveal deep properties of physical systems. For example, the conservation of energy is by Noether's theorem a consequence of a system's invariance under time-shifting. In this paper, we link Reynolds' relational parametricity with Noether's theorem for deriving conserved quantities. We propose an extension of System Fω with new kinds, types and term constants for writing programs that describe classical mechanical systems in terms of their Lagrangians. We show, by constructing a relationally parametric model of our extension of Fω, that relational parametricity is enough to satisfy the hypotheses of Noether's theorem, and so to derive conserved quantities for free, directly from the polymorphic types of Lagrangians expressed in our system
Paranatural Category Theory
We establish and advocate for a novel branch of category theory, centered
around strong dinatural transformations (herein known as "paranatural
transformations"). Paranatural transformations generalize natural
transformations to mixed-variant difunctors, but, unlike other such
generalizations, are composable and exceptionally well-behaved. We define the
category of difunctors and paranatural transformations, prove a novel "diYoneda
Lemma" for this category, and explore some of the category-theoretic
implications.
We also develop three compelling uses for paranatural category theory:
parametric polymorphism, impredicative encodings of (co)inductive types, and
difunctor models of type theory. Paranatural transformations capture the
essence of parametricity, with their "paranaturality condition" coinciding
exactly with the "free theorem" of the corresponding polymorphic type; the
paranatural analogue of the (co)end calculus provides an elegant and general
framework for reasoning about initial algebras, terminal coalgebras,
bisimulations, and representation independence; and "diYoneda reasoning"
facilitates the lifting of Grothendieck universes into difunctor models of type
theory. We develop these topics and propose further avenues of research
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
A Presheaf Model of Parametric Type Theory
Abstract We extend Martin-Löf's Logical Framework with special constructions and typing rules providing internalized parametricity. Compared to previous similar proposals, this version comes with a denotational semantics which is a refinement of the standard presheaf semantics of dependent type theory. Further, this presheaf semantics is a refinement of the one used to interpret nominal sets with restrictions. The present calculus is a candidate for the core of a proof assistant with internalized parametricity
A Reasonably Gradual Type Theory
Gradualizing the Calculus of Inductive Constructions (CIC) involves dealing
with subtle tensions between normalization, graduality, and conservativity with
respect to CIC. Recently, GCIC has been proposed as a parametrized gradual type
theory that admits three variants, each sacrificing one of these properties.
For devising a gradual proof assistant based on CIC, normalization and
conservativity with respect to CIC are key, but the tension with graduality
needs to be addressed. Additionally, several challenges remain: (1) The
presence of two wildcard terms at any type-the error and unknown terms-enables
trivial proofs of any theorem, jeopardizing the use of a gradual type theory in
a proof assistant; (2) Supporting general indexed inductive families, most
prominently equality, is an open problem; (3) Theoretical accounts of gradual
typing and graduality so far do not support handling type mismatches detected
during reduction; (4) Precision and graduality are external notions not
amenable to reasoning within a gradual type theory. All these issues manifest
primally in CastCIC, the cast calculus used to define GCIC. In this work, we
present an extension of CastCIC called GRIP. GRIP is a reasonably gradual type
theory that addresses the issues above, featuring internal precision and
general exception handling. GRIP features an impure (gradual) sort of types
inhabited by errors and unknown terms, and a pure (non-gradual) sort of strict
propositions for consistent reasoning about gradual terms. Internal precision
supports reasoning about graduality within GRIP itself, for instance to
characterize gradual exception-handling terms, and supports gradual subset
types. We develop the metatheory of GRIP using a model formalized in Coq, and
provide a prototype implementation of GRIP in Agda.Comment: 27pages + 2pages bibliograph