The Rocq Standard Library
These modules are available through the From Stdlib Require Import
command.
This table of components covers top-level modules intended for direct use. For an exhaustive listing of standard-library modules (public and internal) as well as the internal dependencies between them, see the subcomponent index. There is also an alphabetical index of all modules and objects.
To find specific lemmas and defintions in the standard library, do From Stdlib Require All.
(no Import
!) and use the Search
command, for example Search (_ * (_ + _)).
Concrete Computable Objects
- Byte
- A variant type with 256 cases.
- PeanoNat
- Unary natural numbers
nat
. The first-principles construction in this module is intended for learning, use for structural recursion, and for type indices in advanced dependently typed programming. For code that treats natural numbers opaquely, consider NArith. - NArith
- Natural numbers
N
. For Peano induction, useN.peano_ind
. - ZArith
- Integers
Z
. Induction:Z.peano_ind
,Z.order_induction_0
or, for non-negative,Wf_Z.natlike_ind
. - QArith
- Rational numbers with canonical and non-canonical representations (
Qc
andQ
). Also considerrat
from math-comp orbigQ
from coq-bignums. - SpecFloat
- Floating-point numbers
spec_float
, defined following the fully specified subset of IEEE-754 (without NaN payloads). Continued in flocq.
Programming Aides
- Utf8
- notations for quantifiers and operators.
- Wellfounded
- Relations without infinite descending chains for termination proofs.
- Program
- More intensive elaboration; documented in the Rocq Prover manual: Program. Also consider rocq-equations.
Decision Procedures
Documented in the Rocq Prover manual: Automatic Solvers.
Real Numbers
- Reals
- Axiomatization and uniqeness of constructive real numbers.
- Cauchy.ConstructiveRcomplete
- Construction and completeness of Cauchy real numbers.
Advanced Dependendly Typed Programming
- EqDep_dec
- Uniqueness of proofs of decidable equalities.
- Vector
- Lists with length-dependent type, constructed as an inductive type indexed by a
nat
(the length). This construction is uniquely suitable for nesting with other inductive types, but direct proofs about it require skilled use of dependent pattern matching with anin
clause. Indirect reasoning about vectors converted to lists is often preferred. If nesting is not needed, consider usinglist
, potentially paired with a proof about its length. - Fin
- Bounded natural numbers, constructed as an inductive type indexed by a
nat
(the strict upper bound). This construction matches the index space of Vector, but again direct proofs about it require skilled use of dependent pattern matching with anin
clause. Further,Fin.t n
is inhabited only ifn
is nonzero, so a natural number cannot be a always converted toFin.t
(unlikeZmod 0
, which is isomorphic toZ
).
Study of Rocq's Logic
The standard library contains substantial study of near-paradoxes and edge cases in Rocq's logic. See the logic and classical-logic subcomponents. However, if looking at the included sets library, also consider math-comp/analysis/classical.Axiomatized OCaml Primitives
Rocq Prover documentation: Primitive Objects.
- PArray
- Persistent arrays implemented in OCaml using internal mutability.