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