]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_rmap_head.ma
66209d837bd869cca939b8b7e94ec01075614950
[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_gen_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) (n) (k):
25       q = ↳[n]q →
26       ⇂*[k]f ≗ ⇂*[n+k]↑[qᴿ]f.
27 #f #q elim q -q
28 [ #n #k #Hq
29   <(eq_inv_path_empty_head … Hq) -n //
30 | #l #q #IH #n @(nat_ind_succ … n) -n //
31   #n #_ #k cases l [ #m ]
32   [ <path_head_d_sn #Hq
33     elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hp <nrplus_inj_sn
34     <reverse_lcons
35     @(stream_eq_trans … (tls_lift_rmap_d_dx …))
36     >nrplus_inj_dx >nrplus_inj_sn >nrplus_inj_sn <nplus_plus_comm_23
37     >nsucc_unfold /2 width=1 by/
38   | <path_head_m_sn #Hq
39     elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
40     <reverse_lcons <lift_rmap_m_dx /2 width=1 by/
41   | <path_head_L_sn #Hq
42     elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
43     <reverse_lcons <lift_rmap_L_dx <nplus_succ_sn /2 width=1 by/
44   | <path_head_A_sn #Hq
45     elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
46     <reverse_lcons <lift_rmap_A_dx /2 width=2 by/
47   | <path_head_S_sn #Hq
48     elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
49     <reverse_lcons <lift_rmap_S_dx /2 width=2 by/
50   ]
51 ]
52 qed-.
53
54 lemma tls_lift_rmap_closed (f) (q) (n):
55       qᴿ = ↳[n](qᴿ) →
56       f ≗ ⇂*[n]↑[q]f.
57 #f #q #n #H0
58 >(reverse_reverse q)
59 /2 width=1 by tls_plus_lift_rmap_reverse_closed/
60 qed.