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 "delayed_updating/unwind/unwind2_prototerm.ma".
16 include "delayed_updating/unwind/unwind2_path_structure.ma".
17 include "delayed_updating/syntax/preterm.ma".
18 include "delayed_updating/syntax/path_structure_inner.ma".
19 include "ground/lib/subset_equivalence.ma".
21 (* UNWIND FOR PRETERM *******************************************************)
23 (* Constructions with subset_equivalence ************************************)
25 lemma unwind2_term_grafted_sn (f) (t) (p): p Ļµ š ā
26 ā¼[ā¶[f]pį“æ](tāp) ā (ā¼[f]t)ā(āp).
27 #f #t #p #Hp #q * #r #Hr #H0 destruct
28 @(ex2_intro ā¦ Hr) -Hr
29 <unwind2_path_append_inner_sn //
32 lemma unwind2_term_grafted_dx (f) (t) (p): p Ļµ š ā p Ļµ āµt ā t Ļµ š ā
33 (ā¼[f]t)ā(āp) ā ā¼[ā¶[f]pį“æ](tāp).
34 #f #t #p #H1p #H2p #Ht #q * #r #Hr #H0
35 elim (unwind2_path_inv_append_inner_sn ā¦ (sym_eq ā¦ H0)) -H0 //
36 #p0 #q0 #Hp0 #Hq0 #H0 destruct
37 <(Ht ā¦ Hp0) [|*: /2 width=2 by ex_intro/ ] -p
38 /2 width=1 by in_comp_unwind2_path_term/
41 lemma unwind2_term_grafted (f) (t) (p): p Ļµ š ā p Ļµ āµt ā t Ļµ š ā
42 ā¼[ā¶[f]pį“æ](tāp) ā (ā¼[f]t)ā(āp).
43 /3 width=1 by unwind2_term_grafted_sn, unwind2_term_grafted_dx, conj/ qed.
45 lemma unwind2_term_grafted_S_dx (f) (t) (p): p Ļµ āµt ā t Ļµ š ā
46 (ā¼[f]t)ā((āp)āš¦) ā ā¼[ā¶[f]pį“æ](tā(pāš¦)).
47 #f #t #p #Hp #Ht #q * #r #Hr
48 <list_append_rcons_sn #H0
49 elim (unwind2_path_inv_append_proper_dx ā¦ (sym_eq ā¦ H0)) -H0 //
50 #p0 #q0 #Hp0 #Hq0 #H0 destruct
51 <(Ht ā¦ Hp0) [|*: /2 width=2 by ex_intro/ ] -p
52 elim (unwind2_path_inv_S_sn ā¦ (sym_eq ā¦ Hq0)) -Hq0
53 #r1 #r2 #Hr1 #Hr2 #H0 destruct
54 lapply (preterm_in_root_append_inv_structure_empty_dx ā¦ p0 ā¦ Ht Hr1)
55 [ /2 width=2 by ex_intro/ ] -Hr1 #Hr1 destruct
56 /2 width=1 by in_comp_unwind2_path_term/
59 lemma unwind2_term_grafted_S (f) (t) (p): p Ļµ āµt ā t Ļµ š ā
60 ā¼[ā¶[f]pį“æ](tā(pāš¦)) ā (ā¼[f]t)ā((āp)āš¦).
63 [ >unwind2_rmap_S_sn >reverse_rcons >structure_S_dx
64 @unwind2_term_grafted_sn // (**) (* auto fails *)
65 | /2 width=1 by unwind2_term_grafted_S_dx/