X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fdama%2Fintegration_algebras.ma;h=0339a088929b0b5b6850770930867bab35b2f009;hb=40c2f7eaa04e0baae6933f87260abaa7c2f78dd1;hp=66e47ce26a07a142da1464ba3e60f29b6d1086b0;hpb=6a70643b6520564aa460057bac0806523b43656a;p=helm.git diff --git a/helm/software/matita/dama/integration_algebras.ma b/helm/software/matita/dama/integration_algebras.ma index 66e47ce26..0339a0889 100644 --- a/helm/software/matita/dama/integration_algebras.ma +++ b/helm/software/matita/dama/integration_algebras.ma @@ -20,84 +20,186 @@ include "nat/orders.ma". definition left_neutral \def λC,op.λe:C. ∀x:C. op e x = x. +definition right_neutral \def λC,op. λe:C. ∀x:C. op x e=x. + definition left_inverse \def λC,op.λe:C.λinv:C→C. ∀x:C. op (inv x) x = e. +definition right_inverse \def λC,op.λe:C.λ inv: C→ C. ∀x:C. op x (inv x)=e. + +definition distributive_left ≝ + λA:Type.λf:A→A→A.λg:A→A→A. + ∀x,y,z. f x (g y z) = g (f x y) (f x z). + definition distributive_right ≝ λA:Type.λf:A→A→A.λg:A→A→A. ∀x,y,z. f (g x y) z = g (f x z) (f y z). record is_abelian_group (C:Type) (plus:C→C→C) (zero:C) (opp:C→C) : Prop \def { (* abelian additive semigroup properties *) - plus_assoc: associative ? plus; - plus_comm: symmetric ? plus; + plus_assoc_: associative ? plus; + plus_comm_: symmetric ? plus; (* additive monoid properties *) - zero_neutral: left_neutral ? plus zero; + zero_neutral_: left_neutral ? plus zero; (* additive group properties *) - opp_inverse: left_inverse ? plus zero opp + opp_inverse_: left_inverse ? plus zero opp + }. + +record abelian_group : Type \def + { carrier:> Type; + plus: carrier → carrier → carrier; + zero: carrier; + opp: carrier → carrier; + ag_abelian_group_properties: is_abelian_group ? plus zero opp }. -record is_ring (C:Type) (plus:C→C→C) (mult:C→C→C) (zero:C) (opp:C→C) : Prop +notation "0" with precedence 89 +for @{ 'zero }. + +interpretation "Ring zero" 'zero = + (cic:/matita/integration_algebras/zero.con _). + +interpretation "Ring plus" 'plus a b = + (cic:/matita/integration_algebras/plus.con _ a b). + +interpretation "Ring opp" 'uminus a = + (cic:/matita/integration_algebras/opp.con _ a). + +theorem plus_assoc: ∀G:abelian_group. associative ? (plus G). + intro; + apply (plus_assoc_ ? ? ? ? (ag_abelian_group_properties G)). +qed. + +theorem plus_comm: ∀G:abelian_group. symmetric ? (plus G). + intro; + apply (plus_comm_ ? ? ? ? (ag_abelian_group_properties G)). +qed. + +theorem zero_neutral: ∀G:abelian_group. left_neutral ? (plus G) 0. + intro; + apply (zero_neutral_ ? ? ? ? (ag_abelian_group_properties G)). +qed. + +theorem opp_inverse: ∀G:abelian_group. left_inverse ? (plus G) 0 (opp G). + intro; + apply (opp_inverse_ ? ? ? ? (ag_abelian_group_properties G)). +qed. + +lemma cancellationlaw: ∀G:abelian_group.∀x,y,z:G. x+y=x+z → y=z. +intros; +generalize in match (eq_f ? ? (λa.-x +a) ? ? H); +intros; clear H; +rewrite < plus_assoc in H1; +rewrite < plus_assoc in H1; +rewrite > opp_inverse in H1; +rewrite > zero_neutral in H1; +rewrite > zero_neutral in H1; +assumption. +qed. + +(****************************** rings *********************************) + +record is_ring (G:abelian_group) (mult:G→G→G) (one:G) : Prop ≝ - { (* abelian group properties *) - abelian_group:> is_abelian_group ? plus zero opp; - (* multiplicative semigroup properties *) - mult_assoc: associative ? mult; + { (* multiplicative monoid properties *) + mult_assoc_: associative ? mult; + one_neutral_left_: left_neutral ? mult one; + one_neutral_right_: right_neutral ? mult one; (* ring properties *) - mult_plus_distr_left: distributive ? mult plus; - mult_plus_distr_right: distributive_right C mult plus + mult_plus_distr_left_: distributive_left ? mult (plus G); + mult_plus_distr_right_: distributive_right ? mult (plus G); + not_eq_zero_one_: (0 ≠ one) }. record ring : Type \def - { r_carrier:> Type; - r_plus: r_carrier → r_carrier → r_carrier; - r_mult: r_carrier → r_carrier → r_carrier; - r_zero: r_carrier; - r_opp: r_carrier → r_carrier; - r_ring_properties:> is_ring ? r_plus r_mult r_zero r_opp + { r_abelian_group:> abelian_group; + mult: r_abelian_group → r_abelian_group → r_abelian_group; + one: r_abelian_group; + r_ring_properties: is_ring r_abelian_group mult one }. -notation "0" with precedence 89 -for @{ 'zero }. +theorem mult_assoc: ∀R:ring.associative ? (mult R). + intros; + apply (mult_assoc_ ? ? ? (r_ring_properties R)). +qed. -interpretation "Ring zero" 'zero = - (cic:/matita/integration_algebras/r_zero.con _). +theorem one_neutral_left: ∀R:ring.left_neutral ? (mult R) (one R). + intros; + apply (one_neutral_left_ ? ? ? (r_ring_properties R)). +qed. -interpretation "Ring plus" 'plus a b = - (cic:/matita/integration_algebras/r_plus.con _ a b). +theorem one_neutral_right: ∀R:ring.right_neutral ? (mult R) (one R). + intros; + apply (one_neutral_right_ ? ? ? (r_ring_properties R)). +qed. + +theorem mult_plus_distr_left: ∀R:ring.distributive_left ? (mult R) (plus R). + intros; + apply (mult_plus_distr_left_ ? ? ? (r_ring_properties R)). +qed. + +theorem mult_plus_distr_right: ∀R:ring.distributive_right ? (mult R) (plus R). + intros; + apply (mult_plus_distr_right_ ? ? ? (r_ring_properties R)). +qed. + +theorem not_eq_zero_one: ∀R:ring.0 ≠ one R. + intros; + apply (not_eq_zero_one_ ? ? ? (r_ring_properties R)). +qed. interpretation "Ring mult" 'times a b = - (cic:/matita/integration_algebras/r_mult.con _ a b). + (cic:/matita/integration_algebras/mult.con _ a b). -interpretation "Ring opp" 'uminus a = - (cic:/matita/integration_algebras/r_opp.con _ a). +notation "1" with precedence 89 +for @{ 'one }. + +interpretation "Field one" 'one = + (cic:/matita/integration_algebras/one.con _). lemma eq_mult_zero_x_zero: ∀R:ring.∀x:R.0*x=0. intros; - generalize in match (zero_neutral ? ? ? ? R 0); intro; + generalize in match (zero_neutral R 0); intro; generalize in match (eq_f ? ? (λy.y*x) ? ? H); intro; clear H; - rewrite > (mult_plus_distr_right ? ? ? ? ? R) in H1; + rewrite > mult_plus_distr_right in H1; generalize in match (eq_f ? ? (λy.-(0*x)+y) ? ? H1); intro; clear H1; - rewrite < (plus_assoc ? ? ? ? R) in H; - rewrite > (opp_inverse ? ? ? ? R) in H; - rewrite > (zero_neutral ? ? ? ? R) in H; + rewrite < plus_assoc in H; + rewrite > opp_inverse in H; + rewrite > zero_neutral in H; assumption. qed. -record is_field (C:Type) (plus:C→C→C) (mult:C→C→C) (zero,one:C) (opp:C→C) - (inv:∀x:C.x ≠ zero →C) : Prop +lemma eq_mult_x_zero_zero: ∀R:ring.∀x:R.x*0=0. +intros; +generalize in match (zero_neutral R 0); +intro; +generalize in match (eq_f ? ? (\lambda y.x*y) ? ? H); intro; clear H; +rewrite > mult_plus_distr_left in H1; +generalize in match (eq_f ? ? (\lambda y. (-(x*0)) +y) ? ? H1);intro; +clear H1; +rewrite < plus_assoc in H; +rewrite > opp_inverse in H; +rewrite > zero_neutral in H; +assumption. +qed. + +record is_field (R:ring) (inv:∀x:R.x ≠ 0 → R) : Prop ≝ - { (* ring properties *) - ring_properties: is_ring ? plus mult zero opp; - (* multiplicative abelian properties *) - mult_comm: symmetric ? mult; - (* multiplicative monoid properties *) - one_neutral: left_neutral ? mult one; + { (* multiplicative abelian properties *) + mult_comm_: symmetric ? (mult R); (* multiplicative group properties *) - inv_inverse: ∀x.∀p: x ≠ zero. mult (inv x p) x = one; - (* integral domain *) - not_eq_zero_one: zero ≠ one + inv_inverse_: ∀x.∀p: x ≠ 0. mult ? (inv x p) x = 1 }. +lemma opp_opp: \forall R:ring. \forall x:R. (-(-x))=x. +intros; +apply (cancellationlaw ? (-x) ? ?); +rewrite > (opp_inverse R x); +rewrite > plus_comm; +rewrite > opp_inverse; +reflexivity. +qed. + + let rec sum (C:Type) (plus:C→C→C) (zero,one:C) (n:nat) on n ≝ match n with [ O ⇒ zero @@ -106,39 +208,35 @@ let rec sum (C:Type) (plus:C→C→C) (zero,one:C) (n:nat) on n ≝ record field : Type \def { f_ring:> ring; - one: f_ring; inv: ∀x:f_ring. x ≠ 0 → f_ring; - field_properties: - is_field ? (r_plus f_ring) (r_mult f_ring) (r_zero f_ring) one - (r_opp f_ring) inv + field_properties: is_field f_ring inv }. - -definition sum_field ≝ - λF:field. sum ? (r_plus F) (r_zero F) (one F). -notation "1" with precedence 89 -for @{ 'one }. +theorem mult_comm: ∀F:field.symmetric ? (mult F). + intro; + apply (mult_comm_ ? ? (field_properties F)). +qed. -interpretation "Field one" 'one = - (cic:/matita/integration_algebras/one.con _). +theorem inv_inverse: ∀F:field.∀x.∀p: x ≠ 0. mult ? (inv F x p) x = 1. + intro; + apply (inv_inverse_ ? ? (field_properties F)). +qed. -record is_ordered_field_ch0 (C:Type) (plus,mult:C→C→C) (zero,one:C) (opp:C→C) - (inv:∀x:C.x ≠ zero → C) (le:C→C→Prop) : Prop \def - { (* field properties *) - of_is_field:> is_field C plus mult zero one opp inv; - of_mult_compat: ∀a,b. le zero a → le zero b → le zero (mult a b); - of_plus_compat: ∀a,b,c. le a b → le (plus a c) (plus b c); +definition sum_field ≝ + λF:field. sum ? (plus F) (zero F) (one F). + +record is_ordered_field_ch0 (F:field) (le:F→F→Prop) : Prop \def + { of_mult_compat: ∀a,b. le 0 a → le 0 b → le 0 (a*b); + of_plus_compat: ∀a,b,c. le a b → le (a+c) (b+c); of_weak_tricotomy : ∀a,b. a≠b → le a b ∨ le b a; (* 0 characteristics *) - of_char0: ∀n. n > O → sum ? plus zero one n ≠ zero + of_char0: ∀n. n > O → sum ? (plus F) 0 1 n ≠ 0 }. record ordered_field_ch0 : Type \def { of_field:> field; of_le: of_field → of_field → Prop; - of_ordered_field_properties:> - is_ordered_field_ch0 ? (r_plus of_field) (r_mult of_field) (r_zero of_field) - (one of_field) (r_opp of_field) (inv of_field) of_le + of_ordered_field_properties:> is_ordered_field_ch0 of_field of_le }. interpretation "Ordered field le" 'leq a b = @@ -149,12 +247,14 @@ definition lt \def λF:ordered_field_ch0.λa,b:F.a ≤ b ∧ a ≠ b. interpretation "Ordered field lt" 'lt a b = (cic:/matita/integration_algebras/lt.con _ a b). -axiom le_zero_x_to_le_opp_x_zero: ∀F:ordered_field_ch0.∀x:F. 0 ≤ x → -x ≤ 0. -(* intros; +(*incompleto +lemma le_zero_x_to_le_opp_x_zero: ∀F:ordered_field_ch0.∀x:F. 0 ≤ x → -x ≤ 0. +intros; generalize in match (of_plus_compat ? ? ? ? ? ? ? ? F ? ? (-x) H); intro; rewrite > (zero_neutral ? ? ? ? F) in H1; - rewrite > (plus_comm ? ? ? ? F) in H1; + rewrite > (plus_comm ? ? ? ? F) in H1; rewrite > (opp_inverse ? ? ? ? F) in H1; + assumption. qed.*) @@ -181,18 +281,23 @@ lemma not_eq_x_zero_to_lt_zero_mult_x_x: axiom not_eq_sum_field_zero: ∀F,n. n > O → sum_field F n ≠ 0. -record is_vector_space (K: field) (C:Type) (plus:C→C→C) (zero:C) (opp:C→C) - (emult:K→C→C) : Prop +record is_vector_space (K: field) (G:abelian_group) (emult:K→G→G) : Prop ≝ - { (* abelian group properties *) - vs_abelian_group: is_abelian_group ? plus zero opp; - (* other properties *) - vs_nilpotent: ∀v. emult 0 v = zero; + { vs_nilpotent: ∀v. emult 0 v = 0; vs_neutral: ∀v. emult 1 v = v; - vs_distributive: ∀a,b,v. emult (a + b) v = plus (emult a v) (emult b v); + vs_distributive: ∀a,b,v. emult (a + b) v = (emult a v) + (emult b v); vs_associative: ∀a,b,v. emult (a * b) v = emult a (emult b v) }. +record vector_space (K:field): Type \def +{ vs_abelian_group :> abelian_group; + emult: K → vs_abelian_group → vs_abelian_group; + vs_vector_space_properties :> is_vector_space K vs_abelian_group emult +}. + +interpretation "Vector space external product" 'times a b = + (cic:/matita/integration_algebras/emult.con _ _ a b). + record is_lattice (C:Type) (join,meet:C→C→C) : Prop \def { (* abelian semigroup properties *) l_comm_j: symmetric ? join; @@ -204,39 +309,97 @@ record is_lattice (C:Type) (join,meet:C→C→C) : Prop \def l_adsorb_m_j: ∀f,g. meet f (join f g) = f }. -definition le \def λC.λmeet:C→C→C.λf,g. meet f g = f. +record lattice (C:Type) : Type \def + { join: C → C → C; + meet: C → C → C; + l_lattice_properties: is_lattice ? join meet + }. -record is_riesz_space (K:ordered_field_ch0) (C:Type) (plus:C→C→C) (zero:C) - (opp:C→C) (emult:K→C→C) (join,meet:C→C→C) : Prop \def - { (* vector space properties *) - rs_vector_space: is_vector_space K C plus zero opp emult; - (* lattice properties *) - rs_lattice: is_lattice C join meet; - (* other properties *) - rs_compat_le_plus: ∀f,g,h. le ? meet f g →le ? meet (plus f h) (plus g h); - rs_compat_le_times: ∀a,f. 0≤a → le ? meet zero f → le ? meet zero (emult a f) +definition le \def λC:Type.λL:lattice C.λf,g. meet ? L f g = f. + +interpretation "Lattice le" 'leq a b = + (cic:/matita/integration_algebras/le.con _ _ a b). + +definition carrier_of_lattice ≝ + λC:Type.λL:lattice C.C. + +record is_riesz_space (K:ordered_field_ch0) (V:vector_space K) + (L:lattice (Type_OF_vector_space ? V)) +: Prop +\def + { rs_compat_le_plus: ∀f,g,h. le ? L f g → le ? L (f+h) (g+h); + rs_compat_le_times: ∀a:K.∀f. of_le ? 0 a → le ? L 0 f → le ? L 0 (a*f) }. -definition absolute_value \def λC:Type.λopp.λjoin:C→C→C.λf.join f (opp f). +record riesz_space : Type \def + { rs_ordered_field_ch0: ordered_field_ch0; + rs_vector_space:> vector_space rs_ordered_field_ch0; + rs_lattice:> lattice rs_vector_space; + rs_riesz_space_properties: is_riesz_space ? rs_vector_space rs_lattice + }. -record is_archimedean_riesz_space (K:ordered_field_ch0) (C:Type) (plus:C→C→C) - (zero:C) (opp:C→C) (mult:Type_OF_ordered_field_ch0 K→C→C) (join,meet:C→C→C) - :Prop \def - { ars_riesz_space: is_riesz_space ? ? plus zero opp mult join meet; - ars_archimedean: ∃u.∀n,a.∀p:n > O. - le C meet (absolute_value ? opp join a) - (mult (inv K (sum_field K n) (not_eq_sum_field_zero K n p)) u) → - a = zero +definition absolute_value \def λS:riesz_space.λf.join ? S f (-f). + +record is_archimedean_riesz_space (S:riesz_space) : Prop +\def + { ars_archimedean: ∃u.∀n.∀a.∀p:n > O. + le ? S + (absolute_value S a) + (emult ? S + (inv ? (sum_field (rs_ordered_field_ch0 S) n) (not_eq_sum_field_zero ? n p)) + u) → + a = 0 }. -record is_algebra (K: field) (C:Type) (plus:C→C→C) (zero:C) (opp:C→C) - (emult:K→C→C) (mult:C→C→C) : Prop +record archimedean_riesz_space : Type \def + { ars_riesz_space:> riesz_space; + ars_archimedean_property: is_archimedean_riesz_space ars_riesz_space + }. + +record is_algebra (K: field) (V:vector_space K) (mult:V→V→V) (one:V) : Prop ≝ - { (* vector space properties *) - a_vector_space_properties: is_vector_space ? ? plus zero opp emult; - (* ring properties *) - a_ring: is_ring ? plus mult zero opp; + { (* ring properties *) + a_ring: is_ring V mult one; (* algebra properties *) - a_associative_left: ∀a,f,g. emult a (mult f g) = mult (emult a f) g; - a_associative_right: ∀a,f,g. emult a (mult f g) = mult f (emult a g) - }. \ No newline at end of file + a_associative_left: ∀a,f,g. a * (mult f g) = mult (a * f) g; + a_associative_right: ∀a,f,g. a * (mult f g) = mult f (a * g) + }. + +record algebra (K: field) (V:vector_space K) : Type \def + { a_mult: V → V → V; + a_one: V; + a_algebra_properties: is_algebra K V a_mult a_one + }. + +interpretation "Algebra product" 'times a b = + (cic:/matita/integration_algebras/a_mult.con _ _ _ a b). + +interpretation "Field one" 'one = + (cic:/matita/integration_algebras/a_one.con _). + +definition ring_of_algebra ≝ + λK.λV:vector_space K.λA:algebra ? V. + mk_ring V (a_mult ? ? A) (a_one ? ? A) + (a_ring ? ? ? ? (a_algebra_properties ? ? A)). + +coercion cic:/matita/integration_algebras/ring_of_algebra.con. + +record is_f_algebra (S:archimedean_riesz_space) + (A:algebra (rs_ordered_field_ch0 (ars_riesz_space S)) S) : Prop +\def +{ compat_mult_le: + ∀f,g:S. + le ? S 0 f → le ? S 0 g → le ? S 0 (a_mult ? ? A f g); + compat_mult_meet: + ∀f,g,h:S. + meet ? S f g = 0 → meet ? S (a_mult ? ? A h f) g = 0 +}. + +record f_algebra : Type \def +{ fa_archimedean_riesz_space:> archimedean_riesz_space; + fa_algebra:> algebra ? fa_archimedean_riesz_space; + fa_f_algebra_properties: is_f_algebra fa_archimedean_riesz_space fa_algebra +}. + +(* to be proved; see footnote 2 in the paper by Spitters *) +axiom symmetric_a_mult: ∀A:f_algebra. symmetric ? (a_mult ? ? A).