1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "algebra/semigroups.ma".
17 record PreMonoid : Type ≝
18 { pre_semi_group :> PreSemiGroup;
22 interpretation "Monoid unit" 'neutral = (e ?).
24 record IsMonoid (M:PreMonoid): Prop ≝
25 { is_pre_semi_group :> IsSemiGroup M;
26 e_is_left_unit : is_left_unit M ⅇ;
27 e_is_right_unit : is_right_unit M ⅇ
30 record Monoid : Type ≝
31 { pre_monoid :> PreMonoid;
32 is_monoid :> IsMonoid pre_monoid
35 definition SemiGroup_of_Monoid: Monoid → SemiGroup ≝
36 λM. mk_SemiGroup ? (is_monoid M).
38 coercion SemiGroup_of_Monoid nocomposites.
40 definition is_left_inverse ≝
45 definition is_right_inverse ≝
50 theorem is_left_inverse_to_is_right_inverse_to_eq:
52 is_left_inverse M l → is_right_inverse M r →
56 lapply (eq_f ? ? (λy.y·(r x)) ? ? H2) as H3; clear H2;
57 rewrite > (op_is_associative ? M) in H3.
59 rewrite > (e_is_left_unit ? M) in H3;
60 rewrite > (e_is_right_unit ? M) in H3;