[ 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-.
]
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):
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):
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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.