]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/dama/lattice.ma
reorganization of many files according to the new basic picture.
[helm.git] / helm / software / matita / dama / lattice.ma
diff --git a/helm/software/matita/dama/lattice.ma b/helm/software/matita/dama/lattice.ma
new file mode 100644 (file)
index 0000000..a1cea05
--- /dev/null
@@ -0,0 +1,94 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+set "baseuri" "cic:/matita/lattices/".
+
+include "excedence.ma".
+
+record lattice : Type ≝ {
+  l_carr:> apartness;
+  join: l_carr → l_carr → l_carr;
+  meet: l_carr → l_carr → l_carr;
+  join_comm: ∀x,y:l_carr. join x y ≈ join y x;
+  meet_comm: ∀x,y:l_carr. meet x y ≈ meet y x;
+  join_assoc: ∀x,y,z:l_carr. join x (join y z) ≈ join (join y x) z;
+  meet_assoc: ∀x,y,z:l_carr. meet x (meet y z) ≈ meet (meet y x) z;
+  absorbjm: ∀f,g:l_carr. join f (meet f g) ≈ f;
+  absorbmj: ∀f,g:l_carr. meet f (join f g) ≈ f
+}.
+
+
+(*
+include "ordered_sets.ma".
+
+record lattice (C:Type) (join,meet:C→C→C) : Prop \def
+ { (* abelian semigroup properties *)
+   l_comm_j: symmetric ? join;
+   l_associative_j: associative ? join;
+   l_comm_m: symmetric ? meet;
+   l_associative_m: associative ? meet;
+   (* other properties *)
+   l_adsorb_j_m: ∀f,g:C. join f (meet f g) = f;
+   l_adsorb_m_j: ∀f,g:C. meet f (join f g) = f
+ }.
+
+record lattice : Type \def
+ { l_carrier:> Type;
+   l_join: l_carrier→l_carrier→l_carrier;
+   l_meet: l_carrier→l_carrier→l_carrier;
+   l_lattice_properties:> is_lattice ? l_join l_meet
+ }.
+
+interpretation "Lattice meet" 'and a b =
+ (cic:/matita/lattices/l_meet.con _ a b).
+
+interpretation "Lattice join" 'or a b =
+ (cic:/matita/lattices/l_join.con _ a b).
+
+definition le \def λL:lattice.λf,g:L. (f ∧ g) = f.
+
+definition ordered_set_of_lattice: lattice → ordered_set.
+ intros (L);
+ apply mk_ordered_set;
+  [2: apply (le L)
+  | skip
+  | apply mk_is_order_relation;
+     [ unfold reflexive;
+       intros;
+       unfold;
+       rewrite < (l_adsorb_j_m ? ? ? L ? x) in ⊢ (? ? (? ? ? %) ?);
+       rewrite > l_adsorb_m_j;
+        [ reflexivity
+        | apply (l_lattice_properties L)
+        ]
+     | intros;
+       unfold transitive;
+       unfold le;
+       intros;
+       rewrite < H;
+       rewrite > (l_associative_m ? ? ? L);
+       rewrite > H1;
+       reflexivity
+     | unfold antisimmetric;
+       unfold le;
+       intros;
+       rewrite < H;
+       rewrite > (l_comm_m ? ? ? L);
+       assumption
+     ]
+  ]
+qed.
+
+coercion cic:/matita/lattices/ordered_set_of_lattice.con.
+*)
\ No newline at end of file