]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_after.ma
first definition of cpm:
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / rtmap_after.ma
index 80401a3d14ab99b9e016c4cbcfb5225212db6e71..a28f7b384a76697ad88453e5b109db45731a4b2e 100644 (file)
@@ -1,3 +1,4 @@
+
 (**************************************************************************)
 (*       ___                                                              *)
 (*      ||M||                                                             *)
@@ -14,7 +15,6 @@
 
 include "ground_2/notation/relations/rafter_3.ma".
 include "ground_2/relocation/rtmap_istot.ma".
-include "ground_2/relocation/rtmap_uni.ma".
 
 (* RELOCATION MAP ***********************************************************)
 
@@ -162,7 +162,7 @@ qed-.
 
 (* Basic properties *********************************************************)
 
-corec lemma after_eq_repl_back_2: ∀f1,f. eq_repl_back (λf2. f2 ⊚ f1 ≡ f).
+corec lemma after_eq_repl_back2: ∀f1,f. eq_repl_back (λf2. f2 ⊚ f1 ≡ f).
 #f1 #f #f2 * -f2 -f1 -f
 #f21 #f1 #f #g21 [1,2: #g1 ] #g #Hf #H21 [1,2: #H1 ] #H #g22 #H0
 [ cases (eq_inv_px …  H0 …  H21) -g21 /3 width=7 by after_refl/
@@ -171,11 +171,11 @@ corec lemma after_eq_repl_back_2: ∀f1,f. eq_repl_back (λf2. f2 ⊚ f1 ≡ f).
 ]
 qed-.
 
-lemma after_eq_repl_fwd_2: ∀f1,f. eq_repl_fwd (λf2. f2 ⊚ f1 ≡ f).
-#f1 #f @eq_repl_sym /2 width=3 by after_eq_repl_back_2/
+lemma after_eq_repl_fwd2: ∀f1,f. eq_repl_fwd (λf2. f2 ⊚ f1 ≡ f).
+#f1 #f @eq_repl_sym /2 width=3 by after_eq_repl_back2/
 qed-.
 
-corec lemma after_eq_repl_back_1: ∀f2,f. eq_repl_back (λf1. f2 ⊚ f1 ≡ f).
+corec lemma after_eq_repl_back1: ∀f2,f. eq_repl_back (λf1. f2 ⊚ f1 ≡ f).
 #f2 #f #f1 * -f2 -f1 -f
 #f2 #f11 #f #g2 [1,2: #g11 ] #g #Hf #H2 [1,2: #H11 ] #H #g2 #H0
 [ cases (eq_inv_px …  H0 …  H11) -g11 /3 width=7 by after_refl/
@@ -184,21 +184,21 @@ corec lemma after_eq_repl_back_1: ∀f2,f. eq_repl_back (λf1. f2 ⊚ f1 ≡ f).
 ]
 qed-.
 
-lemma after_eq_repl_fwd_1: ∀f2,f. eq_repl_fwd (λf1. f2 ⊚ f1 ≡ f).
-#f2 #f @eq_repl_sym /2 width=3 by after_eq_repl_back_1/
+lemma after_eq_repl_fwd1: ∀f2,f. eq_repl_fwd (λf1. f2 ⊚ f1 ≡ f).
+#f2 #f @eq_repl_sym /2 width=3 by after_eq_repl_back1/
 qed-.
 
-corec lemma after_eq_repl_back_0: ∀f1,f2. eq_repl_back (λf. f2 ⊚ f1 ≡ f).
+corec lemma after_eq_repl_back0: ∀f1,f2. eq_repl_back (λf. f2 ⊚ f1 ≡ f).
 #f2 #f1 #f * -f2 -f1 -f
 #f2 #f1 #f01 #g2 [1,2: #g1 ] #g01 #Hf01 #H2 [1,2: #H1 ] #H01 #g02 #H0
 [ cases (eq_inv_px …  H0 …  H01) -g01 /3 width=7 by after_refl/
 | cases (eq_inv_nx …  H0 …  H01) -g01 /3 width=7 by after_push/
-| cases (eq_inv_nx …  H0 …  H01) -g01 /3 width=5 by after_next/ 
+| cases (eq_inv_nx …  H0 …  H01) -g01 /3 width=5 by after_next/
 ]
 qed-.
 
-lemma after_eq_repl_fwd_0: ∀f2,f1. eq_repl_fwd (λf. f2 ⊚ f1 ≡ f).
-#f2 #f1 @eq_repl_sym /2 width=3 by after_eq_repl_back_0/
+lemma after_eq_repl_fwd0: ∀f2,f1. eq_repl_fwd (λf. f2 ⊚ f1 ≡ f).
+#f2 #f1 @eq_repl_sym /2 width=3 by after_eq_repl_back0/
 qed-.
 
 (* Main properties **********************************************************)
@@ -264,38 +264,40 @@ qed-.
 
 lemma after_mono_eq: ∀f1,f2,f. f1 ⊚ f2 ≡ f → ∀g1,g2,g. g1 ⊚ g2 ≡ g →
                      f1 ≗ g1 → f2 ≗ g2 → f ≗ g.
-/4 width=4 by after_mono, after_eq_repl_back_1, after_eq_repl_back_2/ qed-.
+/4 width=4 by after_mono, after_eq_repl_back1, after_eq_repl_back2/ qed-.
 
 (* Properties on tls ********************************************************)
 
 lemma after_tls: ∀n,f1,f2,f. @⦃0, f1⦄ ≡ n → 
                  f1 ⊚ f2 ≡ f → ⫱*[n]f1 ⊚ f2 ≡ ⫱*[n]f.
 #n elim n -n //
-#n #IH #f1 #f2 #f #Hf1 #Hf cases (at_inv_pxn … Hf1) -Hf1 [ |*: // ]
-#g1 #Hg1 #H1 cases (after_inv_nxx … Hf … H1) -Hf /2 width=1 by/
+#n #IH #f1 #f2 #f #Hf1 #Hf
+cases (at_inv_pxn … Hf1) -Hf1 [ |*: // ] #g1 #Hg1 #H1
+cases (after_inv_nxx … Hf … H1) -Hf #g #Hg #H0 destruct
+<tls_xn <tls_xn /2 width=1 by/
 qed.
 
-(* Inversion lemmas on isid *************************************************)
+(* Properties on isid *******************************************************)
 
-corec lemma isid_after_sn: ∀f1. 𝐈⦃f1⦄ → ∀f2. f1 ⊚ f2 ≡ f2.
+corec lemma after_isid_sn: ∀f1. 𝐈⦃f1⦄ → ∀f2. f1 ⊚ f2 ≡ f2.
 #f1 * -f1 #f1 #g1 #Hf1 #H1 #f2 cases (pn_split f2) * #g2 #H2
 /3 width=7 by after_push, after_refl/
-qed-.
+qed.
 
-corec lemma isid_after_dx: ∀f2. 𝐈⦃f2⦄ → ∀f1. f1 ⊚ f2 ≡ f1.
+corec lemma after_isid_dx: ∀f2. 𝐈⦃f2⦄ → ∀f1. f1 ⊚ f2 ≡ f1.
 #f2 * -f2 #f2 #g2 #Hf2 #H2 #f1 cases (pn_split f1) * #g1 #H1
 [ /3 width=7 by after_refl/
 | @(after_next … H1 H1) /3 width=3 by isid_push/
 ]
-qed-.
+qed.
 
-lemma after_isid_inv_sn: ∀f1,f2,f. f1 ⊚ f2 ≡ f →  𝐈⦃f1⦄ → f2 ≗ f.
-/3 width=6 by isid_after_sn, after_mono/
-qed-.
+(* Inversion lemmas on isid *************************************************)
 
-lemma after_isid_inv_dx: ∀f1,f2,f. f1 ⊚ f2 ≡ f →  𝐈⦃f2⦄ → f1 ≗ f.
-/3 width=6 by isid_after_dx, after_mono/
-qed-.
+lemma after_isid_inv_sn: ∀f1,f2,f. f1 ⊚ f2 ≡ f → 𝐈⦃f1⦄ → f2 ≗ f.
+/3 width=6 by after_isid_sn, after_mono/ qed-.
+
+lemma after_isid_inv_dx: ∀f1,f2,f. f1 ⊚ f2 ≡ f → 𝐈⦃f2⦄ → f1 ≗ f.
+/3 width=6 by after_isid_dx, after_mono/ qed-.
 
 corec lemma after_fwd_isid1: ∀f1,f2,f. f1 ⊚ f2 ≡ f → 𝐈⦃f⦄ → 𝐈⦃f1⦄.
 #f1 #f2 #f * -f1 -f2 -f
@@ -318,7 +320,25 @@ lemma after_inv_isid3: ∀f1,f2,f. f1 ⊚ f2 ≡ f → 𝐈⦃f⦄ → 𝐈⦃f1
 
 lemma after_isid_isuni: ∀f1,f2. 𝐈⦃f2⦄ → 𝐔⦃f1⦄ → f1 ⊚ ⫯f2 ≡ ⫯f1.
 #f1 #f2 #Hf2 #H elim H -H
-/5 width=7 by isid_after_dx, after_eq_repl_back_2, after_next, after_push, eq_push_inv_isid/
+/5 width=7 by after_isid_dx, after_eq_repl_back2, after_next, after_push, eq_push_inv_isid/
+qed.
+
+lemma after_uni_next2: ∀f2. 𝐔⦃f2⦄ → ∀f1,f. ⫯f2 ⊚ f1 ≡ f → f2 ⊚ ⫯f1 ≡ f.
+#f2 #H elim H -f2
+[ #f2 #Hf2 #f1 #f #Hf
+  elim (after_inv_nxx … Hf) -Hf [2,3: // ] #g #Hg #H0 destruct
+  /4 width=7 by after_isid_inv_sn, after_isid_sn, after_eq_repl_back0, eq_next/
+| #f2 #_ #g2 #H2 #IH #f1 #f #Hf
+  elim (after_inv_nxx … Hf) -Hf [2,3: // ] #g #Hg #H0 destruct
+  /3 width=5 by after_next/
+]
+qed.
+
+(* Properties on uni ********************************************************)
+
+lemma after_uni: ∀n1,n2. 𝐔❴n1❵ ⊚ 𝐔❴n2❵ ≡ 𝐔❴n1+n2❵.
+@nat_elim2 [3: #n #m <plus_n_Sm ] (**) (* full auto fails *)
+/4 width=5 by after_uni_next2, after_isid_dx, after_isid_sn, after_next/
 qed.
 
 (* Forward lemmas on at *****************************************************)
@@ -384,32 +404,32 @@ qed-.
 
 (* Properties with at *******************************************************)
 
-lemma after_isuni_dx: ∀i2,i1,f2. @⦃i1, f2⦄ ≡ i2 →
-                      ∀f. f2 ⊚ 𝐔❴i1❵ ≡ f → 𝐔❴i2❵ ⊚ ⫱*[i2] f2 ≡ f.
+lemma after_uni_dx: ∀i2,i1,f2. @⦃i1, f2⦄ ≡ i2 →
+                    ∀f. f2 ⊚ 𝐔❴i1❵ ≡ f → 𝐔❴i2❵ ⊚ ⫱*[i2] f2 ≡ f.
 #i2 elim i2 -i2
 [ #i1 #f2 #Hf2 #f #Hf
   elim (at_inv_xxp … Hf2) -Hf2 // #g2 #H1 #H2 destruct
   lapply (after_isid_inv_dx … Hf ?) -Hf
-  /3 width=3 by isid_after_sn, after_eq_repl_back_0/
+  /3 width=3 by after_isid_sn, after_eq_repl_back0/
 | #i2 #IH #i1 #f2 #Hf2 #f #Hf
   elim (at_inv_xxn … Hf2) -Hf2 [1,3: * |*: // ]
   [ #g2 #j1 #Hg2 #H1 #H2 destruct
     elim (after_inv_pnx … Hf) -Hf [ |*: // ] #g #Hg #H destruct
-    /3 width=5 by after_next/
+    <tls_xn /3 width=5 by after_next/
   | #g2 #Hg2 #H2 destruct
     elim (after_inv_nxx … Hf) -Hf [2,3: // ] #g #Hg #H destruct
-    /3 width=5 by after_next/
+    <tls_xn /3 width=5 by after_next/
   ]
 ]
 qed.
 
-lemma after_isuni_sn: ∀i2,i1,f2. @⦃i1, f2⦄ ≡ i2 →
-                      ∀f. 𝐔❴i2❵ ⊚ ⫱*[i2] f2 ≡ f → f2 ⊚ 𝐔❴i1❵ ≡ f.
+lemma after_uni_sn: ∀i2,i1,f2. @⦃i1, f2⦄ ≡ i2 →
+                    ∀f. 𝐔❴i2❵ ⊚ ⫱*[i2] f2 ≡ f → f2 ⊚ 𝐔❴i1❵ ≡ f.
 #i2 elim i2 -i2
 [ #i1 #f2 #Hf2 #f #Hf
   elim (at_inv_xxp … Hf2) -Hf2 // #g2 #H1 #H2 destruct
   lapply (after_isid_inv_sn … Hf ?) -Hf
-  /3 width=3 by isid_after_dx, after_eq_repl_back_0/
+  /3 width=3 by after_isid_dx, after_eq_repl_back0/
 | #i2 #IH #i1 #f2 #Hf2 #f #Hf
   elim (after_inv_nxx … Hf) -Hf [2,3: // ] #g #Hg #H destruct
   elim (at_inv_xxn … Hf2) -Hf2 [1,3: * |*: // ]
@@ -419,6 +439,50 @@ lemma after_isuni_sn: ∀i2,i1,f2. @⦃i1, f2⦄ ≡ i2 →
 ]
 qed-.
 
+lemma after_uni_succ_dx: ∀i2,i1,f2. @⦃i1, f2⦄ ≡ i2 →
+                         ∀f. f2 ⊚ 𝐔❴⫯i1❵ ≡ f → 𝐔❴⫯i2❵ ⊚ ⫱*[⫯i2] f2 ≡ f.
+#i2 elim i2 -i2
+[ #i1 #f2 #Hf2 #f #Hf
+  elim (at_inv_xxp … Hf2) -Hf2 // #g2 #H1 #H2 destruct
+  elim (after_inv_pnx … Hf) -Hf [ |*: // ] #g #Hg #H
+  lapply (after_isid_inv_dx … Hg ?) -Hg
+  /4 width=5 by after_isid_sn, after_eq_repl_back0, after_next/
+| #i2 #IH #i1 #f2 #Hf2 #f #Hf
+  elim (at_inv_xxn … Hf2) -Hf2 [1,3: * |*: // ]
+  [ #g2 #j1 #Hg2 #H1 #H2 destruct
+    elim (after_inv_pnx … Hf) -Hf [ |*: // ] #g #Hg #H destruct
+    <tls_xn /3 width=5 by after_next/
+  | #g2 #Hg2 #H2 destruct
+    elim (after_inv_nxx … Hf) -Hf [2,3: // ] #g #Hg #H destruct
+    <tls_xn /3 width=5 by after_next/
+  ]
+]
+qed.
+
+lemma after_uni_succ_sn: ∀i2,i1,f2. @⦃i1, f2⦄ ≡ i2 →
+                         ∀f. 𝐔❴⫯i2❵ ⊚ ⫱*[⫯i2] f2 ≡ f → f2 ⊚ 𝐔❴⫯i1❵ ≡ f.
+#i2 elim i2 -i2
+[ #i1 #f2 #Hf2 #f #Hf
+  elim (at_inv_xxp … Hf2) -Hf2 // #g2 #H1 #H2 destruct
+  elim (after_inv_nxx … Hf) -Hf [ |*: // ] #g #Hg #H destruct
+  lapply (after_isid_inv_sn … Hg ?) -Hg
+  /4 width=7 by after_isid_dx, after_eq_repl_back0, after_push/
+| #i2 #IH #i1 #f2 #Hf2 #f #Hf
+  elim (after_inv_nxx … Hf) -Hf [2,3: // ] #g #Hg #H destruct
+  elim (at_inv_xxn … Hf2) -Hf2 [1,3: * |*: // ]
+  [ #g2 #j1 #Hg2 #H1 #H2 destruct <tls_xn in Hg; /3 width=7 by after_push/
+  | #g2 #Hg2 #H2 destruct <tls_xn in Hg; /3 width=5 by after_next/
+  ]
+]
+qed-.
+
+lemma after_uni_one_dx: ∀f2,f. ↑f2 ⊚ 𝐔❴⫯O❵ ≡ f → 𝐔❴⫯O❵ ⊚ f2 ≡ f.
+#f2 #f #H @(after_uni_succ_dx … (↑f2)) /2 width=3 by at_refl/
+qed.
+
+lemma after_uni_one_sn: ∀f1,f. 𝐔❴⫯O❵ ⊚ f1 ≡ f → ↑f1 ⊚ 𝐔❴⫯O❵ ≡ f.
+/3 width=3 by after_uni_succ_sn, at_refl/ qed-.
+
 (* Forward lemmas on istot **************************************************)
 
 lemma after_istot_fwd: ∀f2,f1,f. f2 ⊚ f1 ≡ f → 𝐓⦃f2⦄ → 𝐓⦃f1⦄ → 𝐓⦃f⦄.