[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"3iWXAuKdER":3},"# `lean-inf`\n\n**Compute with infinities (`H`) and infinitesimals (`ε = 1/H`) in Lean 4 — with zero-`sorry` verified fast algorithms, discontinuous automatic differentiation, and a live calculator web app.**\n\n## Highlights\n\n- **Exact Levi-Civita arithmetic** with rational exponents and rational coefficients (`H * ε = 1`, `2H + 1 > 2H`, `ε² \u003C ε \u003C √ε \u003C 1 \u003C H`).\n- **Zero-`sorry` verified refactors** (`FastLC` vs original naive HashMap `LeviCivitaNum`, `#print axioms` clean — only `[propext, Classical.choice, Quot.sound]`):\n  - `O(1)` `signumFast` vs `O(n log n)` sort (**311× – 540× faster**)\n  - `O(n + m)` two-pointer sorted merge addition (`addMerge`)\n  - Verified **Karatsuba** multiplication (`O(n^1.585)`) + balanced-tree sparse fallback (`mulTree`) (**5.8× faster at n=512**)\n  - `O(log k)` binary exponentiation (`powFast`) (**4.3× faster at k=48**)\n  - `O(log N)` quadratically convergent **Newton-Raphson** inversion (`newton_order_doubles`) (**13.8× faster at order=40**)\n- **Step function → Dirac delta via pure Levi-Civita AD** (`LeanInf/StepFunction.lean`): differentiates `L_H(x) = 1 / (1 + e^{-Hx})` automatically with step `ε²` (yielding `(1/4)H - (1/48)ε + ...` at `x = 0` and hyperfinite area `≈ 1.000`), plus **finite specialization** `evalFinite` (`H ↦ N`, `ε ↦ 1/N`).\n- **122-test differential & expression suite** (`lake exe inf test`) covering Crowell's `Test.js`, algebraic laws, naive-vs-fast equivalence, and step-function AD.\n- **Live HTTP API & Blog Calculator** (`server/server.ts`, `~/blog/inf/index.html`).\n\n## Quick Start\n\n```bash\nlake build\n.lake/build/bin/inf test                   # 122/122 differential & expression tests\n.lake/build/bin/inf bench                  # Naive HashMap vs Verified FastLC benchmarks\n.lake/build/bin/inf step-demo --N 100      # Step function -> Dirac delta & H -> 100 eval\n.lake/build/bin/inf eval \"dstep(0)\" --N 100\n.lake/build/bin/inf repl                   # Interactive calculator\nuv run scripts/generate_plots.py           # Regenerate plots from Lean 4 JSON\nbun run server/server.ts                   # Start Lean 4 HTTP API on 127.0.0.1:4420\n```\n\n## Documentation\n\n- [Theorem Whiteboard Talk Guide](docs/theorem-whiteboard-talk.md)\n- [Build-It-Yourself Developer Guide](docs/dev-guide.md)\n- [Specification](docs/SPEC.md)\n",1795466874951]