• Stars
    star
    176
  • Rank 216,783 (Top 5 %)
  • Language Lean
  • Created almost 4 years ago
  • Updated 9 months ago

Reviews

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

Repository Details

šŸ’§ Liquid Tensor Experiment

Liquid Tensor Experiment

Gitpod Ready-to-Code

For the eponymous blogpost by Peter Scholze which started it all: see https://xenaproject.wordpress.com/2020/12/05/liquid-tensor-experiment/.

The main aim of this community-owned repository is to digitise some mathematical definitions, theorem statements and theorem proofs. Digitisation, or formalisation, is a process where the source material, typically a mathematical textbook or a pdf file or website or video, is transformed into definitions in a target system consisting of a computer implementation of a logical theory (such as set theory or type theory).

The source

The main "source" definitions, theorems and proofs in this repository are all taken from Scholze's Bonn lecture notes Analytic.pdf explaining some of his work with Clausen on the theory of solid and liquid modules, and on their development of a new approach to certain proofs in complex analytic geometry.

The target

The formal system which we are using as a target system is Lean's dependent type theory. Lean is a project being developed at Microsoft Research by Leonardo de Moura and his team. Our formalisation could not have even started without a major classical mathematical library backing it up, and so we chose Lean 3 as the engine behind the project. Although Lean 4's type theory is the same as Lean 3's type theory, it currently lacks the mathematical infrastructure needed for this project.

Brief overview of the project

The challenge in the blog post is to formalise its Theorem 1.1, a variant of Analytic 9.1 (i.e. Theorem 9.1 of Analytic.pdf) in Lean.

When the project started, it was immediately noticed that there was a "sub-boss" in the form of Analytic 9.4, a far more technical theorem involving a completely different class of objects and which Scholze was claiming was a sufficiently powerful stepping stone. The project then split into two sub-projects: "Prove Analytic 9.4" and "Prove that Analytic 9.4 implies Theorem 1.1"

An important intermediate achievement was the completion of a blueprint for the proof of 9.4 and the related 9.5. The blueprint was a guide which was comprehensible to mathematicians who had no Lean training, whilst also being a visual guide to where progress was needed during the formalisation process.

The preliminary announcement of a proof of Theorem 9.4 was made on 28th May 2021, by Johan Commelin and his team from the Lean prover community. The second half of the project was completed on 14th July 2022. Together, the two components give a formal verification of Theorem 1.1 of the blogpost.

The formal statement of Analytic 9.4

The statement can be found in src/liquid.lean

theorem first_target :
  āˆ€ m : ā„•, āˆƒ (k K : ā„ā‰„0) [fact (1 ā‰¤ k)] (cā‚€ : ā„ā‰„0),
  āˆ€ (S : Type) [fintype S] (V : SemiNormedGroup.{0}) [normed_with_aut r V],
    ā€‹((BD.data.system Īŗ r V r').obj (op $ of r' (Lbar r' S))).is_weak_bounded_exact k K m cā‚€ := _

See src/liquid.lean for details on how to read this statement.

The formal statement of Theorem 1.1

The statement can be found in src/challenge.lean

variables (p' p : ā„ā‰„0) [fact (0 < p')] [fact (p' < p)] [fact (p ā‰¤ 1)]

theorem liquid_tensor_experiment (S : Profinite.{0}) (V : pBanach.{0} p) :
  āˆ€ i > 0, Ext i (ā„³_{p'} S) V ā‰… 0 :=

How to browse this repository

Blueprint

Below we explain how to engage with the Lean code directly. We also provide a blueprint including two dependency graphs of the main ingredients in the repository. All material in the blueprint is cross-referenced with the Lean formalization using hyperlinks.

Getting the project

At the moment, we support two ways of browsing this repository: Either via Gitpod or by using a Lean development environment.

Crucially, both methods will allow you to introspect Lean's "Goal state" during proofs, and easily jump to definitions or otherwise follow paths through the code.

Gitpod provides an online Lean environment, but requires a GitHub account and might have weaker performance than a local installation. To use it, simply click the Gitpod button at the top of this Readme file.

To install a Lean development environment on your computer please use the installation instructions to install Lean and a supporting toolchain. After that, download and open a copy of the repository by executing the following command in a terminal:

leanproject get lean-liquid
code lean-liquid

For detailed instructions on how to work with Lean projects, see this. The script scripts/get-cache.sh in the folder lean-liquid will download the olean files created by our continuous integration. This will save you some time by not havig to do leanproject build.

Reading the project

With the project opened in VScode, you are all set to start exploring the code. There are two pieces of functionality that help a lot when browsing through Lean code:

  • "Go to definition": If you right-click on a name of a definition or lemma (such as Lbar, or Tinv_continuous), then you can choose "Go to definition" from the menu, and you will be taken to the relevant location in the source files. This also works by Ctrl-clicking on the name.
  • "Goal view": in the event that you would like to read a proof, you can step through the proof line-by-line, and see the internals of Lean's "brain" in the Goal window. If the Goal window is not open, you can open it by clicking on one of the icons in the top right hand corner.

Important files in the project

  • All the Lean code (the juicy stuff) is contained in the directory src/.
  • The file src/challenge.lean contains the statement of the main theorem.
  • The file src/liquid.lean contains the statement of the first target (the first half of the project).
  • The directory src/examples/ contains Lean files that explain the main ingredients in the statement of the main theorem. These files should form convincing evidence that we did not make a mistake in formalizing the necessary definitions.
  • The directory src/for_mathlib/ contains preliminary material that is gradually being moved to mathlib, the main library of mathematics for Lean.

Brief note on type theory

Lean is based on type theory, which means that some things work slightly differently from set theory. We highlight two syntactical differences.

  • Firstly, the element-of relation (āˆˆ) plays no fundamental role. Instead, there is a typing judgment (:).

    This means that we write x : X to say that "x is a term of type X" instead of "x is an element of the set X". Conveniently, we can write f : X ā†’ Y to mean "f has type X ā†’ Y", in other words "f is a function from X to Y".

  • Secondly, type theorists do not use the mapsto symbol (ā†¦), but instead use lambda-notation. This means that we can define the square function on the integers via Ī» x, x^2, which translates to x ā†¦ x^2 in set-theoretic notation. For more information about Ī», see the Wikipedia page on lambda calculus.

For a more extensive discussion of type theory, see the dedicated page on the perfectoid project website.

Source reference

[Analytic] : http://www.math.uni-bonn.de/people/scholze/Analytic.pdf

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

mathematics_in_lean

The user home repository for the Mathematics in Lean tutorial.
HTML
253
star
5

batteries

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

lean4-metaprogramming-book

Lean
211
star
7

tutorials

Some Lean tutorials
Lean
181
star
8

aesop

White-box automation for Lean 4
Lean
180
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