---
fullname: CoqEAL
shortname: coqeal
organization: coq-community
community: true
action: true
coqdoc: false
dune: false

synopsis: >-
  CoqEAL - The Coq Effective Algebra Library

description: |-
  This Coq library contains a subset of the work that was developed in the context
  of the ForMath EU FP7 project (2009-2013). It has two parts:
  - theory, which contains developments in algebra including normal forms of matrices,
    and optimized algorithms on MathComp data structures.
  - refinements, which is a framework to ease change of data representations during a proof.

publications:
- pub_url: https://hal.inria.fr/hal-00734505/document
  pub_title: A refinement-based approach to computational algebra in Coq
  pub_doi: 10.1007/978-3-642-32347-8_7
- pub_url: https://hal.inria.fr/hal-01113453/document
  pub_title: Refinements for free!
  pub_doi: 10.1007/978-3-319-03545-1_10
- pub_url: https://hal.inria.fr/hal-01378905/document
  pub_title: A Coq Formalization of Finitely Presented Modules
  pub_doi: 10.1007/978-3-319-08970-6_13
- pub_url: https://hal.inria.fr/hal-01081908/document
  pub_title: Formalized Linear Algebra over Elementary Divisor Rings in Coq
  pub_doi: 10.2168/LMCS-12(2:7)2016
- pub_url: https://hal.inria.fr/hal-01414881/document
  pub_title: A refinement-based approach to large scale reflection for algebra
- pub_url: https://tel.archives-ouvertes.fr/tel-00986283/
  pub_title: Interaction entre algèbre linéaire et analyse en formalisation des mathématiques
- pub_url: https://jfr.unibo.it/article/view/2615
  pub_doi: 10.6092/issn.1972-5787/2615
  pub_title: A formal proof of Sasaki-Murao algorithm
- pub_url: http://hdl.handle.net/2077/37325
  pub_title: Formalizing Refinements and Constructive Algebra in Type Theory
- pub_title: Coherent and Strongly Discrete Rings in Type Theory
  pub_url: https://staff.math.su.se/anders.mortberg/papers/coherent.pdf
  pub_doi: 10.1007/978-3-642-35308-6_21

authors:
- name: Guillaume Cano
  initial: true
- name: Cyril Cohen
  initial: true
- name: Maxime Dénès
  initial: true
- name: Érik Martin-Dorel
  initial: false
- name: Anders Mörtberg
  initial: true
- name: Damien Rouhling
  initial: false
- name: Pierre Roux
  initial: false
- name: Vincent Siles
  initial: true

maintainers:
- name: Cyril Cohen
  nickname: CohenCyril
- name: Pierre Roux
  nickname: proux01

opam-file-maintainer: Cyril Cohen <cyril.cohen@inria.fr>

opam-file-version: dev

license:
  fullname: MIT License
  identifier: MIT

supported_coq_versions:
  text: 8.20 or later (use releases for other Coq versions)
  opam: '{(>= "8.20" & < "9.1~") | (= "dev")}'

dependencies:
- opam:
    name: coq-bignums
  description: |-
    [Bignums](https://github.com/coq/bignums) same version as Coq
- opam:
    name: coq-elpi
    version: '{>= "2.4.1" | = "dev"}'
  description: |-
    [Coq-Elpi](https://github.com/LPCIC/coq-elpi) 2.4.1 or later
- opam:
    name: coq-hierarchy-builder
    version: '{>= "1.4.0"}'
  description: |-
    [Hierarchy Builder](https://github.com/math-comp/hierarchy-builder) 1.4.0 or later
- opam:
    name: coq-mathcomp-ssreflect
    version: '{>= "2.3"}'
  description: |-
    [MathComp ssreflect](https://math-comp.github.io) 2.3 or later
- opam:
    name: coq-mathcomp-algebra
  description: |-
    [MathComp algebra](https://math-comp.github.io) 2.1 or later
- opam:
    name: coq-mathcomp-multinomials
    version: '{>= "2.0"}'
  description: |-
    [MathComp Multinomials](https://github.com/math-comp/multinomials) 2.0 or later
- opam:
    name: coq-mathcomp-real-closed
    version: '{>= "2.0"}'
  description: |-
    [MathComp real-closed](https://math-comp.github.io) 2.0 or later

tested_coq_opam_versions:
- version: '2.3.0-coq-8.20'
  repo: 'mathcomp/mathcomp'
- version: '2.3.0-coq-dev'
  repo: 'mathcomp/mathcomp'
- version: 'coq-8.20'
  repo: 'mathcomp/mathcomp-dev'
- version: 'coq-dev'
  repo: 'mathcomp/mathcomp-dev'

namespace: CoqEAL

keywords:
- name: effective algebra
- name: elementary divisor rings
- name: Smith normal form
- name: mathematical components
- name: Bareiss
- name: Karatsuba multiplication
- name: refinements

categories:
- name: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms

documentation: |-
  ## Theory

  The theory directory has the following content:

  - `ssrcomplements`, `minor` `mxstructure`, `polydvd`, `similar`,
    `binetcauchy`, `ssralg_ring_tac`: Various extensions of the
    Mathematical Components library.

  - `dvdring`, `coherent`, `stronglydiscrete`, `edr`: Hierarchy of
    structures with divisibility (from rings with divisibility, PIDs,
    elementary divisor rings, etc.).

  - `fpmod`: Formalization of finitely presented modules.

  - `kaplansky`: For providing elementary divisor rings from the
    Kaplansky condition.

  - `closed_poly`: Polynomials with coefficients in a closed field.

  - `companion`, `frobenius_form`, `jordan`, `perm_eq_image`,
    `smith_complements`: Results on normal forms of matrices.

  - `bareiss_dvdring`, `bareiss`, `gauss`, `karatsuba`, `rank`,
    `strassen`, `toomcook`, `smithpid`, `smith`: Various efficient
    algorithms for computing operations on polynomials or matrices.

  ## Refinements

  The refinements directory has the following content:

  - `refinements`: Classes for refinements and refines together with
    operational typeclasses for common operations.

  - `binnat`: Proof that the binary naturals of Coq (`N`) are a refinement
    of the MathComp unary naturals (`nat`) together with basic operations.

  - `binord`: Proof that the binary natural numbers of Coq (`N`) are a refinement
    of the MathComp ordinals.

  - `binint`: MathComp integers (`ssrint`) are refined to a new type
    parameterized by positive numbers (represented by a sigma type) and
    natural numbers.  This means that proofs can be done using only
    lemmas from the MathComp library which leads to simpler proofs than
    previous versions of `binint` (e.g., `N`).

  - `binrat`: Arbitrary precision rational numbers (`bigQ`) from the
    [Bignums](https://github.com/coq/bignums) library are refined to
    MathComp's rationals (`rat`).

  - `rational`: The rational numbers of MathComp (`rat`) are refined to
    pairs of elements refining integers using parametricity of
    refinements.

  - `seqmatrix` and `seqmx_complements`: Refinement of MathComp
    matrices (`M[R]_(m,n)`) to lists of lists (`seq (seq R)`).

  - `seqpoly`: Refinement of MathComp polynomials (`{poly R}`) to lists (`seq R`).

  - `multipoly`: Refinement of
    [MathComp multinomials](https://github.com/math-comp/multinomials)
    and multivariate polynomials to Coq
    [finite maps](https://github.com/coq/coq/blob/master/theories/FSets/FMapAVL.v).

  Files should use the following conventions (w.r.t. `Local` and `Global` instances):

  ```coq
  (** Part 1: Generic operations *)
  Section generic_operations.

  Global Instance generic_operation := ...

  (** Part 2: Correctness proof for proof-oriented types and programs *)
  Section theory.

  Local Instance param_correctness : param ...

  (** Part 3: Parametricity *)
  Section parametricity.

  Global Instance param_parametricity : param ...
  Proof. exact: param_trans. Qed.

  End parametricity.
  End theory.
  ```
---
