The kernel's code from Lecture 3

Course page · chapter in the book · slides · Boole Lab

A minimal kernel for equational logic, tactics and the axioms of Boolean algebra — exactly the code that runs in the notebooks of the chapter and in the Boole Lab. Python 3.10 or newer is enough, with no additional libraries. Save the files in one folder (for example next to a downloaded notebook).

Each file opens in a reader with colored syntax, line numbers you can link to, an outline and names that lead to their definitions; the reader has a link to the raw file.

The code of the lecture

Proof compression (a deep dive)

The Boole Lab

The same in Lean 4

Example:

from boolean import theory_with_theorems
from syntax import lean
B, proofs = theory_with_theorems()
print(lean(proofs["add_idem"]))

The Polish book and slides show a Polish version of the lecture code (jadro/: jadro.py, skladnia.py, taktyki.py, boole.py). It is generated from these English files with a dictionary of names and comments, so the two versions are the same program.