[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"vWIxTg2Ium":3},"# SpivakCalculus\n\nLean 4 formalization of Michael Spivak, *Calculus* — **both the 3rd edition**\n(Publish or Perish, 1994) **and the 4th** (2008). For each edition: the whole\ntext of Chapters 1–30 and the nine appendices (every definition, theorem,\ncorollary and worked example, including the unnumbered examples of the running\ntext) and every problem, in every lettered part. Problem numbers follow the 3rd\nedition unless marked otherwise; `docs/fourth/` holds a per-chapter concordance\nbetween the two numberings.\n\n- **Spivak's own definitions are used throughout**: `ε`–`δ` limits and\n  continuity, the derivative as a limit of his difference quotients, the\n  lower/upper-sum integral, and constructions of `π`, `sin`, `cos`\n  (Chapter 15), `log`, `exp` (Chapter 18), the complex numbers (Chapter 25) and\n  the real numbers as Dedekind cuts (Chapter 29). Identification lemmas\n  (`Chapter15.piS_eq`, `sinS_eq`, `cosS_eq`, `Chapter18.logS_eq`, `expS_eq`,\n  `eS_eq`, `rpowS_eq`) prove these are Mathlib's functions, which later chapters\n  then use. Chapter 6's `ContinuousOnIccS` is Spivak's own \"continuous on\n  `[a, b]`\" (one-sided at the endpoints), and the `ChapterNNContS` files restate\n  under it every theorem of the book whose hypothesis is that phrase.\n- **`e` is transcendental, proved twice**: by Spivak's argument (`Chapter21`,\n  using no Mathlib transcendence result) and by Hermite's on top of Mathlib's\n  analytical half of Lindemann–Weierstrass (`TranscendenceE`). **`π` is\n  irrational** (Chapter 16) and **`π` is transcendental** (`TranscendencePi`,\n  `TranscendencePiAux`) — the latter by Niven's form of Hermite–Lindemann, whose\n  algebraic half (symmetric functions of the conjugates of an algebraic number)\n  is not in Mathlib and is proved here.\n- **Liouville's theorem on integration in finite terms** (`Liouville.lean`,\n  Rosenlicht's proof for differential fields) and, from it, Spivak's remark that\n  `e^{-x²}` has no elementary primitive (`Chapter19Liouville.lean`). Mathlib had\n  only the algebraic step of Liouville's theorem.\n- **The whole book was audited against page images of the printed 3rd\n  edition**, problem part by problem part and theorem by theorem, after the\n  development had been written from an OCR text extraction. The results are in\n  the `ChapterNNAudit`, `ChapterNNText`, `ChapterNNAnswers` and `AppendixAudit`\n  files.\n- **About sixty statements are false or unusable as printed.** Each is marked\n  **Correction to Spivak** in its docstring and listed in\n  [PROGRESS.md](PROGRESS.md); they include **sixteen errors in the 3rd edition's\n  answer section**, where the development's value was right in every case; the\n  4th edition fixes six of them outright and keeps eight. In\n  some twenty-six places the 4th edition independently makes exactly a\n  correction this project had already made to the 3rd.\n\nSee [PROGRESS.md](PROGRESS.md) for the per-chapter status of both editions, the\nfull list of corrections, and the remaining caveats.\n\n## Documentation\n\nThe docstrings in the Lean sources are the documentation of record. Each\ntheorem's docstring says what it formalizes — which numbered theorem, or which\nproblem and lettered part, in which edition — so the sources can be read\nchapter by chapter alongside the book. The corrections to Spivak are recorded\nthe same way: each is a docstring marked **Correction to Spivak:** on the\ndeclaration that proves the corrected statement (or that refutes the printed\none). Grepping for the marker finds them all:\n\n```sh\ngrep -rn 'Correction to Spivak' SpivakCalculus\n```\n\nThere are 84 hits, 83 of them markers, spread over 46 files: 51 of the plain\n`**Correction to Spivak:**` form, 12 marked `**Correction to Spivak (4th ed.)`,\n11 `**Correction to Spivak (answer section…)`, and the rest small variants. The\nsame corrections are tabulated, with the reason for each, in\n[PROGRESS.md](PROGRESS.md).\n\n`docs/fourth/README.md` indexes the thirty 4th-edition concordance files.\n\n`LICENSE` and `NOTICE` at the repository root give the terms. The Lean code is\nlicensed under the Apache License 2.0. `NOTICE` records that the underlying\nmathematics is Spivak's: this is an independent formalization, not affiliated\nwith or endorsed by him or Publish or Perish, it reproduces neither the book's\nexposition nor its problems (they are identified by number), and a copy of the\nbook is needed to follow it.\n\n## Building\n\n```sh\nlake build +SpivakCalculus        # the 3rd edition (129 modules)\nlake build SpivakCalculus.Fourth  # both editions (129 + 29 modules)\n```\n\n`SpivakCalculus.lean` imports the 129 modules of the 3rd edition;\n`SpivakCalculus/Fourth.lean` imports those plus the 29 modules of the 4th.\nFetch Mathlib's prebuilt artifacts first with `lake exe cache get`; a full build\nfrom scratch takes a few hours, most of it Mathlib.\n\nThere is no `sorry`, no `axiom` and no `native_decide` anywhere in the project.\nThe full axiom audit is `SpivakCalculus/AuditAll.lean` (not imported by either\nroot module):\n\n```sh\nlake env lean SpivakCalculus/AuditAll.lean\n```\n\nIt imports both editions, runs `Lean.collectAxioms` over every declaration in\nthe `Spivak` namespace and reports\n\n    audited 9110 declarations: all use only propext, Classical.choice, Quot.sound\n\n`SpivakCalculus/Verify.lean` additionally prints the axioms of 148\nrepresentative results from Chapters 1–14 and of the transcendence of `e`, as a\nquick human-readable check.\n\n## Layout\n\nAll files are in `SpivakCalculus/`, namespace `Spivak.ChapterNN`; the\n4th-edition files are in `SpivakCalculus/Fourth/`, namespace\n`Spivak.Fourth.ChapterNN`.\n\n| Chapter | 3rd-edition files | 4th | Content |\n|---|---|---|---|\n| 1 | `Chapter01` | `Fourth/Chapter01` | Basic Properties of Numbers: P1–P12, Theorem 1, Problems 1–25 |\n| 2 | `Chapter02`, `Chapter02ProblemsB` | `Fourth/Chapter02` | Numbers of Various Sorts: induction, binomial theorem, irrationality |\n| 3 | `Chapter03`, `Chapter03ProblemsB`, `Chapter03Audit` | `Fourth/Chapter03` | Functions; appendix on ordered pairs |\n| 4 | `Chapter04`, `Chapter04ProblemsB`, `Chapter04Audit`, `Chapter04Answers` | `Fourth/Chapter04` | Graphs; vectors, conic sections, polar coordinates |\n| 5 | `Chapter05`, `Chapter05Problems`, `Chapter05ProblemsB`, `Chapter05Text`, `Chapter05Audit` | `Fourth/Chapter05` | Limits (Spivak's `ε`–`δ`); the 4th edition's rewritten text |\n| 6 | `Chapter06`, `Chapter06Problems`, `Chapter06ProblemsB`, `Chapter06Text`, `Chapter06Audit` | `Fourth/Chapter06` | Continuous Functions; `ContinuousOnIccS` |\n| 7 | `Chapter07`, `Chapter07Problems`, `Chapter07ProblemsB`, `Chapter07Text`, `Chapter07Audit` | `Fourth/Chapter07` | Three Hard Theorems, also under Spivak's continuity |\n| 8 | `Chapter08`, `Chapter08Problems`, `Chapter08ProblemsB`, `Chapter08Text`, `Chapter08Audit` | `Fourth/Chapter08` | Least Upper Bounds; appendix on uniform continuity |\n| 9 | `Chapter09`, `Chapter09Problems`, `Chapter09ProblemsB`, `Chapter09Audit` | — | Derivatives |\n| 10 | `Chapter10`, `Chapter10Problems`, `Chapter10ProblemsB`, `Chapter10Audit`, `Chapter10Answers` | `Fourth/Chapter10` | Differentiation, the Chain Rule |\n| 11 | `Chapter11`, `Chapter11Problems`, `Chapter11ProblemsB`, `Chapter11Appendix`, `Chapter11AppendixB`, `Chapter11Audit`, `Chapter11ContS` | `Fourth/Chapter11`, `Fourth/Chapter11Appendix` | Rolle, MVT, l'Hôpital; convexity |\n| 12 | `Chapter12`, `Chapter12Problems`, `Chapter12ProblemsB`, `Chapter12Appendix`, `Chapter12AppendixB`, `Chapter12Audit`, `Chapter12ContS` | `Fourth/Chapter12`, `Fourth/Chapter12Appendix` | Inverse functions; parametric curves |\n| 13 | `Chapter13`, `Chapter13Problems`, `Chapter13ProblemsB`, `Chapter13Audit`, `Chapter13AuditB`, `Chapter13ContS` | `Fourth/Chapter13` | Spivak's integral; Riemann sums |\n| 14 | `Chapter14`, `Chapter14Problems`, `Chapter14ProblemsB`, `Chapter14Audit`, `Chapter14ContS` | `Fourth/Chapter14` | Fundamental Theorem; improper integrals |\n| 15 | `Chapter15`, `Chapter15Problems` | `Fourth/Chapter15` | Trigonometric functions constructed |\n| 16 | `Chapter16`, `Chapter16Problems` | `Fourth/Chapter16` | `π` is irrational; Viète |\n| 17 | `Chapter17`, `Chapter17Area` | `Fourth/Chapter17` | Planetary motion: Kepler's laws, with the ellipse's area derived |\n| 18 | `Chapter18`, `Chapter18Problems` | `Fourth/Chapter18` | `log`, `exp` constructed |\n| 19 | `Chapter19`, `Chapter19Text`, `Chapter19Problems`, `Chapter19ProblemsB`, `Chapter19Appendix`, `Chapter19ContS`, `Chapter19Liouville`, `Liouville` | `Fourth/Chapter19` | Integration in elementary terms; Liouville's theorem; the cosmopolitan integral |\n| 20 | `Chapter20`, `Chapter20Text`, `Chapter20Problems`, `Chapter20Audit`, `Chapter20ContS` | `Fourth/Chapter20`, `Fourth/Chapter20B` | Taylor's Theorem, `e` irrational; the 4th edition's rewritten text |\n| 21 | `Chapter21`, `Chapter21Problems`, `Chapter21ContS`, `TranscendenceE` | `Fourth/Chapter21` | `e` is transcendental (two proofs) |\n| 22 | `Chapter22`, `Chapter22Problems`, `Chapter22ProblemsB`, `Chapter22Audit`, `Chapter22ContS` | `Fourth/Chapter22` | Sequences, Bolzano–Weierstrass, Cauchy |\n| 23 | `Chapter23`, `Chapter23Problems`, `Chapter23ProblemsB` | `Fourth/Chapter23` | Series, rearrangements; Kempner's series |\n| 24 | `Chapter24`, `Chapter24Problems`, `Chapter24ProblemsB`, `Chapter24ProblemsC`, `Chapter24Audit`, `Chapter24ContS` | `Fourth/Chapter24` | Uniform convergence, power series |\n| 25 | `Chapter25`, `Chapter25Problems` | `Fourth/Chapter25` | Complex numbers as ordered pairs |\n| 26 | `Chapter26`, `Chapter26Problems`, `Chapter26Audit` | `Fourth/Chapter26` | Complex functions, Fundamental Theorem of Algebra |\n| 27 | `Chapter27`, `Chapter27Problems`, `Chapter27ProblemsB`, `Chapter27ProblemsC`, `Chapter27Audit` | `Fourth/Chapter27` | Complex power series, `e^{iπ} = −1`, Liouville's theorem, Stirling's formula |\n| 28 | `Chapter28`, `Chapter28Problems` | — | Fields |\n| 29 | `Chapter29`, `Chapter29Problems`, `Chapter29Direct`, `Chapter29DirectB` | — | Reals as Dedekind cuts; Cauchy sequences and decimals, all from `ℚ` |\n| 30 | `Chapter30`, `Chapter30Problems` | — | Uniqueness of the reals |\n| — | `TranscendencePi`, `TranscendencePiAux` | — | `π` is transcendental |\n| — | `ChapterFigures`, `ChapterFiguresB` | — | the problems given only by a figure |\n| — | `AppendixAudit` | — | the text results of the nine appendices |\n| — | `Bridge` | — | Spivak's derivative and continuity agree with Mathlib's |\n| — | `Verify` | — | axioms of 148 representative results |\n| — | `AuditAll` | — | full axiom audit of every `Spivak` declaration |\n| — | `docs/fourth/*.md` | — | the 4th-edition concordance, one file per chapter |\n",1790531058895]