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/groups/".
17 include "higher_order_defs/functions.ma".
19 include "nat/orders.ma".
20 include "constructive_connectives.ma".
22 definition left_neutral \def λC,op.λe:C. ∀x:C. op e x = x.
24 definition right_neutral \def λC,op. λe:C. ∀x:C. op x e=x.
26 definition left_inverse \def λC,op.λe:C.λinv:C→C. ∀x:C. op (inv x) x = e.
28 definition right_inverse \def λC,op.λe:C.λ inv: C→ C. ∀x:C. op x (inv x)=e.
30 definition distributive_left ≝
31 λA:Type.λf:A→A→A.λg:A→A→A.
32 ∀x,y,z. f x (g y z) = g (f x y) (f x z).
34 definition distributive_right ≝
35 λA:Type.λf:A→A→A.λg:A→A→A.
36 ∀x,y,z. f (g x y) z = g (f x z) (f y z).
38 record is_abelian_group (C:Type) (plus:C→C→C) (zero:C) (opp:C→C) : Prop \def
39 { (* abelian additive semigroup properties *)
40 plus_assoc_: associative ? plus;
41 plus_comm_: symmetric ? plus;
42 (* additive monoid properties *)
43 zero_neutral_: left_neutral ? plus zero;
44 (* additive group properties *)
45 opp_inverse_: left_inverse ? plus zero opp
48 record abelian_group : Type \def
50 plus: carrier → carrier → carrier;
52 opp: carrier → carrier;
53 ag_abelian_group_properties: is_abelian_group ? plus zero opp
56 notation "0" with precedence 89
59 interpretation "Abelian group zero" 'zero =
60 (cic:/matita/groups/zero.con _).
62 interpretation "Abelian group plus" 'plus a b =
63 (cic:/matita/groups/plus.con _ a b).
65 interpretation "Abelian group opp" 'uminus a =
66 (cic:/matita/groups/opp.con _ a).
69 λG:abelian_group.λa,b:G. a + -b.
71 interpretation "Abelian group minus" 'minus a b =
72 (cic:/matita/groups/minus.con _ a b).
74 theorem plus_assoc: ∀G:abelian_group. associative ? (plus G).
76 apply (plus_assoc_ ? ? ? ? (ag_abelian_group_properties G)).
79 theorem plus_comm: ∀G:abelian_group. symmetric ? (plus G).
81 apply (plus_comm_ ? ? ? ? (ag_abelian_group_properties G)).
84 theorem zero_neutral: ∀G:abelian_group. left_neutral ? (plus G) 0.
86 apply (zero_neutral_ ? ? ? ? (ag_abelian_group_properties G)).
89 theorem opp_inverse: ∀G:abelian_group. left_inverse ? (plus G) 0 (opp G).
91 apply (opp_inverse_ ? ? ? ? (ag_abelian_group_properties G)).
94 lemma cancellationlaw: ∀G:abelian_group.∀x,y,z:G. x+y=x+z → y=z.
96 generalize in match (eq_f ? ? (λa.-x +a) ? ? H);
98 rewrite < plus_assoc in H1;
99 rewrite < plus_assoc in H1;
100 rewrite > opp_inverse in H1;
101 rewrite > zero_neutral in H1;
102 rewrite > zero_neutral in H1;