]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_preterm_eq.ma
partial commit 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_append.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 (* TAILED 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_des_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 (eq_inv_S_sn_unwind2_path … 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_dx >structure_S_dx
64   @unwind2_term_grafted_sn // (**) (* auto fails *)
65 | /2 width=1 by unwind2_term_grafted_S_dx/
66 ]
67 qed.