Volume 1: Logical Foundations
Table of Contents
Index
Roadmap
Preface
Welcome
Overview
Logic
Proof Assistants
Functional Programming
Further Reading
Practicalities
System Requirements
Exercises
Downloading the Coq Files
Chapter Dependencies
Recommended Citation Format
Resources
Sample Exams
Lecture Videos
Note for Instructors and Contributors
Translations
Thanks
Functional Programming in Coq (
Basics
)
Data and Functions
Enumerated Types
Days of the Week
Booleans
Types
New Types from Old
Modules
Tuples
Numbers
Proof by Simplification
Proof by Rewriting
Proof by Case Analysis
Testing Your Solutions
Proof by Induction (
Induction
)
Review
Separate Compilation
Proof by Induction
Proofs Within Proofs
Formal vs. Informal Proof
More Exercises
Working with Structured Data (
Lists
)
Pairs of Numbers
Lists of Numbers
Reasoning About Lists
Induction on Lists
Options
Partial Maps
Polymorphism and Higher-Order Functions (
Poly
)
Polymorphic Lists
Polymorphic Pairs
Polymorphic Options
Functions as Data
Higher-Order Functions
Filter
Anonymous Functions
Map
Fold
Functions That Construct Functions
More Basic Tactics (
Tactics
)
The
apply
Tactic
The
apply
with
Tactic
The
injection
and
discriminate
Tactics
Using Tactics on Hypotheses
Varying the Induction Hypothesis
Unfolding Definitions
Using
destruct
on Compound Expressions
Micro Sermon
Logic in Coq (
Logic
)
Logical Connectives
Conjunction
Disjunction
Falsehood and Negation
Truth
Logical Equivalence
Setoids and Logical Equivalence
Existential Quantification
Programming with Propositions
Applying Theorems to Arguments
Coq vs. Set Theory
Functional Extensionality
Propositions vs. Booleans
Working with Decidable Properties
Classical vs. Constructive Logic
Inductively Defined Propositions (
IndProp
)
Inductively Defined Propositions
The Collatz Conjecture
Transitive Closure
Permutations
Evenness (yet again)
Using Evidence in Proofs
Inversion on Evidence
Induction on Evidence
Inductive Relations
A Digression on Notation
Case Study: Regular Expressions
The
remember
Tactic
Case Study: Improving Reflection
Total and Partial Maps (
Maps
)
The Coq Standard Library
Identifiers
Total Maps
Partial maps
The Curry-Howard Correspondence (
ProofObjects
)
Proof Scripts
Quantifiers, Implications, Functions
Programming with Tactics
Logical Connectives as Inductive Types
Conjunction
Disjunction
Existential Quantification
True
and
False
Equality
Coq's Trusted Computing Base
Induction Principles (
IndPrinciples
)
Basics
Induction Principles for Propositions
Explicit Proof Objects for Induction (Optional)
Properties of Relations (
Rel
)
Relations
Basic Properties
Reflexive, Transitive Closure
Simple Imperative Programs (
Imp
)
Arithmetic and Boolean Expressions
Syntax
Evaluation
Optimization
Coq Automation
Tacticals
Defining New Tactics
The
lia
Tactic
A Few More Handy Tactics
Evaluation as a Relation
Inference Rule Notation
Equivalence of the Definitions
Computational vs. Relational Definitions
Expressions With Variables
States
Syntax
Notations
Evaluation
Commands
Syntax
More Examples
Evaluating Commands
Evaluation as a Function (Failed Attempt)
Evaluation as a Relation
Determinism of Evaluation
Additional Exercises
Lexing and Parsing in Coq (
ImpParser
)
Internals
Lexical Analysis
Parsing
Examples
An Evaluation Function for Imp (
ImpCEvalFun
)
A Broken Evaluator
A Step-Indexed Evaluator
Relational vs. Step-Indexed Evaluation
Determinism of Evaluation Again
Extracting OCaml from Coq (
Extraction
)
Basic Extraction
Controlling Extraction of Specific Types
A Complete Example
Discussion
Going Further
More Automation (
Auto
)
The
auto
Tactic
Searching For Hypotheses
Tactics
eapply
and
eauto
A Streamlined Treatment of Automation (
AltAuto
)
Tacticals
The
try
Tactical
The Sequence Tactical
;
(Simple Form)
The
repeat
Tactical
Tactics that Make Mentioning Names Unnecessary
The
assumption
tactic
The
contradiction
tactic
The
subst
tactic
The
constructor
tactic
Automatic Solvers
Linear Integer Arithmetic: The
lia
Tactic
Equalities: The
congruence
Tactic
Propositions: The
intuition
Tactic
Search Tactics
The
auto
Tactic
The
eauto
variant
Ltac: The Tactic Language
Ltac Functions
Ltac Pattern Matching
Review
Postscript
Looking Back
Looking Forward
Resources
Bibliography (
Bib
)
Resources cited in this volume