]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_fcla.ma
rtmaps with finite colength
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / rtmap_fcla.ma
diff --git a/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_fcla.ma b/matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_fcla.ma
new file mode 100644 (file)
index 0000000..14542cf
--- /dev/null
@@ -0,0 +1,71 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/notation/relations/rcolength_2.ma".
+include "ground_2/relocation/rtmap_isid.ma".
+
+(* RELOCATION MAP ***********************************************************)
+
+inductive fcla: relation2 rtmap nat ā‰
+| fcla_isid: āˆ€f. šˆā¦ƒfā¦„ ā†’ fcla f 0
+| fcla_push: āˆ€f,n. fcla f n ā†’ fcla (ā†‘f) n
+| fcla_next: āˆ€f,n. fcla f n ā†’ fcla (ā«Æf) (ā«Æn)
+.
+
+interpretation "finite colength assignment (rtmap)"
+   'RCoLength f n = (fcla f n).
+
+(* Basic inversion lemmas ***************************************************)
+
+lemma fcla_inv_px: āˆ€g,m. š‚ā¦ƒgā¦„ ā‰” m ā†’ āˆ€f. ā†‘f = g ā†’ š‚ā¦ƒfā¦„ ā‰” m.
+#g #m * -g -m /3 width=3 by fcla_isid, isid_inv_push/
+#g #m #_ #f #H elim (discr_push_next ā€¦ H)
+qed-.
+
+lemma fcla_inv_nx: āˆ€g,m. š‚ā¦ƒgā¦„ ā‰” m ā†’ āˆ€f. ā«Æf = g ā†’
+                   āˆƒāˆƒn. š‚ā¦ƒfā¦„ ā‰” n & ā«Æn = m.
+#g #m * -g -m /2 width=3 by ex2_intro/
+[ #g #Hg #f #H elim (isid_inv_next ā€¦  H) -H //
+| #g #m #_ #f #H elim (discr_next_push ā€¦ H)
+]
+qed-.
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma cla_inv_nn: āˆ€g,m. š‚ā¦ƒgā¦„ ā‰” m ā†’ āˆ€f,n. ā«Æf = g ā†’ ā«Æn = m ā†’ š‚ā¦ƒfā¦„ ā‰” n.
+#g #m #H #f #n #H1 #H2 elim (fcla_inv_nx ā€¦ H ā€¦ H1) -g
+#x #Hf #H destruct //
+qed-.
+
+lemma cla_inv_np: āˆ€g,m. š‚ā¦ƒgā¦„ ā‰” m ā†’ āˆ€f. ā«Æf = g ā†’ 0 = m ā†’ āŠ„.
+#g #m #H #f #H1 elim (fcla_inv_nx ā€¦ H ā€¦ H1) -g
+#x #_ #H1 #H2 destruct
+qed-.
+
+lemma fcla_inv_xp: āˆ€g,m. š‚ā¦ƒgā¦„ ā‰” m ā†’ 0 = m ā†’ šˆā¦ƒgā¦„.
+#g #m #H elim H -g -m /3 width=3 by isid_push/
+#g #m #_ #_ #H destruct
+qed-.
+
+(* Basic properties *********************************************************)
+
+lemma fcla_eq_repl_back: āˆ€n. eq_repl_back ā€¦ (Ī»f. š‚ā¦ƒfā¦„ ā‰” n).
+#n #f1 #H elim H -f1 -n /3 width=3 by fcla_isid, isid_eq_repl_back/
+#f1 #n #_ #IH #g2 #H [ elim (eq_inv_px ā€¦ H) | elim (eq_inv_nx ā€¦ H) ] -H
+/3 width=3 by fcla_push, fcla_next/
+qed-.
+
+lemma fcla_eq_repl_fwd: āˆ€n. eq_repl_fwd ā€¦ (Ī»f. š‚ā¦ƒfā¦„ ā‰” n).
+#n @eq_repl_sym /2 width=3 by fcla_eq_repl_back/
+qed-.