]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_preterm_fsubst.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / unwind / unwind2_preterm_fsubst.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_eq.ma".
16 include "delayed_updating/unwind/unwind2_path_structure.ma".
17 include "delayed_updating/substitution/fsubst.ma".
18 include "delayed_updating/syntax/preterm.ma".
19 include "delayed_updating/syntax/prototerm_proper.ma".
20
21 (* UNWIND FOR PRETERM ******************************************************)
22
23 (* Constructions with fsubst ************************************************)
24
25 lemma unwind2_term_fsubst_sn (f) (t) (u) (p): u ϵ 𝐏 →
26       (▼[f]t)[⋔(⊗p)←▼[▶[f]pᴿ]u] ⊆ ▼[f](t[⋔p←u]).
27 #f #t #u #p #Hu #ql * *
28 [ #rl * #r #Hr #H1 #H2 destruct
29   >unwind2_path_append_proper_dx
30   /4 width=5 by in_comp_unwind2_path_term, in_ppc_comp_trans, or_introl, ex2_intro/
31 | * #q #Hq #H1 #H0
32   @(ex2_intro … H1) @or_intror @conj // *
33   [ <list_append_empty_dx #H2 destruct
34     elim (unwind2_path_root f q) #r #_ #Hr /2 width=2 by/
35   | #l #r #H2 destruct
36     @H0 -H0 [| <unwind2_path_append_proper_dx /2 width=3 by ppc_lcons/ ]
37   ]
38 ]
39 qed-.
40
41 lemma unwind2_term_fsubst_dx (f) (t) (u) (p): u ϵ 𝐏 → p ϵ ▵t → t ϵ 𝐓 →
42       ▼[f](t[⋔p←u]) ⊆ (▼[f]t)[⋔(⊗p)←▼[▶[f]pᴿ]u].
43 #f #t #u #p #Hu #H1p #H2p #ql * #q * *
44 [ #r #Hu #H1 #H2 destruct
45   @or_introl @ex2_intro
46   [|| <unwind2_path_append_proper_dx /2 width=5 by in_ppc_comp_trans/ ]
47   /2 width=3 by ex2_intro/
48 | #Hq #H0 #H1 destruct
49   @or_intror @conj [ /2 width=1 by in_comp_unwind2_path_term/ ] *
50   [ <list_append_empty_dx #Hr @(H0 … (𝐞)) -H0
51     <list_append_empty_dx @H2p -H2p
52     /2 width=2 by unwind_gen_des_structure, prototerm_in_comp_root/
53   | #l #r #Hr
54     elim (unwind2_path_inv_append_proper_dx … Hr) -Hr // #s1 #s2 #Hs1 #_ #H1 destruct
55     lapply (H2p … Hs1) -H2p -Hs1 /2 width=2 by ex_intro/
56   ]
57 ]
58 qed-.
59
60 lemma unwind2_term_fsubst (f) (t) (u) (p): u ϵ 𝐏 → p ϵ ▵t → t ϵ 𝐓 →
61       (▼[f]t)[⋔(⊗p)←▼[▶[f]pᴿ]u] ⇔ ▼[f](t[⋔p←u]).
62 /4 width=3 by unwind2_term_fsubst_sn, conj, unwind2_term_fsubst_dx/ qed.