TL;DR
This paper demonstrates that shallow embedding of type theory in proof assistants is morally correct by ensuring injectivity and soundness, enabling formal reasoning about syntax with minimal technical overhead.
Contribution
It introduces a method to shallowly embed type theory that preserves syntactic distinctions and avoids illegal equalities, applicable in all major dependent type theory proof assistants.
Findings
Shallow embedding is injective up to definitional equality.
Implementation hiding prevents illegal propositional equalities.
Technique is demonstrated with formalizations of canonicity and parametricity.
Abstract
There are multiple ways to formalise the metatheory of type theory. For some purposes, it is enough to consider specific models of a type theory, but sometimes it is necessary to refer to the syntax, for example in proofs of canonicity and normalisation. One option is to embed the syntax deeply, by using inductive definitions in a proof assistant. However, in this case the handling of definitional equalities becomes technically challenging. Alternatively, we can reuse conversion checking in the metatheory by shallowly embedding the object theory. In this paper, we consider the standard model of a type theoretic object theory in Agda. This model has the property that all of its equalities hold definitionally, and we can use it as a shallow embedding by building expressions from the components of this model. However, if we are to reason soundly about the syntax with this setup, we must…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
