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 plus_assoc: ∀G:abelian_group.∀x,y,z:G.x+(y+z)≈x+y+z ≝ plus_assoc_.
64 lemma plus_comm: ∀G:abelian_group.∀x,y:G.x+y≈y+x ≝ plus_comm_.
65 lemma zero_neutral: ∀G:abelian_group.∀x:G.0+x≈x ≝ zero_neutral_.
66 lemma opp_inverse: ∀G:abelian_group.∀x:G.-x+x≈0 ≝ opp_inverse_.
68 definition ext ≝ λA:apartness.λop:A→A. ∀x,y. x ≈ y → op x ≈ op y.
70 lemma strong_ext_to_ext: ∀A:apartness.∀op:A→A. strong_ext ? op → ext ? op.
71 intros 6 (A op SEop x y Exy); intro Axy; apply Exy; apply SEop; assumption;
74 lemma feq_plusl: ∀G:abelian_group.∀x,y,z:G. y ≈ z → x+y ≈ x+z.
75 intros (G x y z Eyz); apply (strong_ext_to_ext ?? (plus_strong_ext ? x));
79 coercion cic:/matita/groups/feq_plusl.con nocomposites.
81 lemma plus_strong_extr: ∀G:abelian_group.∀z:G.strong_ext ? (λx.x + z).
82 intros 5 (G z x y A); simplify in A;
83 lapply (plus_comm ? z x) as E1; lapply (plus_comm ? z y) as E2;
84 lapply (ap_rewl ???? E1 A) as A1; lapply (ap_rewr ???? E2 A1) as A2;
85 apply (plus_strong_ext ???? A2);
88 lemma feq_plusr: ∀G:abelian_group.∀x,y,z:G. y ≈ z → y+x ≈ z+x.
89 intros (G x y z Eyz); apply (strong_ext_to_ext ?? (plus_strong_extr ? x));
93 coercion cic:/matita/groups/feq_plusr.con nocomposites.
95 (* generation of coercions to make *_rew[lr] easier *)
96 lemma feq_plusr_sym_: ∀G:abelian_group.∀x,y,z:G.z ≈ y → y+x ≈ z+x.
97 compose feq_plusr with eq_sym (H); apply H; assumption;
99 coercion cic:/matita/groups/feq_plusr_sym_.con nocomposites.
100 lemma feq_plusl_sym_: ∀G:abelian_group.∀x,y,z:G.z ≈ y → x+y ≈ x+z.
101 compose feq_plusl with eq_sym (H); apply H; assumption;
103 coercion cic:/matita/groups/feq_plusl_sym_.con nocomposites.
105 lemma fap_plusl: ∀G:abelian_group.∀x,y,z:G. y # z → x+y # x+z.
106 intros (G x y z Ayz); apply (plus_strong_ext ? (-x));
107 apply (ap_rewl ??? ((-x + x) + y));
108 [1: apply plus_assoc;
109 |2: apply (ap_rewr ??? ((-x +x) +z));
110 [1: apply plus_assoc;
111 |2: apply (ap_rewl ??? (0 + y));
112 [1: apply (feq_plusr ???? (opp_inverse ??));
113 |2: apply (ap_rewl ???? (zero_neutral ? y));
114 apply (ap_rewr ??? (0 + z) (opp_inverse ??));
115 apply (ap_rewr ???? (zero_neutral ??)); assumption;]]]
118 lemma fap_plusr: ∀G:abelian_group.∀x,y,z:G. y # z → y+x # z+x.
119 intros (G x y z Ayz); apply (plus_strong_extr ? (-x));
120 apply (ap_rewl ??? (y + (x + -x)));
121 [1: apply (eq_sym ??? (plus_assoc ????));
122 |2: apply (ap_rewr ??? (z + (x + -x)));
123 [1: apply (eq_sym ??? (plus_assoc ????));
124 |2: apply (ap_rewl ??? (y + (-x+x)) (plus_comm ? x (-x)));
125 apply (ap_rewl ??? (y + 0) (opp_inverse ??));
126 apply (ap_rewl ??? (0 + y) (plus_comm ???));
127 apply (ap_rewl ??? y (zero_neutral ??));
128 apply (ap_rewr ??? (z + (-x+x)) (plus_comm ? x (-x)));
129 apply (ap_rewr ??? (z + 0) (opp_inverse ??));
130 apply (ap_rewr ??? (0 + z) (plus_comm ???));
131 apply (ap_rewr ??? z (zero_neutral ??));
135 lemma plus_cancl: ∀G:abelian_group.∀y,z,x:G. x+y ≈ x+z → y ≈ z.
136 intros 6 (G y z x E Ayz); apply E; apply fap_plusl; assumption;
139 lemma plus_cancr: ∀G:abelian_group.∀y,z,x:G. y+x ≈ z+x → y ≈ z.
140 intros 6 (G y z x E Ayz); apply E; apply fap_plusr; assumption;
143 theorem eq_opp_plus_plus_opp_opp:
144 ∀G:abelian_group.∀x,y:G. -(x+y) ≈ -x + -y.
145 intros (G x y); apply (plus_cancr ??? (x+y));
146 apply (eq_trans ?? 0 ? (opp_inverse ??));
147 apply (eq_trans ?? (-x + -y + x + y)); [2: apply (eq_sym ??? (plus_assoc ????))]
148 apply (eq_trans ?? (-y + -x + x + y)); [2: repeat apply feq_plusr; apply plus_comm]
149 apply (eq_trans ?? (-y + (-x + x) + y)); [2: apply feq_plusr; apply plus_assoc;]
150 apply (eq_trans ?? (-y + 0 + y));
151 [2: apply feq_plusr; apply feq_plusl; apply eq_sym; apply opp_inverse]
152 apply (eq_trans ?? (-y + y));
153 [2: apply feq_plusr; apply eq_sym;
154 apply (eq_trans ?? (0+-y)); [apply plus_comm|apply zero_neutral]]
155 apply eq_sym; apply opp_inverse.
158 theorem eq_opp_opp_x_x: ∀G:abelian_group.∀x:G.--x ≈ x.
159 intros (G x); apply (plus_cancl ??? (-x));
160 apply (eq_trans ?? (--x + -x)); [apply plus_comm]
161 apply (eq_trans ?? 0); [apply opp_inverse]
162 apply eq_sym; apply opp_inverse;
165 theorem eq_zero_opp_zero: ∀G:abelian_group.0 ≈ -0. [assumption]
166 intro G; apply (plus_cancr ??? 0);
167 apply (eq_trans ?? 0); [apply zero_neutral;]
168 apply eq_sym; apply opp_inverse;
171 lemma feq_oppr: ∀G:abelian_group.∀x,y,z:G. y ≈ z → x ≈ -y → x ≈ -z.
172 intros (G x y z H1 H2); apply (plus_cancr ??? z);
173 apply (eq_trans ?? 0 ?? (opp_inverse ?z));
174 apply (eq_trans ?? (-y + z) ? H2);
175 apply (eq_trans ?? (-y + y) ? H1);
176 apply (eq_trans ?? 0 ? (opp_inverse ??));
180 lemma feq_oppl: ∀G:abelian_group.∀x,y,z:G. y ≈ z → -y ≈ x → -z ≈ x.
181 intros (G x y z H1 H2); apply eq_sym; apply (feq_oppr ??y);
182 [2:apply eq_sym] assumption;
185 lemma feq_opp: ∀G:abelian_group.∀x,y:G. x ≈ y → -x ≈ -y.
186 intros (G x y H); apply (feq_oppl ??y ? H); apply eq_reflexive;
189 coercion cic:/matita/groups/feq_opp.con nocomposites.
191 lemma eq_opp_sym: ∀G:abelian_group.∀x,y:G. y ≈ x → -x ≈ -y.
192 compose feq_opp with eq_sym (H); apply H; assumption;
195 coercion cic:/matita/groups/eq_opp_sym.con nocomposites.
197 lemma eq_opp_plusr: ∀G:abelian_group.∀x,y,z:G. x ≈ y → -(x + z) ≈ -(y + z).
198 compose feq_plusr with feq_opp(H); apply H; assumption;
201 coercion cic:/matita/groups/eq_opp_plusr.con nocomposites.
203 lemma eq_opp_plusl: ∀G:abelian_group.∀x,y,z:G. x ≈ y → -(z + x) ≈ -(z + y).
204 compose feq_plusl with feq_opp(H); apply H; assumption;
207 coercion cic:/matita/groups/eq_opp_plusl.con nocomposites.
209 lemma plus_cancr_ap: ∀G:abelian_group.∀x,y,z:G. x+z # y+z → x # y.
210 intros (G x y z H); lapply (fap_plusr ? (-z) ?? H) as H1; clear H;
211 lapply (ap_rewl ? (x + (z + -z)) ?? (plus_assoc ? x z (-z)) H1) as H2; clear H1;
212 lapply (ap_rewl ? (x + (-z + z)) ?? (plus_comm ?z (-z)) H2) as H1; clear H2;
213 lapply (ap_rewl ? (x + 0) ?? (opp_inverse ?z) H1) as H2; clear H1;
214 lapply (ap_rewl ? (0+x) ?? (plus_comm ?x 0) H2) as H1; clear H2;
215 lapply (ap_rewl ? x ?? (zero_neutral ?x) H1) as H2; clear H1;
216 lapply (ap_rewr ? (y + (z + -z)) ?? (plus_assoc ? y z (-z)) H2) as H3;
217 lapply (ap_rewr ? (y + (-z + z)) ?? (plus_comm ?z (-z)) H3) as H4;
218 lapply (ap_rewr ? (y + 0) ?? (opp_inverse ?z) H4) as H5;
219 lapply (ap_rewr ? (0+y) ?? (plus_comm ?y 0) H5) as H6;
220 lapply (ap_rewr ? y ?? (zero_neutral ?y) H6);
224 lemma pluc_cancl_ap: ∀G:abelian_group.∀x,y,z:G. z+x # z+y → x # y.
225 intros (G x y z H); apply (plus_cancr_ap ??? z);
226 apply (ap_rewl ???? (plus_comm ???));
227 apply (ap_rewr ???? (plus_comm ???));