This is a textbook for learning logic and proofs,
as well as interactive theorem proving with lean4,
written by Jeremy Avigad, Joseph Hua, Robert Y. Lewis, and Floris van Doorn.
The web version is available here.
It is based on the older version
available here,
which uses lean3.
We need
- an old version of
pythone.g. 3.5.4 - the virtual environment for this version of
python convertfrom imagemagickxelatexandlatexmk
- there are many ways of installing
xelatexandlatexmk, we won't describe them here - note that
latexmkmight come under some other package such astexlive-binextra
- install
pyenv - install suitable version of python e.g.
python3.5.4usingpyenvby doingpyenv install 3.5.4 - change global python version to
3.5.4by doingpyenv global 3.5.4 - check versions by doing
pyenv versions - install
pyenv-virtualenv - add the following to
~/.bashrc(or equivalent)export PYENV_ROOT="$HOME/.pyenv" command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" - close and reopen terminal for changes to take effect
- make a virtual environment. We called it environment3.5.4
pyenv virtualenv 3.5.4 environment3.5.4 - you can activate the virtual environment by doing
pyenv activate environment3.5.4 - then install
sphinxusingpipinside virtual environmentpip install --trusted-host pypi.python.org sphinx source deactivatewill deactivate the virtual environment
-
clone the project into project directory
/logic_and_proof/,git clone https://github.com/leanprover-community/logic_and_proof.git cd logic_and_proof -
go to
MAKEand make sureVENVDIR := "$HOME/.pyenv/versions/environment3.5.4"so that
makewill use the virtual environment we made. If you chose a different name for the virtual environment, change this line accordingly. -
now in project directory, with the virtual environment active, we can do
make images make html make latexpdf -
The call to
make imagesis also only required the first time, or if you add new latex source tolatex_imagesafter that. -
note that the original
make install-depsseems to no longer work because the link https://bitbucket.org/gebner/pygments-main/get/default.tar.gz#egg=Pygments is dead. This would give a bundled version of Sphinx and Pygments with improved syntax highlighting for Lean.