1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/integration_algebras/".
17 include "higher_order_defs/functions.ma".
19 include "nat/orders.ma".
21 definition left_neutral \def λC,op.λe:C. ∀x:C. op e x = x.
23 definition right_neutral \def λC,op. λe:C. ∀x:C. op x e=x.
25 definition left_inverse \def λC,op.λe:C.λinv:C→C. ∀x:C. op (inv x) x = e.
27 definition right_inverse \def λC,op.λe:C.λ inv: C→ C. ∀x:C. op x (inv x)=e.
29 definition distributive_left ≝
30 λA:Type.λf:A→A→A.λg:A→A→A.
31 ∀x,y,z. f x (g y z) = g (f x y) (f x z).
33 definition distributive_right ≝
34 λA:Type.λf:A→A→A.λg:A→A→A.
35 ∀x,y,z. f (g x y) z = g (f x z) (f y z).
37 record is_abelian_group (C:Type) (plus:C→C→C) (zero:C) (opp:C→C) : Prop \def
38 { (* abelian additive semigroup properties *)
39 plus_assoc_: associative ? plus;
40 plus_comm_: symmetric ? plus;
41 (* additive monoid properties *)
42 zero_neutral_: left_neutral ? plus zero;
43 (* additive group properties *)
44 opp_inverse_: left_inverse ? plus zero opp
47 record abelian_group : Type \def
49 plus: carrier → carrier → carrier;
51 opp: carrier → carrier;
52 ag_abelian_group_properties: is_abelian_group ? plus zero opp
55 notation "0" with precedence 89
58 interpretation "Ring zero" 'zero =
59 (cic:/matita/integration_algebras/zero.con _).
61 interpretation "Ring plus" 'plus a b =
62 (cic:/matita/integration_algebras/plus.con _ a b).
64 interpretation "Ring opp" 'uminus a =
65 (cic:/matita/integration_algebras/opp.con _ a).
67 theorem plus_assoc: ∀G:abelian_group. associative ? (plus G).
69 apply (plus_assoc_ ? ? ? ? (ag_abelian_group_properties G)).
72 theorem plus_comm: ∀G:abelian_group. symmetric ? (plus G).
74 apply (plus_comm_ ? ? ? ? (ag_abelian_group_properties G)).
77 theorem zero_neutral: ∀G:abelian_group. left_neutral ? (plus G) 0.
79 apply (zero_neutral_ ? ? ? ? (ag_abelian_group_properties G)).
82 theorem opp_inverse: ∀G:abelian_group. left_inverse ? (plus G) 0 (opp G).
84 apply (opp_inverse_ ? ? ? ? (ag_abelian_group_properties G)).
87 lemma cancellationlaw: ∀G:abelian_group.∀x,y,z:G. x+y=x+z → y=z.
89 generalize in match (eq_f ? ? (λa.-x +a) ? ? H);
91 rewrite < plus_assoc in H1;
92 rewrite < plus_assoc in H1;
93 rewrite > opp_inverse in H1;
94 rewrite > zero_neutral in H1;
95 rewrite > zero_neutral in H1;
99 (****************************** rings *********************************)
101 record is_ring (G:abelian_group) (mult:G→G→G) (one:G) : Prop
103 { (* multiplicative monoid properties *)
104 mult_assoc_: associative ? mult;
105 one_neutral_left_: left_neutral ? mult one;
106 one_neutral_right_: right_neutral ? mult one;
107 (* ring properties *)
108 mult_plus_distr_left_: distributive_left ? mult (plus G);
109 mult_plus_distr_right_: distributive_right ? mult (plus G);
110 not_eq_zero_one_: (0 ≠ one)
113 record ring : Type \def
114 { r_abelian_group:> abelian_group;
115 mult: r_abelian_group → r_abelian_group → r_abelian_group;
116 one: r_abelian_group;
117 r_ring_properties: is_ring r_abelian_group mult one
120 theorem mult_assoc: ∀R:ring.associative ? (mult R).
122 apply (mult_assoc_ ? ? ? (r_ring_properties R)).
125 theorem one_neutral_left: ∀R:ring.left_neutral ? (mult R) (one R).
127 apply (one_neutral_left_ ? ? ? (r_ring_properties R)).
130 theorem one_neutral_right: ∀R:ring.right_neutral ? (mult R) (one R).
132 apply (one_neutral_right_ ? ? ? (r_ring_properties R)).
135 theorem mult_plus_distr_left: ∀R:ring.distributive_left ? (mult R) (plus R).
137 apply (mult_plus_distr_left_ ? ? ? (r_ring_properties R)).
140 theorem mult_plus_distr_right: ∀R:ring.distributive_right ? (mult R) (plus R).
142 apply (mult_plus_distr_right_ ? ? ? (r_ring_properties R)).
145 theorem not_eq_zero_one: ∀R:ring.0 ≠ one R.
147 apply (not_eq_zero_one_ ? ? ? (r_ring_properties R)).
150 interpretation "Ring mult" 'times a b =
151 (cic:/matita/integration_algebras/mult.con _ a b).
153 notation "1" with precedence 89
156 interpretation "Field one" 'one =
157 (cic:/matita/integration_algebras/one.con _).
159 lemma eq_mult_zero_x_zero: ∀R:ring.∀x:R.0*x=0.
161 generalize in match (zero_neutral R 0); intro;
162 generalize in match (eq_f ? ? (λy.y*x) ? ? H); intro; clear H;
163 rewrite > mult_plus_distr_right in H1;
164 generalize in match (eq_f ? ? (λy.-(0*x)+y) ? ? H1); intro; clear H1;
165 rewrite < plus_assoc in H;
166 rewrite > opp_inverse in H;
167 rewrite > zero_neutral in H;
171 lemma eq_mult_x_zero_zero: ∀R:ring.∀x:R.x*0=0.
173 generalize in match (zero_neutral R 0);
175 generalize in match (eq_f ? ? (\lambda y.x*y) ? ? H); intro; clear H;
176 rewrite > mult_plus_distr_left in H1;
177 generalize in match (eq_f ? ? (\lambda y. (-(x*0)) +y) ? ? H1);intro;
179 rewrite < plus_assoc in H;
180 rewrite > opp_inverse in H;
181 rewrite > zero_neutral in H;
185 record is_field (R:ring) (inv:∀x:R.x ≠ 0 → R) : Prop
187 { (* multiplicative abelian properties *)
188 mult_comm_: symmetric ? (mult R);
189 (* multiplicative group properties *)
190 inv_inverse_: ∀x.∀p: x ≠ 0. mult ? (inv x p) x = 1
193 lemma opp_opp: \forall R:ring. \forall x:R. (-(-x))=x.
195 apply (cancellationlaw ? (-x) ? ?);
196 rewrite > (opp_inverse R x);
198 rewrite > opp_inverse;
203 let rec sum (C:Type) (plus:C→C→C) (zero,one:C) (n:nat) on n ≝
206 | (S m) ⇒ plus one (sum C plus zero one m)
209 record field : Type \def
211 inv: ∀x:f_ring. x ≠ 0 → f_ring;
212 field_properties: is_field f_ring inv
215 theorem mult_comm: ∀F:field.symmetric ? (mult F).
217 apply (mult_comm_ ? ? (field_properties F)).
220 theorem inv_inverse: ∀F:field.∀x.∀p: x ≠ 0. mult ? (inv F x p) x = 1.
222 apply (inv_inverse_ ? ? (field_properties F)).
225 definition sum_field ≝
226 λF:field. sum ? (plus F) (zero F) (one F).
228 record is_ordered_field_ch0 (F:field) (le:F→F→Prop) : Prop \def
229 { of_mult_compat: ∀a,b. le 0 a → le 0 b → le 0 (a*b);
230 of_plus_compat: ∀a,b,c. le a b → le (a+c) (b+c);
231 of_weak_tricotomy : ∀a,b. a≠b → le a b ∨ le b a;
232 (* 0 characteristics *)
233 of_char0: ∀n. n > O → sum ? (plus F) 0 1 n ≠ 0
236 record ordered_field_ch0 : Type \def
238 of_le: of_field → of_field → Prop;
239 of_ordered_field_properties:> is_ordered_field_ch0 of_field of_le
242 interpretation "Ordered field le" 'leq a b =
243 (cic:/matita/integration_algebras/of_le.con _ a b).
245 definition lt \def λF:ordered_field_ch0.λa,b:F.a ≤ b ∧ a ≠ b.
247 interpretation "Ordered field lt" 'lt a b =
248 (cic:/matita/integration_algebras/lt.con _ a b).
250 lemma le_zero_x_to_le_opp_x_zero: ∀F:ordered_field_ch0.∀x:F. 0 ≤ x → -x ≤ 0.
252 generalize in match (of_plus_compat ? ? F ? ? (-x) H); intro;
253 rewrite > zero_neutral in H1;
254 rewrite > plus_comm in H1;
255 rewrite > opp_inverse in H1;
259 lemma le_x_zero_to_le_zero_opp_x: ∀F:ordered_field_ch0.∀x:F. x ≤ 0 → 0 ≤ -x.
261 generalize in match (of_plus_compat ? ? F ? ? (-x) H); intro;
262 rewrite > zero_neutral in H1;
263 rewrite > plus_comm in H1;
264 rewrite > opp_inverse in H1;
269 lemma eq_opp_x_times_opp_one_x: ∀F:ordered_field_ch0.∀x:F.-x = -1*x.
272 lemma not_eq_x_zero_to_lt_zero_mult_x_x:
273 ∀F:ordered_field_ch0.∀x:F. x ≠ 0 → 0 < x * x.
275 elim (of_weak_tricotomy ? ? ? ? ? ? ? ? F ? ? H);
276 [ generalize in match (le_x_zero_to_le_zero_opp_x F ? H1); intro;
277 generalize in match (of_mult_compat ? ? ? ? ? ? ? ? F ? ? H2 H2); intro;
280 axiom not_eq_sum_field_zero: ∀F,n. n > O → sum_field F n ≠ 0.
282 record is_vector_space (K: field) (G:abelian_group) (emult:K→G→G) : Prop
284 { vs_nilpotent: ∀v. emult 0 v = 0;
285 vs_neutral: ∀v. emult 1 v = v;
286 vs_distributive: ∀a,b,v. emult (a + b) v = (emult a v) + (emult b v);
287 vs_associative: ∀a,b,v. emult (a * b) v = emult a (emult b v)
290 record vector_space (K:field): Type \def
291 { vs_abelian_group :> abelian_group;
292 emult: K → vs_abelian_group → vs_abelian_group;
293 vs_vector_space_properties :> is_vector_space K vs_abelian_group emult
296 interpretation "Vector space external product" 'times a b =
297 (cic:/matita/integration_algebras/emult.con _ _ a b).
299 record is_lattice (C:Type) (join,meet:C→C→C) : Prop \def
300 { (* abelian semigroup properties *)
301 l_comm_j: symmetric ? join;
302 l_associative_j: associative ? join;
303 l_comm_m: symmetric ? meet;
304 l_associative_m: associative ? meet;
305 (* other properties *)
306 l_adsorb_j_m: ∀f,g. join f (meet f g) = f;
307 l_adsorb_m_j: ∀f,g. meet f (join f g) = f
310 record lattice (C:Type) : Type \def
313 l_lattice_properties: is_lattice ? join meet
316 definition le \def λC:Type.λL:lattice C.λf,g. meet ? L f g = f.
318 interpretation "Lattice le" 'leq a b =
319 (cic:/matita/integration_algebras/le.con _ _ a b).
321 definition carrier_of_lattice ≝
322 λC:Type.λL:lattice C.C.
324 record is_riesz_space (K:ordered_field_ch0) (V:vector_space K)
325 (L:lattice (Type_OF_vector_space ? V))
328 { rs_compat_le_plus: ∀f,g,h. le ? L f g → le ? L (f+h) (g+h);
329 rs_compat_le_times: ∀a:K.∀f. of_le ? 0 a → le ? L 0 f → le ? L 0 (a*f)
332 record riesz_space : Type \def
333 { rs_ordered_field_ch0: ordered_field_ch0;
334 rs_vector_space:> vector_space rs_ordered_field_ch0;
335 rs_lattice:> lattice rs_vector_space;
336 rs_riesz_space_properties: is_riesz_space ? rs_vector_space rs_lattice
339 definition absolute_value \def λS:riesz_space.λf.join ? S f (-f).
341 record is_archimedean_riesz_space (S:riesz_space) : Prop
343 { ars_archimedean: ∃u.∀n.∀a.∀p:n > O.
347 (inv ? (sum_field (rs_ordered_field_ch0 S) n) (not_eq_sum_field_zero ? n p))
352 record archimedean_riesz_space : Type \def
353 { ars_riesz_space:> riesz_space;
354 ars_archimedean_property: is_archimedean_riesz_space ars_riesz_space
357 record is_algebra (K: field) (V:vector_space K) (mult:V→V→V) (one:V) : Prop
359 { (* ring properties *)
360 a_ring: is_ring V mult one;
361 (* algebra properties *)
362 a_associative_left: ∀a,f,g. a * (mult f g) = mult (a * f) g;
363 a_associative_right: ∀a,f,g. a * (mult f g) = mult f (a * g)
366 record algebra (K: field) (V:vector_space K) : Type \def
369 a_algebra_properties: is_algebra K V a_mult a_one
372 interpretation "Algebra product" 'times a b =
373 (cic:/matita/integration_algebras/a_mult.con _ _ _ a b).
375 interpretation "Field one" 'one =
376 (cic:/matita/integration_algebras/a_one.con _).
378 definition ring_of_algebra ≝
379 λK.λV:vector_space K.λA:algebra ? V.
380 mk_ring V (a_mult ? ? A) (a_one ? ? A)
381 (a_ring ? ? ? ? (a_algebra_properties ? ? A)).
383 coercion cic:/matita/integration_algebras/ring_of_algebra.con.
385 record is_f_algebra (S:archimedean_riesz_space)
386 (A:algebra (rs_ordered_field_ch0 (ars_riesz_space S)) S) : Prop
390 le ? S 0 f → le ? S 0 g → le ? S 0 (a_mult ? ? A f g);
393 meet ? S f g = 0 → meet ? S (a_mult ? ? A h f) g = 0
396 record f_algebra : Type \def
397 { fa_archimedean_riesz_space:> archimedean_riesz_space;
398 fa_algebra:> algebra ? fa_archimedean_riesz_space;
399 fa_f_algebra_properties: is_f_algebra fa_archimedean_riesz_space fa_algebra
402 (* to be proved; see footnote 2 in the paper by Spitters *)
403 axiom symmetric_a_mult: ∀A:f_algebra. symmetric ? (a_mult ? ? A).