]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/etc/reduction/dfr_ifr.etc
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / etc / reduction / dfr_ifr.etc
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/dfr.ma".
16 include "delayed_updating/reduction/ifr.ma".
17 include "delayed_updating/unwind1/unwind_fsubst.ma".
18 include "delayed_updating/unwind1/unwind_constructors.ma".
19 include "delayed_updating/unwind1/unwind_preterm_eq.ma".
20 include "delayed_updating/unwind1/unwind_structure_depth.ma".
21 include "delayed_updating/unwind1/unwind_depth.ma".
22 include "delayed_updating/substitution/fsubst_eq.ma".
23 include "delayed_updating/substitution/lift_prototerm_eq.ma".
24 include "delayed_updating/syntax/prototerm_proper_constructors.ma".
25 include "delayed_updating/syntax/path_structure_depth.ma".
26 include "ground/relocation/tr_uni_compose.ma".
27 include "ground/relocation/tr_pap_pushs.ma".
28
29 (* DELAYED FOCUSED REDUCTION ************************************************)
30
31 (* COMMENT
32 axiom pippo (b) (q) (n):
33       ↑❘q❘ = (↑[q]𝐢)@❨n❩ →
34       ↑❘q❘+❘b❘= (↑[b●𝗟◗q]𝐢)@❨n+❘b❘❩.
35
36 lemma unwind_rmap_tls_eq_id (p) (n):
37       ❘p❘ = ↑[p]𝐢@❨n❩ →
38       (𝐢) ≗ ⇂*[n]↑[p]𝐢.
39 #p @(list_ind_rcons … p) -p
40 [ #n <depth_empty #H destruct
41 | #p * [ #m ] #IH #n
42   [ <depth_d_dx <unwind_rmap_pap_d_dx #H0
43     @(stream_eq_trans … (unwind_rmap_tls_d_dx …))
44     @(stream_eq_trans … (IH …)) -IH //
45   | /2 width=1 by/
46   | <depth_L_dx <unwind_rmap_L_dx
47     cases n -n [| #n ] #H0
48     [
49     | 
50     ]
51   | /2 width=1 by/
52   | /2 width=1 by/
53   ]
54 ]
55
56
57 (*  (↑❘q❘+❘b❘=↑[b●𝗟◗q]𝐢@❨n+❘b❘❩ *)
58 (* [↑[p]𝐢@❨n❩]⫯*[❘p❘]f∘⇂*[n]↑[p]𝐢) *)
59 lemma unwind_rmap_tls_eq (f) (p) (n):
60       ❘p❘ = ↑[p]𝐢@❨n❩ →
61       f ≗ ⇂*[n]↑[p]f.
62 #f #p #n #Hp
63 @(stream_eq_canc_dx … (stream_tls_eq_repl …))
64 [| @unwind_rmap_decompose | skip ]
65 <tr_compose_tls <Hp
66
67 @(stream_eq_canc_dx) … (unwind_rmap_decompose …)) 
68
69 *)
70 lemma dfr_unwind_id_bi (p) (q) (t1) (t2): t1 ϵ 𝐓 →
71       t1 ➡𝐝𝐟[p,q] t2 → ▼[𝐢]t1 ➡𝐟[⊗p,⊗q] ▼[𝐢]t2.
72 #p #q #t1 #t2 #H0t1
73 * #b #n * #Hb #Hn #Ht1 #Ht2
74 @(ex1_2_intro … (⊗b) (↑❘⊗q❘)) @and4_intro
75 [ //
76 | //
77 | lapply (in_comp_unwind_bi (𝐢) … Ht1) -Ht1 -H0t1 -Hb -Ht2
78   <unwind_path_d_empty_dx <depth_structure //
79 | lapply (unwind_term_eq_repl_dx (𝐢) … Ht2) -Ht2 #Ht2
80   @(subset_eq_trans … Ht2) -t2
81   @(subset_eq_trans … (unwind_fsubst …))
82   [ (*<unwind_rmap_append <unwind_rmap_A_sn <unwind_rmap_append <unwind_rmap_L_sn *)
83     <structure_append <structure_A_sn <structure_append <structure_L_sn
84     <depth_append <depth_L_sn <depth_structure <depth_structure
85     @fsubst_eq_repl [ // ]
86     @(subset_eq_trans … (unwind_iref …))
87
88     elim Hb -Hb #Hb #H0 <H0 -H0 <nrplus_zero_dx <nplus_zero_dx <Hn
89     @(subset_eq_canc_sn … (lift_term_eq_repl_dx …))
90     [ @unwind_grafted_S /2 width=2 by ex_intro/ | skip ]
91
92 (*
93     @(subset_eq_canc_sn … (unwind_term_eq_repl_dx …))
94     [ @unwind_grafted_S /2 width=2 by ex_intro/ | skip ]
95
96     @(subset_eq_trans … (unwind_term_after …))
97     @(subset_eq_canc_dx … (unwind_term_after …))
98     @unwind_term_eq_repl_sn -t1
99     @(stream_eq_trans … (tr_compose_uni_dx …))
100     lapply (Hn (𝐢)) -Hn >tr_id_unfold #Hn
101     lapply (pippo … b … Hn) -Hn #Hn
102     @tr_compose_eq_repl
103     [ <unwind_rmap_pap_le //
104       <Hn <nrplus_inj_sn //
105     |
106     ]
107 *)
108   | //
109   | /2 width=2 by ex_intro/
110   | //
111   ]
112 ]
113
114 (*
115 Hn : ↑❘q❘ = ↑[p●𝗔◗b●𝗟◗q]𝐢@❨n❩
116 ---------------------------
117 ↑[𝐮❨↑❘q❘+❘b❘❩] ↑[↑[p]𝐢] t ⇔ ↑[𝐮❨↑[p●𝗔◗b●𝗟◗q]𝐢@❨n+❘b❘❩❩] t
118 *)