]> matita.cs.unibo.it Git - helm.git/blob - matita/contribs/dama/dama/metric_lattice.ma
tagged 0.5.0-rc1
[helm.git] / matita / contribs / dama / dama / metric_lattice.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 include "metric_space.ma".
16 include "lattice.ma".
17
18 record mlattice_ (R : todgroup) : Type ≝ {
19   ml_mspace_: metric_space R;
20   ml_lattice:> lattice;
21   ml_with: ms_carr ? ml_mspace_ = Type_OF_lattice ml_lattice 
22 }.
23
24 lemma ml_mspace: ∀R.mlattice_ R → metric_space R.
25 intros  (R ml); apply (mk_metric_space R (Type_OF_mlattice_ ? ml));
26 unfold Type_OF_mlattice_; cases (ml_with ? ml); simplify;
27 [apply (metric ? (ml_mspace_ ? ml));|apply (mpositive ? (ml_mspace_ ? ml));
28 |apply (mreflexive ? (ml_mspace_ ? ml));|apply (msymmetric ? (ml_mspace_ ? ml));
29 |apply (mtineq ? (ml_mspace_ ? ml))]
30 qed.
31
32 coercion cic:/matita/metric_lattice/ml_mspace.con.
33
34 alias symbol "plus" = "Abelian group plus".
35 alias symbol "leq" = "Excess less or equal than".
36 record mlattice (R : todgroup) : Type ≝ {
37   ml_carr :> mlattice_ R;
38   ml_prop1: ∀a,b:ml_carr. 0 < δ a b → a # b;
39   ml_prop2: ∀a,b,c:ml_carr. δ (a∨b) (a∨c) + δ (a∧b) (a∧c) ≤ (δ b c)
40 }.
41
42 interpretation "Metric lattice leq" 'leq a b = 
43   (cic:/matita/excess/le.con (cic:/matita/metric_lattice/excess_OF_mlattice1.con _ _) a b). 
44 interpretation "Metric lattice geq" 'geq a b = 
45   (cic:/matita/excess/le.con (cic:/matita/metric_lattice/excess_OF_mlattice.con _ _) a b). 
46
47 lemma eq_to_ndlt0: ∀R.∀ml:mlattice R.∀a,b:ml. a ≈ b → ¬ 0 < δ a b.
48 intros (R ml a b E); intro H; apply E; apply ml_prop1;
49 assumption;
50 qed.
51
52 lemma eq_to_dzero: ∀R.∀ml:mlattice R.∀x,y:ml.x ≈ y → δ x y ≈ 0.
53 intros (R ml x y H); intro H1; apply H; clear H; 
54 apply ml_prop1; split [apply mpositive] apply ap_symmetric;
55 assumption;
56 qed.
57
58 lemma meq_l: ∀R.∀ml:mlattice R.∀x,y,z:ml. x≈z → δx y ≈ δz y.
59 intros (R ml x y z); apply le_le_eq;
60 [ apply (le_transitive ???? (mtineq ???y z)); 
61   apply (le_rewl ??? (0+δz y) (eq_to_dzero ???? H));
62   apply (le_rewl ??? (δz y) (zero_neutral ??)); apply le_reflexive;
63 | apply (le_transitive ???? (mtineq ???y x));
64   apply (le_rewl ??? (0+δx y) (eq_to_dzero ??z x H));
65   apply (le_rewl ??? (δx y) (zero_neutral ??)); apply le_reflexive;]
66 qed.
67
68 (* 3.3 *)
69 lemma meq_r: ∀R.∀ml:mlattice R.∀x,y,z:ml. x≈z → δy x ≈ δy z.
70 intros; apply (eq_trans ???? (msymmetric ??y x));
71 apply (eq_trans ????? (msymmetric ??z y)); apply meq_l; assumption;
72 qed.
73
74 lemma dap_to_lt: ∀R.∀ml:mlattice R.∀x,y:ml. δ x y # 0 → 0 < δ x y.
75 intros; split [apply mpositive] apply ap_symmetric; assumption;
76 qed.
77
78 lemma dap_to_ap: ∀R.∀ml:mlattice R.∀x,y:ml. δ x y # 0 → x # y.
79 intros (R ml x y H); apply ml_prop1; split; [apply mpositive;]
80 apply ap_symmetric; assumption;
81 qed.
82
83 (* 3.11 *)
84 lemma le_mtri: 
85   ∀R.∀ml:mlattice R.∀x,y,z:ml. x ≤ y → y ≤ z → δ x z ≈ δ x y + δ y z.
86 intros (R ml x y z Lxy Lyz); apply le_le_eq; [apply mtineq]
87 apply (le_transitive ????? (ml_prop2 ?? (y) ??)); 
88 cut ( δx y+ δy z ≈ δ(y∨x) (y∨z)+ δ(y∧x) (y∧z)); [
89   apply (le_rewr ??? (δx y+ δy z)); [assumption] apply le_reflexive]
90 lapply (le_to_eqm y x Lxy) as Dxm; lapply (le_to_eqm z y Lyz) as Dym;
91 lapply (le_to_eqj x y Lxy) as Dxj; lapply (le_to_eqj y z Lyz) as Dyj; clear Lxy Lyz;
92 STOP
93 apply (Eq≈ (δ(x∧y) y + δy z) (meq_l ????? Dxm));
94 apply (Eq≈ (δ(x∧y) (y∧z) + δy z) (meq_r ????? Dym));
95 apply (Eq≈ (δ(x∧y) (y∧z) + δ(y∨x) z));[
96   apply feq_plusl; apply meq_l; clear Dyj Dxm Dym; assumption]
97 apply (Eq≈ (δ(x∧y) (y∧z) + δ(y∨x) (z∨y))); [
98   apply (feq_plusl ? (δ(x∧y) (y∧z)) ?? (meq_r ??? (y∨x) ? Dyj));]
99 apply (Eq≈ ? (plus_comm ???));
100 apply (Eq≈ (δ(y∨x) (y∨z)+ δ(x∧y) (y∧z)));[
101   apply feq_plusr; apply meq_r; apply (join_comm ??);]
102 apply feq_plusl;
103 apply (Eq≈ (δ(y∧x) (y∧z)) (meq_l ????? (meet_comm ??)));
104 apply eq_reflexive;   
105 qed.  
106
107
108 (* 3.17 conclusione: δ x y ≈ 0 *)
109 (* 3.20 conclusione: δ x y ≈ 0 *)
110 (* 3.21 sup forte
111    strong_sup x ≝ ∀n. s n ≤ x ∧ ∀y x ≰ y → ∃n. s n ≰ y
112    strong_sup_zoli x ≝  ∀n. s n ≤ x ∧ ∄y. y#x ∧ y ≤ x
113 *)
114 (* 3.22 sup debole (più piccolo dei maggioranti) *)
115 (* 3.23 conclusion: δ x sup(...) ≈ 0 *)
116 (* 3.25 vero nel reticolo e basta (niente δ) *)
117 (* 3.36 conclusion: δ x y ≈ 0 *)