Monoid: definitions and properties

Definition

A monoid is a mathematical structure composed of a set M, an associative operation o on M, and a neutral element u for o.

In this module, we use the % Record Record declaration of Coq. The fields are u:M->M->M, o:M, and proofs of associativity of o and neutrality of u. The domain M is not a field of the Record, but a parameter of the declaration:

Variable M:Set.

Record monoid:Set := 
     mkmonoid {
        u:M;
        o:M->M->M;
        point_assoc:(a,b,c:M)      
                 (o a (o b c))=(o (o a  b)  c);
        u_neutral_l:(a:M) (o u a)=a;
        u_neutral_r:(a:M) (o a u)=a }.

Powering

The powering operation on some monoid (M,u',o') is defined by primitive recursion:
Recursive Definition power[x:M]:nat->M:=
                            O => u'
                        |   (S n) =>(o'  x  (power  x  n)).
In this text, we use indifferently the notation (power x n) or (x ^ n).

Properties

Some classical properties of on powering are proved in this module, the most important is:
Lemma power_eucl:(m:M)(b,q,r:nat)
         (power m  (plus (mult q b) r))=
         (o' (power (power m b) q) (power m  r)).
which is used heavily in our algorithms.

You can see the coq source of this module .

Examples of monoids

We present in this developement three examples of monoids: