Skip to main content
v2026.11,986 entries · CC-BY 4.0

Coq proof assistant (now Rocq Prover): install, first proof and how to read it

Coq proof assistant, now the Rocq Prover: install routes, a first proof, reading goals, and how Qed and Admitted affect trust.

Written and maintained by CASRAI Editorial Board

Published

On this page

The Coq proof assistant is now called the Rocq Prover: it is an interactive tool in which you state a mathematical theorem or a program specification in a formal language and then build a proof that a small trusted checker, the kernel, verifies. Researchers use it to machine-check proofs and to extract certified programs. This guide covers what it does, how to install it, a first proof written step by step, how to read its output, and the free alternatives.

What Coq proof assistant (now Rocq Prover) is used for in research

According to the project’s own about page, Rocq is the new name of the Coq Proof Assistant. The name “honors Inria Rocquencourt, the original site where the prover was developed”, and it alludes to the Roc bird; the project’s Core team chose it after a user poll. Anything published before the rename, including papers, theses and library documentation, uses the name Coq, and both names refer to the same system.

Rocq implements a program specification and mathematical language called Gallina, whose logical basis is a polymorphic, cumulative calculus of inductive constructions. In practice that means one language serves for definitions, statements and proofs. The system is written in OCaml and distributed under the GNU Lesser General Public Licence version 2.1. Its development began in 1984 at INRIA Rocquencourt with Coquand and Huet, and the project page says the logic was extended to the calculus of inductive constructions in 1991 by Paulin.

Two research uses

  • Machine-checked mathematics. You state a theorem, construct a proof with commands called tactics, and the kernel checks the finished proof term. The about page describes this as letting users “machine-check these proofs by a relatively small certification kernel”.
  • Certified programs. Rocq can extract certified programs to OCaml, Haskell or Scheme, so a program proved correct against its specification can be turned into runnable code.

The project records two recognitions for the system under its former name: the 2013 ACM Software System Award and the 2013 ACM SIGPLAN Programming Languages Software Award, and the 2022 Open Science Free Software Award in France’s Scientific and Technical category. For the wider discipline see the CASRAI guides on formal verification and formal methods.

Coq and Rocq: a naming map for citing and searching

You are looking at Name used What to do
A paper, thesis or tutorial from before the rename Coq Search both names; the system is the same project.
The reference manual, version 9.0 Rocq (docs.rocq-prover.org, rocq-prover.org) Use it for current command names, such as rocq compile for batch compilation.
An older manual version, for example 8.9 Hosted under both coq.inria.fr and docs.rocq-prover.org Match the manual version to the version you actually run.

How to install or access Coq proof assistant (Rocq Prover)

Install Rocq from the official install page at rocq-prover.org/install. The route depends on your operating system, and the page recommends the Rocq Platform binary installer for beginners on Windows and macOS. The page links the Platform 2026.07.0 release page for those installers.

Operating system Routes the official install page lists
Windows Rocq Platform binary installer; or WSL or a Linux virtual machine
macOS Rocq Platform binary installer; Homebrew (the page notes it lacks some external packages)
Linux No Platform binary installer; Platform scripts that compile from source with opam; opam; Nix; the distribution package manager (can be outdated, check Repology); the Docker image rocq/rocq-prover on Docker Hub

Choose an editor

The install page names VsRocq for Visual Studio Code. The language server comes through opam or the Platform (Platform 2025.01 or later), and the extension and the language server must be the same version. Check the install page for the current release before you start, because version numbers change.

How to prove a first theorem in Coq (Rocq) step by step

The worked example is the first proof from “Basics: Functional Programming in Rocq”, the opening chapter of Software Foundations Volume 1 (Logical Foundations), which states that zero plus any natural number is that number.

  1. Create a file with the extension .v and open it in your editor. In an interactive editor each command you send is executed and the proof state updates.
  2. State the theorem: Theorem plus_O_n : ∀ n : nat, 0 + n = n. Entering a command such as Theorem puts Rocq into proof mode.
  3. Start with Proof. (the reference manual calls this a no-op marker and discourages relying on it, but the textbook uses it).
  4. Introduce the variable with intros n. The goal now has n in its local context.
  5. Simplify with simpl.
  6. Close the goal with reflexivity.
  7. Finish with Qed. The term built so far is sent to the kernel, which checks that it is well typed and that its type matches the statement. If the check passes, the theorem is added as an opaque constant.

The book compiles its Basics file in batch mode with rocq compile -Q . LF Basics.v. You can also test terms interactively: Check true : bool., Check negb : bool → bool. and Check S : nat → nat. display types, and Compute (next_working_day friday). evaluates an expression (in the book it returns monday).

How to read the output of Coq (Rocq)

The proof state shows goals. Each goal has a conclusion below a horizontal line and a local context above it. Only the first goal’s context is shown. For the example above, after intros n. the context holds n as a natural number and the conclusion is 0 + n = n. When you close the last goal, the state is empty and you can enter Qed.

Two facts about the interface matter. Tactics only work in proof mode, and interactive interfaces display the proof state while batch mode (rocq compile) does not. To inspect an unfinished proof term use Show Proof.; Check shows the type of a term.

How a proof ends: what each command means for trust

How you end a proof determines how much a reader can rely on it. The data table below, compiled from the Rocq 9.0 reference manual page on proof mode, compares the commands. The practical consequence for a research paper: a development that closes proofs with Qed is checked by the kernel, whereas a development that uses Admitted contains a declared axiom, so you should list any Admitted statements when you report what was verified.

Reporting a Rocq result in a paper

The sources support four things worth stating alongside a verified result. State the system and its version, using both names if you cite older work. State whether every theorem is closed with Qed. List any statement closed with Admitted, since the manual says Admitted gives up the proof and declares the initial goal as an axiom. State what is trusted: the kernel and the statements themselves. A proof that the kernel accepts shows that the statement holds; it does not show that the statement says what you meant, so the specification deserves the same review as any other definition.

Because Rocq is distributed under an open licence and the kernel is small, a reader can rerun the check. Provide the .v files and the exact install route from the table above so that others can reproduce it.

Troubleshooting Coq (Rocq)

“No focused proof (No proof-editing in progress)”

This is the message the manual gives when a proof-ending command such as Qed is used outside proof mode. Check that a Theorem or similar command was accepted before the tactics, and that you did not already end the proof.

The proof state does not appear

Batch compilation with rocq compile does not display proof state. Run the file in an interactive interface such as VsRocq to see goals.

The editor extension misbehaves

The install page requires the VsRocq extension and the language server to have identical versions. Reinstall one of them to match the other.

Old code or an old package on Linux

Distribution packages can be outdated; the install page suggests checking Repology, or using opam, Nix or the Docker image for a current version. Match the manual version (for example 9.0) to your installed version, since command names changed with the rename.

Free alternatives to Coq (Rocq Prover)

Rocq itself is open source. Other proof assistants are also free. The table states only what each project’s own site says. For background on how CASRAI treats software for formal work, see the research tools hub.

Tool What its own site says
Lean “An open-source programming language and proof assistant”; a functional language that compiles to native code; Mathlib is described as a mathematical library of over a million lines of formalized mathematics (lean-lang.org).
Isabelle A “generic proof assistant” with tools for proving formulas in a logical calculus; distributed for free under open-source licences; front ends Isabelle/jEdit and Isabelle/VSCode; the Archive of Formal Proofs collects examples (isabelle.in.tum.de).
Rocq Prover (this guide) Gallina language; written in OCaml; LGPL 2.1; extraction to OCaml, Haskell and Scheme (rocq-prover.org).

Sources

Data: Rocq proof-ending commands and what each means for the result

Compares the commands that end or abandon a proof in Rocq proof mode, as defined in the Rocq 9.0 reference manual page on proof mode. Compiled by reading the manual and recording each command's stated effect.

Period covered: Rocq 9.0.

Rocq proof-ending commands and what each means for the result
CommandEffect stated in the manualResulting constant
QedSends the proof term to the kernel, which checks it is well typed and that its type matches the statementOpaque constant
DefinedEnds the proof like Qed but adds a transparent constantTransparent constant
SaveEnds the proof and gives it a nameNamed constant
AdmittedGives up the proof and declares the initial goal as an axiomAxiom
AbortAborts the proofNone

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Coq proof assistant (now Rocq Prover): install, first proof and how to read it

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →