]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_preterm_eq.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / unwind / unwind2_preterm_eq.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
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".
20
21 (* UNWIND FOR PRETERM *******************************************************)
22
23 (* Constructions with subset_equivalence ************************************)
24
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 //
30 qed-.
31
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/
39 qed-.
40
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.
44
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/
57 qed-.
58
59 lemma unwind2_term_grafted_S (f) (t) (p): p Ļµ ā–µt ā†’ t Ļµ š“ ā†’
60       ā–¼[ā–¶[f]pį“æ](tā‹”(pā—–š—¦)) ā‡” (ā–¼[f]t)ā‹”((āŠ—p)ā—–š—¦).
61 #f #t #p #Hp #Ht
62 @conj
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/
66 ]
67 qed.