This is not a particular product, but rather a collection of scratch files and formalizations at different levels of interest.
This has not been set up with a leanpkg.toml
file, because I'm not sure how well leanpkg
deals with projects that don't live at the root of the repo. Instead, I just use a leanpkg.path
file. This file is not versioned, so if you want to compile the lean files, you should create a leanpkg.lean
file at the root of the repo, containing:
builtin_path
path mm0-lean
path path/to/mathlib/src
path path/to/flypitch/src
You must have the mathlib and flypitch projects installed, and should point to them above relative to the mm0
base directory.
-
mm0/set
is a framework for translating theorems fromset.mm
into lean.-
mm0/set/basic.lean
is the initial file, which contains lean definitions replacing all the metamath axioms (mostly "definition axioms"). -
mm0/set/set1.lean
throughmm0/set/set6.lean
are autogenerated files, produced by translatingset.mm
to MM0, and from there to Lean, usingmm0-hs
as follows:stack exec -- mm0-hs from-mm set.mm -f dirith,elnnne0 -o out.mm0 out.mmu stack exec -- mm0-hs to-lean out.mm0 out.mmu -a .basic -c 2000 -o mm0-lean/mm0/set/set.lean
- The
-f dirith,elnnne0
says we are interested in the theoremsdirith
andelnnne0
and their dependents (which is significantly less than all ofset.mm
, and generally preferred if you have a particular goal theorem). - The
-c 2000
controls how many theorems appear in each lean file, because lean tends to choke on very large files.
- The
-
mm0/set/post.lean
is a manually written postprocessing file, that imports the autogenerated theorems and relates Metamath notions to Lean notions, so that one can obtain a native-Lean statement rather than a deep embedded Metamath statement in Lean. Currently, we are demonstrating this by proving theoremdirith'
(Dirichlet's theorem), which uses only Lean definitions but is processed from the analogous MM theoremdirith
.
-
-
mm0/basic.lean
andmm0/meta.lean
are an experimental framework for being able to write MM0 theorems by syntactic restriction of lean theorems, andmm0/set.lean
is a demonstration. -
mm0/mm0b.lean
is a formalization of the MMB operational semantics in lean. -
mm0/fol.lean
is a syntactic model of MM0/ZFC in Lean using deep embedding to schemes in FOL in the language of ZFC. This is WIP but proves soundness of MM0 withset.mm
axioms. -
x86/
contains a number of experimental formalizations relating to verified compilation down to a model ofx86-64
. -
x86/x86.lean
is a formalization of the fullx86
model that is of interest for the MM0 bootstrapping project. It is parallel toexamples/x86.mm0
. -
x86/lemmas.lean
proves some facts about the model, in particular determinism of the decoder. -
x86/assembly.lean
formalizes an initial assembly pass to make labels symbolic and remove explicit reference to the PC. -
x86/matching.lean
andx86/separation.lean
are two competing formalizations for higher level constructs, based on matching logic (see K framework) and separation logic (see Iris et al.) respectively.