]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/etc/unwind1/unwind_update.etc
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / etc / unwind1 / unwind_update.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/unwind1/unwind_eq.ma".
16 include "delayed_updating/syntax/path_height.ma".
17 include "delayed_updating/syntax/path_depth.ma".
18 include "ground/lib/stream_eq_eq.ma".
19
20 (* UNWIND FOR PATH *********************************************************)
21 (* COMMMENT
22 (* Constructions with update ***********************************************)
23
24 lemma unwind_rmap_pap_le (f1) (f2) (p) (m:pnat) (l:nat):
25       ninj (m+⧣p+l) = ❘p❘ →
26       (▼[p]f1)@⧣❨m❩ = (▼[p]f2)@⧣❨m❩.
27 #f1 #f2 #p @(list_ind_rcons … p) -p
28 [ #m #l <depth_empty #H0 destruct
29 | #p * [ #n ] #IH #m #l
30   [ <update_d_dx <depth_d_dx <unwind_rmap_pap_d_dx <unwind_rmap_pap_d_dx
31     <nplus_comm <nrplus_inj_sn <nrplus_inj_dx <nrplus_pplus_assoc
32     #H0 <(IH … l) -IH //
33   | /2 width=2 by/
34   | <update_L_dx <depth_L_dx <unwind_rmap_L_dx <unwind_rmap_L_dx
35     cases m -m // #m
36     <nrplus_succ_sn <nrplus_succ_sn >nsucc_inj #H0
37     <tr_pap_push <tr_pap_push
38     <(IH … l) -IH //
39   | /2 width=2 by/
40   | /2 width=2 by/
41   ]
42 ]
43 qed.
44
45 lemma unwind_rmap_pap_gt (f) (p) (m):
46       f@⧣❨m+⧣p❩+❘p❘ = (▼[p]f)@⧣❨m+❘p❘❩.
47 #f #p @(list_ind_rcons … p) -p [ // ]
48 #p * [ #n ] #IH #m
49 [ <update_d_dx <depth_d_dx
50   <nplus_comm <nrplus_inj_sn <nrplus_inj_dx <nrplus_pplus_assoc
51   <unwind_rmap_pap_d_dx >IH -IH //
52 | //
53 | <update_L_dx <depth_L_dx
54   <nrplus_succ_dx <nrplus_succ_dx <unwind_rmap_L_dx <tr_pap_push //
55 | //
56 | //
57 ]
58 qed.
59
60 lemma unwind_rmap_tls_gt (f) (p) (m:pnat):
61       ⇂*[ninj (m+⧣p)]f ≗ ⇂*[ninj (m+❘p❘)]▼[p]f.
62 #f #p @(list_ind_rcons … p) -p [ // ]
63 #p * [ #n ] #IH #m
64 [ <update_d_dx <depth_d_dx
65   <nplus_comm <nrplus_inj_sn <nrplus_inj_dx <nrplus_pplus_assoc
66   @(stream_eq_trans … (unwind_rmap_tls_d_dx …))
67   @(stream_eq_canc_dx … (IH …)) -IH //
68 | //
69 | <update_L_dx <depth_L_dx
70   <nrplus_succ_dx >nsucc_inj //
71 | //
72 | //
73 ]
74 qed.
75
76 lemma unwind_rmap_tls_eq (f) (p):
77       ⇂*[⧣p]f ≗ ⇂*[▼❘p❘]▼[p]⫯f.
78 (*
79 #f #p @(list_ind_rcons … p) -p //
80 #p * [ #n ] #IH //
81 <update_d_dx <depth_d_dx <unwind_rmap_d_dx
82 @(stream_eq_trans … (tr_tls_compose_uni_dx …))
83 *)
84 *)