brain

tamnd's digital brain — notes, problems, research

42810 notes

2.22 Backward Reasoning

Backward reasoning starts from the goal and reduces it to simpler subgoals.

leanproof-assistanttype-theorylogicproof-theory
2.23 Rewriting Strategies

Rewriting with equality is one of the most frequent operations in Lean.

leanproof-assistanttype-theorylogicproof-theoryrewriting
2.21 Forward Reasoning

Forward reasoning starts from the assumptions in the local context and derives new facts until the goal becomes immediate.

leanproof-assistanttype-theorylogicproof-theory
2.20 Using Assumptions Effectively

An assumption is a local term that Lean may use to solve the current goal or produce another proof.

leanproof-assistanttype-theorylogicproof-theory
2.19 Local Context Management

The local context is the list of variables, hypotheses, instances, and intermediate facts available at a point in a proof.

leanproof-assistanttype-theorylogicproof-theory
2.17 Proof Structuring Patterns

A Lean proof should expose the shape of the argument.

leanproof-assistanttype-theorylogicproof-theory
2.16 Introduction and Elimination Rules

Every logical connective in Lean has two sides.

leanproof-assistanttype-theorylogicproof-theory
2.18 Naming Conventions

Names in Lean carry meaning.

leanproof-assistanttype-theorylogicproof-theory
2.15 Case Analysis

Case analysis is the proof pattern for using data that has more than one possible constructor.

leanproof-assistanttype-theorylogicproof-theory
2.14 Proof by Contradiction

Proof by contradiction is a classical proof pattern.

leanproof-assistanttype-theorylogicproof-theory
2.12 Universal Quantifiers

A universal statement asserts that a property holds for every element of a type.

leanproof-assistanttype-theorylogicproof-theoryquantifiers
2.13 Classical vs Constructive Logic

Lean is constructive by default.

leanproof-assistanttype-theorylogicproof-theoryclassical-logic
2.10 Symmetry and Transitivity

Equality supports two structural operations: reversing direction (symmetry) and chaining steps (transitivity).

leanproof-assistanttype-theorylogicproof-theory
2.11 Existential Quantifiers

An existential statement says that some object exists with a given property.

leanproof-assistanttype-theorylogicproof-theoryquantifiers
2.9 Rewriting with Equality

Rewriting is the main way to use equality in Lean.

leanproof-assistanttype-theorylogicproof-theoryequalityrewriting
2.6 False and Contradiction

`False` is the proposition with no constructors.

leanproof-assistanttype-theorylogicproof-theory
2.5 Negation

Negation represents "not".

leanproof-assistanttype-theorylogicproof-theory
2.7 True and Trivial Proofs

`True` is the proposition that always has a proof.

leanproof-assistanttype-theorylogicproof-theory
2.8 Equality Basics

Equality expresses that two terms are identical.

leanproof-assistanttype-theorylogicproof-theoryequality
2.3 Conjunction

Conjunction represents "and".

leanproof-assistanttype-theorylogicproof-theory
2.1 Propositions as Types

Lean identifies propositions with types and proofs with terms.

leanproof-assistanttype-theorylogicproof-theorypropositions-as-types
2.2 Implication and Functions

Implication is the first logical connective to understand in Lean because it is also the ordinary function type.

leanproof-assistanttype-theorylogicproof-theory
2.4 Disjunction

Disjunction represents "or".

leanproof-assistanttype-theorylogicproof-theory
1.24 Editor Integration

Lean is normally developed inside an editor with live feedback.

leanproof-assistanttype-theoryfunctional-programming
1.23 Interactive Development Workflow

Lean development is interactive.

leanproof-assistanttype-theoryfunctional-programming
1.25 Minimal Working Examples

A minimal working example is the smallest complete Lean fragment that demonstrates a definition, theorem, error, or technique.

leanproof-assistanttype-theoryfunctional-programming
1.22 Imports and Dependencies

Imports control what a Lean file can see.

leanproof-assistanttype-theoryfunctional-programming
1.21 Error Messages and Debugging

Lean’s error messages report failed constraints during elaboration.

leanproof-assistanttype-theoryfunctional-programming
1.20 Holes and Goals

Lean development is driven by goals.

leanproof-assistanttype-theoryfunctional-programming
1.19 Term Mode vs Tactic Mode

Lean proofs are terms.

leanproof-assistanttype-theoryfunctional-programming
1.17 Structures and Records

A structure is a type whose values are built from named fields.

leanproof-assistanttype-theoryfunctional-programming
1.18 Basic Tactic Mode

Tactic mode is an interactive way to build proofs.

leanproof-assistanttype-theoryfunctional-programming
1.16 Inductive Types Introduction

Inductive types define data by listing its constructors.

leanproof-assistanttype-theoryfunctional-programming
1.12 Evaluation with `#eval`

Lean can execute many expressions during development.

leanproof-assistanttype-theoryfunctional-programming
1.13 Checking Types with `#check`

Type checking is the primary feedback mechanism in Lean.

leanproof-assistanttype-theoryfunctional-programming
1.15 Pattern Matching Basics

Pattern matching defines functions by cases on the shape of their inputs.

leanproof-assistanttype-theoryfunctional-programming
1.11 Comments and Documentation

Lean files serve two readers at once: the compiler and the human maintainer.

leanproof-assistanttype-theoryfunctional-programming
1.14 Simple Rewriting

Rewriting replaces one expression with another using an equality.

leanproof-assistanttype-theoryfunctional-programming
1.5 Definitions with `def`

A definition introduces a named term together with its type.

leanproof-assistanttype-theoryfunctional-programming
1.8 Functions and Lambda Abstraction

Functions are the main form of computation in Lean.

leanproof-assistanttype-theoryfunctional-programming
1.2 Project Structure with Lean and Lake

Lean development is organized around projects.

leanproof-assistanttype-theoryfunctional-programming
1.7 Types and Universes

Lean is a dependently typed system.

leanproof-assistanttype-theoryfunctional-programming
1.9 Implicit and Explicit Arguments

Lean functions often contain arguments that the user does not write.

leanproof-assistanttype-theoryfunctional-programming
1.4 Basic Syntax and Expressions

Lean code is built from expressions.

leanproof-assistanttype-theoryfunctional-programming
1.6 Theorems with `theorem` and `lemma`

Lean treats a theorem as a named proof.

leanproof-assistanttype-theoryfunctional-programming
1.10 Notation and Infix Operators

Lean notation is ordinary syntax attached to ordinary declarations.

leanproof-assistanttype-theoryfunctional-programming
1.3 Files, Namespaces, and Modules

Lean organizes code as a hierarchy of modules.

leanproof-assistanttype-theoryfunctional-programming
Preface

This book is a working manual for the Lean proof assistant.

leanproof-assistanttype-theory
1.1 Installation and Toolchain

Lean is distributed as a small toolchain rather than as a single editor plugin.

leanproof-assistanttype-theoryfunctional-programming
19. Formal Languages

Grammars, syntax, automata theory, regular and context free languages, parsing, recognition, and applications in compilers.

logiccomputer scienceformal languagesautomatacompilers
17. Type Theory

Simple type theory, dependent types, Curry-Howard correspondence, proof assistants, and formalized mathematics.

logictype theorydependent typesproof assistantsformalized mathematics
17. Type Theory

Simple type theory, dependent types, Curry-Howard correspondence, proof assistants, and formalized mathematics.

logictype theorydependent typesproof assistantsformalized mathematics
20. Logic in Programming

Logic programming, type systems, verification, model checking, and program synthesis.

logiccomputer scienceprogramming languagesverificationprogram synthesis
22. Foundations Programs

Logicism, formalism, intuitionism, structuralism, and modern perspectives on the foundations of mathematics.

logicfoundationslogicismformalismintuitionismstructuralism
22. Foundations Programs

Logicism, formalism, intuitionism, structuralism, and modern perspectives on the foundations of mathematics.

logicfoundationslogicismformalismintuitionismstructuralism
24. Limits of Formal Systems

Incompleteness, undecidability, independence, practical implications, and future directions in logic and foundations.

logicfoundationsincompletenessundecidabilityindependence
15. Ordinal Analysis

Proof theoretic ordinals, transfinite induction, strength of theories, applications to arithmetic, and limits of formal strength.

logicproof theoryordinal analysistransfinite inductionformal systems
16. Intuitionistic Logic

Constructive semantics, proof interpretation, differences from classical logic, Kripke models, and applications in computation.

logicintuitionistic logicconstructive logickripke modelscomputation
20. Logic in Programming

Logic programming, type systems, verification, model checking, and program synthesis.

logiccomputer scienceprogramming languagesverificationprogram synthesis
14.4 Implications

Consequences of incompleteness for truth, provability, independence, and the structure of formal systems.

logicfoundationsincompletenessphilosophymathematics
14.5 Extensions

Stronger forms of incompleteness, Rosser’s improvement, Löb’s theorem, and connections to computability.

logicgodelproof theorycomputabilityfoundations
14.1 Arithmetization

Encoding symbols, formulas, and proofs as natural numbers to allow arithmetic to reason about its own syntax.

logicgodel numberingarithmetizationsyntaxfoundations
14.3 Second Incompleteness

Proof that no sufficiently strong consistent system can prove its own consistency.

logicgodelconsistencyincompletenessfoundations
14. Godel Theorems

Arithmetization of syntax, the first and second incompleteness theorems, implications for formal systems, and refinements.

logicproof theorygodel theoremsincompletenessformal systems
14.2 First Incompleteness

Construction of a true but unprovable statement using diagonalization and self-reference.

logicgodelincompletenessdiagonalizationproof theory
13.5 Proof Length and Complexity

Quantitative study of proofs, including proof size, efficiency, and connections to computational complexity.

logicproof theorycomplexitycomputation
13.1 Syntax of Proofs

Formal structure of proofs, including derivations, inference rules, axioms, and proof representations.

logicproof theorysyntaxderivations
13.3 Normal Forms

Normalization of proofs, elimination of detours, and structural simplification of derivations.

logicproof theorynormalizationstructure
13. Formal Proof Systems

Syntax of proofs, derivability, normal forms, consistency proofs, proof length, and proof complexity.

logicproof theoryformal proofsderivabilityproof complexity
13.4 Consistency Proofs

Methods for proving consistency of formal systems, including syntactic and semantic approaches.

logicproof theoryconsistencyfoundations
13.2 Derivability

Formal notion of deriving formulas from assumptions, including structural properties and inference behavior.

logicproof theoryderivabilityinference
12.3 Recursively Enumerable Sets

Sets that can be enumerated by algorithms and their role in semi-decidability and computability theory.

computabilityrecursively enumerablesemi-decidablehalting problem
12.4 Post’s Problem

Existence of intermediate degrees between computable sets and the halting problem.

computabilitypost problempriority methodturing degrees
12.5 Structure of Degrees

Global properties of the Turing degrees including incomparability, density, and jump structure.

computabilitydegree structureturing degreeslogic
12.1 Reducibility

Formal methods for comparing decision problems using many-one and Turing reducibility.

computabilityreducibilitydecision problemsturing machines
12.2 Turing Degrees

Equivalence classes of sets under Turing reducibility and the ordering of computational power.

computabilityturing degreesoracle computationdegree theory
12. Degrees of Unsolvability

Reducibility, Turing degrees, recursively enumerable sets, Post's problem, and the structure of degrees.

logiccomputabilityturing degreesreducibilityrecursively enumerable sets
11.4 Halting Problem

The undecidable problem of determining whether a Turing machine halts on a given input.

halting problemundecidabilitycomputabilitylogictheory
11.5 Undecidability Results

Extensions of undecidability using reductions and general results such as Rice’s theorem.

undecidabilityreductionsrice theoremcomputabilitylogic
11.2 Computation Traces

Step-by-step evolution of Turing machine configurations and how computations are represented as traces.

turing machinescomputationtracesconfigurationsalgorithms
11.3 Universal Machines

Machines that simulate any other Turing machine, establishing the concept of programmable computation.

turing machinesuniversalitysimulationprogramscomputation
11.1 Machine Definitions

Formal definition of Turing machines, including states, tape, alphabets, and transition functions.

turing machinesformal modelscomputationautomatatheory
11. Turing Machines

Turing machine definitions, computation traces, universal machines, the halting problem, and undecidability results.

logiccomputabilityturing machinesundecidability
10.5 Equivalence

Detailed equivalence proofs between Turing machines, recursive functions, and lambda calculus, with explicit constructions and simulations.

logiccomputabilityequivalenceturing machinesrecursive functions
10.4 Formal Models

Turing machines, register machines, lambda calculus, recursive functions, and the precise mathematical models used to define computation.

logiccomputabilityformal modelsturing machineslambda calculus
10.3 Church Turing

The Church Turing thesis, formal models of computation, equivalence of models, and the distinction between mathematical theorem and foundational principle.

logiccomputabilitychurch turing thesisturing machinesrecursive functions
10.2 Partial vs Total

Distinction between partial and total computable functions, undefined values, domains of definition, and the role of nontermination.

logiccomputabilitypartial functionstotal functions
10.1 Recursive Functions

Primitive recursive functions, general recursive functions, minimization, and the formal construction of computable numerical functions.

logiccomputabilityrecursive functionsprimitive recursion
10. Computable Functions

Recursive functions, partial and total functions, the Church-Turing thesis, formal models of computation, and equivalence of models.

logiccomputabilityrecursive functionscomputation
9.4 Determinacy

An introduction to infinite games, determined games, the axiom of determinacy, projective determinacy, and consequences for sets of reals.

logicset theorydeterminacydescriptive set theory
9.5 Applications

Applications of advanced set theory to analysis and topology, including regularity properties, Banach spaces, measure theory, and topological classification.

logicset theoryanalysistopologyapplications
9.3 Descriptive Set Theory

An introduction to Polish spaces, Borel sets, analytic sets, projective sets, regularity properties, and the role of definability in set theory.

logicset theorydescriptive set theorydefinability
9. Advanced Set Theory

Forcing, large cardinals, descriptive set theory, determinacy principles, and applications in analysis and topology.

logicset theoryforcinglarge cardinalsdescriptive set theory
9.2 Large Cardinals

An introduction to large cardinal axioms, inaccessible cardinals, measurable cardinals, elementary embeddings, and consistency strength.

logicset theorylarge cardinalsfoundations
9.1 Forcing

An introduction to forcing, generic filters, forcing names, the forcing relation, and the basic extension theorem.

logicset theoryforcingindependence
8.1 Axiom of Choice

The axiom of choice, choice functions, indexed families, and first consequences in axiomatic set theory.

logicset theoryaxiom of choiceZFC
8.3 Constructible Universe

The constructible universe, definable subsets, the hierarchy L_alpha, and the axiom of constructibility.

logicset theoryconstructible universeinner models
8.2 Equivalent Formulations

Equivalent forms of the axiom of choice, including Zorn's lemma, the well ordering theorem, maximal principles, and right inverses of surjections.

logicset theoryaxiom of choicezorn lemmawell ordering
8.5 Independence Phenomena

Independence results in set theory, including the axiom of choice and the continuum hypothesis, and the methods used to establish independence.

logicset theoryindependenceforcingconstructibility
8.4 Consistency Results

Relative consistency, inner models, constructibility, and the role of consistency results in axiomatic set theory.

logicset theoryconsistencyinner modelsconstructibility