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/oplus_3.ma".
16 include "ground/lib/list.ma".
18 (* APPEND FOR LISTS *********************************************************)
20 rec definition list_append A (l1:list A) (l2:list A) on l1 ≝ match l1 with
22 | list_lcons hd tl ⇒ hd ⨮ (list_append A tl l2)
27 'OPlus A l1 l2 = (list_append A l1 l2).
29 (* Basic constructions ******************************************************)
31 lemma list_append_empty_sn (A):
35 lemma list_append_lcons_sn (A):
36 ∀a,l1,l2. a ⨮ l1 ⨁ l2 = (a⨮l1) ⨁{A} l2.
39 (* Advanced constructions ***************************************************)
41 lemma list_append_empty_dx (A):
44 [ <list_append_empty_sn //
45 | #hd #tl #IH <list_append_lcons_sn <IH //
49 lemma list_append_assoc (A):
50 associative … (list_append A).
52 [ <list_append_empty_sn //
54 [ #l3 <list_append_empty_dx <list_append_empty_sn //
55 | #a2 #l2 #l3 <list_append_lcons_sn <list_append_lcons_sn <IH //
60 (* Basic inversions *********************************************************)
62 lemma eq_inv_list_empty_append (A):
63 ∀l1,l2. ⓔ = l1⨁{A}l2 →
66 [ #l2 /2 width=1 by conj/
67 | #a1 #l1 #l2 <list_append_lcons_sn #H destruct