]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/algebra/semigroups.ma
- applyTransformation: bugfix in the rendering of records
[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 include "higher_order_defs/functions.ma".
16
17 (* Magmas *)
18
19 record Magma : Type≝
20  { carrier:> Type;
21    op: carrier → carrier → carrier
22  }.
23
24 interpretation "magma operation" 'middot a b = (op ? a b).
25
26 (* Semigroups *)
27
28 record isSemiGroup (M:Magma) : Prop≝
29  { op_associative: associative ? (op M) }.
30
31 record SemiGroup : Type≝
32  { magma:> Magma;
33    semigroup_properties:> isSemiGroup magma
34  }.
35  
36 definition is_left_unit ≝
37  λS:SemiGroup. λe:S. ∀x:S. e·x = x.
38  
39 definition is_right_unit ≝
40  λS:SemiGroup. λe:S. ∀x:S. x·e = x.
41
42 theorem is_left_unit_to_is_right_unit_to_eq:
43  ∀S:SemiGroup. ∀e,e':S.
44   is_left_unit ? e → is_right_unit ? e' → e=e'.
45  intros;
46  rewrite < (H e');
47  rewrite < (H1 e) in \vdash (? ? % ?).
48  reflexivity.
49 qed.