]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_rmap_head.ma
update in delayed updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / substitution / lift_rmap_head.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/substitution/lift_eq.ma".
16 include "delayed_updating/syntax/path_head.ma".
17 include "delayed_updating/syntax/path_reverse.ma".
18 include "ground/lib/stream_eq_eq.ma".
19
20 (* LIFT MAP FOR PATH ********************************************************)
21
22 (* Constructions with path_head *********************************************)
23
24 lemma tls_plus_lift_rmap_reverse_closed (f) (q) (p) (n) (k):
25       q = (↳[n]q)●p →
26       ⇂*[k]↑[pᴿ]f ≗ ⇂*[n+k]↑[qᴿ]f.
27 #f #q elim q -q
28 [ #p #n #k #Hp
29   elim (eq_inv_list_empty_append … Hp) -Hp #Hn #H0 destruct
30   <path_head_empty in Hn; #Hn
31   <(eq_inv_empty_labels … Hn) -n //
32 | #l #q #IH #p #n @(nat_ind_succ … n) -n //
33   #n #_ #k cases l [ #m ]
34   [ <path_head_d_sn <list_append_lcons_sn #Hp
35     elim (eq_inv_list_lcons_bi ????? Hp) -Hp #_ #Hp <nrplus_inj_sn
36     <reverse_lcons
37     @(stream_eq_trans … (tls_lift_rmap_d_dx …))
38     >nrplus_inj_dx >nrplus_inj_sn >nrplus_inj_sn <nplus_plus_comm_23
39     >nsucc_unfold /2 width=1 by/
40   | <path_head_m_sn <list_append_lcons_sn #Hp
41     elim (eq_inv_list_lcons_bi ????? Hp) -Hp #_ #Hp
42     <reverse_lcons <lift_rmap_m_dx /2 width=1 by/
43   | <path_head_L_sn <list_append_lcons_sn #Hp
44     elim (eq_inv_list_lcons_bi ????? Hp) -Hp #_ #Hp
45     <reverse_lcons <lift_rmap_L_dx <nplus_succ_sn /2 width=1 by/
46   | <path_head_A_sn <list_append_lcons_sn #Hp
47     elim (eq_inv_list_lcons_bi ????? Hp) -Hp #_ #Hp
48     <reverse_lcons <lift_rmap_A_dx /2 width=2 by/
49   | <path_head_S_sn <list_append_lcons_sn #Hp
50     elim (eq_inv_list_lcons_bi ????? Hp) -Hp #_ #Hp
51     <reverse_lcons <lift_rmap_S_dx /2 width=2 by/
52   ]
53 ]
54 qed-.
55
56 lemma tls_lift_rmap_append_closed (f) (p) (q) (n):
57       qᴿ = ↳[n](p●q)ᴿ →
58       ↑[p]f ≗ ⇂*[n]↑[p●q]f.
59 #f #p #q #n #H0
60 >(reverse_reverse p) >(reverse_reverse q)
61 /2 width=1 by tls_plus_lift_rmap_reverse_closed/
62 qed.