]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/dama/integration_algebras.ma
94bc002b377d4d019d8463675c67c7f073a87005
[helm.git] / helm / software / matita / dama / integration_algebras.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/integration_algebras/".
16
17 include "higher_order_defs/functions.ma".
18 include "nat/nat.ma".
19 include "nat/orders.ma".
20
21 definition left_neutral \def λC,op.λe:C. ∀x:C. op e x = x.
22
23 definition left_inverse \def λC,op.λe:C.λinv:C→C. ∀x:C. op (inv x) x = e.
24
25 record is_abelian_group (C:Type) (plus:C→C→C) (zero:C) (opp:C→C) : Prop \def
26  { (* abelian additive semigroup properties *)
27     plus_assoc: associative ? plus;
28     plus_comm: symmetric ? plus;
29     (* additive monoid properties *)
30     zero_neutral: left_neutral ? plus zero;
31     (* additive group properties *)
32     opp_inverse: left_inverse ? plus zero opp
33  }.
34
35 record is_field (C:Type) (plus:C→C→C) (mult:C→C→C) (zero,one:C) (opp:C→C)
36  (inv:∀x:C.x ≠ zero →C)  : Prop
37
38  {  (* abelian group properties *)
39     abelian_group:> is_abelian_group ? plus zero opp;
40     (* abelian multiplicative semigroup properties *)
41     mult_assoc: associative ? mult;
42     mult_comm: symmetric ? mult;
43     (* multiplicative monoid properties *)
44     one_neutral: left_neutral ? mult one;
45     (* multiplicative group properties *)
46     inv_inverse: ∀x.∀p: x ≠ zero. mult (inv x p) x = one;
47     (* ring properties *)
48     mult_plus_distr: distributive ? mult plus;
49     (* integral domain *)
50     not_eq_zero_one: zero ≠ one
51  }.
52
53 let rec sum (C:Type) (plus:C→C→C) (zero,one:C) (n:nat) on n  ≝
54  match n with
55   [ O ⇒ zero
56   | (S m) ⇒ plus one (sum C plus zero one m)
57   ].
58
59 record field : Type \def
60  { carrier:> Type;
61    plus: carrier → carrier → carrier;
62    mult: carrier → carrier → carrier;
63    zero: carrier;
64    one: carrier;
65    opp: carrier → carrier;
66    inv: ∀x:carrier. x ≠ zero → carrier;
67    field_properties: is_field ? plus mult zero one opp inv
68  }.
69
70 definition sum_field ≝
71  λF:field. sum ? (plus F) (zero F) (one F).
72  
73 notation "0" with precedence 89
74 for @{ 'zero }.
75
76 interpretation "Field zero" 'zero =
77  (cic:/matita/integration_algebras/zero.con _).
78
79 notation "1" with precedence 89
80 for @{ 'one }.
81
82 interpretation "Field one" 'one =
83  (cic:/matita/integration_algebras/one.con _).
84
85 interpretation "Field plus" 'plus a b =
86  (cic:/matita/integration_algebras/plus.con _ a b).
87
88 interpretation "Field mult" 'times a b =
89  (cic:/matita/integration_algebras/mult.con _ a b).
90
91 interpretation "Field opp" 'uminus a =
92  (cic:/matita/integration_algebras/opp.con _ a).
93  
94 record is_ordered_field_ch0 (C:Type) (plus,mult:C→C→C) (zero,one:C) (opp:C→C)
95  (inv:∀x:C.x ≠ zero → C) (le:C→C→Prop) : Prop \def
96  { (* field properties *)
97    of_is_field:> is_field C plus mult zero one opp inv;
98    of_mult_compat: ∀a,b. le zero a → le zero b → le zero (mult a b);
99    of_plus_compat: ∀a,b,c. le a b → le (plus a c) (plus b c);
100    of_weak_tricotomy : ∀a,b. a≠b → le a b ∨ le b a;
101    (* 0 characteristics *)
102    of_char0: ∀n. n > O → sum ? plus zero one n ≠ zero
103  }.
104  
105 record ordered_field_ch0 : Type \def
106  { of_field:> field;
107    of_le: of_field → of_field → Prop;
108    of_ordered_field_properties:>
109     is_ordered_field_ch0 ? (plus of_field) (mult of_field) (zero of_field)
110      (one of_field) (opp of_field) (inv of_field) of_le
111  }.
112
113 interpretation "Ordered field le" 'leq a b =
114  (cic:/matita/integration_algebras/of_le.con _ a b).
115  
116 definition lt \def λF:ordered_field_ch0.λa,b:F.a ≤ b ∧ a ≠ b.
117
118 interpretation "Ordered field lt" 'lt a b =
119  (cic:/matita/integration_algebras/lt.con _ a b).
120
121 lemma le_zero_x_to_le_opp_x_zero: ∀F:ordered_field_ch0.∀x:F. 0 ≤ x → -x ≤ 0.
122  intros;
123  generalize in match (of_plus_compat ? ? ? ? ? ? ? ? F ? ? (-x) H); intro;
124  rewrite > (zero_neutral ? ? ? ? F) in H1;
125  rewrite > (plus_comm ? ? ? ? F) in H1;
126  rewrite > (opp_inverse ? ? ? ? F) in H1;
127  assumption.
128 qed.
129
130 lemma le_x_zero_to_le_zero_opp_x: ∀F:ordered_field_ch0.∀x:F. x ≤ 0 → 0 ≤ -x.
131  intros;
132  generalize in match (of_plus_compat ? ? ? ? ? ? ? ? F ? ? (-x) H); intro;
133  rewrite > (zero_neutral ? ? ? ? F) in H1;
134  rewrite > (plus_comm ? ? ? ? F) in H1;
135  rewrite > (opp_inverse ? ? ? ? F) in H1;
136  assumption.
137 qed.
138
139 (* To be proved for rings only *)
140 lemma eq_mult_zero_x_zero: ∀F:ordered_field_ch0.∀x:F.0*x=0.
141  intros;
142  generalize in match (zero_neutral ? ? ? ? F 0); intro;
143  generalize in match (eq_f ? ? (λy.x*y) ? ? H); intro; clear H;
144  rewrite > (mult_plus_distr ? ? ? ? ? ? ? F) in H1;
145  generalize in match (eq_f ? ? (λy.-(x*0)+y) ? ? H1); intro; clear H1;
146  rewrite < (plus_assoc ? ? ? ? F) in H;
147  rewrite > (opp_inverse ? ? ? ? F) in H;
148  rewrite > (zero_neutral ? ? ? ? F) in H;
149  rewrite > (mult_comm ? ? ? ? ? ? ? F) in H;
150  assumption.
151 qed.
152
153 (*
154 lemma eq_opp_x_times_opp_one_x: ∀F:ordered_field_ch0.∀x:F.-x = -1*x.
155  intros;
156  
157 lemma not_eq_x_zero_to_lt_zero_mult_x_x:
158  ∀F:ordered_field_ch0.∀x:F. x ≠ 0 → 0 < x * x.
159  intros;
160  elim (of_weak_tricotomy ? ? ? ? ? ? ? ? F ? ? H);
161   [ generalize in match (le_x_zero_to_le_zero_opp_x F ? H1); intro;
162     generalize in match (of_mult_compat ? ? ? ? ? ? ? ?  F ? ? H2 H2); intro;
163 *)  
164
165 axiom not_eq_sum_field_zero: ∀F,n. n > O → sum_field F n ≠ 0.
166
167 record is_vector_space (K: field) (C:Type) (plus:C→C→C) (zero:C) (opp:C→C)
168  (mult:K→C→C) : Prop
169
170  { (* abelian group properties *)
171    vs_abelian_group: is_abelian_group ? plus zero opp;
172    (* other properties *)
173    vs_nilpotent: ∀v. mult 0 v = zero;
174    vs_neutral: ∀v. mult 1 v = v;
175    vs_distributive: ∀a,b,v. mult (a + b) v = plus (mult a v) (mult b v);
176    vs_associative: ∀a,b,v. mult (a * b) v = mult a (mult b v)
177  }.
178
179 record is_lattice (C:Type) (join,meet:C→C→C) : Prop \def
180  { (* abelian semigroup properties *)
181    l_comm_j: symmetric ? join;
182    l_associative_j: associative ? join;
183    l_comm_m: symmetric ? meet;
184    l_associative_m: associative ? meet;
185    (* other properties *)
186    l_adsorb_j_m: ∀f,g. join f (meet f g) = f;
187    l_adsorb_m_j: ∀f,g. meet f (join f g) = f
188  }.
189
190 definition le \def λC.λmeet:C→C→C.λf,g. meet f g = f.
191
192 record is_riesz_space (K:ordered_field_ch0) (C:Type) (plus:C→C→C) (zero:C)
193  (opp:C→C) (mult:K→C→C) (join,meet:C→C→C) : Prop \def
194  { (* vector space properties *)
195    rs_vector_space: is_vector_space K C plus zero opp mult;
196    (* lattice properties *)
197    rs_lattice: is_lattice C join meet;
198    (* other properties *)
199    rs_compat_le_plus: ∀f,g,h. le ? meet f g →le ? meet (plus f h) (plus g h);
200    rs_compat_le_times: ∀a,f. 0≤a → le ? meet zero f → le ? meet zero (mult a f)  
201  }.
202
203 definition absolute_value \def λC:Type.λopp.λjoin:C→C→C.λf.join f (opp f).   
204
205 record is_archimedean_riesz_space (K:ordered_field_ch0) (C:Type) (plus:C→C→C)
206  (zero:C) (opp:C→C) (mult:Type_OF_ordered_field_ch0 K→C→C) (join,meet:C→C→C) : Prop \def
207   { ars_riesz_space: is_riesz_space ? ? plus zero opp mult join meet;
208     ars_archimedean: ∃u.∀n,a.∀p:n > O.
209      le C meet (absolute_value ? opp join a)
210       (mult (inv K (sum_field K n) (not_eq_sum_field_zero K n p)) u) →
211      a = zero
212   }.