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/metric_lattice/".
17 include "metric_space.ma".
20 record mlattice_ (R : ogroup) : Type ≝ {
21 ml_mspace_: metric_space R;
23 ml_with_: ms_carr ? ml_mspace_ = ap_carr (l_carr ml_lattice)
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))]
34 coercion cic:/matita/metric_lattice/ml_mspace.con.
36 record is_mlattice (R : ogroup) (ml: mlattice_ R) : Type ≝ {
37 ml_prop1: ∀a,b:ml. 0 < δ a b → a # b;
38 ml_prop2: ∀a,b,c:ml. δ (a∨b) (a∨c) + δ (a∧b) (a∧c) ≤ δ b c
41 record mlattice (R : ogroup) : Type ≝ {
42 ml_carr :> mlattice_ R;
43 ml_props:> is_mlattice R ml_carr
46 lemma eq_to_zero: ∀R.∀ml:mlattice R.∀x,y:ml.x ≈ y → δ x y ≈ 0.
47 intros (R ml x y H); intro H1; apply H; clear H;
48 apply (ml_prop1 ?? ml); split [apply mpositive] apply ap_symmetric;
52 lemma meq_joinl: ∀R.∀ml:mlattice R.∀x,y,z:ml. x≈z → δx y ≈ δz y.
53 intros (R ml x y z); apply le_le_eq;
54 [ apply (le_transitive ???? (mtineq ???y z));
55 apply (le_rewl ??? (0+δz y) (eq_to_zero ???? H));
56 apply (le_rewl ??? (δz y) (zero_neutral ??)); apply le_reflexive;
57 | apply (le_transitive ???? (mtineq ???y x));
58 apply (le_rewl ??? (0+δx y) (eq_to_zero ??z x H));
59 apply (le_rewl ??? (δx y) (zero_neutral ??)); apply le_reflexive;]
62 lemma meq_joinr: ∀R.∀ml:mlattice R.∀x,y,z:ml. x≈z → δy x ≈ δy z.
63 intros; apply (eq_trans ???? (msymmetric ??y x));
64 apply (eq_trans ????? (msymmetric ??z y)); apply meq_joinl; assumption;
69 ∀R.∀ml:mlattice R.∀x,y,z:ml. x ≤ y → y ≤ z → δ x z ≈ δ x y + δ y z.
70 intros (R ml x y z Lxy Lyz); apply le_le_eq; [apply mtineq]
71 apply (le_transitive ????? (ml_prop2 ?? ml (y) ??));
72 (* auto type. assert failure *)