1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
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".
23 (* TAILED UNWIND FOR RELOCATION MAP *****************************************)
25 (* Destructions with cpp ****************************************************)
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
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
44 | <unwind2_rmap_A_dx <unwind2_rmap_A_dx
46 | <unwind2_rmap_S_dx <unwind2_rmap_S_dx
51 lemma unwind2_rmap_append_L_closed_dx_nap (f) (p) (q) (n):
53 ▶[f](𝗟◗q)@§❨n❩ = ▶[f](p●𝗟◗q)@§❨n❩.
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/
61 lemma unwind2_rmap_push_closed_nap (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 //
69 lemma unwind2_rmap_append_closed_nap (f) (p) (q) (n):
71 ♭q = ▶[f](p●𝗟◗q)@§❨n❩.
73 <unwind2_rmap_append_L_closed_dx_nap //
74 /2 width=1 by unwind2_rmap_push_closed_nap/
77 lemma tls_succ_plus_unwind2_rmap_push_closed (f) (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 //
88 lemma tls_succ_unwind2_rmap_append_L_closed_dx (f) (p) (q) (n):
90 ▶[f]p ≗ ⇂*[↑n]▶[f](p●𝗟◗q).
91 /2 width=1 by tls_succ_plus_unwind2_rmap_push_closed/