mirefek/lean-tactic-programming-guide

Beginner's guide to Tactic Programming in Lean

Lean

93

82 commits

updated Apr 24, 2026

See the code

README

Introduction to Tactic Writing in Lean

Originally, this was a single Lean file, later we extended the tutorial with further files with more advanced topics.

If you are a metaprogramming beginner, we recommend to start with TacticProgrammingGuide.lean. There are 762 lines coverging the basics of Lean tactic writing. We assume you already know Lean, and probably use VS Code, in that case clone this repository, or simply download the file.

Alternatively, you can also copy it to Lean 4 Web but you will miss the Ctrl-click feature.

We tried to explain all the basic concepts but keep at least the introduction it beginner friendly. Enjoy learning Lean metaprogramming. If you are getting confused somewhere, it is probably not your fault. Let us know what needs more clarification in the Zulip thread.

Content

So far, there are three tutorials of increasing difficulty. Although you can scroll through it on Github, we indeed recommend to download the files and play with them.

Contributors

mirefek

68 commits

JovanGerb

11 commits

BoltonBailey

1 commits

pelicanhere

1 commits

mirefek/lean-tactic-programming-guide

Beginner's guide to Tactic Programming in Lean

Lean

93

82 commits

updated Apr 24, 2026

See the code

README

Introduction to Tactic Writing in Lean

Originally, this was a single Lean file, later we extended the tutorial with further files with more advanced topics.

If you are a metaprogramming beginner, we recommend to start with TacticProgrammingGuide.lean. There are 762 lines coverging the basics of Lean tactic writing. We assume you already know Lean, and probably use VS Code, in that case clone this repository, or simply download the file.

Alternatively, you can also copy it to Lean 4 Web but you will miss the Ctrl-click feature.

We tried to explain all the basic concepts but keep at least the introduction it beginner friendly. Enjoy learning Lean metaprogramming. If you are getting confused somewhere, it is probably not your fault. Let us know what needs more clarification in the Zulip thread.

Content

So far, there are three tutorials of increasing difficulty. Although you can scroll through it on Github, we indeed recommend to download the files and play with them.

Contributors

mirefek

68 commits

JovanGerb

11 commits

BoltonBailey

1 commits

pelicanhere

1 commits

Languages

Lean

98.3%

Python

1.7%