]> matita.cs.unibo.it Git - helm.git/blob - matita/contribs/dama/dama/ordered_divisible_group.ma
tagged 0.5.0-rc1
[helm.git] / matita / contribs / dama / dama / ordered_divisible_group.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
16
17 include "nat/orders.ma".
18 include "nat/times.ma".
19 include "ordered_group.ma".
20 include "divisible_group.ma".
21
22 record todgroup : Type ≝ {
23   todg_order:> togroup;
24   todg_division_: dgroup;
25   todg_with_: dg_carr todg_division_ = og_abelian_group todg_order
26 }.
27
28 lemma todg_division: todgroup → dgroup.
29 intro G; apply (mk_dgroup G); unfold abelian_group_OF_todgroup; 
30 cases (todg_with_ G); exact (dg_prop (todg_division_ G));
31 qed.
32
33 coercion cic:/matita/ordered_divisible_group/todg_division.con.
34
35 lemma mul_ge: ∀G:todgroup.∀x:G.∀n.0 ≤ x → 0 ≤ n * x.
36 intros (G x n); elim n; simplify; [apply le_reflexive]
37 apply (le_transitive ???? H1); 
38 apply (Le≪ (0+(n1*x)) (zero_neutral ??));
39 apply fle_plusr; assumption;
40 qed. 
41
42 lemma lt_ltmul: ∀G:todgroup.∀x,y:G.∀n. x < y → S n * x < S n * y.
43 intros; elim n; [simplify; apply flt_plusr; assumption]
44 simplify; apply (ltplus); [assumption] assumption;
45 qed.
46
47 lemma ltmul_lt: ∀G:todgroup.∀x,y:G.∀n. S n * x < S n * y → x < y.
48 intros 4; elim n; [apply (plus_cancr_lt ??? 0); assumption]
49 simplify in l; cases (ltplus_orlt ????? l); [assumption]
50 apply f; assumption;
51 qed.
52
53 lemma divide_preserves_lt: ∀G:todgroup.∀e:G.∀n.0<e → 0 < e/n.
54 intros; elim n; [apply (Lt≫ ? (div1 ??));assumption]
55 unfold divide; elim (dg_prop G e (S n1)); simplify; simplify in f;
56 apply (ltmul_lt ??? (S n1)); simplify; apply (Lt≫ ? f);
57 apply (Lt≪ ? (zero_neutral ??)); (* bug se faccio repeat *)
58 apply (Lt≪ ? (zero_neutral ??));  
59 apply (Lt≪ ? (mulzero ?n1));
60 assumption;
61 qed.
62
63 lemma muleqplus_lt: ∀G:todgroup.∀x,y:G.∀n,m.
64    0<x → 0<y → S n * x ≈ S (n + S m) * y → y < x.
65 intros (G x y n m H1 H2 H3); apply (ltmul_lt ??? n); apply (Lt≫ ? H3);
66 clear H3; elim m; [
67   rewrite > sym_plus; simplify; apply (Lt≪ (0+(y+n*y))); [
68     apply eq_sym; apply zero_neutral]
69   apply flt_plusr; assumption;]
70 apply (lt_transitive ???? l); rewrite > sym_plus; simplify;  
71 rewrite > (sym_plus n); simplify; repeat apply flt_plusl;
72 apply (Lt≪ (0+(n1+n)*y)); [apply eq_sym; apply zero_neutral]
73 apply flt_plusr; assumption;
74 qed.  
75