]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/dama/premetric_lattice.ma
bir georganization, most of the structures done
[helm.git] / helm / software / matita / dama / premetric_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/premetric_lattice/".
16
17 include "metric_space.ma".
18
19 record premetric_lattice_ (R : ogroup) : Type ≝ {
20   pml_carr:> metric_space R;
21   meet: pml_carr → pml_carr → pml_carr;
22   join: pml_carr → pml_carr → pml_carr
23 }.
24
25 interpretation "valued lattice meet" 'and a b =
26  (cic:/matita/premetric_lattice/meet.con _ _ a b).
27
28 interpretation "valued lattice join" 'or a b =
29  (cic:/matita/premetric_lattice/join.con _ _ a b).
30  
31 record premetric_lattice_props (R : ogroup) (ml : premetric_lattice_ R) : Prop ≝ {
32   prop1a: ∀a : ml.δ (a ∧ a) a ≈ 0;
33   prop1b: ∀a : ml.δ (a ∨ a) a ≈ 0;
34   prop2a: ∀a,b: ml. δ (a ∨ b) (b ∨ a) ≈ 0;
35   prop2b: ∀a,b: ml. δ (a ∧ b) (b ∧ a) ≈ 0;
36   prop3a: ∀a,b,c: ml. δ (a ∨ (b ∨ c)) ((a ∨ b) ∨ c) ≈ 0;
37   prop3b: ∀a,b,c: ml. δ (a ∧ (b ∧ c)) ((a ∧ b) ∧ c) ≈ 0;
38   prop4a: ∀a,b: ml. δ (a ∨ (a ∧ b)) a ≈ 0;
39   prop4b: ∀a,b: ml. δ (a ∧ (a ∨ b)) a ≈ 0;
40   prop5: ∀a,b,c: ml. δ (a ∨ b) (a ∨ c) + δ (a ∧ b) (a ∧ c) ≤ δ b c
41 }.
42
43 record pmlattice (R : ogroup) : Type ≝ {
44   carr :> premetric_lattice_ R;
45   ispremetriclattice:> premetric_lattice_props R carr
46 }.
47   
48 include "lattice.ma".
49
50 lemma lattice_of_pmlattice: ∀R: ogroup. pmlattice R → lattice.
51 intros (R pml); apply (mk_lattice (apart_of_metric_space ? pml));
52 [apply (join ? pml)|apply (meet ? pml)]
53 intros (x y z); whd; intro H; whd in H; cases H (LE AP);
54 [apply (prop2a ? pml pml x y);  |apply (prop2b ? pml pml x y); 
55 |apply (prop3a ? pml pml x y z);|apply (prop3b ? pml pml x y z);
56 |apply (prop4a ? pml pml x y);  |apply (prop4b ? pml pml x y);]
57 apply ap_symmetric; assumption;
58 qed.
59
60 coercion cic:/matita/premetric_lattice/lattice_of_pmlattice.con.