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 set "baseuri" "cic:/matita/algebra/monoids/".
17 include "algebra/semigroups.ma".
19 record PreMonoid : Type ≝
24 record isMonoid (M:PreMonoid) : Prop ≝
25 { is_semi_group:> isSemiGroup M;
27 is_left_unit (mk_SemiGroup ? is_semi_group) (e M);
29 is_right_unit (mk_SemiGroup ? is_semi_group) (e M)
32 record Monoid : Type ≝
33 { premonoid:> PreMonoid;
34 monoid_properties:> isMonoid premonoid
37 notation "1" with precedence 89
40 interpretation "Monoid unit" 'munit =
41 (cic:/matita/algebra/monoids/e.con _).
43 definition is_left_inverse ≝
48 definition is_right_inverse ≝
53 theorem is_left_inverse_to_is_right_inverse_to_eq:
55 is_left_inverse M l → is_right_inverse M r →
58 generalize in match (H x); intro;
59 generalize in match (eq_f ? ? (λy.y·(r x)) ? ? H2);
60 simplify; fold simplify (op M);
62 generalize in match (op_associative ? (is_semi_group ? (monoid_properties M)));
64 rewrite > H2 in H3; clear H2;
66 rewrite > (e_is_left_unit ? (monoid_properties M)) in H3;
67 rewrite > (e_is_right_unit ? (monoid_properties M)) in H3;