https://github.com/leanprover/tutorial
Lean Tutorials
https://github.com/leanprover/tutorial
Last synced: about 1 year ago
JSON representation
Lean Tutorials
- Host: GitHub
- URL: https://github.com/leanprover/tutorial
- Owner: leanprover
- License: apache-2.0
- Archived: true
- Created: 2014-10-30T19:16:20.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-10-04T07:37:01.000Z (over 5 years ago)
- Last Synced: 2025-02-16T23:42:05.206Z (over 1 year ago)
- Language: TeX
- Homepage: https://leanprover.github.io/tutorial
- Size: 7.95 MB
- Stars: 44
- Watchers: 8
- Forks: 46
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/leanprover/tutorial)
Lean Tutorial
=============
- Web : https://leanprover.github.io/tutorial
- PDF : https://leanprover.github.io/tutorial/tutorial.pdf
Please note that this is the tutorial for [Lean 2](https://github.com/leanprover/lean2), which allows the use of homotopy type theory (HoTT). It is /not/ the [tutorial](https://leanprover.github.io/introduction_to_lean) for the [current version of Lean](https://github.com/leanprover/lean).
How to Build
------------
We use [cask][cask] to install emacs dependencies ([org-mode][org-mode], [lean-mode][lean-mode], [htmlize][htmlize]) and [pygments][pygments] and [minted][minted] to syntax-highlight Lean code in LaTeX. We assume that you already have emacs-24.3 or higher installed in your system.
```
sudo apt-get install mercurial python2.7 texlive-latex-recommended \
texlive-humanities texlive-xetex texlive-science \
texlive-latex-extra texlive-fonts-recommended texlive-luatex\
bibtex2html git make mercurial autoconf automake gcc curl
git clone https://github.com/leanprover/tutorial
cd tutorial
tar xvfz header/l3kernel.tar.gz -C ~/
make install-cask # after this, you need to add the cask binary to your $PATH
make install-pygments
make
```
[cask]: https://github.com/cask/cask
[org-mode]: http://orgmode.org/
[lean-mode]: https://github.com/leanprover/lean/tree/master/src/emacs
[htmlize]: https://github.com/emacsmirror/htmlize
[pygments]: http://pygments.org/
[minted]: https://github.com/gpoore/minted
Automatic Build using Watchman
------------------------------
Using [watchman][watchman], we can detect any changes on the
org-files, and trigger re-builds automatically on the background.
To install [watchman][watchman]:
```
sudo apt-get install automake
make install-watchman
```
To enable watch:
```
make watch-on
```
To disable watch:
```
make watch-off
```
[watchman]: https://github.com/facebook/watchman
How to preview generated HTML files
-----------------------------------
It requires a webserver to preview generated HTML files. We can use Python's `SimpleHTTPServer` module:
```bash
tutorial $ python -m SimpleHTTPServer
```
The above command starts a HTTP server at `tutorial` directory (default port: `8000`). For example, `01_Introduction.html` is available at `http://localhost:8000/01_Introduction.html`.
Auto-reload HTML page
---------------------
- Firefox: [Auto Reload][firefox-auto-reload] add-on
- Tools > AutoReload Preferences

- Create Reload Rule

- Link .html in the filesystem

- Chrome: [Tincr][google-tincr] (does *not* work on Linux)
- Right-click and choose "Inspect Element"

- Go to "tincr" tab, choose "Http Web Server" for project type, then select Root directory.

[firefox-auto-reload]: https://addons.mozilla.org/en-US/firefox/addon/auto-reload
[google-tincr]: http://tin.cr
Test Lean Code in .org files
----------------------------
1. Using Native Lean: First, you need to install Lean. Please follow the instructions at the [download page](http://leanprover.github.io/download/). You can test all Lean code blocks in `*.org` files by executing the following command:
```bash
make test
```
To use a specific binary of Lean in test, please do the following:
```bash
LEAN_BIN=/path/to/your/lean make test
```
2. Using Lean.JS:
```bash
make test_js
```