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_labels.ma".
16 include "delayed_updating/unwind/xap.ma".
17 include "delayed_updating/syntax/path_head_depth.ma".
18 include "ground/arith/nat_le_plus.ma".
20 (* UNWIND MAP FOR PATH ******************************************************)
22 (* Constructions with path_head *********************************************)
24 lemma unwind2_rmap_head_xap_closed (f) (p) (n) (k):
25 (∃q. p = (↳[n]p)●q) → k ≤ n →
26 (▶[f]p)@❨k❩ = (▶[f]↳[n]p)@❨k❩.
29 elim (eq_inv_list_empty_append … Hq) -Hq * #_ //
30 | #l #p #IH #n @(nat_ind_succ … n) -n
31 [ #k #_ #Hk <(nle_inv_zero_dx … Hk) -k -IH
32 <path_head_zero <unwind2_rmap_empty //
33 | #n #_ #k cases l [ #m ] * #q
34 [ <path_head_d_sn <list_append_lcons_sn #Hq #Hk
35 elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
36 <unwind2_rmap_d_sn <unwind2_rmap_d_sn
37 <tr_compose_xap <tr_compose_xap
38 @IH [ /2 width=2 by ex_intro/ ] (**) (* auto too slow *)
39 @nle_trans [| @tr_uni_xap ]
40 /2 width=1 by nle_plus_bi_dx/
41 | <path_head_m_sn <list_append_lcons_sn #Hq #Hk
42 elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
43 <unwind2_rmap_m_sn <unwind2_rmap_m_sn
44 /3 width=2 by ex_intro/
45 | <path_head_L_sn <list_append_lcons_sn #Hq
46 @(nat_ind_succ … k) -k // #k #_ #Hk
47 lapply (nle_inv_succ_bi … Hk) -Hk #Hk
48 elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
49 <unwind2_rmap_L_sn <unwind2_rmap_L_sn
50 <tr_xap_push <tr_xap_push
51 /4 width=2 by ex_intro, eq_f/
52 | <path_head_A_sn <list_append_lcons_sn #Hq #Hk
53 elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
54 <unwind2_rmap_A_sn <unwind2_rmap_A_sn
55 /3 width=2 by ex_intro/
56 | <path_head_S_sn <list_append_lcons_sn #Hq #Hk
57 elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
58 <unwind2_rmap_S_sn <unwind2_rmap_S_sn
59 /3 width=2 by ex_intro/
65 lemma unwind2_rmap_head_xap (f) (p) (n):
66 n + ♯(↳[n]p) = (▶[f]↳[n]p)@❨n❩.
68 [ #n <path_head_empty <unwind2_rmap_labels_L <height_labels_L
70 | #l #p #IH #n @(nat_ind_succ … n) -n //
72 [ <unwind2_rmap_d_sn <path_head_d_sn <height_d_sn
73 <nplus_assoc >IH -IH <tr_compose_xap <tr_uni_xap_succ //
74 | <unwind2_rmap_m_sn <path_head_m_sn <height_m_sn //
75 | <unwind2_rmap_L_sn <path_head_L_sn <height_L_sn
76 <tr_xap_push <npred_succ //
77 | <unwind2_rmap_A_sn <path_head_A_sn <height_A_sn //
78 | <unwind2_rmap_S_sn <path_head_S_sn <height_S_sn //