Variations on Kirby & Paris' hydra battles and other entertaining math in Coq (collaborative, documented, includes exercises) [maintainer=@Casteran]
81
stars
1,798
commits
Coq
primary language
Jan 22, 2025
updated
This Coq-based project has four parts:
An exploration of some properties of Kirby and Paris' hydra battles, including the study of several representations of ordinal numbers and a part of the so-called Ketonen and Solovay machinery (combinatorial properties of epsilon0).
This part also hosts a formalization by Russell O'Connor of primitive recursive functions and Peano Arithmetic (PA).
Some algorithms for computing x^n with as few multiplications as possible (using addition chains).
A bridge to definitions and results in the Gaia project, in particular on ordinals.
A proof originally by Russell O'Connor of the Gödel-Rosser 1st incompleteness theorem, which says that any first order theory extending NN (which is PA without induction) that is complete is inconsistent.
Both the documentation and the Coq sources are work continuously in progress. For more information on how the project is organized, maintained, and documented, see this paper from the proceedings of JFLA 2022.
hydras, additions, gaia_hydras, GoedelTo get the required dependencies, you can use opam or Nix. With opam:
opam install ./coq-hydra-battles.opam --deps-only to get the hydra battles dependencies;opam install ./coq-addition-chains.opam --deps-only to get the addition chains dependencies.opam install ./coq-gaia-hydras.opam --deps-only to get the gaia hydras dependencies.opam install ./coq-goedel.opam --deps-only to get the Goedel dependencies.With Nix, just run nix-shell to get all the dependencies
(including for building the documentation). If you only want the
dependencies to build a sub-package, you can run one of:
nix-shell --argstr job hydra-battlesnix-shell --argstr job addition-chainsnix-shell --argstr job gaia-hydrasnix-shell --argstr job goedelBuilding the PDF documentation also requires
Alectryon 1.4
and SerAPI.
See doc/movies/Readme.md for details.
The general Makefile is in the top directory:
make : compilation of the Coq scriptsmake pdf : generation of PDF documentation as doc/hydras.pdfmake html : generation of HTML documentation in theories/htmlYou may also rely on dune to install just one part. Run:
dune build coq-hydra-battles.install to build only the hydra battles partdune build coq-addition-chains.install to build only the addition chains partdune build coq-gaia-hydras.install to build only the gaia hydras partdune build coq-goedel.install to build only the goedel partDocumentation for the master branch is continuously deployed at:
theories/ordinals
Hydra/*.v
OrdinalNotations/*.v
Epsilon0/*.v
Schutte/*.v
Gamma0/*.v
rpo/*.v
Ackermann/*.v
MoreAck/*.v
Prelude/*.v
theories/additions/*.v
theories/gaia/*.v
theories/goedel/*.v
exercises/ordinals/*.v
exercises/primrec/*.v
Any suggestion for improving the Coq scripts and/or the documentation will be taken into account.
In particular, we would be delighted to replace proofs with simpler ones, and/or to propose various proofs or definitions of the same concept, in order to illustrate different techniques and patterns. New tactics for automatizing the proofs are welcome too.
Along the text, we propose several projects, the solution of which is planned to be integrated in the development.
Please do not hesitate to send your remarks as GitHub issues and your suggestions of improvements (including solutions of "projects") as pull requests.
Of course, new topics are welcome !
If you wish to contribute without having to clone the project / install the dependencies on your machine, you may use Gitpod to get an editor and all the dependencies in your browser, with support to open pull requests as well.
Contact : pierre dot casteran at gmail dot com
A bibliography is at the end of the documentation. Please feel free to suggest more references to us.
Coq
99.6%
Variations on Kirby & Paris' hydra battles and other entertaining math in Coq (collaborative, documented, includes exercises) [maintainer=@Casteran]
81
stars
1,798
commits
Coq
primary language
Jan 22, 2025
updated
This Coq-based project has four parts:
An exploration of some properties of Kirby and Paris' hydra battles, including the study of several representations of ordinal numbers and a part of the so-called Ketonen and Solovay machinery (combinatorial properties of epsilon0).
This part also hosts a formalization by Russell O'Connor of primitive recursive functions and Peano Arithmetic (PA).
Some algorithms for computing x^n with as few multiplications as possible (using addition chains).
A bridge to definitions and results in the Gaia project, in particular on ordinals.
A proof originally by Russell O'Connor of the Gödel-Rosser 1st incompleteness theorem, which says that any first order theory extending NN (which is PA without induction) that is complete is inconsistent.
Both the documentation and the Coq sources are work continuously in progress. For more information on how the project is organized, maintained, and documented, see this paper from the proceedings of JFLA 2022.
hydras, additions, gaia_hydras, GoedelTo get the required dependencies, you can use opam or Nix. With opam:
opam install ./coq-hydra-battles.opam --deps-only to get the hydra battles dependencies;opam install ./coq-addition-chains.opam --deps-only to get the addition chains dependencies.opam install ./coq-gaia-hydras.opam --deps-only to get the gaia hydras dependencies.opam install ./coq-goedel.opam --deps-only to get the Goedel dependencies.With Nix, just run nix-shell to get all the dependencies
(including for building the documentation). If you only want the
dependencies to build a sub-package, you can run one of:
nix-shell --argstr job hydra-battlesnix-shell --argstr job addition-chainsnix-shell --argstr job gaia-hydrasnix-shell --argstr job goedelBuilding the PDF documentation also requires
Alectryon 1.4
and SerAPI.
See doc/movies/Readme.md for details.
The general Makefile is in the top directory:
make : compilation of the Coq scriptsmake pdf : generation of PDF documentation as doc/hydras.pdfmake html : generation of HTML documentation in theories/htmlYou may also rely on dune to install just one part. Run:
dune build coq-hydra-battles.install to build only the hydra battles partdune build coq-addition-chains.install to build only the addition chains partdune build coq-gaia-hydras.install to build only the gaia hydras partdune build coq-goedel.install to build only the goedel partDocumentation for the master branch is continuously deployed at:
theories/ordinals
Hydra/*.v
OrdinalNotations/*.v
Epsilon0/*.v
Schutte/*.v
Gamma0/*.v
rpo/*.v
Ackermann/*.v
MoreAck/*.v
Prelude/*.v
theories/additions/*.v
theories/gaia/*.v
theories/goedel/*.v
exercises/ordinals/*.v
exercises/primrec/*.v
Any suggestion for improving the Coq scripts and/or the documentation will be taken into account.
In particular, we would be delighted to replace proofs with simpler ones, and/or to propose various proofs or definitions of the same concept, in order to illustrate different techniques and patterns. New tactics for automatizing the proofs are welcome too.
Along the text, we propose several projects, the solution of which is planned to be integrated in the development.
Please do not hesitate to send your remarks as GitHub issues and your suggestions of improvements (including solutions of "projects") as pull requests.
Of course, new topics are welcome !
If you wish to contribute without having to clone the project / install the dependencies on your machine, you may use Gitpod to get an editor and all the dependencies in your browser, with support to open pull requests as well.
Contact : pierre dot casteran at gmail dot com
A bibliography is at the end of the documentation. Please feel free to suggest more references to us.
Coq
99.6%