]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/fsubst_lift.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / substitution / fsubst_lift.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/substitution/fsubst.ma".
16 include "delayed_updating/substitution/lift_prototerm.ma".
17 include "delayed_updating/substitution/lift_structure.ma".
18 include "delayed_updating/syntax/preterm.ma".
19 include "delayed_updating/syntax/prototerm_proper.ma".
20
21 (* FOCALIZED SUBSTITUTION ***************************************************)
22
23 lemma lift_fsubst_sn (f) (t) (u) (p): Ꝕu → p ⧸ϵ t →
24       (↑[f]t)[⋔(⊗p)←↑[↑[p]f]u] ⊆ ↑[f](t[⋔p←u]).
25 #f #t #u #p #Hu #Hp #ql * *
26 [ #rl * #r #Hr #H1 #H2 destruct
27   >lift_append_proper_dx
28   /4 width=1 by subset_in_ext_f1_dx, or_introl/
29 | * #q #Hq #H1 #H0
30   @(ex2_intro … H1) @or_intror @conj //
31   #r #H2 destruct
32   @H0 -H0 [| <lift_append_proper_dx /2 width=1 by/ ]
33 ]
34 qed-.
35
36 lemma lift_fsubst_dx (f) (t) (u) (p): Ꝕu → p ϵ ▵t → structure_injective t →
37       ↑[f](t[⋔p←u]) ⊆ (↑[f]t)[⋔(⊗p)←↑[↑[p]f]u].
38 #f #t #u #p #Hu #H1p #H2p #ql * #q * *
39 [ #r #Hu #H1 #H2 destruct
40   @or_introl @ex2_intro
41   [|| <lift_append_proper_dx /2 width=1 by/ ]
42   /2 width=3 by ex2_intro/
43 | #Hq #H0 #H1 destruct
44   @or_intror @conj [ /2 width=1 by subset_in_ext_f1_dx/ ] *
45   [ <list_append_empty_dx #Hr @(H0 … (𝐞)) -H0
46     <list_append_empty_dx @H2p -H2p /2 width=1 by prototerm_in_comp_root/
47   | #l #r #Hr
48     elim (lift_inv_append_proper_dx … Hr) -Hr // #s1 #s2 #Hs1 #_ #H1 destruct
49     lapply (H2p … Hs1) -H2p -Hs1 /2 width=2 by ex_intro/
50   ]
51 ]
52 qed-.
53
54 lemma lift_fsubst (f) (t) (u) (p): Ꝕu → p ⧸ϵ t → p ϵ ▵t → structure_injective t →
55       (↑[f]t)[⋔(⊗p)←↑[↑[p]f]u] ⇔ ↑[f](t[⋔p←u]).
56 /4 width=3 by lift_fsubst_sn, conj, lift_fsubst_dx/ qed.