]> matita.cs.unibo.it Git - helm.git/blob - matita/dama/ordered_fields_ch0.ma
We begin to play the real game: we have defined real numbers and
[helm.git] / matita / dama / ordered_fields_ch0.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_fields_ch0/".
16
17 include "fields.ma".
18
19 record is_total_order_relation (C:Type) (le:C→C→Prop) : Type \def
20  { to_cotransitive: ∀x,y,z:C. le x y → le x z ∨ le z y;
21    to_antisimmetry: ∀x,y:C. le x y → le y x → x=y
22  }.
23
24 record is_ordered_field_ch0 (F:field) (le:F→F→Prop) : Type \def
25  { of_total_order_relation:> is_total_order_relation ? le;
26    of_mult_compat: ∀a,b. le 0 a → le 0 b → le 0 (a*b);
27    of_plus_compat: ∀a,b,c. le a b → le (a+c) (b+c);
28    of_weak_tricotomy : ∀a,b. a≠b → le a b ∨ le b a;
29    (* 0 characteristics *)
30    of_char0: ∀n. n > O → sum ? (plus F) 0 1 n ≠ 0
31  }.
32  
33 record ordered_field_ch0 : Type \def
34  { of_field:> field;
35    of_le: of_field → of_field → Prop;
36    of_ordered_field_properties:> is_ordered_field_ch0 of_field of_le
37  }.
38
39 interpretation "Ordered field le" 'leq a b =
40  (cic:/matita/ordered_fields_ch0/of_le.con _ a b).
41  
42 definition lt \def λF:ordered_field_ch0.λa,b:F.a ≤ b ∧ a ≠ b.
43
44 interpretation "Ordered field lt" 'lt a b =
45  (cic:/matita/ordered_fields_ch0/lt.con _ a b).
46
47 lemma le_zero_x_to_le_opp_x_zero: ∀F:ordered_field_ch0.∀x:F. 0 ≤ x → -x ≤ 0.
48 intros;
49  generalize in match (of_plus_compat ? ? F ? ? (-x) H); intro;
50  rewrite > zero_neutral in H1;
51  rewrite > plus_comm in H1;
52  rewrite > opp_inverse in H1;
53  assumption.
54 qed.
55
56 lemma le_x_zero_to_le_zero_opp_x: ∀F:ordered_field_ch0.∀x:F. x ≤ 0 → 0 ≤ -x.
57  intros;
58  generalize in match (of_plus_compat ? ? F ? ? (-x) H); intro;
59  rewrite > zero_neutral in H1;
60  rewrite > plus_comm in H1;
61  rewrite > opp_inverse in H1;
62  assumption.
63 qed.
64
65 (*
66 lemma eq_opp_x_times_opp_one_x: ∀F:ordered_field_ch0.∀x:F.-x = -1*x.
67  intros;
68  
69 lemma not_eq_x_zero_to_lt_zero_mult_x_x:
70  ∀F:ordered_field_ch0.∀x:F. x ≠ 0 → 0 < x * x.
71  intros;
72  elim (of_weak_tricotomy ? ? ? ? ? ? ? ? F ? ? H);
73   [ generalize in match (le_x_zero_to_le_zero_opp_x F ? H1); intro;
74     generalize in match (of_mult_compat ? ? ? ? ? ? ? ?  F ? ? H2 H2); intro;
75 *)  
76
77 axiom lt_zero_to_lt_inv_zero:
78  ∀F:ordered_field_ch0.∀x:F.∀p:x≠0. 0 < x → 0 < inv ? x p.
79  
80 (* The ordering is not necessary. *)
81 axiom not_eq_sum_field_zero: ∀F:ordered_field_ch0.∀n. O<n → sum_field F n ≠ 0.
82 axiom le_zero_sum_field: ∀F:ordered_field_ch0.∀n. O<n → 0 < sum_field F n.
83
84 axiom lt_zero_to_le_inv_zero:
85  ∀F:ordered_field_ch0.∀n:nat.∀p:sum_field F n ≠ 0. 0 ≤ inv ? (sum_field F n) p.
86
87 definition tends_to : ∀F:ordered_field_ch0.∀f:nat→F.∀l:F.Prop.
88  alias symbol "leq" = "Ordered field le".
89  alias id "le" = "cic:/matita/nat/orders/le.ind#xpointer(1/1)".
90  apply
91   (λF:ordered_field_ch0.λf:nat → F.λl:F.
92     ∀n:nat.∃m:nat.∀j:nat. le m j →
93      l - (inv F (sum_field F (S n)) ?) ≤ f j ∧
94      f j ≤ l + (inv F (sum_field F (S n)) ?));
95  apply not_eq_sum_field_zero;
96  unfold;
97  auto new.
98 qed.
99
100 (*
101 definition is_cauchy_seq ≝
102  λF:ordered_field_ch0.λf:nat→F.
103   ∀eps:F. 0 < eps →
104    ∃n:nat.∀M. n ≤ M →
105     -eps ≤ f M - f n ∧ f M - f n ≤ eps.
106 *)
107
108 definition is_cauchy_seq : ∀F:ordered_field_ch0.∀f:nat→F.Prop.
109  apply
110   (λF:ordered_field_ch0.λf:nat→F.
111     ∀m:nat.
112      ∃n:nat.∀N. n ≤ N →
113       -(inv ? (sum_field F (S m)) ?) ≤ f N - f n ∧
114       f N - f n ≤ inv ? (sum_field F (S m)) ?);
115  apply not_eq_sum_field_zero;
116  unfold;
117  auto.
118 qed.
119
120 definition is_complete ≝
121  λF:ordered_field_ch0.
122   ∀f:nat→F. is_cauchy_seq ? f →
123    ∃l:F. tends_to ? f l.