A formalization of type theory in Coq
This Coq library formalizes dependent type theory in the style of Per Martin-Löf. The formalization is configurable in the sense that various components can be turned on or off, or be left ambivalent. It is thus easy to instantiate many variants of type theory, such as extensional vs. intensional, with or without universes, etc. The library also formalizes several meta-theorems about type theory.
Requirements for compiling the library
The library works with Coq 8.6, and probably with many other recent versions as well, as it does not use any special features of Coq. You may find out about the best way to install Coq at the Coq web site.
To compile the library you need Coq and
Requirements for generating the LaTeX version of rules
mathpartir package is GNU-licensed, and we do not want a viral license, the
compilation script attempts to download it using the
wget commands. If
neither is available, you will have
and place it in the
latex subfolder of the repository.
The best way to download the library is to clone it from GitHub. If you do not use git (you should) then you can just download the ZIP file of the latest version. Even better, you can fork the repository so that you can easily send us your improvements (see the section on contributions below).
To compile the library and the LaTeX version of the rules run
from the command line. The library is in the
src subfolder and the PDF with the rules is
Specific targets for
clean-- clean files
latex/rules.pdf-- the rules in PDF, the file can be found in
latex/rulesParanoid.pdf-- the rules in PDF, but with preconditions
library-- compile the library only
make latex/rules.pdf generates the file
Using the library
This section briefly describes how the library is structured and how it can be used and extended.
src folder contains the Coq files. Here is an overview of what is in them:
config.v-- configuration options
config_tactics.v-- tactics for dealing with configuration options
ett.v-- economic type theory
ett2ptt.v-- proof that we can pass from economic to paranoid type theory
ett_sanity.v-- proof that economic type theory is sane
inversion.v-- inversion lemmas
negfunext.v-- proof that function extensionality is not provable in MLTT
ptt.v-- paranoid type theory
ptt2ett.v-- proof that we can pass from paranoid to economic type theory
ptt_admissible.v-- various admissibility lemmas for paranoid type theory
ptt_inversion.v-- inversion principles for paranoid type theory
ptt_sanity.v-- proof that paranoid type theory is sane
substitution_elim.v-- an attempt to show that explicit substitutions can be computed
syntax.v-- definition of presytnax
tactics.v-- tactics for working with the library
tt.v-- all the rules of type theory
uniqueness.v-- proof of uniqueness of typing
The current version of the library is on the
master branch, the rest is kept around for legacy:
mastercontains the current status of the translation (sanity is being handled, as well as uniqueness of typing),
zero-shiftcontains another formulation of type theory where substitutions have context annotations (probably a bad idea)
simpler-substitutionsremoves all annotations from substitutions but this results in the loss of uniqueness of typing,
faster-magicis its counter-part and maybe should be kept instead of
untyped-reflcorrresponds to an experiment regarding the removal of typing annotation to
inversioncorresponds to inversion lemmata (probably subsumed by more recent work),
into-coq-attemptwere branches where we were trying to eliminate reflection by translation from our formalised type theory to Coq directly, but e failed.
bool-disjointis about showing that
true = false -> Empty(inside the theory),
bool-large-elimis about adding large elimination for Bool.
How the library is structured
(To be written)