[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-95905":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":8,"rankLanguage":8,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":8,"pushedAt":8,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":14,"starSnapshotCount":14,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},95905,"fermats-last-theorem","anthropics\u002Ffermats-last-theorem","anthropics",null,"Lean",1005,83,4,1,0,388,18.77,"Apache License 2.0",false,"main",true,[],"2026-09-21 02:04:29","# Fermat's Last Theorem in Lean 4\n\nA complete, machine-checked proof of Fermat's Last Theorem in [Lean 4](https:\u002F\u002Flean-lang.org), built on\n[Mathlib](https:\u002F\u002Fgithub.com\u002Fleanprover-community\u002Fmathlib4) (Lean 4.33.1; Mathlib `v4.33.0`, pinned by commit in\n`lakefile.lean`). The argument is that of Frey, Serre, Ribet, Wiles and Taylor-Wiles. `PROOF-PATH.md` names each step\nand the Lean theorem that carries it, and the `html\u002F` folder presents the whole proof as web pages you can browse\noffline (see \"Reading the proof in a browser\" below).\n\nResearch artifact. Not maintained and not accepting contributions.\n\n## The statement\n\n`Theorems\u002FThm_fermat_last_theorem.lean` declares\n\n~~~lean\ntheorem fermat_last_theorem (n : ℕ) (hn : 3 ≤ n) (a b c : ℕ) (ha : 0 \u003C a) (hb : 0 \u003C b) (hc : 0 \u003C c) : a ^ n + b ^ n ≠ c ^ n\n~~~\n\nand the default build target `FinalCheck.lean` contains\n\n~~~lean\n\u002F-- info: 'fermat_last_theorem' depends on axioms: [propext, Classical.choice, Quot.sound] -\u002F\n#guard_msgs in\n#print axioms fermat_last_theorem\n~~~\n\nso the build fails unless the proof rests on exactly Lean's three standard axioms (no `sorry`, no added `axiom`,\nno `native_decide`). `FinalCheck.lean` also derives Mathlib's own statement, `FermatLastTheorem`, from this theorem.\n\n## How it was verified\n\n- **Build.** A from-scratch `lake build` on Lean 4.33.1 (which includes the 2026 kernel soundness fixes), with\n  Mathlib compiled from source. All 60,475 modules of this repository built, every declaration was checked by the\n  Lean kernel, and the axioms are as above.\n- **comparator.** [leanprover\u002Fcomparator](https:\u002F\u002Fgithub.com\u002Fleanprover\u002Fcomparator) `v4.33.0` checked the build against\n  `verification\u002Fcomparator\u002FChallenge.lean`, which states the theorem using only Mathlib. It confirmed that the proved\n  statement and every constant it mentions are identical to the challenge, that no other axiom is used, and that the\n  whole proof, Mathlib included, replays through the Lean kernel. Verdict: `Your solution is okay!`\n- **A second kernel.** [nanoda](https:\u002F\u002Fgithub.com\u002Fammkrn\u002Fnanoda_lib) 0.4.13, an independent Lean kernel written in\n  Rust, accepted an export of the same environment (written with lean4export): `Checked 1052234 declarations with no\n  errors`. We built nanoda with four small patches of our own (`verification\u002Fnanoda\u002Fpatches\u002F`): one adds progress output and\n  three speed up its definitional-equality search, without which a few declarations of this proof occupy unmodified\n  nanoda for many hours each. None of the patches adds, removes or weakens a typing rule.\n\nNo module contains `axiom`, `sorry`, `native_decide`, `unsafe`, `extern`, `implemented_by`, `partial def` or `#eval`\n(`Challenge.lean` uses `sorry` by design and is not part of the package).\n\nTogether, these checks establish that the statement above follows from the three axioms, given trust in the Lean\nkernel (or nanoda) and the checking tools. The statement is written with Lean's built-in natural numbers, `+`, `≤`, `\u003C`\nand `≠`; its one Mathlib ingredient is `^` on ℕ, which Mathlib defines as Lean's built-in exponentiation, and\ncomparator checks that every definition the statement mentions is identical to stock Mathlib's. Nothing else in\nMathlib has to be trusted, because the kernel checks everything beneath the statement. What no tool can check is that\neach intermediate theorem means what its name suggests; that is for the reader to judge, and `PROOF-PATH.md` names\nthe Lean theorem behind each step and states exactly how strong each named classical result is as proved here.\n\n## Reading the proof in a browser\n\nThe `html\u002F` folder (about 390 MB) presents this repository as static web pages: the route of the proof step by step;\na page for each of the 29,511 theorems (the exact Lean statement, what it cites and what cites it, and an expandable\ndependency graph) and for each of the 1,450 definition modules (the full source and which statements use it); a\nsearch box over all theorem and definition names; the landmark theorems as a graph; and `README.md`, `PROOF-PATH.md`\nand `ATTRIBUTION.md` rendered with cross-links. The folder is part of this repository, so a clone or a ZIP download\nalready contains it (if you obtained `html\u002F` as a separate archive, unpack it at the repository root). Open\n`html\u002Findex.html` in a web browser; everything works offline, with no web server. The pages were machine-tested in a\nChromium-based browser only, and `html\u002FREADME-DOCS.md` explains what is quoted from the Lean files and what is\ngenerated (the English summaries and suggested references are generated automatically; the Lean statement is\nauthoritative).\n\n## Check it yourself\n\n- You need Linux or macOS (some paths are too long for Windows), [elan](https:\u002F\u002Fgithub.com\u002Fleanprover\u002Felan) (it\n  installs Lean 4.33.1 from `lean-toolchain`), and a network connection: Lake fetches Mathlib from GitHub and compiles\n  it from source, since no prebuilt Mathlib matches this toolchain (about 13 minutes at 96 jobs).\n- The build needs about 5 GB of memory per parallel job (a few modules need up to 36 GB); about 67 GB of disk under\n  `.lake\u002F`, plus C files (about 220 GB) that can be deleted as the build goes. Ours took 5 h 32 min at 96 jobs, with a\n  peak of 153 GB of memory.\n- comparator takes about 15 hours (ours: 14 h 46 min), nearly all of it the kernel replay on one core. Our peak memory\n  was 230 GB, so allow 300 GB. Run nanoda after the comparator script, whose tools it reuses. Writing the 37.8 GB\n  export takes about 90 GB of memory for an hour, and the check itself about 40 GB (about 30 minutes at 16 threads).\n  Both scripts are for Linux (bash, git, python3, GNU coreutils; nanoda also needs `patch`, `cargo` and crates.io).\n\n~~~sh\ngit clone \u003Cthis repository> flt && cd flt\nLEAN_NUM_THREADS=96 lake build              # one job per hardware thread by default; lower it to bound memory (about 5 GB per job)\nverification\u002Fcomparator\u002Frun.sh              # verdict: last line of .verify-work\u002Fwrapper\u002Fcomparator.log\nverification\u002Fnanoda\u002Frun.sh                  # after the comparator script; verdict: .verify-work\u002Fnanoda\u002Frun-*\u002Fnanoda.stdout\n~~~\n\nLean prints a large number of deprecation and style-linter warnings while building. They do not affect the result.\nThe build has succeeded when its output ends with\n`'flt_mathlib' depends on axioms: [propext, Classical.choice, Quot.sound]` and `Build completed successfully`. Each\nscript fetches and builds its checker at a pinned version and exits 0 on success.\n\n## About the sources\n\n`FinalCheck.lean` is the default target; `Theorems\u002F` holds the statements, `P2M\u002FSol\u002F` the proofs (each importing the\nstatements it cites), `Definitions\u002F` the definitions, `verification\u002F` the two checks, `html\u002F` the web pages described\nabove and `tools\u002Fdocs-site\u002F` the program that generated them. The Lean sources were produced by AI agents building\non human-written open-source Lean, with Lean as the arbiter, and are written to be checked rather than read: names are\nmachine-generated, labels such as `P2M` or hexadecimal suffixes are pipeline labels rather than mathematics, and where\na name and a statement disagree the statement is what was proved. Comments were removed, apart from upstream notices,\ndoc strings and citations (listed in `ATTRIBUTION.md`) and the expected-output comment that `#guard_msgs` checks.\n\n## Licence and attribution\n\nCopyright 2026 Anthropic, PBC; released under the Apache License 2.0 (`LICENSE`). Portions derive from three\nApache-2.0 projects credited in `NOTICE`: the\n[Imperial College London FLT project](https:\u002F\u002Fgithub.com\u002FImperialCollegeLondon\u002FFLT) led by Kevin Buzzard (Frey\npackage, Galois representations, deformation theory, patching and more),\n[flt-regular](https:\u002F\u002Fgithub.com\u002Fleanprover-community\u002Fflt-regular) (Kummer's theorem) and Mathlib. `ATTRIBUTION.md`\nlists the 106 files containing material from the first two, with upstream file, copyright holder and authors, and the\n23 files that reproduce Mathlib text (the excerpts in `Definitions\u002FDef_Compat_Mathlib430.lean` and twenty-two modules\nthat re-prove a Mathlib lemma in place). The web pages bundle KaTeX and Graphviz (compiled to WebAssembly) under their\nown licences, listed in `html\u002Fassets\u002Fvendor\u002FLICENSES.txt`. Lean and the packages in `lake-manifest.json` are fetched\nat build time, not distributed here. If you recognise unattributed material, the omission is unintentional.\n","这是一个使用Lean 4形式化验证的费马大定理完整数学证明项目，严格基于Frey–Serre–Ribet–Wiles–Taylor-Wiles证明路径。项目通过Mathlib库构建，所有60,475个模块均经Lean 4.33.1内核逐行检查，仅依赖propext、Classical.choice和Quot.sound三个标准公理，无任何sorr y或非构造性扩展；同时经独立Rust实现的nanoda内核二次验证，确保逻辑可靠性。适用于数学基础研究、形式化方法教学、定理证明工具链验证及可信赖数学知识库建设等场景。",2,"2026-09-06 02:30:03","CREATED_QUERY"]