Rocq Proof Framework
- Rocq Proof Framework is an extensible proof assistant ecosystem built on Coq with specialized libraries and AI integrations for automating certified formal proofs.
- It formalizes advanced mathematical structures—including category theory, numerical semigroups, combinatorics, and adhesive categories—through rigorous, machine-checked algorithms.
- Its innovative use of multi-agent planning, automated premise selection, and clone detection empowers scalable, modular verification and trusted program extraction.
The Rocq Proof Framework is a proof assistant infrastructure and ecosystem that supports the development, certification, and automation of formal proofs across a broad range of mathematical, algorithmic, and verification domains. Rooted in Coq but with specific Rocq extensions, libraries, and methodologies, Rocq accommodates developments in category theory, formal verification, combinatorics, algebra, program logics, cryptography, and more. The framework integrates machine-assisted proof, automation, advanced certified algorithms, and interfaces for interacting with generative AI to facilitate robust, scalable, and modular formal developments.
1. Foundations and Architecture
The foundation of Rocq is its type-theoretic kernel, compatible with Coq but extended by Rocq-specific libraries and integration patterns. It supports a dependently typed language (variants of Gallina) for expressing definitions, theorems, inductive constructions, and tactics. Rocq builds on well-established components (such as Mathematical Components, MathComp, Hierarchy Builder) and augments them with Rocq-native libraries for areas like P-category theory (Berry et al., 12 May 2025), numerical semigroups (Bartoletti et al., 29 May 2025), combinatorics (Hivert, 6 Dec 2024), adhesive categories (Arsac et al., 22 Sep 2025), logical pinning (Guan et al., 27 Sep 2025), and metatheoretic verification (Kent et al., 8 Sep 2025).
A distinguishing architectural practice is the systematic use of certified algorithms—implementations whose correctness properties are machine-checked via Rocq proofs. Additionally, Rocq supports agentic and machine-learning-augmented proof generation (Khramov et al., 28 May 2025), deep integration with LLM-driven automation (Bayazıt et al., 26 Aug 2025), clone detection for proof engineering (Ghanbari, 27 Apr 2025), and careful modularization of formal libraries for interoperability.
2. Formalization of Mathematical and Algebraic Structures
Rocq has been used to fully formalize intricate areas of mathematics and algorithms, giving rise to libraries that extend the reach and rigor of mechanized mathematics:
- P-Category Theory and Normalization by Evaluation Rocq formalizes P-category theory, where homs are subsetoids, and deploys this abstraction for normalization by evaluation algorithms that do not rely on syntactic constructs such as normal or neutral terms (Berry et al., 12 May 2025). The framework uniquely provides a categorical proof of the strong completeness property, including a full formalization of the universal property of the free Cartesian-closed category and new results on the universal property of unquotiented syntax for the simply typed lambda calculus.
- Algebraic Combinatorics Comprehensive libraries in Rocq handle the combinatorics and algebra of symmetric functions, tableau algorithms (notably, Robinson–Schensted), and formalize key results such as the Littlewood–Richardson rule, connecting combinatorial algorithms with algebraic enumeration in a machine-checked environment (Hivert, 6 Dec 2024).
- Certified Algorithms for Numerical Semigroups Rocq supports the first fully certified implementations of algorithms for invariants of numerical semigroups, including the computation of gaps, multiplicity, Apéry sets, small elements, and conductors. The representation as ordered gap lists facilitates constructively decidable membership and structural recursion, ensuring correctness by proof for all computations (Bartoletti et al., 29 May 2025).
- Adhesive Category Theory for Graph Rewriting The hierarchy-based Rocq library encodes adhesive categories, including variants such as rm-adhesive and rm-quasiadhesive categories, captures morphism classes (isomorphisms, monos, regular monos), and mechanizes central results in double-pushout (DPO) rewriting such as the local Church–Rosser and concurrency theorems. Proofs extend to categories of types, setoids, finite structures, graphs, presheaves, and their slice categories (Arsac et al., 22 Sep 2025).
3. Proof Automation, Synthesis, and Agentic Systems
Rocq integrates advanced proof automation, retriever-ranker models, and agentic planning systems:
- Similarity-Driven Retrieval and Planning RocqStar introduces a premise selection mechanism based on self-attentive embedder models that learn representation spaces for theorem–proof pairs using information extracted from the Rocq corpus. The system aligns distances on statements with proof distances (measured by a combination of Levenshtein and Jaccard metrics), improving premise selection performance by up to 28% over baselines (Khramov et al., 28 May 2025).
- Agentic Multi-Stage Proof Synthesis Proof synthesis proceeds in stages: a planning phase (often involving multi-agent LLM debate) constructs a high-level proof strategy, adjudicated and refined before execution. During execution, automation tools iteratively interact with the Rocq environment (via coq-lsp and MCP), invoking proof checking, contextual exploration, and refinement as needed. An ablation paper confirms the significant benefit of multi-agent planning for success rates in difficult proofs.
- LLM-Based Analysis and Proof Generation Studies using LLMs (e.g., in hs-to-coq and Verdi) reveal that access to richer context—both internal and external dependencies—is crucial for generating valid and concise proofs (Bayazıt et al., 26 Aug 2025). LLMs excel in small proof goals and are capable of concise and “smart” proof reuse but may make occasional unanticipated mistakes or struggle with complex tactics, revealing the necessity of human-in-the-loop verification.
- Clone Detection and Proof Engineering The clone-finder tool rigorously detects duplicate goals (α-equivalent terms) in Rocq codebases, uncovering redundancy and opportunities for refactoring, proof reuse, and library abstraction. Three principal redundancy classes are reported: exact duplications, generalizations, and alternative proofs of α-equivalent goals (Ghanbari, 27 Apr 2025).
4. Domain-Specific Logics, Verification, and Certified Protocols
The Rocq Framework addresses domain-specific verification in several areas:
- Verified Graph Rewriting and Category Theory The adhesive category libraries facilitate the formal mechanization of DPO rewriting metatheory, supporting modeling tasks involving graph transformations in both theoretical and applied contexts (Arsac et al., 22 Sep 2025).
- Logic for Programs with Fine-Grained Pointer Manipulation Logical pinning, fully mechanized in Rocq with the CFML library, enables precise specifications for APIs that expose container-internal pointers. The framework generalizes the magic-wand-based approach by introducing borrowing/pinning predicates and states, handling aliasing and in-place mutation without sacrificing modularity (Guan et al., 27 Sep 2025).
- Formal Metatheory for Linearizability Rocq mechanizes the complete forward reasoning metatheory of linearizability for concurrent data structures (Kent et al., 8 Sep 2025). A generic “tracker” meta-configuration object evolves alongside concrete runs, and the adequacy theorem relates tracker inhabitation to linearizability, supporting verified end-to-end proofs for concurrent registers and other structures.
- Security Protocols: Mechanized Strand Spaces and Remote Attestation StrandsRocq encodes the strand spaces protocol verification formalism with modular attacker specifications (“maximal penetrator”), new proof techniques (e.g., “protected predicates”), automation (“simplify_prop”), and composition theorems (Busi et al., 18 Feb 2025). In the context of cryptographic protocol verification, the Rocq Prover and SSProve libraries mechanize security proofs for digital signatures and remote attestation schemes, supporting modular, game-based reductions, and formalizing challenges arising from stateful monadic primitives (Zain et al., 24 Feb 2025).
- AMQ Data Structures – Certainty and Uncertainty The Ceramist framework, implemented in Rocq/Coq, applies modular interfaces and probability monads to the verification of approximate membership query data structures (Bloom filters, counting filters), automatically proving no-false-negative guarantees and bounding false positive rates, with all probabilistic reasoning encoded and verified (Gopinathan et al., 2020).
5. Universal Properties, Normalization, and Computation Extraction
Rocq applies advanced categorical and syntactic machinery to normalization by evaluation (NbE), extending classical results:
- Categorical Normalization Algorithms The library formalizes the universal property of free Cartesian-closed categories—a result not previously fully encoded in a proof assistant—enabling categorical proofs of both soundness and strong completeness for NbE algorithms (Berry et al., 12 May 2025). This involves abstractly stating and proving, for unquotiented lambda calculus syntax, the existence and uniqueness of morphisms into arbitrary Cartesian-closed categories, and applying this to normalization proofs.
- Program Extraction All formalized normalization proofs admit extraction of certified, executable normalization algorithms for simply-typed lambda terms, inclusive of both β- and η-normalization and their correctness derivations.
- Emphasis on Computable Formalization The design of all libraries, such as the numerical semigroups and combinatorial algorithms, is guided by the intent that formal proofs readily admit to extracted computation—ensuring the derived programs are both mathematically certified and practically usable.
6. Cross-System Interoperability, Benchmarks, and Dataset Integration
Rocq facilitates interaction with other proof assistants and leverages LLM-driven translation:
- Automatic Translation of MiniF2F A large-scale experiment translated 478 out of 488 MiniF2F theorems from Lean/Isabelle/natural language to Rocq statements using multi-stage prompting with LLMs (including error-driven multi-turn interactions and prompt engineering) (Viennot et al., 11 Feb 2025). This pipeline enables cross-benchmarking and opens infrastructure for comparative research and tool evaluation.
- Benchmarking and Auditability All automated translations are verified with the Pétanque system, and human audits indicate semantic correctness of the majority of outputs, underscoring Rocq's potential as a reference point for formal mathematics interoperability.
7. Methodological and Practical Impact
The overarching impact of Rocq centers on:
- Mechanized Rigor and Trust By mandating that all algorithms, proofs, and transformations are certified and auditable, Rocq ensures maximal reliability—crucial in applications from cryptography to distributed systems and program verification.
- Modularity and Automation The architecture favors modular development (both in category theory, combinatorics, and logic) and embraces automation—enabling proof engineers to tackle large-scale endeavors efficiently.
- Practical Extraction and Usability The coupling of formal proofs with computable extraction makes Rocq libraries valuable for integration into real-world tools such as computer algebra systems and formally verified software stacks.
- Scalability and Future Extensions Through clone detection, modular layering, agentic planning, and premise selection, Rocq accommodates modern proof engineering practices and is positioned to adapt to large-scale formal projects, future advances in AI-assisted proving, and new domains.
In summary, the Rocq Proof Framework constitutes an advanced formal development ecosystem in which category theory, combinatorics, algebra, program logics, cryptographic reasoning, and AI-driven automation converge, providing both foundational assurance and practical tools for the formal methods community.