# anthropics/fermats-last-theorem architecture

> Architecture diagram of the GitHub repository anthropics/fermats-last-theorem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anthropics/fermats-last-theorem
- Repository: https://github.com/anthropics/fermats-last-theorem

## Overview

This repository is a machine-checked Lean proof of Fermat’s Last Theorem, accompanied by offline proof-browsing pages and independent kernel-checking workflows. The principal result is stated in `Theorems/Thm_fermat_last_theorem.lean`; the README identifies the argument as Frey–Serre–Ribet–Wiles–Taylor–Wiles and says `P2M/Sol/` proofs import the statements they cite. The README also describes theorem and definition pages, search, and landmark graphs. No source excerpts were provided, so edges use only README-documented relationships; internal proof-stage links are omitted where their implementation is not documented.

Main entry points: [`html`](https://github.com/anthropics/fermats-last-theorem/tree/main/html) (Offline pages), [`P2M/Sol`](https://github.com/anthropics/fermats-last-theorem/tree/main/P2M/Sol) (Proof modules), [`PROOF-PATH.md`](https://github.com/anthropics/fermats-last-theorem/blob/main/PROOF-PATH.md) (Proof path), [`verification/comparator`](https://github.com/anthropics/fermats-last-theorem/tree/main/verification/comparator) (Comparator check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_formal_proof["Formal proof"]
  node_flt_statement["FLT statement"]
  node_proof_statements["Proof statements"]
  node_proof_modules["Proof modules"]
  node_definitions["Definitions"]
  node_proof_path["Proof path<br/>[PROOF-PATH.md]"]
end

subgraph group_proof_browser["Proof browser"]
  node_html_home["Offline pages"]
  node_theorem_pages["Theorem pages"]
  node_definition_pages["Definition pages"]
  node_proof_route["Proof route"]
  node_search["Name search"]
  node_landmark_graph["Landmark graph"]
end

subgraph group_independent_checks["Independent checks"]
  node_comparator_check["Comparator check"]
  node_nanoda_check["Nanoda check"]
end

node_lean_user(("Lean user"))
node_lean_kernel["Lean kernel"]
node_nanoda_kernel["Nanoda kernel"]

node_proof_modules -->|"import cited"| node_proof_statements
node_proof_path -->|"names proof theorem"| node_flt_statement
node_lean_user -->|"browses offline"| node_html_home
node_html_home -->|"presents"| node_theorem_pages
node_html_home -->|"presents"| node_definition_pages
node_html_home -->|"presents"| node_proof_route
node_html_home -->|"provides"| node_search
node_html_home -->|"presents"| node_landmark_graph
node_comparator_check -->|"checks build"| node_lean_kernel
node_nanoda_check -->|"checks export"| node_nanoda_kernel

click node_proof_statements "https://github.com/anthropics/fermats-last-theorem/tree/main/Theorems"
click node_proof_modules "https://github.com/anthropics/fermats-last-theorem/tree/main/P2M/Sol"
click node_definitions "https://github.com/anthropics/fermats-last-theorem/tree/main/Definitions"
click node_proof_path "https://github.com/anthropics/fermats-last-theorem/blob/main/PROOF-PATH.md"
click node_html_home "https://github.com/anthropics/fermats-last-theorem/tree/main/html"
click node_theorem_pages "https://github.com/anthropics/fermats-last-theorem/tree/main/html"
click node_definition_pages "https://github.com/anthropics/fermats-last-theorem/tree/main/html"
click node_proof_route "https://github.com/anthropics/fermats-last-theorem/tree/main/html/route"
click node_search "https://github.com/anthropics/fermats-last-theorem/tree/main/html"
click node_landmark_graph "https://github.com/anthropics/fermats-last-theorem/tree/main/html/dag"
click node_comparator_check "https://github.com/anthropics/fermats-last-theorem/tree/main/verification/comparator"
click node_nanoda_check "https://github.com/anthropics/fermats-last-theorem/tree/main/verification/nanoda"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flt_statement,node_proof_statements,node_proof_modules,node_definitions,node_proof_path,node_lean_user toneBlue
class node_html_home,node_theorem_pages,node_definition_pages,node_proof_route,node_search,node_landmark_graph toneAmber
class node_comparator_check,node_nanoda_check toneMint
class node_lean_kernel,node_nanoda_kernel toneIndigo
```

## Components

### Formal proof

- **FLT statement**
- [Proof statements](https://github.com/anthropics/fermats-last-theorem/tree/main/Theorems): `Theorems`
- [Proof modules](https://github.com/anthropics/fermats-last-theorem/tree/main/P2M/Sol): `P2M/Sol`
- [Definitions](https://github.com/anthropics/fermats-last-theorem/tree/main/Definitions): `Definitions`
- [Proof path](https://github.com/anthropics/fermats-last-theorem/blob/main/PROOF-PATH.md): `PROOF-PATH.md`

### Proof browser

- [Offline pages](https://github.com/anthropics/fermats-last-theorem/tree/main/html): `html`
- [Theorem pages](https://github.com/anthropics/fermats-last-theorem/tree/main/html): `html`
- [Definition pages](https://github.com/anthropics/fermats-last-theorem/tree/main/html): `html`
- [Proof route](https://github.com/anthropics/fermats-last-theorem/tree/main/html/route): `html/route`
- [Name search](https://github.com/anthropics/fermats-last-theorem/tree/main/html): `html`
- [Landmark graph](https://github.com/anthropics/fermats-last-theorem/tree/main/html/dag): `html/dag`

### Independent checks

- [Comparator check](https://github.com/anthropics/fermats-last-theorem/tree/main/verification/comparator): `verification/comparator`
- [Nanoda check](https://github.com/anthropics/fermats-last-theorem/tree/main/verification/nanoda): `verification/nanoda`

### Other components

- **Lean user**
- **Lean kernel**
- **Nanoda kernel**

## Connections

- Proof modules → Proof statements: import cited (evidence: `README.md`)
- Proof path → FLT statement: names proof theorem (evidence: `README.md`)
- Lean user → Offline pages: browses offline (evidence: `README.md`)
- Offline pages → Theorem pages: presents (evidence: `README.md`)
- Offline pages → Definition pages: presents (evidence: `README.md`)
- Offline pages → Proof route: presents (evidence: `README.md`)
- Offline pages → Name search: provides (evidence: `README.md`)
- Offline pages → Landmark graph: presents (evidence: `README.md`)
- Comparator check → Lean kernel: checks build (evidence: `README.md`)
- Nanoda check → Nanoda kernel: checks export (evidence: `README.md`)
