跳到正文
The Lumenary
本科低年级Computation计划中

Formalising mathematics in Lean and Mathlib

Formalising undergraduate mathematics in Lean 4 with Mathlib: structures and type classes, sets and functions, quantifier reasoning, algebraic structures, and searching and contributing to a large library.

math.comp.formal-proof-lean

本主题的课程尚未编写。下面的提纲是课程地图的一部分,尚未经过审校。

前置知识

16 项必需的前置知识(一直追溯到底)

你将学会

  • Formalise definitions and proofs about sets, functions and quantifiers, such as the fact that a composite of injections is injective.
  • Use Mathlib's algebraic hierarchy to state and prove results about groups and rings.
  • Search Mathlib for existing results and explain the trade-off between using library lemmas and proving from scratch.

定义

  • Mathlib is the community-maintained mathematical library for Lean 4.
  • A type class packages structure, such as a group operation, which Lean then finds automatically by instance search.
  • A structure in Lean is a type whose elements bundle several fields, such as the carrier operations and laws of a monoid.

定理

  • Mathlib's Function.Injective.comp states that a composite of injective functions is injective.
  • Lean's #print axioms command lists the axioms on which a proof depends.
  • A formal library is useful only if its definitions match standard mathematical usage, which people must check.

常见误解

  • Thinking formalisation is mere translation; it often exposes hidden assumptions and edge cases.
  • Believing Lean's convention x / 0 = 0 changes mathematics; it is a definitional convenience, and theorems carry hypotheses such as x ≠ 0 where needed.

通向

可选发现

学习路径

延伸阅读