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 ≝
22 record isMonoid (M:PreMonoid) : Prop ≝
23 { is_semi_group:> isSemiGroup M;
25 is_left_unit (mk_SemiGroup ? is_semi_group) (e M);
27 is_right_unit (mk_SemiGroup ? is_semi_group) (e M)
30 record Monoid : Type ≝
31 { premonoid:> PreMonoid;
32 monoid_properties:> isMonoid premonoid
35 interpretation "Monoid unit" 'neutral = (e _).
37 definition is_left_inverse ≝
42 definition is_right_inverse ≝
47 theorem is_left_inverse_to_is_right_inverse_to_eq:
49 is_left_inverse M l → is_right_inverse M r →
52 generalize in match (H x); intro;
53 generalize in match (eq_f ? ? (λy.y·(r x)) ? ? H2);
54 simplify; fold simplify (op M);
56 generalize in match (op_associative ? (is_semi_group ? (monoid_properties M)));
58 rewrite > H2 in H3; clear H2;
60 rewrite > (e_is_left_unit ? (monoid_properties M)) in H3;
61 rewrite > (e_is_right_unit ? (monoid_properties M)) in H3;