]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/delayed_updating/substitution/fsubst_constructors.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / substitution / fsubst_constructors.ma
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/substitution/fsubst_constructors.ma b/matita/matita/contribs/lambdadelta/delayed_updating/substitution/fsubst_constructors.ma
new file mode 100644 (file)
index 0000000..7d69778
--- /dev/null
@@ -0,0 +1,105 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "delayed_updating/substitution/fsubst.ma".
+include "delayed_updating/syntax/prototerm_constructors.ma".
+include "ground/lib/subset_equivalence.ma".
+
+(* FOCALIZED SUBSTITUTION ***************************************************)
+
+(* Constructions with constructors for prototerm ****************************)
+
+lemma fsubst_abst_hd (t) (u) (p):
+      š›Œ.(t[ā‹”pā†u]) ā‡” (š›Œ.t)[ā‹”š—Ÿā——pā†u].
+#t #u #p @conj #r
+[ #Hr
+  elim (in_comp_inv_abst ā€¦ Hr) -Hr #s #H0 * *
+  [ #q #Hq #H1 destruct
+    /3 width=3 by ex2_intro, or_introl/
+  | #H1s #H2s destruct
+    @or_intror @conj
+    [ /2 width=1 by in_comp_abst_hd/ ]
+    #s0 <list_append_rcons_dx #Hs0
+    elim (eq_inv_list_rcons_bi ????? Hs0) -Hs0 #H1 #H2 destruct
+    /2 width=2 by/
+  ]
+| * *
+  [ #q #Hq #H0 destruct
+    /4 width=3 by in_comp_abst_hd, ex2_intro, or_introl/
+  | #H1r #H2r
+    elim (in_comp_inv_abst ā€¦ H1r) -H1r #s #H0 #Hs destruct
+    /5 width=2 by in_comp_abst_hd, conj, or_intror/
+  ]
+]
+qed.
+
+lemma fsubst_appl_sd (v) (t) (u) (p):
+      ļ¼ v[ā‹”pā†u].t ā‡” (ļ¼ v.t)[ā‹”š—¦ā——pā†u].
+#v #t #u #p @conj #r
+[ #Hr
+  elim (in_comp_inv_appl ā€¦ Hr) -Hr * #s #H0
+  [ * *
+    [ #q #Hq #H1 destruct
+      /3 width=3 by ex2_intro, or_introl/
+    | #H1s #H2s destruct
+      @or_intror @conj
+      [ /2 width=1 by in_comp_appl_sd/ ]
+      #s0 <list_append_rcons_dx #Hs0
+      elim (eq_inv_list_rcons_bi ????? Hs0) -Hs0 #H1 #H2 destruct
+      /2 width=2 by/
+    ]
+  | #Hs destruct
+    @or_intror @conj [ /2 width=1 by in_comp_appl_hd/ ]
+    #r <list_append_rcons_dx #H0
+    elim (eq_inv_list_rcons_bi ????? H0) -H0 #H1 #H2 destruct
+  ]
+| * *
+  [ #q #Hq #H0 destruct
+    /4 width=3 by in_comp_appl_sd, ex2_intro, or_introl/
+  | #H1r #H2r
+    elim (in_comp_inv_appl ā€¦ H1r) -H1r * #s #H0 #Hs destruct
+    /5 width=2 by in_comp_appl_hd, in_comp_appl_sd, or_intror, conj/
+  ]
+]
+qed.
+
+lemma fsubst_appl_hd (v) (t) (u) (p):
+      ļ¼ v.(t[ā‹”pā†u]) ā‡” (ļ¼ v.t)[ā‹”š—”ā——pā†u].
+#v #t #u #p @conj #r
+[ #Hr
+  elim (in_comp_inv_appl ā€¦ Hr) -Hr * #s #H0
+  [ #Hs destruct
+    @or_intror @conj [ /2 width=1 by in_comp_appl_sd/ ]
+    #r <list_append_rcons_dx #H0
+    elim (eq_inv_list_rcons_bi ????? H0) -H0 #H1 #H2 destruct
+  | * *
+    [ #q #Hq #H1 destruct
+      /3 width=3 by ex2_intro, or_introl/
+    | #H1s #H2s destruct
+      @or_intror @conj
+      [ /2 width=1 by in_comp_appl_hd/ ]
+      #s0 <list_append_rcons_dx #Hs0
+      elim (eq_inv_list_rcons_bi ????? Hs0) -Hs0 #H1 #H2 destruct
+      /2 width=2 by/
+    ]
+  ]
+| * *
+  [ #q #Hq #H0 destruct
+    /4 width=3 by in_comp_appl_hd, ex2_intro, or_introl/
+  | #H1r #H2r
+    elim (in_comp_inv_appl ā€¦ H1r) -H1r * #s #H0 #Hs destruct
+    /5 width=2 by in_comp_appl_hd, in_comp_appl_sd, or_intror, conj/
+  ]
+]
+qed.