]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/reduction/ibfr_unwind.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / reduction / ibfr_unwind.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/reduction/ibfr_lift.ma".
16 include "delayed_updating/reduction/ibfr_eq.ma".
17
18 include "delayed_updating/unwind/unwind2_preterm_fsubst.ma".
19 include "delayed_updating/unwind/unwind2_preterm_eq.ma".
20 include "delayed_updating/unwind/unwind2_prototerm_lift.ma".
21 include "delayed_updating/unwind/unwind2_rmap_crux.ma".
22
23 include "delayed_updating/syntax/path_closed_structure.ma".
24 include "delayed_updating/syntax/path_guard_structure.ma".
25 include "delayed_updating/syntax/path_structure_depth.ma".
26
27 (* IMMEDIATE BALANCED FOCUSED REDUCTION *************************************)
28
29 (* Constructions with unwind2 ***********************************************)
30
31 lemma ibfr_structure_unwind_bi (f) (t1) (t2) (r):
32       ▼[⫯𝐢]t1 ➡𝐢𝐛𝐟[⊗r] ▼[⫯𝐢]t2 → ▼[f]t1 ➡𝐢𝐛𝐟[⊗r] ▼[f]t2.
33 #f #t1 #t2 #r #Ht12
34 lapply (ibfr_lift_bi (f) … Ht12) -Ht12
35 <lift_path_structure #Ht12
36 @(ibfr_eq_repl … Ht12) -r
37 @(subset_eq_canc_dx … (lift_unwind2_term_after …))
38 @unwind2_term_eq_repl_sn -t1 -t2 //
39 qed-.
40
41 lemma ibfr_unwind_bi_push (f) (t1) (t2) (r):
42       t1 ϵ 𝐓 → r ϵ 𝐈 →
43       t1 ➡𝐢𝐛𝐟[r] t2 → ▼[⫯f]t1 ➡𝐢𝐛𝐟[⊗r] ▼[⫯f]t2.
44 #f #t1 #t2 #r #H1t1 #H2r
45 * #p #b #q #m #n #Hr #Hp #Hb #Hm #Hn #Ht1 #Ht2 destruct
46 @(ex7_5_intro … (⊗p) (⊗b) (⊗q) (♭b) (♭q))
47 [ -H1t1 -H2r -Hp -Hb -Hm -Hn -Ht1 -Ht2 //
48 | -H1t1 -H2r -Hb -Hm -Hn -Ht1 -Ht2
49   /2 width=1 by path_guard_structure/
50 | -H1t1 -H2r -Hp -Hm -Hn -Ht1 -Ht2 //
51 | -H1t1 -H2r -Hp -Hb -Hn -Ht1 -Ht2
52   /2 width=2 by path_closed_structure_depth/
53 | -H1t1 -H2r -Hp -Hb -Hm -Ht1 -Ht2
54   /2 width=2 by path_closed_structure_depth/
55 | lapply (in_comp_unwind2_path_term (⫯f) … Ht1) -Ht2 -Ht1 -H1t1 -H2r -Hp -Hb
56   <unwind2_path_d_dx <tr_pap_succ_nap <list_append_rcons_sn >list_append_assoc
57   <nap_unwind2_rmap_append_closed_Lq_dx //
58 | lapply (unwind2_term_eq_repl_dx (⫯f) … Ht2) -Ht2 #Ht2
59   @(subset_eq_trans … Ht2) -t2
60   @(subset_eq_trans … (unwind2_term_fsubst_pic …))
61   [ @fsubst_eq_repl [ // | // ]
62     @(subset_eq_canc_sn … (lift_term_eq_repl_dx …))
63     [ @unwind2_term_grafted_S /2 width=2 by ex_intro/ | skip ] -Ht1
64     @(subset_eq_trans … (lift_unwind2_term_after …))
65     @(subset_eq_canc_dx … (unwind2_lift_term_after …))
66     @unwind2_term_eq_repl_sn
67 (* Note: crux of the proof begins *)
68     /2 width=1 by unwind2_rmap_uni_crux/
69 (* Note: crux of the proof ends *)
70   | //
71   | /2 width=2 by ex_intro/
72   | //
73   ]
74 ]
75 qed-.
76
77 lemma ibfr_unwind_bi (f) (t1) (t2) (r):
78       t1 ϵ 𝐓 → r ϵ 𝐈 →
79       t1 ➡𝐢𝐛𝐟[r] t2 → ▼[f]t1 ➡𝐢𝐛𝐟[⊗r] ▼[f]t2.
80 #f #t1 #t2 #r #Ht1 #Hr #Ht12
81 lapply (ibfr_unwind_bi_push (𝐢) … Ht1 Hr Ht12) -Ht1 -Hr -Ht12 #Ht12
82 /2 width=1 by ibfr_structure_unwind_bi/
83 qed.