]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/library/algebra/semigroups.ma
64c2d13c9670f4e66a94448fb414895a1dfaeb34
[helm.git] / helm / matita / library / algebra / semigroups.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 set "baseuri" "cic:/matita/algebra/semigroups".
16
17 include "higher_order_defs/functions.ma".
18
19 definition isSemiGroup ≝
20  λC:Type. λop: C → C → C.associative C op.
21
22 record SemiGroup : Type ≝
23  { carrier: Type;
24    op: carrier → carrier → carrier;
25    semigroup_properties: isSemiGroup carrier op
26  }.
27  
28 coercion cic:/matita/algebra/semigroups/carrier.con.
29
30 notation "hvbox(a break \middot \sub S b)" 
31   left associative with precedence 55
32 for @{ 'ptimes $S $a $b }.
33
34 notation "hvbox(a break \middot b)" 
35   left associative with precedence 55
36 for @{ 'ptimesi $a $b }.
37
38 interpretation "Semigroup operation" 'ptimesi a b =
39  (cic:/matita/algebra/semigroups/op.con _ a b).
40
41 (* too ugly
42 interpretation "Semigroup operation" 'ptimes S a b =
43  (cic:/matita/algebra/semigroups/op.con S a b). *)
44
45 definition is_left_unit ≝
46  λS:SemiGroup. λe:S. ∀x:S. e·x = x.
47  
48 definition is_right_unit ≝
49  λS:SemiGroup. λe:S. ∀x:S. x·e = x.
50
51 theorem is_left_unit_to_is_right_unit_to_eq:
52  ∀S:SemiGroup. ∀e,e':S.
53   is_left_unit ? e → is_right_unit ? e' → e=e'.
54  intros;
55  rewrite < (H e');
56  rewrite < (H1 e) in \vdash (? ? % ?);
57  reflexivity.
58 qed.