]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground/relocation/nap.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / nap.ma
index ac32304ed352d6fd996c64900ead586effd36fe2..6bd5d7715f82c84d491a6b6287d04173d745e9b3 100644 (file)
@@ -1,8 +1,10 @@
 include "ground/relocation/tr_uni_pap.ma".
 include "ground/relocation/tr_compose_pap.ma".
-include "ground/notation/functions/applysucc_2.ma".
+include "ground/relocation/tr_pap_eq.ma".
+include "ground/relocation/tr_pap_hdtl_eq.ma".
+include "ground/notation/functions/atsection_2.ma".
 include "ground/arith/nat_lt.ma".
-include "ground/arith/nat_plus_rplus.ma".
+include "ground/arith/nat_plus_pplus.ma".
 include "ground/arith/nat_pred_succ.ma".
 
 lemma nlt_npsucc_bi (n1) (n2):
@@ -16,40 +18,78 @@ definition tr_nap (f) (l:nat): nat ≝
 
 interpretation
   "functional non-negative application (total relocation maps)"
-  'ApplySucc f l = (tr_nap f l).
+  'AtSection f l = (tr_nap f l).
 
 lemma tr_nap_unfold (f) (l):
-      ↓(f@⧣❨↑l❩) = f@↑❨l❩.
+      ↓(f@⧣❨↑l❩) = f@§❨l❩.
 // qed.
 
 lemma tr_pap_succ_nap (f) (l):
-      ↑(f@↑❨l❩) = f@⧣❨↑l❩.
+      ↑(f@§❨l❩) = f@⧣❨↑l❩.
 // qed.
 
 lemma tr_compose_nap (f2) (f1) (l):
-      f2@↑❨f1@↑❨l❩❩ = (f2∘f1)@↑❨l❩.
+      f2@§❨f1@§❨l❩❩ = (f2∘f1)@§❨l❩.
 #f2 #f1 #l
 <tr_nap_unfold <tr_nap_unfold <tr_nap_unfold
 <tr_compose_pap <npsucc_pred //
 qed.
 
 lemma tr_uni_nap (n) (m):
-      m + n = 𝐮❨n❩@↑❨m❩.
+      m + n = 𝐮❨n❩@§❨m❩.
 #n #m
 <tr_nap_unfold
 <tr_uni_pap <nrplus_npsucc_sn //
 qed.
 
 lemma tr_nap_push (f):
-      ∀l. ↑(f@↑❨l❩) = (⫯f)@↑❨↑l❩.
+      ∀l. ↑(f@§❨l❩) = (⫯f)@§❨↑l❩.
 #f #l
 <tr_nap_unfold <tr_nap_unfold
 <tr_pap_push <pnpred_psucc //
 qed.
 
 lemma tr_nap_pushs_lt (f) (n) (m):
-      m < n → m = (⫯*[n]f)@↑❨m❩.
+      m < n → m = (⫯*[n]f)@§❨m❩.
 #f #n #m #Hmn
 <tr_nap_unfold <tr_pap_pushs_le
 /2 width=1 by nlt_npsucc_bi/
 qed-.
+
+theorem tr_nap_eq_repl (i):
+        stream_eq_repl … (λf1,f2. f1@§❨i❩ = f2@§❨i❩).
+#i #f1 #f2 #Hf
+<tr_nap_unfold <tr_nap_unfold
+/3 width=1 by tr_pap_eq_repl, eq_f/
+qed.
+
+lemma tr_eq_inv_nap_zero_tl_bi (f1) (f2):
+      f1@§❨𝟎❩ = f2@§❨𝟎❩ → ⇂f1 ≗ ⇂f2 → f1 ≗ f2.
+#f1 #f2
+<tr_nap_unfold <tr_nap_unfold #H1 #H2
+/3 width=1 by tr_eq_inv_pap_unit_tl_bi, eq_inv_pnpred_bi/
+qed-.
+
+lemma tr_nap_plus_sn (f) (m) (n):
+      (⫯⇂*[↑n]f)@§❨m❩+f@§❨n❩ = f@§❨m+n❩.
+#f #m @(nat_ind_succ … m) -m [| #m #_ ] #n
+[ <nplus_zero_sn <nplus_zero_sn //
+| <tr_nap_push <nplus_comm in ⊢ (???%);
+  <tr_nap_unfold <tr_nap_unfold <tr_nap_unfold
+  <nsucc_pnpred <nrplus_inj_sn <nrplus_pnpred_dx
+  >nrplus_npsucc_sn <nrplus_inj_dx
+  <pplus_comm in ⊢ (???%); <tr_pap_plus //
+]
+qed.
+
+lemma tr_nap_plus_dx (f) (m) (n):
+      ⇂*[n]f@§❨m❩+(⫯f)@§❨n❩ = f@§❨m+n❩.
+#f #m #n @(nat_ind_succ … n) -n [| #n #_ ]
+[ //
+| <tr_nap_push
+  <tr_nap_unfold <tr_nap_unfold <tr_nap_unfold
+  <nsucc_pnpred <nplus_pnpred_sn
+  >nrplus_npsucc_sn <nrplus_inj_dx
+  <tr_pap_plus //
+]
+qed.