1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground/notation/functions/oplusleft_3.ma".
16 include "ground/lib/list_append.ma".
17 include "ground/generated/pull_2.ma".
19 (* RIGHT CONS FOR LISTS *****************************************************)
23 'OPlusLeft A hd tl = (list_append A hd (list_lcons A tl (list_empty A))).
25 (* Basic constructions ******************************************************)
27 lemma list_cons_comm (A):
31 lemma list_cons_shift (A):
32 ∀a1,l,a2. a1 ⨮{A} l ⨭ a2 = (a1 ⨮ l) ⨭ a2.
35 (* Advanced constructions ***************************************************)
37 (* Note: this is list_append_lcons_dx *)
38 lemma list_append_rcons_sn (A):
39 ∀l1,l2,a. l1 ⨁ (a ⨮ l2) = (l1 ⨭ a) ⨁{A} l2.
42 lemma list_append_rcons_dx (A):
43 ∀l1,l2,a. l1 ⨁ l2 ⨭ a = l1 ⨁{A} (l2 ⨭ a).
46 (* Basic inversions *********************************************************)
48 lemma eq_inv_list_empty_rcons (A):
51 elim (eq_inv_list_empty_append … H) -H #_ #H destruct
54 (* Advanced eliminations ****************************************************)
56 lemma list_ind_rcons (A) (Q:predicate …):
58 (∀l,a. Q l -> Q (l⨭a)) →
61 @(list_ind_append_dx … l) -l //
62 @pull_2 #l2 elim l2 -l2 //
63 #a2 #l2 #IH0 #l1 #IH /3 width=1 by/