The teorth/analysis repository is a Lean formalization of Terry Tao's textbook Analysis I, serving as a companion resource that translates the mathematical content into formal proof code. The project aims to maintain fidelity to the original text while demonstrating Lean's capabilities and syntax, though it explicitly prioritizes pedagogical clarity over computational efficiency and idiomatic Lean practices.
The formalization closely mirrors the textbook's structure, arrangement of definitions, theorems, and proofs. Where the original text presents material as exercises for readers to complete, the Lean version marks these sections with `sorry` statements, inviting users to fork the repository and attempt their own solutions. The repository does not include direct solutions to these exercises. Rather than directly quoting the textbook, the formalization provides references to the original text, positioning itself as an annotated companion rather than a standalone replacement.
A key design decision involves the gradual transition from textbook-specific definitions to those provided by Lean's standard mathematics library, Mathlib. This approach sacrifices complete self-containedness in favor of compatibility with the broader Lean ecosystem. For example, Chapter 2 develops natural number theory independently, but subsequent chapters adopt Mathlib's natural numbers. An epilogue to Chapter 2 demonstrates the isomorphism between these two approaches. This strategy also serves as an introduction to relevant portions of Mathlib for readers progressing through the material.
Several technical adjustments distinguish the formalization from the textbook. Sequences use zero-based indexing to align with Mathlib's stronger support for zero-indexed natural numbers rather than one-indexed alternatives. Operations that remain undefined in the text, such as division by zero or limits of non-Cauchy sequences, receive assigned junk values like zero to maintain total function definitions. This choice reflects Lean's superior support for total functions over partial functions, avoiding the complexity that indiscriminate partial function use can introduce. The Chapter 2 natural numbers employ inductive type construction rather than a purely axiomatic framework, though the Peano Axioms are formalized in the chapter epilogue.
According to GitGenius activity tracking, the repository shows median issue and pull request response latency of 4.4 hours across 25 tracked items, with a mean latency of 46.1 hours. The primary contributor teorth has logged 34 tracked events, followed by Chessing234 with 17 events and hansonchar with 10 events. The repository's contributor network overlaps with several major open-source projects including facebook/react-devtools, webpack/webpack, and facebook/react, suggesting cross-pollination within the developer community. The repository is classified across multiple domains including data analysis, data visualization, machine learning, data science, scripts, tools, notebooks, algorithms, modeling, and data processing, reflecting its broad educational and technical scope within the formal mathematics space.