]> matita.cs.unibo.it Git - helm.git/blob - matita/dama/ordered_groups.ma
Some notes for Enrico.
[helm.git] / matita / dama / ordered_groups.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/ordered_groups/".
16
17 include "ordered_sets.ma".
18 include "groups.ma".
19
20 record pre_ogroup : Type ≝ { 
21   og_abelian_group_: abelian_group;
22   og_tordered_set:> tordered_set;
23   og_with: carr og_abelian_group_ = og_tordered_set
24 }.
25
26 lemma og_abelian_group: pre_ogroup → abelian_group.
27 intro G; apply (mk_abelian_group G); [1,2,3: rewrite < (og_with G)]
28 [apply (plus (og_abelian_group_ G));|apply zero;|apply opp]
29 unfold apartness_OF_pre_ogroup; cases (og_with G); simplify;
30 [apply plus_assoc|apply plus_comm|apply zero_neutral|apply opp_inverse|apply plus_strong_ext]
31 qed.
32
33 coercion cic:/matita/ordered_groups/og_abelian_group.con.
34
35 (* CSC: NO! Cosi' e' nel frammento negativo. Devi scriverlo con l'eccedenza!
36    Tutto il resto del file e' da rigirare nel frammento positivo.
37 *)
38 record ogroup : Type ≝ { 
39   og_carr:> pre_ogroup;
40   fle_plusr: ∀f,g,h:og_carr. f≤g → f+h≤g+h
41 }.
42
43 lemma plus_cancr_le: 
44   ∀G:ogroup.∀x,y,z:G.x+z ≤ y + z → x ≤ y.
45 intros 5 (G x y z L);
46 apply (le_rewl ??? (0+x) (zero_neutral ??));
47 apply (le_rewl ??? (x+0) (plus_comm ???));
48 apply (le_rewl ??? (x+(-z+z)) (opp_inverse ??));
49 apply (le_rewl ??? (x+(z+ -z)) (plus_comm ??z));
50 apply (le_rewl ??? (x+z+ -z) (plus_assoc ????));
51 apply (le_rewr ??? (0+y) (zero_neutral ??));
52 apply (le_rewr ??? (y+0) (plus_comm ???));
53 apply (le_rewr ??? (y+(-z+z)) (opp_inverse ??));
54 apply (le_rewr ??? (y+(z+ -z)) (plus_comm ??z));
55 apply (le_rewr ??? (y+z+ -z) (plus_assoc ????));
56 apply (fle_plusr ??? (-z) L);
57 qed.
58
59 lemma fle_plusl: ∀G:ogroup. ∀f,g,h:G. f≤g → h+f≤h+g.
60 intros (G f g h);
61 apply (plus_cancr_le ??? (-h));
62 apply (le_rewl ??? (f+h+ -h) (plus_comm ? f h));
63 apply (le_rewl ??? (f+(h+ -h)) (plus_assoc ????));
64 apply (le_rewl ??? (f+(-h+h)) (plus_comm ? h (-h)));
65 apply (le_rewl ??? (f+0) (opp_inverse ??));
66 apply (le_rewl ??? (0+f) (plus_comm ???));
67 apply (le_rewl ??? (f) (zero_neutral ??));
68 apply (le_rewr ??? (g+h+ -h) (plus_comm ? h ?));
69 apply (le_rewr ??? (g+(h+ -h)) (plus_assoc ????));
70 apply (le_rewr ??? (g+(-h+h)) (plus_comm ??h));
71 apply (le_rewr ??? (g+0) (opp_inverse ??));
72 apply (le_rewr ??? (0+g) (plus_comm ???));
73 apply (le_rewr ??? (g) (zero_neutral ??) H);
74 qed.
75
76 lemma plus_cancl_le: 
77   ∀G:ogroup.∀x,y,z:G.z+x ≤ z+y → x ≤ y.
78 intros 5 (G x y z L);
79 apply (le_rewl ??? (0+x) (zero_neutral ??));
80 apply (le_rewl ??? ((-z+z)+x) (opp_inverse ??));
81 apply (le_rewl ??? (-z+(z+x)) (plus_assoc ????));
82 apply (le_rewr ??? (0+y) (zero_neutral ??));
83 apply (le_rewr ??? ((-z+z)+y) (opp_inverse ??));
84 apply (le_rewr ??? (-z+(z+y)) (plus_assoc ????));
85 apply (fle_plusl ??? (-z) L);
86 qed.
87
88
89 lemma le_zero_x_to_le_opp_x_zero: 
90   ∀G:ogroup.∀x:G.0 ≤ x → -x ≤ 0.
91 intros (G x Px); apply (plus_cancr_le ??? x);
92 apply (le_rewl ??? 0 (opp_inverse ??));
93 apply (le_rewr ??? x (zero_neutral ??) Px);
94 qed.
95
96 lemma le_x_zero_to_le_zero_opp_x: 
97   ∀G:ogroup.∀x:G. x ≤ 0 → 0 ≤ -x.
98 intros (G x Lx0); apply (plus_cancr_le ??? x);
99 apply (le_rewr ??? 0 (opp_inverse ??));
100 apply (le_rewl ??? x (zero_neutral ??));
101 assumption; 
102 qed.