A step-by-step hands-on guide to The Rocq Prover (formerly Coq), from Check and Compute evaluation to Definition and Fixpoint functions, Inductive and Record data types, polymorphic lists, Ltac tactic proofs (intros, rewrite, destruct, induction), OCaml/Haskell program extraction, and a verified two-list FIFO queue.
8 episodes
Rocq (Coq) Basics 1. Setup and Checking Values and Types with Check and Compute
Understand the three sub-languages (Gallina, Vernacular, Ltac) of The Rocq Prover (formerly Coq) and evaluate natural numbers (nat), integers (Z), and booleans (bool) with Check and Compute.
Rocq (Coq) Basics 2. Functions with Definition and Structural Recursion with Fixpoint
Define ordinary and curried functions with Definition, and practice writing terminating structurally recursive functions with Fixpoint.
Rocq (Coq) Basics 3. Defining Data Types with Inductive and Record and Branching with match
Declare sum types with Inductive and product types with Record, and branch safely over every constructor case using match ... with ... end.
Rocq (Coq) Basics 4. Polymorphism (Type Parameters), option, and list
Use implicit type parameters {A : Type} to write polymorphic functions, handle absent values with option, and implement recursive functions over standard lists.
Rocq (Coq) Basics 5. Propositions (Prop) and Your First Proofs: intros, simpl, reflexivity, rewrite
Learn how to enter tactic mode between Proof and Qed and prove equalities and implications using intros, simpl, reflexivity, rewrite, exact, and apply.
Rocq (Coq) Basics 6. Case Analysis (destruct), Induction (induction), and Logical Connectives
Split constructors with destruct and use mathematical induction to prove universal properties over natural numbers (n + 0 = n) and polymorphic list functions (my_app length conservation).
Rocq (Coq) Basics 7. Multi-File Projects with _CoqProject and Code Extraction to OCaml and Haskell
Organize multiple .v files into a project with _CoqProject, erase Prop proof terms, and extract verified Rocq functions to executable OCaml and Haskell code.
Rocq (Coq) Basics 8. Verifying a Two-List FIFO Queue and Command Replay
Prove that replaying commands on a two-list FIFO queue produces the exact same pop history and remaining elements as a single-list reference model, then extract and run it in OCaml.