]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_rmap_closed.ma
update in ground and delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / unwind / unwind2_rmap_closed.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/unwind/unwind2_rmap_eq.ma".
16 include "delayed_updating/syntax/path_closed.ma".
17 include "delayed_updating/syntax/path_depth.ma".
18 include "ground/relocation/xap.ma".
19 include "ground/lib/stream_eq_eq.ma".
20 include "ground/arith/nat_le_plus.ma".
21 include "ground/arith/nat_le_pred.ma".
22
23 (* TAILED UNWIND FOR RELOCATION MAP *****************************************)
24
25 (* Destructions with cpp ****************************************************)
26
27 lemma unwind2_rmap_append_closed_dx_xap_le (f) (p) (q) (n):
28       q ϵ 𝐂❨n❩ → ∀m. m ≤ n →
29       ▶[f]q@❨m❩ = ▶[f](p●q)@❨m❩.
30 #f #p #q #n #Hq elim Hq -q -n
31 [|*: #q #n [ #k ] #_ #IH ] #m #Hm
32 [ <(nle_inv_zero_dx … Hm) -m //
33 | <unwind2_rmap_d_dx <unwind2_rmap_d_dx
34   <tr_compose_xap <tr_compose_xap
35   @IH -IH (**) (* auto too slow *)
36   @nle_trans [| @tr_uni_xap ]
37   /2 width=1 by nle_plus_bi_dx/
38 | <unwind2_rmap_m_dx <unwind2_rmap_m_dx
39   /2 width=2 by/
40 | <unwind2_rmap_L_dx <unwind2_rmap_L_dx
41   elim (nle_inv_succ_dx … Hm) -Hm // * #Hm #H0
42   >H0 -H0 <tr_xap_push <tr_xap_push
43   /3 width=2 by eq_f/
44 | <unwind2_rmap_A_dx <unwind2_rmap_A_dx
45   /2 width=2 by/
46 | <unwind2_rmap_S_dx <unwind2_rmap_S_dx
47   /2 width=2 by/
48 ]
49 qed-.
50
51 lemma unwind2_rmap_append_closed_Lq_dx_nap (f) (p) (q) (n):
52       q ϵ 𝐂❨n❩ →
53       ▶[f](𝗟◗q)@§❨n❩ = ▶[f](p●𝗟◗q)@§❨n❩.
54 #f #p #q #n #Hq
55 lapply (pcc_L_sn … Hq) -Hq #Hq
56 lapply (unwind2_rmap_append_closed_dx_xap_le f p … Hq (↑n) ?) -Hq //
57 <tr_xap_succ_nap <tr_xap_succ_nap #Hq
58 /2 width=1 by eq_inv_nsucc_bi/
59 qed-.
60
61 lemma unwind2_rmap_push_closed_nap (f) (q) (n):
62       q ϵ 𝐂❨n❩ →
63       ♭q = ▶[⫯f]q@§❨n❩.
64 #f #q #n #Hq elim Hq -q -n
65 [|*: #q #n [ #k ] #_ #IH ] //
66 <unwind2_rmap_d_dx <tr_compose_nap //
67 qed-.
68
69 lemma unwind2_rmap_append_closed_Lq_dx_nap_depth (f) (p) (q) (n):
70       q ϵ 𝐂❨n❩ →
71       ♭q = ▶[f](p●𝗟◗q)@§❨n❩.
72 #f #p #q #n #Hq
73 <unwind2_rmap_append_closed_Lq_dx_nap //
74 /2 width=1 by unwind2_rmap_push_closed_nap/
75 qed-.
76
77 lemma tls_succ_plus_unwind2_rmap_push_closed (f) (q) (n):
78       q ϵ 𝐂❨n❩ →
79       ∀m. ⇂*[m]f ≗ ⇂*[↑(m+n)]▶[⫯f]q.
80 #f #q #n #Hq elim Hq -q -n //
81 #q #n [ #k ] #_ #IH #m
82 [ @(stream_eq_trans … (tls_unwind2_rmap_d_dx …))
83   >nrplus_inj_dx >nrplus_inj_sn >nsucc_unfold //
84 | <unwind2_rmap_L_dx <nplus_succ_dx //
85 ]
86 qed-.
87
88 lemma tls_succ_unwind2_rmap_append_closed_Lq_dx (f) (p) (q) (n):
89       q ϵ 𝐂❨n❩ →
90       ▶[f]p ≗ ⇂*[↑n]▶[f](p●𝗟◗q).
91 /2 width=1 by tls_succ_plus_unwind2_rmap_push_closed/
92 qed-.
93
94 lemma unwind2_rmap_append_closed_Lq_dx_nap_plus (f) (p) (q) (m) (n):
95       q ϵ 𝐂❨n❩ →
96       ▶[f]p@❨m❩+♭q = ▶[f](p●𝗟◗q)@§❨m+n❩.
97 #f #p #q #m #n #Hq
98 <tr_nap_plus @eq_f2
99 [ <(tr_xap_eq_repl … (tls_succ_unwind2_rmap_append_closed_Lq_dx …)) //
100 | /2 width=1 by unwind2_rmap_append_closed_Lq_dx_nap_depth/
101 ]
102 qed-.