]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/dama/dama_duality/attic/vector_spaces.ma
Preparing for 0.5.9 release.
[helm.git] / helm / software / matita / contribs / dama / dama_duality / attic / vector_spaces.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 "attic/reals.ma".
18
19 record is_vector_space (K: field) (G:abelian_group) (emult:K→G→G) : Prop
20
21  { vs_nilpotent: ∀v. emult 0 v = 0;
22    vs_neutral: ∀v. emult 1 v = v;
23    vs_distributive: ∀a,b,v. emult (a + b) v = (emult a v) + (emult b v);
24    vs_associative: ∀a,b,v. emult (a * b) v = emult a (emult b v)
25  }.
26
27 record vector_space (K:field): Type \def
28 { vs_abelian_group :> abelian_group;
29   emult: K → vs_abelian_group → vs_abelian_group;
30   vs_vector_space_properties :> is_vector_space ? vs_abelian_group emult
31 }.
32
33 interpretation "Vector space external product" 'times a b = (emult ? ? a b).
34
35 record is_semi_norm (R:real) (V: vector_space R) (semi_norm:V→R) : Prop \def
36  { sn_positive: ∀x:V. zero R ≤ semi_norm x;
37    sn_omogeneous: ∀a:R.∀x:V. semi_norm (a*x) = (abs ? a) * semi_norm x;
38    sn_triangle_inequality: ∀x,y:V. semi_norm (x + y) ≤ semi_norm x + semi_norm y
39  }.
40
41 theorem eq_semi_norm_zero_zero:
42  ∀R:real.∀V:vector_space R.∀semi_norm:V→R.
43   is_semi_norm ? ? semi_norm →
44    semi_norm 0 = 0.
45  intros;
46  (* facile *)
47  elim daemon.
48 qed.
49
50 record is_norm (R:real) (V:vector_space R) (norm:V → R) : Prop ≝
51  { n_semi_norm:> is_semi_norm ? ? norm;
52    n_properness: ∀x:V. norm x = 0 → x = 0
53  }.
54
55 record norm (R:real) (V:vector_space R) : Type ≝
56  { n_function:1> V→R;
57    n_norm_properties: is_norm ? ? n_function
58  }.
59
60 record is_semi_distance (R:real) (C:Type) (semi_d: C→C→R) : Prop ≝
61  { sd_positive: ∀x,y:C. zero R ≤ semi_d x y;
62    sd_properness: ∀x:C. semi_d x x = 0; 
63    sd_triangle_inequality: ∀x,y,z:C. semi_d x z ≤ semi_d x y + semi_d z y
64  }.
65
66 record is_distance (R:real) (C:Type) (d:C→C→R) : Prop ≝
67  { d_semi_distance:> is_semi_distance ? ? d;
68    d_properness: ∀x,y:C. d x y = 0 → x=y
69  }.
70
71 record distance (R:real) (V:vector_space R) : Type ≝
72  { d_function:2> V→V→R;
73    d_distance_properties: is_distance ? ? d_function
74  }.
75
76 definition induced_distance_fun ≝
77  λR:real.λV:vector_space R.λnorm:norm ? V.
78   λf,g:V.norm (f - g).
79
80 theorem induced_distance_is_distance:
81  ∀R:real.∀V:vector_space R.∀norm:norm ? V.
82   is_distance ? ? (induced_distance_fun ? ? norm).
83 elim daemon.(*
84  intros;
85  apply mk_is_distance;
86   [ apply mk_is_semi_distance;
87     [ unfold induced_distance_fun;
88       intros;
89       apply sn_positive;
90       apply n_semi_norm;
91       apply (n_norm_properties ? ? norm)
92     | unfold induced_distance_fun;
93       intros;
94       unfold minus;
95       rewrite < plus_comm;
96       rewrite > opp_inverse;
97       apply eq_semi_norm_zero_zero;
98       apply n_semi_norm;
99       apply (n_norm_properties ? ? norm)
100     | unfold induced_distance_fun;
101       intros;
102       (* ??? *)
103       elim daemon
104     ]
105   | unfold induced_distance_fun;
106     intros;
107     generalize in match (n_properness ? ? norm ? ? H);
108      [ intro;
109        (* facile *)
110        elim daemon
111      | apply (n_norm_properties ? ? norm)
112      ]
113   ].*)
114 qed.
115
116 definition induced_distance ≝
117  λR:real.λV:vector_space R.λnorm:norm ? V.
118   mk_distance ? ? (induced_distance_fun ? ? norm)
119    (induced_distance_is_distance ? ? norm).
120
121 definition tends_to :
122  ∀R:real.∀V:vector_space R.∀d:distance ? V.∀f:nat→V.∀l:V.Prop.
123 apply
124   (λR:real.λV:vector_space R.λd:distance ? V.λf:nat→V.λl:V.
125     ∀n:nat.∃m:nat.∀j:nat. m ≤ j →
126      d (f j) l ≤ inv R (sum_field ? (S n)) ?);
127  apply not_eq_sum_field_zero;
128  unfold;
129  autobatch.
130 qed.
131
132 definition is_cauchy_seq : ∀R:real.\forall V:vector_space R.
133 \forall d:distance ? V.∀f:nat→V.Prop.
134  apply
135   (λR:real.λV: vector_space R. \lambda d:distance ? V.
136    \lambda f:nat→V.
137     ∀m:nat.
138      ∃n:nat.∀N. n ≤ N →
139       -(inv R (sum_field ? (S m)) ?) ≤ d (f N)  (f n)  ∧
140       d (f N)  (f n)≤ inv R (sum_field R (S m)) ?);
141  apply not_eq_sum_field_zero;
142  unfold;
143  autobatch.
144 qed.
145
146 definition is_complete ≝
147  λR:real.λV:vector_space R. 
148  λd:distance ? V.
149   ∀f:nat→V. is_cauchy_seq ? ? d f→
150    ex V (λl:V. tends_to ? ? d f l).