Fermat's Last Theorem (FLT) Project

repository·main·Indexed 21 days ago

https://github.com/imperialcollegelondon/flt

A large-scale effort to formalize a modern proof of Fermat's Last Theorem using the Lean interactive theorem prover. The project utilizes the Verso Blueprint framework to manage complex mathematical dependencies and generate interactive, graph-based documentation that links mathematical statements to Lean declarations.

Tokens
6.3K
Snippets
16
Records
32
Agent score
70%

What's inside flt

  1. Overview of the Fermat's Last Theorem (FLT) Project

    main
    The FLT project is a large-scale effort to formalize a modern proof of Fermat's Last Theorem using the Lean interactive theorem prover (ITP). The goal is to translate complex 20th-century mathematical theories—such as automorphic forms, L-functions, Galois representations, and modularity lifting theorems—into a computer-verifiable format. The project aims to reduce FLT to claims known by the end of the 1980s and uses the blueprint software framework to manage the complex dependency graph of the proof.
  2. Use labels for node identity and dependencies

    main

    Blueprint nodes (statements, groups, authors, etc.) are identified by unique labels chosen by the author. These labels are stable identifiers used for:

    • Dependency references: Using {uses "label"}[] to create a dependency edge in the graph.
    • Link-only references: Using {bpref "label"}[] to link to a node without registering a formal dependency.
    • Code attachment: Labeling inline lean or rust blocks to attach them to a Blueprint node.
    • Metadata: Used in summary pages, graphs, and exported metadata.

    Tip: Choose labels early and treat them as stable project identifiers. If a role like {uses "label"}[] has an empty payload, Blueprint can automatically generate visible text (e.g., Theorem N).

  3. Use labels to identify and link Blueprint nodes

    main

    Labels are the core of the Blueprint system. Authors choose stable labels (e.g., addition_spec, multiplication_assoc) to identify nodes. These labels enable:

    • Dependency Tracking: Use {uses "label"}[] to indicate that a node mathematically depends on the target. Blueprint resolves these forward references during the build.
    • Prose References: Use {bpref "label"}[] to create a link in the text that renders as a Blueprint link but does not add an edge to the dependency graph or summary.
    • Code Attachment: Attach inline Lean code or raw TeX source using labeled lean or tex code blocks.
    • Metadata Tagging: Tag compiled declarations using @[blueprint "label"].
    • Graph/Summary Identification: Identify nodes in the generated summary and graph views.

    If the payload of a uses or bpref command is empty (e.g., {uses "label"}[]), Blueprint automatically generates visible text like Theorem N.

  4. Understand the Dimension Theorem formalization

    main

    This module proves the dimension theorem for Noetherian local rings. It establishes that the Krull dimension of a ring $R$ is equal to both the growth degree of its Hilbert-Samuel function and the minimum number of generators of an ideal whose radical is the maximal ideal.

    The core theorem is expressed as the cycle: dim R ≤ growthDeg R ≤ minGenPrimary R ≤ dim R.

    Key definitions used:

    • growthDeg R: The least exponent bounding the Hilbert-Samuel function $n \mapsto \text{length}(R / \mathfrak{m}^n)$. Note that this is treated as a formal growth order rather than a constructed polynomial.
    • minGenPrimary R: The least number of generators of an ideal whose radical is the maximal ideal.
    • ringKrullDim R: The Krull dimension of the ring.
    ringKrullDim R = (growthDeg R : WithBot ℕ∞)
    ringKrullDim R = (minGenPrimary R : WithBot ℕ∞)
  5. The Blueprint software framework

    main

    The blueprint software, developed by Patrick Massot, is a framework used to enable collaboration on large-scale formalization projects. It provides tools for:

    • Dependency Management: Creating a blueprint graph that visualizes the progress and logical dependencies of a proof.
    • Mathematical Roadmapping: Providing a structured way to write mathematical proofs (often in LaTeX) that serve as a roadmap for formalization in an ITP like Lean.
    • Collaboration: Facilitating the transition of mathematical ideas from paper to code by allowing experts to state results clearly for others to formalize.
  6. Understand the structure of a Blueprint project

    main

    A Blueprint project consists of three primary components:

    1. Chapter Modules: One or more Lean files containing the mathematical content.
    2. Blueprint Top-level File: An assembly file (often named Contents.lean in older examples) that organizes the document and includes chapters.
    3. Generator Entry Point: A file (e.g., ProjectTemplateMain.lean) that renders the site.

    Key files in a standard template include lakefile.lean for package configuration and the generator entry point.

  7. Understand the Blueprint mental model

    main

    A Blueprint project is composed of three primary components:

    1. Chapter modules: Lean files containing the mathematical content and Blueprint blocks.
    2. Top-level Blueprint file: An assembly file (often named Contents.lean, though the name is arbitrary) that imports chapters and configures global pages.
    3. Generator entry point: A file that handles the rendering of the site.

    This structure allows you to separate mathematical content from the document assembly and the final rendering logic.

  8. Verify the Dimension Theorem implementation

    main

    To verify that the formalization is complete and does not rely on unproven assumptions (using sorry), use the lake build command. You can then inspect the axioms used by the theorem to ensure it only relies on standard Lean axioms.

    Run the following commands:

    # Compile the package
    lake build FLT.Slop.DimensionTheorem
    
    # Check the axioms used by the theorem
    #print axioms DimensionTheorem.dimension_theorem

    A successful verification should report only the three standard axioms: [propext, Classical.choice, Quot.sound].

    lake build FLT.Slop.DimensionTheorem
  9. Create Blueprint blocks in chapters

    main

    Blueprint chapters use specific block forms to define mathematical objects. These blocks can be nested or linked via parent attributes.

    Core Block Forms:

    • :::definition "label"
    • :::lemma_ "label"
    • :::theorem "label"
    • :::corollary "label"
    • :::proof "label" (Attaches to the preceding statement with the same label)
    • :::group "label" (Used for grouping related statements)
    • :::author "id" (name := "Name") (Assigns authorship)

    Example usage:

    :::definition "addition_spec" (parent := "addition_core")
    We write $`a + b` for the result of adding $`b` to $`a`.
    :::
    
    :::theorem "addition_right_identity" (parent := "addition_core") (owner := "project_author")
    For every natural number $`n`, adding zero on the right leaves it unchanged: $`n + 0 = n`.
    :::
    
    :::proof "addition_right_identity"
    Induct on $`n`.
    :::
  10. How to contribute to the FLT project

    main

    The project is open-source and relies on crowd-sourcing mathematical expertise. To participate:

    1. Explore the codebase: The formalization work is hosted on GitHub at https://github.com/ImperialCollegeLondon/FLT.
    2. Review the roadmap: Use the blueprint (an in-progress LaTeX write-up) and the blueprint graph (a dependency graph showing current progress) to understand the mathematical route being taken.
    3. Collaborate via Zulip: The primary research forum for real-time collaboration between mathematicians and computer scientists is the FLT stream on Lean Zulip. This is the recommended place to make yourself known if you wish to contribute code or mathematical proofs.
  11. Connect Blueprint blocks to Lean code

    main

    There are three ways to link Blueprint statements to Lean formalization:

    1. Inline Lean code: Attach a labeled lean block directly after a Blueprint block using the same label. This is best for local formalization.
    2. Compiled Lean declarations: Use the @[blueprint "label"] attribute on an existing Lean theorem or definition. Blueprint will register it as a node and attempt to use its docstring as the informal statement.
    3. Existing Lean declarations: Use the (lean := "declaration_name") option in a Blueprint block to point to a Lean-owned declaration without re-stating it.

    Reference Table:

    MethodSyntaxUse Case
    Inline```lean "label"Local code in the same project
    Attribute@[blueprint "label"]Registering existing Lean code as a Blueprint node
    Pointer(lean := "Name")Linking an informal block to an existing Lean name

    Note: (lean := "Name") supports comma-separated lists like (lean := "Nat.add, Nat.succ").

    // Method 2: Attribute
    @[blueprint "addition_assoc_compiled"]
    theorem addition_assoc_compiled (a b c : Nat) : (a + b) + c = a + (b + c) := by
      simpa [Nat.add_assoc]
    // Method 3: Pointer
    :::theorem "addition_assoc" (lean := "Nat.add_assoc")
    For all natural numbers $`a`, $`b`, and $`c`, addition is associative.
    :::