]> matita.cs.unibo.it Git - helm.git/commitdiff
update in ground
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Fri, 20 May 2022 20:43:51 +0000 (22:43 +0200)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Fri, 20 May 2022 20:43:51 +0000 (22:43 +0200)
+ additions to lifts

matita/matita/contribs/lambdadelta/ground/lib/list.ma
matita/matita/contribs/lambdadelta/ground/lib/list_append.ma
matita/matita/contribs/lambdadelta/ground/lib/list_rcons.ma
matita/matita/contribs/lambdadelta/ground/lib/list_tl.ma [new file with mode: 0644]

index 6dc752d65ad5b4aa84d5b22e2d6a8b9f0654e084..a486fd39ae1fbf2cdcf0096331b5a7759358368b 100644 (file)
@@ -35,3 +35,12 @@ rec definition list_all A (R:predicate A) (l:list A) on l ≝ match l with
 [ list_empty       ⇒ ⊤
 | list_lcons hd tl ⇒ ∧∧ R hd & list_all A R tl
 ].
+
+(* Basic inversions *********************************************************)
+
+lemma eq_inv_list_lcons_bi (A) (a1) (a2) (l1) (l2):
+      a1⨮l1 = a2⨮{A}l2 →
+      ∧∧ a1 = a2 & l1 = l2.
+#A #a1 #a2 #l1 #l2 #H0 destruct
+/2 width=1 by conj/
+qed-.
index 042497aac144f4549933ebc96f4afc615c50218b..e4c3d743e2d17273430c19d9672a86fe3bd7a70c 100644 (file)
@@ -68,6 +68,15 @@ lemma eq_inv_list_empty_append (A):
 ]
 qed-.
 
+lemma eq_inv_list_append_empty (A):
+      ∀l1,l2. l1⨁{A}l2 = ⓔ →
+      ∧∧ l1 = ⓔ & l2 = ⓔ.
+#A *
+[ #l2 /2 width=1 by conj/
+| #a1 #l1 #l2 <list_append_lcons_sn #H destruct
+]
+qed-.
+
 (* Advanced inversions ******************************************************)
 
 lemma eq_inv_list_append_dx_sn_refl (A) (l1) (l2):
index 00faad83dc2af5462773b9ef7ba0fc592ed623c1..bfbc0e986dba994d0f6e33f9d2e7e06880b2fa42 100644 (file)
@@ -51,6 +51,12 @@ lemma eq_inv_list_empty_rcons (A):
 elim (eq_inv_list_empty_append … H0) -H0 #_ #H0 destruct
 qed-.
 
+lemma eq_inv_list_rcons_empty (A):
+      ∀l,a. l⨭{A}a = ⓔ → ⊥.
+#A #l #a #H0
+elim (eq_inv_list_append_empty … H0) -H0 #_ #H0 destruct
+qed-.
+
 (* Advanced inversions ******************************************************)
 
 lemma eq_inv_list_rcons_bi (A):
diff --git a/matita/matita/contribs/lambdadelta/ground/lib/list_tl.ma b/matita/matita/contribs/lambdadelta/ground/lib/list_tl.ma
new file mode 100644 (file)
index 0000000..0e9b887
--- /dev/null
@@ -0,0 +1,36 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/notation/functions/downharpoonright_2.ma".
+include "ground/lib/list.ma".
+
+(* TAIL FOR LISTS ***********************************************************)
+
+definition list_tl (A:Type[0]): list A → list A.
+#A * [ @(ⓔ) | #_ #t @t ]
+defined.
+
+interpretation
+  "tail (streams)"
+  'DownHarpoonRight A t = (list_tl A t).
+
+(* Basic constructions ******************************************************)
+
+lemma list_tl_empty (A):
+      ⓔ = ⇂{A}ⓔ.
+// qed.
+
+lemma list_tl_lcons (A) (a) (t):
+      t = ⇂{A}(a⨮t).
+// qed.