]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/dama/ordered_groups.ma
makefile reworked to make debian package possible
[helm.git] / helm / software / 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_sets2.ma".
19
20 record pre_ordered_abelian_group : Type ≝
21  { og_abelian_group:> abelian_group;
22    og_ordered_set_: ordered_set;
23    og_with: os_carrier og_ordered_set_ = og_abelian_group
24  }.
25
26 lemma og_ordered_set: pre_ordered_abelian_group → ordered_set.
27  intro G;
28  apply mk_ordered_set;
29   [ apply (carrier (og_abelian_group G))
30   | apply (eq_rect ? ? (λC:Type.C→C→Prop) ? ? (og_with G));
31     apply os_le
32   | apply
33      (eq_rect' ? ?
34        (λa:Type.λH:os_carrier (og_ordered_set_ G) = a.
35         is_order_relation a
36          (eq_rect Type (og_ordered_set_ G) (λC:Type.C→C→Prop)
37           (os_le (og_ordered_set_ G)) a H))
38        ? ? (og_with G));
39     simplify;
40     apply (os_order_relation_properties (og_ordered_set_ G))
41   ]
42 qed.
43
44 coercion cic:/matita/ordered_groups/og_ordered_set.con.
45
46 definition is_ordered_abelian_group ≝
47  λG:pre_ordered_abelian_group. ∀f,g,h:G. f≤g → f+h≤g+h.
48
49 record ordered_abelian_group : Type ≝
50  { og_pre_ordered_abelian_group:> pre_ordered_abelian_group;
51    og_ordered_abelian_group_properties:
52     is_ordered_abelian_group og_pre_ordered_abelian_group
53  }.
54
55 lemma le_zero_x_to_le_opp_x_zero: ∀G:ordered_abelian_group.∀x:G.0 ≤ x → -x ≤ 0.
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.
63
64 lemma le_x_zero_to_le_zero_opp_x: ∀G:ordered_abelian_group.∀x:G. x ≤ 0 → 0 ≤ -x.
65  intros;
66  generalize in match (og_ordered_abelian_group_properties ? ? ? (-x) H); intro;
67  rewrite > zero_neutral in H1;
68  rewrite > plus_comm in H1;
69  rewrite > opp_inverse in H1;
70  assumption.
71 qed.