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