Learning Lean 4 With Examples

Learning Lean 4 With Examples

Mark Watson
Buy on Leanpub

Table of Contents

Learning Lean 4 With Examples

  • Little Bits of Lean 4
  • Preface
    • What’s Up With Lean 4?
  • Introduction
    • Installing Lean on macOS
    • Running the examples
    • What each chapter needs
  • A Short Tour of Lean 4
    • Functions
    • \#eval
    • Lists, arrays, and tuples
    • String helpers
    • Structures
    • Type classes and instances
    • abbrev and dot calls
    • Coercions
    • Inductive types and pattern matching
    • Option and do
    • More monads: Except and StateM
    • Loops and local variables
    • Typing the symbols
    • Numbers
    • Sorting and exact fractions
    • Bool and Prop
    • Proofs
    • Programs
    • A helper you will see again
    • Cheat sheet
  • Bayesian Inference
    • The Code
    • How It Works
    • Checking the Numbers
    • Lean 4 Notes
    • Running It
    • Using It
  • A Tiny Triple Store
    • The Code
    • How It Works
    • Lean 4 Notes
    • Running It
    • Using It
  • Ranking Documents with BM25
    • The Code
    • How It Works
    • Checking a Score
    • Lean 4 Notes
    • Running It
    • Using It
  • Extractive Summarization
    • The Code
    • How It Works
    • Checking a Score
    • Lean 4 Notes
    • Running It
    • Using It
  • A Tiny Vector Store
    • The Code
    • How It Works
    • The Geometry
    • Lean 4 Notes
    • Running It
    • Using It
  • Associative Memory with Hopfield Networks
    • The Code
    • How It Works
    • Lean 4 Notes
    • Running It
    • Testing Recall
    • Using It
  • Symbolic Polynomial Calculus
    • The Code
    • How It Works
    • Multiplication
    • Lean 4 Notes
    • Running It
    • Using It
  • Automatic Differentiation
    • The Code
    • How It Works
    • Checking the Gradients
    • Lean 4 Notes
    • Running It
    • Using It
  • On-Device AI with Apple Foundation Models
    • The Code
    • How It Works
    • The fm Command
    • Lean 4 Notes
    • Running It
    • Using It
  • JavaScript-Rendered Pages with Lightpanda
    • Dump Formats
    • The Code
    • How It Works
    • Lean 4 Notes
    • Running It
    • Using It
  • Local LLMs with Ollama
    • The Code
    • How It Works
    • The Reply
    • Multi-turn Chat
    • Generation Options
    • Lean 4 Notes
    • Running It
    • Using It
  • Calling Google Gemini
    • The Code
    • How It Works
    • Keeping the Key Private
    • The Response
    • Generation Options
    • Lean 4 Notes
    • Running It
    • Using It
  • Querying Knowledge Graphs with SPARQL
    • The Code
    • How It Works
    • The Result Format
    • Lean 4 Notes
    • Running It
    • Using It
  • Web Search with Exa and Brave
    • The Two APIs
    • The Code
    • How It Works
    • Lean 4 Notes
    • Running It
    • Using It
  • From One File to a Lake Project
    • Modules and Files
    • Adding an Executable
    • A Project for This Book
    • Troubleshooting
  • Making Stand Alone Programs With Lean 4
    • Four Steps With Lake
    • What the Build Leaves Behind
    • Building One File by Hand
    • Start-Up Time
    • A Command-Line Tool That Calls C
    • Linking a System Library
    • Shipping the Binary
    • Try This
  • Errors You May See
    • A reserved word as a name
    • A line that starts with a minus sign
    • A field of an unknown type
    • A missing default value
    • An import after code
    • An identifier from a missing import
    • A Nat where a Float is expected
    • A missing match case
    • A subtraction that floors at zero
    • Summary
    • Reading an Error
  • Where to Go Next
    • Properties to Prove
    • A First Proof
    • Tactics and Mathlib
  • Use Cases: Mathematical Discovery, Verification, and AI
    • Why a Checked Proof Means Something
    • Proving Things About Programs
    • Verification in Production
    • Mathlib
    • Lean and AI
    • What This Means for You
Learning Lean 4 With Examples/Overview

Learning Lean 4 With Examples

Course overview

23 chapters
Begin reading
Download
The Book

Learning Lean 4 With Examples23 chapters

Begin ›
  1. Little Bits of Lean 4

  2. Preface

  3. Introduction

  4. A Short Tour of Lean 4

  5. Bayesian Inference

  6. A Tiny Triple Store

  7. Ranking Documents with BM25

  8. Extractive Summarization

  9. A Tiny Vector Store

  10. Associative Memory with Hopfield Networks

  11. Symbolic Polynomial Calculus

  12. Automatic Differentiation

  13. On-Device AI with Apple Foundation Models

  14. JavaScript-Rendered Pages with Lightpanda

  15. Local LLMs with Ollama

  16. Calling Google Gemini

  17. Querying Knowledge Graphs with SPARQL

  18. Web Search with Exa and Brave

  19. From One File to a Lake Project

  20. Making Stand Alone Programs With Lean 4

  21. Errors You May See

  22. Where to Go Next

  23. Use Cases: Mathematical Discovery, Verification, and AI