]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/algebra/semigroups.ma
- renamed ocaml/ to components/
[helm.git] / helm / software / 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 (* Magmas *)
20
21 record Magma : Type ≝
22  { carrier:> Type;
23    op: carrier → carrier → carrier
24  }.
25
26 notation < "M" for @{ 'carrier $M }.
27 interpretation "carrier coercion" 'carrier S =
28  (cic:/matita/algebra/semigroups/carrier.con S).
29
30 notation "hvbox(a break \middot b)" 
31   left associative with precedence 55
32 for @{ 'magma_op $a $b }.
33
34 interpretation "magma operation" 'magma_op a b =
35  (cic:/matita/algebra/semigroups/op.con _ a b).
36
37 (* Semigroups *)
38
39 record isSemiGroup (M:Magma) : Prop ≝
40  { associative: associative ? (op M) }.
41
42 record SemiGroup : Type ≝
43  { magma:> Magma;
44    semigroup_properties:> isSemiGroup magma
45  }.
46  
47 notation < "S" for @{ 'magma $S }.
48 interpretation "magma coercion" 'magma S =
49  (cic:/matita/algebra/semigroups/magma.con S).
50  
51 definition is_left_unit ≝
52  λS:SemiGroup. λe:S. ∀x:S. e·x = x.
53  
54 definition is_right_unit ≝
55  λS:SemiGroup. λe:S. ∀x:S. x·e = x.
56
57 theorem is_left_unit_to_is_right_unit_to_eq:
58  ∀S:SemiGroup. ∀e,e':S.
59   is_left_unit ? e → is_right_unit ? e' → e=e'.
60  intros;
61  rewrite < (H e');
62  rewrite < (H1 e) in \vdash (? ? % ?);
63  reflexivity.
64 qed.