]> matita.cs.unibo.it Git - helm.git/blob - matita/dama/ordered_groups.ma
snapshot
[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 "groups.ma".
18 include "ordered_sets.ma".
19
20 record pre_ordered_abelian_group : 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_ordered_abelian_group → 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_ordered_abelian_group; 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 definition is_ordered_abelian_group ≝
36  λG:pre_ordered_abelian_group. ∀f,g,h:G. f≤g → f+h≤g+h.
37
38 record ordered_abelian_group : Type ≝
39  { og_pre_ordered_abelian_group:> pre_ordered_abelian_group;
40    og_ordered_abelian_group_properties:
41     is_ordered_abelian_group og_pre_ordered_abelian_group
42  }.
43
44 lemma le_zero_x_to_le_opp_x_zero: 
45   ∀G:ordered_abelian_group.∀x:G.0 ≤ x → -x ≤ 0.
46 intros (G x Px);
47 generalize in match (og_ordered_abelian_group_properties ? ? ? (-x) Px); intro;
48 (* ma cazzo, qui bisogna rifare anche i gruppi con ≈ ? *)
49  rewrite > zero_neutral in H;
50  rewrite > plus_comm in H;
51  rewrite > opp_inverse in H;
52  assumption.
53 qed.
54
55 lemma le_x_zero_to_le_zero_opp_x: ∀G:ordered_abelian_group.∀x:G. x ≤ 0 → 0 ≤ -x.
56  intros;
57  generalize in match (og_ordered_abelian_group_properties ? ? ? (-x) H); intro;
58  rewrite > zero_neutral in H1;
59  rewrite > plus_comm in H1;
60  rewrite > opp_inverse in H1;
61  assumption.
62 qed.