]> matita.cs.unibo.it Git - helm.git/commitdiff
update in ground
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Wed, 7 Dec 2022 16:46:39 +0000 (17:46 +0100)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Thu, 8 Dec 2022 21:40:15 +0000 (22:40 +0100)
+ head-tail decomposition of a relocation map
+ injectivity of pnpred

matita/matita/contribs/lambdadelta/ground/arith/nat_plus_pplus.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/ground/arith/nat_pred_succ.ma
matita/matita/contribs/lambdadelta/ground/arith/nat_rplus_pplus.ma
matita/matita/contribs/lambdadelta/ground/lib/stream_hdtl_eq.ma
matita/matita/contribs/lambdadelta/ground/relocation/nap.ma
matita/matita/contribs/lambdadelta/ground/relocation/tr_pap_hdtl.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/ground/relocation/tr_pap_hdtl_eq.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/ground/relocation/xap.ma
matita/matita/contribs/lambdadelta/ground/web/ground_src.tbl

diff --git a/matita/matita/contribs/lambdadelta/ground/arith/nat_plus_pplus.ma b/matita/matita/contribs/lambdadelta/ground/arith/nat_plus_pplus.ma
new file mode 100644 (file)
index 0000000..d176fae
--- /dev/null
@@ -0,0 +1,28 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/arith/nat_rplus_pplus.ma".
+include "ground/arith/nat_plus_rplus.ma".
+
+(* ADDITION FOR NON-NEGATIVE INTEGERS ***************************************)
+
+lemma nplus_inj_bi (p) (q):
+      ninj (pplus p q) = nplus (ninj p) (ninj q).
+// qed.
+
+lemma nplus_pnpred_sn (p) (q):
+      pnpred (p + q) = nplus (pnpred p) (ninj q).
+#p #q
+<pplus_comm >nplus_comm >nrplus_pnpred_dx //
+qed.
index 4a6e23b01846b0fd7b807b095b87add5b44d060f..5472d7c1bee0a348a9233f491f820c9c7bd37030 100644 (file)
@@ -43,6 +43,15 @@ lemma npred_succ (n): n = ↓↑n.
 * //
 qed.
 
+(* Basic inversions *********************************************************)
+
+lemma eq_inv_pnpred_bi:
+      injective … pnpred.
+#p1 #p2 #Hp
+>(npsucc_pred p1) >(npsucc_pred p2)
+<Hp -Hp @refl
+qed-.
+
 (* Inversions with nsucc ****************************************************)
 
 (*** nat_split *)
index 661da6d710797eb806bae547a8f5377b61f093e3..f3ae67e31085b2d6043f19eed543a830ba0d58b1 100644 (file)
@@ -13,6 +13,7 @@
 (**************************************************************************)
 
 include "ground/arith/pnat_plus.ma".
+include "ground/arith/nat_pred.ma".
 include "ground/arith/nat_rplus_succ.ma".
 
 (* RIGHT ADDITION FOR NON-NEGATIVE INTEGERS *********************************)
@@ -23,6 +24,11 @@ lemma nrplus_inj_dx (p) (q):
       p + q = p + ninj q.
 // qed.
 
+lemma nrplus_pnpred_dx (p) (q):
+      pnpred (p+q) = nrplus p (pnpred q).
+#p * //
+qed.
+
 lemma nrplus_pplus_assoc (p,q:pnat) (n:nat):
       (p+q)+n = p+(q+n).
 #p #q #n
index ebe087664523abbd9c05a4da65dfdee03f9f8c09..f113e998871baff0546388257e7d83f345295e87 100644 (file)
@@ -32,3 +32,18 @@ lemma stream_tl_eq_repl (A):
 elim (stream_eq_inv_cons_bi … H) -H
 /2 width=7 by/
 qed.
+
+lemma stream_hd_tl_eq_repl (A) (t1) (t2):
+      t1 ≗{A} t2 →
+      ∧∧ ⇃t1 = ⇃t2 & ⇂t1 ≗ ⇂t2.
+#A #t1 #t2 #H
+/3 width=1 by stream_tl_eq_repl, stream_hd_eq_repl, conj/
+qed-.
+
+(* Inversions with stram_eq *************************************************)
+
+lemma stream_eq_inv_hd_tl_bi (A) (t1) (t2):
+      ⇃t1 = ⇃t2 → ⇂t1 ≗ ⇂t2 → t1 ≗{A} t2.
+#A * #a1 #t1 * #a2 #t2
+/2 width=1 by stream_eq_cons/
+qed-.
index 921863e5065948b5b73449c61337a28d4c04ea85..6bd5d7715f82c84d491a6b6287d04173d745e9b3 100644 (file)
@@ -1,9 +1,10 @@
 include "ground/relocation/tr_uni_pap.ma".
 include "ground/relocation/tr_compose_pap.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):
@@ -61,3 +62,34 @@ theorem tr_nap_eq_repl (i):
 <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.
diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/tr_pap_hdtl.ma b/matita/matita/contribs/lambdadelta/ground/relocation/tr_pap_hdtl.ma
new file mode 100644 (file)
index 0000000..f06670e
--- /dev/null
@@ -0,0 +1,25 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/relocation/tr_pap.ma".
+include "ground/lib/stream_hdtl.ma".
+
+(* POSITIVE APPLICATION FOR TOTAL RELOCATION MAPS ***************************)
+
+(* Constructions with stream_hd *********************************************)
+
+lemma tr_pap_unit (f):
+      ⇃f = f@⧣❨𝟏❩.
+* #p #f //
+qed.
diff --git a/matita/matita/contribs/lambdadelta/ground/relocation/tr_pap_hdtl_eq.ma b/matita/matita/contribs/lambdadelta/ground/relocation/tr_pap_hdtl_eq.ma
new file mode 100644 (file)
index 0000000..9fcff78
--- /dev/null
@@ -0,0 +1,26 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/relocation/tr_pap_hdtl.ma".
+include "ground/lib/stream_hdtl_eq.ma".
+
+(* POSITIVE APPLICATION FOR TOTAL RELOCATION MAPS ***************************)
+
+(* Inversions with stream_eq and stream_tl **********************************)
+
+lemma tr_eq_inv_pap_unit_tl_bi (f1) (f2):
+      f1@⧣❨𝟏❩ = f2@⧣❨𝟏❩ → ⇂f1 ≗ ⇂f2 → f1 ≗ f2.
+#f1 #f2 #H1 #H2
+/2 width=1 by stream_eq_inv_hd_tl_bi/
+qed-.
index 0835ec53f5326d518fb4194b861542bc5312c70e..4c3e8fc3963633a03582edb81c810eb53908f003 100644 (file)
@@ -1,5 +1,4 @@
 (**) (* reverse include *)
-include "ground/arith/nat_rplus_pplus.ma".
 include "ground/relocation/tr_pn_eq.ma".
 include "ground/relocation/tr_compose_pn.ma".
 include "ground/relocation/nap.ma".
@@ -78,11 +77,15 @@ theorem tr_xap_eq_repl (i):
 /3 width=1 by tr_push_eq_repl, tr_nap_eq_repl/
 qed.
 
-lemma tr_nap_plus (f) (m) (n):
+lemma tr_nap_plus_dx_xap (f) (m) (n):
       ⇂*[↑n]f@❨m❩+f@§❨n❩ = f@§❨m+n❩.
-/2 width=1 by eq_inv_nsucc_bi/
+/2 width=1 by tr_nap_eq_repl/
 qed.
 
+lemma tr_nap_plus_sn_xap (f) (m) (n):
+      ⇂*[n]f@§❨m❩+f@❨n❩ = f@§❨m+n❩.
+// qed.
+
 lemma tr_xap_pos (f) (n):
       n = ↑↓n → f@❨n❩=↑↓(f@❨n❩).
 #f #n #H0 >H0 -H0
index 80d76fbe080bb36c23b8bf8843154458454e9945..81aeb39e945c5b7d2150cf0392a6fbe36cdc3271 100644 (file)
@@ -33,7 +33,7 @@ table {
           [ "tr_uni ( 𝐮❨?❩ )" "tr_uni_eq" "tr_uni_hdtl" "tr_uni_tls" "tr_uni_pap" "tr_uni_compose" * ]
           [ "tr_id ( 𝐢 ) " "tr_id_hdtl" "tr_id_pushs" "tr_id_tls" "tr_id_pap" "tr_id_compose" * ]
           [ "tr_compose ( ?∘? )" "tr_compose_eq" "tr_compose_tls" "tr_compose_pn" "tr_compose_pushs" "tr_compose_pap" "tr_compose_compose" * ]
-          [ "tr_pap ( ?@⧣❨?❩ )" "tr_pap_eq" "tr_pap_tls" "tr_pap_pat" "tr_pap_pn" "tr_pap_pushs" "tr_pap_pap" * ]
+          [ "tr_pap ( ?@⧣❨?❩ )" "tr_pap_eq" "tr_pap_hdtl" "tr_pap_hdtl_eq" "tr_pap_tls" "tr_pap_pat" "tr_pap_pn" "tr_pap_pushs" "tr_pap_pap" * ]
           [ "tr_pushs ( ⫯*[?]? )" * ]
           [ "tr_pn ( ⫯? ) ( ↑? )" "tr_pn_eq" "tr_pn_hdtl" "tr_pn_tls" * ]
           [ "tr_map ( 𝐭❨?❩ )" "tr_eq" "tr_nexts" "tr_pat" "tr_ist" * ]
@@ -109,7 +109,7 @@ table {
           [ "nat_le ( ?≤? )" "nat_le_pred" "nat_le_plus" "nat_le_minus" "nat_le_minus_plus" "nat_le_max" * ]
           [ "nat_max ( ?∨? )" * ]
           [ "nat_minus ( ?-? )" "nat_minus_plus" * ]
-          [ "nat_plus ( ?+? )" "nat_plus_pred" "nat_plus_rplus" * ]
+          [ "nat_plus ( ?+? )" "nat_plus_pred" "nat_plus_rplus" "nat_plus_pplus" * ]
           [ "nat_rplus ( ?+? )" "nat_rplus_pplus" "nat_rplus_succ" * ]
           [ "nat_pred ( ↓? )" "nat_pred_succ" * ]
           [ "nat_succ ( ↑? )" "nat_succ_iter" "nat_succ_tri" * ]