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