• Stars
    star
    253
  • Rank 160,645 (Top 4 %)
  • Language
    HTML
  • Created over 4 years ago
  • Updated 22 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The user home repository for the Mathematics in Lean tutorial.

Mathematics in Lean

This tutorial depends on Lean 4, VS Code, and Mathlib. You can find the textbook both online and in this repository in html format or as a pdf document. The book is designed to be read as you work through examples and exercises, using a copy of this repository on your computer. Alternatively, you can use Gitpod to run Lean and VS Code in the cloud.

This version of Mathematics in Lean is designed for Lean 4 and Mathlib. For the Lean 3 version, see https://github.com/leanprover-community/mathematics_in_lean3.

To use this repository on your computer

Do the following:

  1. Install Lean 4 and VS Code following these instructions.

  2. Make sure you have git installed.

  3. Follow these instructions to fetch the mathematics_in_lean repository and open it up in VS Code.

  4. Each section in the textbook has an associated Lean file with examples and exercises. You can find them in the folder MIL, organized by chapter. We strongly recommend making a copy of that folder and experimenting and doing the exercises in that copy. This leaves the originals intact, and it also makes it easier to update the repository as it changes (see below). You can call the copy my_files or whatever you want and use it to create your own Lean files as well.

At that point, you can open the textbook in a side panel in VS Code as follows:

  1. Type ctrl-shift-P (command-shift-P in macOS).

  2. Type Lean 4: Open Documentation View in the bar that appears, and then press return. (You can press return to select it as soon as it is highlighted in the menu.)

  3. In the window that opens, click on Open documentation of current project.

The textbook and this repository are still a work in progress. You can update the repository by typing git pull followed by lake exe cache get inside the mathematics_in_lean folder. (This assumes that you have not changed the contents of the MIL folder, which is why we suggested making a copy.)

To use this repository with Gitpod

If you have a Gitpod account or are willing to sign up for one, just point your browser to https://gitpod.io/#/https://github.com/leanprover-community/mathematics_in_lean. This creates a virtual machine in the cloud, and installs Lean and Mathlib. It then presents you with a VS Code window, running in a virtual copy of the repository. We still suggest making a copy of the MIL directory, as described in step 5 in the last section. You can update the repository by opening a terminal in the browser and typing git pull followed by lake exe cache get as above.

Gitpod gives you 50 free hours every month. When you are done working, choose Stop workspace from the menu on the left. The workspace should also stop automatically 30 minutes after the last interaction or 3 minutes after closing the tab.

To restart a previous workspace, go to https://gitpod.io/workspaces/. If you change the filter from Active to All, you will see all your recent workspaces. You can pin a workspace to keep it on the list of active ones.

Contributing

PRs and issues should be opened at the upstream source repository.

More Repositories

1

mathlib3

Lean 3's obsolete mathematical components library: please use mathlib4
Lean
1,667
star
2

mathlib4

The math library of Lean 4
Lean
1,482
star
3

lean

Lean 3 Theorem Prover (community fork)
C++
435
star
4

batteries

The "batteries included" extended library for the Lean programming language and theorem prover
Lean
238
star
5

lean4-metaprogramming-book

Lean
211
star
6

tutorials

Some Lean tutorials
Lean
181
star
7

aesop

White-box automation for Lean 4
Lean
180
star
8

lean-liquid

💧 Liquid Tensor Experiment
Lean
176
star
9

lean4game

Server to host lean games.
TypeScript
167
star
10

lean-perfectoid-spaces

Perfectoid spaces in the Lean formal theorem prover.
Lean
115
star
11

ProofWidgets4

Helper toolkit for creating your own Lean 4 UserWidgets
Lean
102
star
12

NNG4

Natural Number Game
Lean
99
star
13

quote4

Intuitive, type-safe expression quotations for Lean 4.
Lean
73
star
14

con-nf

A formal consistency proof of Quine's set theory New Foundations
Lean
66
star
15

lean-auto

Experiments in automation for Lean
Lean
66
star
16

lftcm2020

Lean for the Curious Mathematician 2020
Lean
63
star
17

lean4web

The Lean 4 web editor
TypeScript
62
star
18

format_lean

A Lean file formatter
Python
62
star
19

iris-lean

Lean 4 port of Iris, a higher-order concurrent separation logic framework
Lean
62
star
20

lean4-mode

Emacs major mode for Lean 4
Emacs Lisp
60
star
21

leanprover-community.github.io

Hosts the website for mathlib and other Lean community infrastructure.
CSS
52
star
22

flt-regular

Fermat's Last Theorem for regular primes
Lean
51
star
23

lean-client-python

Python talking to the Lean theorem prover
Python
41
star
24

mathport

Mathport is a tool for porting Lean3 projects to Lean4
Lean
39
star
25

sphere-eversion

Formalization of the existence of sphere eversions
Lean
36
star
26

mathlib-tools

Development tools for https://github.com/leanprover-community/mathlib
Python
33
star
27

mathzoo

Lean mathzoo
Lean
23
star
28

repl

A simple REPL for Lean 4, returning information about errors and sorries.
Lean
22
star
29

doc-gen

Generate HTML documentation for mathlib and Lean
Python
21
star
30

leancrawler

An obsolete python library which gathers statistics and relational information about Lean 3 libraries.
Python
17
star
31

llm

Interfacing with Large Language Models (remote and local) from Lean.
Lean
13
star
32

mathlib3port

Synport output from mathport for mathlib3
Lean
11
star
33

lean-sensitivity

A formalization of Huang's degree theorem
Lean
8
star
34

duper

Lean
7
star
35

mathlib4_docs

7
star
36

highlightjs-lean

A highlight.js language grammar for the Lean theorem proving language.
JavaScript
7
star
37

import-graph

Tool to analyse the import structure of lean projects.
Lean
7
star
38

blog

Source for the community blog
Python
6
star
39

mathlib_docs

Hosts the HTML documentation for mathlib.
6
star
40

liquid

Website and documentation for the Liquid Tensor Experiment
TeX
6
star
41

lt2021

Website for Lean Together 2021
JavaScript
5
star
42

plausible

Lean
5
star
43

lean-mode-contrib

Emacs Lisp
4
star
44

mathlib-nursery

Lean
3
star
45

yasnippet-lean

YASnippet
3
star
46

mathlib-port-status

Tools for managing the status of the port
Jinja
3
star
47

archive-old

HTML
3
star
48

LeanSearchClient

Syntax for searching with natural language from Lean, using https://leansearch.net/ (may extend to other services)
Lean
3
star
49

logic_and_proof

TeX
3
star
50

archive

Replacement for the archive repo
HTML
2
star
51

mathlib_docs_demo

2
star
52

tutorials4

Lean 4 tutorial files
Lean
2
star
53

lean3port

Stub for downloading mathport artifacts for Lean 3
Lean
1
star
54

test-mathport

Dockerfile
1
star
55

mathlib_stats

Display gitstats output on the mathlib website
Python
1
star
56

witt-vectors

1
star
57

azure-scripts

scripts and cron jobs for Azure
Python
1
star
58

mathlib-nightly

stores nightly releases of mathlib
1
star