]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground_2/relocation/nstream_basic.ma
update in ground_2
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / nstream_basic.ma
diff --git a/matita/matita/contribs/lambdadelta/ground_2/relocation/nstream_basic.ma b/matita/matita/contribs/lambdadelta/ground_2/relocation/nstream_basic.ma
new file mode 100644 (file)
index 0000000..613f279
--- /dev/null
@@ -0,0 +1,48 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "ground_2/relocation/rtmap_basic.ma".
+include "ground_2/relocation/nstream_after.ma".
+
+(* RELOCATION N-STREAM ******************************************************)
+
+(* Specific properties on basic relocation **********************************)
+
+lemma apply_basic_lt: āˆ€m,n,i. i < m ā†’ šā“m,nāµ@ā“iāµ = i.
+/3 width=1 by at_inv_total, at_basic_lt/ qed-.
+
+lemma apply_basic_ge: āˆ€m,n,i. m ā‰¤ i ā†’ šā“m,nāµ@ā“iāµ = n+i.
+/3 width=1 by at_inv_total, at_basic_ge/ qed-.
+
+(* Specific main properties on basic relocation *****************************)
+
+theorem basic_swap: āˆ€d1,d2. d2 ā‰¤ d1 ā†’
+                    āˆ€h1,h2. šā“d2,h2āµāˆ˜šā“d1,h1āµ ā‰” šā“h2+d1,h1āµāˆ˜šā“d2,h2āµ.
+#d1 #d2 #Hd21 #h1 #h2
+@nstream_inv_eq
+@nstream_eq_inv_ext #i
+<compose_apply <compose_apply
+elim (lt_or_ge i d2) #Hd2
+[ lapply (lt_to_le_to_lt ā€¦ Hd2 Hd21) -Hd21 #Hd1
+  >(apply_basic_lt ā€¦ Hd1) >(apply_basic_lt ā€¦ Hd2) >apply_basic_lt
+  /2 width=1 by le_plus_a/
+| elim (lt_or_ge i d1) -Hd21 #Hd1
+  [ >(apply_basic_lt ā€¦ Hd1) >(apply_basic_ge ā€¦ Hd2) >apply_basic_lt
+    /2 width=1 by monotonic_lt_plus_r/
+  | >(apply_basic_ge ā€¦ Hd1) >(apply_basic_ge ā€¦ Hd2)
+    >apply_basic_ge [2: /2 width=1 by le_plus_a/ ]
+    >apply_basic_ge /2 width=1 by monotonic_le_plus_r/
+  ]
+]
+qed-.