]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/static_2/syntax/fold.ma
update in static_2 and app_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / syntax / fold.ma
diff --git a/matita/matita/contribs/lambdadelta/static_2/syntax/fold.ma b/matita/matita/contribs/lambdadelta/static_2/syntax/fold.ma
new file mode 100644 (file)
index 0000000..67bfbf7
--- /dev/null
@@ -0,0 +1,38 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "static_2/syntax/lenv.ma".
+
+(* FOLD FOR RESTRICTED CLOSURES *********************************************)
+
+rec definition fold L T on L ≝ match L with
+[ LAtom     ⇒ T
+| LBind L I ⇒ match I with
+  [ BUnit _   ⇒ fold L (-ⓛ⋆0.T)
+  | BPair I V ⇒ fold L (-ⓑ{I}V.T)
+  ]
+].
+
+interpretation "fold (restricted closure)" 'plus L T = (fold L T).
+
+(* Basic properties *********************************************************)
+
+lemma fold_atom: ∀T. ⋆ + T = T.
+// qed.
+
+lemma fold_unit: ∀I,L,T. L.ⓤ{I}+T = L+(-ⓛ⋆0.T).
+// qed.
+
+lemma fold_pair: ∀I,L,V,T. (L.ⓑ{I}V)+T = L+(-ⓑ{I}V.T).
+// qed.