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 "excedence.ma".
19 definition left_neutral ≝ λC:apartness.λop.λe:C. ∀x:C. op e x ≈ x.
20 definition right_neutral ≝ λC:apartness.λop. λe:C. ∀x:C. op x e ≈ x.
21 definition left_inverse ≝ λC:apartness.λop.λe:C.λinv:C→C. ∀x:C. op (inv x) x ≈ e.
22 definition right_inverse ≝ λC:apartness.λop.λe:C.λ inv: C→ C. ∀x:C. op x (inv x) ≈ e.
23 definition strong_ext ≝ λA:apartness.λop:A→A.∀x,y. op x # op y → x # y.
24 (* ALLOW DEFINITION WITH SOME METAS *)
26 definition distributive_left ≝
27 λA:apartness.λf:A→A→A.λg:A→A→A.
28 ∀x,y,z. f x (g y z) ≈ g (f x y) (f x z).
30 definition distributive_right ≝
31 λA:apartness.λf:A→A→A.λg:A→A→A.
32 ∀x,y,z. f (g x y) z ≈ g (f x z) (f y z).
34 record abelian_group : Type ≝
36 plus: carr → carr → carr;
39 plus_assoc: associative ? plus (eq carr);
40 plus_comm: commutative ? plus (eq carr);
41 zero_neutral: left_neutral ? plus zero;
42 opp_inverse: left_inverse ? plus zero opp;
43 plus_strong_ext: ∀z.strong_ext ? (plus z)
46 notation "0" with precedence 89 for @{ 'zero }.
48 interpretation "Abelian group zero" 'zero =
49 (cic:/matita/groups/zero.con _).
51 interpretation "Abelian group plus" 'plus a b =
52 (cic:/matita/groups/plus.con _ a b).
54 interpretation "Abelian group opp" 'uminus a =
55 (cic:/matita/groups/opp.con _ a).
58 λG:abelian_group.λa,b:G. a + -b.
60 interpretation "Abelian group minus" 'minus a b =
61 (cic:/matita/groups/minus.con _ a b).
63 lemma ap_rewl: ∀A:apartness.∀x,z,y:A. x ≈ y → y # z → x # z.
64 intros (A x z y Exy Ayz); cases (ap_cotransitive ???x Ayz); [2:assumption]
65 cases (Exy (ap_symmetric ??? a));
68 lemma ap_rewr: ∀A:apartness.∀x,z,y:A. x ≈ y → z # y → z # x.
69 intros (A x z y Exy Azy); apply ap_symmetric; apply (ap_rewl ???? Exy);
70 apply ap_symmetric; assumption;
73 definition ext ≝ λA:apartness.λop:A→A. ∀x,y. x ≈ y → op x ≈ op y.
75 lemma strong_ext_to_ext: ∀A:apartness.∀op:A→A. strong_ext ? op → ext ? op.
76 intros 6 (A op SEop x y Exy); intro Axy; apply Exy; apply SEop; assumption;
79 lemma feq_plusl: ∀G:abelian_group.∀x,y,z:G. y ≈ z → x+y ≈ x+z.
80 intros (G x y z Eyz); apply (strong_ext_to_ext ?? (plus_strong_ext ? x));
84 lemma plus_strong_extr: ∀G:abelian_group.∀z:G.strong_ext ? (λx.x + z).
85 intros 5 (G z x y A); simplify in A;
86 lapply (plus_comm ? z x) as E1; lapply (plus_comm ? z y) as E2;
87 lapply (ap_rewl ???? E1 A) as A1; lapply (ap_rewr ???? E2 A1) as A2;
88 apply (plus_strong_ext ???? A2);
91 lemma feq_plusr: ∀G:abelian_group.∀x,y,z:G. y ≈ z → y+x ≈ z+x.
92 intros (G x y z Eyz); apply (strong_ext_to_ext ?? (plus_strong_extr ? x));
96 lemma fap_plusl: ∀G:abelian_group.∀x,y,z:G. y # z → x+y # x+z.
97 intros (G x y z Ayz); apply (plus_strong_ext ? (-x));
98 apply (ap_rewl ??? ((-x + x) + y));
100 |2: apply (ap_rewr ??? ((-x +x) +z));
101 [1: apply plus_assoc;
102 |2: apply (ap_rewl ??? (0 + y));
103 [1: apply (feq_plusr ???? (opp_inverse ??));
104 |2: apply (ap_rewl ???? (zero_neutral ? y)); apply (ap_rewr ??? (0 + z));
105 [1: apply (feq_plusr ???? (opp_inverse ??));
106 |2: apply (ap_rewr ???? (zero_neutral ??)); assumption;]]]]
109 lemma fap_plusr: ∀G:abelian_group.∀x,y,z:G. y # z → y+x # z+x.
110 intros (G x y z Ayz); apply (plus_strong_extr ? (-x));
111 apply (ap_rewl ??? (y + (x + -x)));
112 [1: apply (eq_symmetric ??? (plus_assoc ????));
113 |2: apply (ap_rewr ??? (z + (x + -x)));
114 [1: apply (eq_symmetric ??? (plus_assoc ????));
115 |2: apply (ap_rewl ??? (y + (-x+x)) (feq_plusl ???? (plus_comm ???)));
116 apply (ap_rewl ??? (y + 0) (feq_plusl ???? (opp_inverse ??)));
117 apply (ap_rewl ??? (0 + y) (plus_comm ???));
118 apply (ap_rewl ??? y (zero_neutral ??));
119 apply (ap_rewr ??? (z + (-x+x)) (feq_plusl ???? (plus_comm ???)));
120 apply (ap_rewr ??? (z + 0) (feq_plusl ???? (opp_inverse ??)));
121 apply (ap_rewr ??? (0 + z) (plus_comm ???));
122 apply (ap_rewr ??? z (zero_neutral ??));
126 lemma plus_cancl: ∀G:abelian_group.∀y,z,x:G. x+y ≈ x+z → y ≈ z.
127 intros 6 (G y z x E Ayz); apply E; apply fap_plusl; assumption;
130 lemma plus_cancr: ∀G:abelian_group.∀y,z,x:G. y+x ≈ z+x → y ≈ z.
131 intros 6 (G y z x E Ayz); apply E; apply fap_plusr; assumption;
134 theorem eq_opp_plus_plus_opp_opp:
135 ∀G:abelian_group.∀x,y:G. -(x+y) ≈ -x + -y.
136 intros (G x y); apply (plus_cancr ??? (x+y));
137 apply (eq_transitive ?? 0); [apply (opp_inverse ??)]
138 apply (eq_transitive ?? (-x + -y + x + y)); [2: apply (eq_symmetric ??? (plus_assoc ????))]
139 apply (eq_transitive ?? (-y + -x + x + y)); [2: repeat apply feq_plusr; apply plus_comm]
140 apply (eq_transitive ?? (-y + (-x + x) + y)); [2: apply feq_plusr; apply plus_assoc;]
141 apply (eq_transitive ?? (-y + 0 + y));
142 [2: apply feq_plusr; apply feq_plusl; apply eq_symmetric; apply opp_inverse]
143 apply (eq_transitive ?? (-y + y));
144 [2: apply feq_plusr; apply eq_symmetric;
145 apply (eq_transitive ?? (0+-y)); [apply plus_comm|apply zero_neutral]]
146 apply eq_symmetric; apply opp_inverse.
149 theorem eq_opp_opp_x_x: ∀G:abelian_group.∀x:G.--x ≈ x.
150 intros (G x); apply (plus_cancl ??? (-x));
151 apply (eq_transitive ?? (--x + -x)); [apply plus_comm]
152 apply (eq_transitive ?? 0); [apply opp_inverse]
153 apply eq_symmetric; apply opp_inverse;
156 theorem eq_zero_opp_zero: ∀G:abelian_group.0 ≈ -0. [assumption]
157 intro G; apply (plus_cancr ??? 0);
158 apply (eq_transitive ?? 0); [apply zero_neutral;]
159 apply eq_symmetric; apply opp_inverse;