]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_rmap.ma
partial commit in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / unwind / unwind2_rmap.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/syntax/path.ma".
16 include "delayed_updating/notation/functions/black_righttriangle_2.ma".
17 include "delayed_updating/notation/functions/black_righttriangle_1.ma".
18 include "ground/relocation/tr_uni.ma".
19 include "ground/relocation/tr_compose.ma".
20
21 (* UNWIND MAP FOR PATH ******************************************************)
22
23 rec definition unwind2_rmap (f) (p) on p: tr_map ≝
24 match p with
25 [ list_empty     ⇒ f
26 | list_lcons l q ⇒
27   match l with
28   [ label_d n ⇒ (unwind2_rmap f q)∘𝐮❨n❩
29   | label_m   ⇒ unwind2_rmap f q
30   | label_L   ⇒ ⫯(unwind2_rmap f q)
31   | label_A   ⇒ unwind2_rmap f q
32   | label_S   ⇒ unwind2_rmap f q
33   ]
34 ].
35
36 interpretation
37   "tailed unwind map (reversed path)"
38   'BlackRightTriangle f p = (unwind2_rmap f p).
39
40 interpretation
41   "unwind map (reversed path)"
42   'BlackRightTriangle p = (unwind2_rmap tr_id p).
43
44 (* Basic constructions ******************************************************)
45
46 lemma unwind2_rmap_empty (f):
47       f = ▶[f]𝐞.
48 // qed.
49
50 lemma unwind2_rmap_d_sn (f) (p) (n:pnat):
51       (▶[f]p∘𝐮❨n❩) = ▶[f](𝗱n◗p).
52 // qed.
53
54 lemma unwind2_rmap_m_sn (f) (p):
55       ▶[f]p = ▶[f](𝗺◗p).
56 // qed.
57
58 lemma unwind2_rmap_L_sn (f) (p):
59       (⫯▶[f]p) = ▶[f](𝗟◗p).
60 // qed.
61
62 lemma unwind2_rmap_A_sn (f) (p):
63       ▶[f]p = ▶[f](𝗔◗p).
64 // qed.
65
66 lemma unwind2_rmap_S_sn (f) (p):
67       ▶[f]p = ▶[f](𝗦◗p).
68 // qed.
69
70 (* Constructions with list_append *******************************************)
71
72 lemma unwind2_rmap_append (f) (p1) (p2):
73       ▶[▶[f]p2]p1 = ▶[f](p1●p2).
74 #f #p1 elim p1 -p1 //
75 * [ #n ] #p1 #IH #p2 //
76 [ <unwind2_rmap_m_sn <unwind2_rmap_m_sn //
77 | <unwind2_rmap_L_sn <unwind2_rmap_L_sn //
78 | <unwind2_rmap_A_sn <unwind2_rmap_A_sn //
79 | <unwind2_rmap_S_sn <unwind2_rmap_S_sn //
80 ]
81 qed.
82
83 (* Constructions with list_rcons ********************************************)
84
85 lemma unwind2_rmap_d_dx (f) (p) (n:pnat):
86       ▶[f∘𝐮❨n❩]p = ▶[f](p◖𝗱n).
87 // qed.
88
89 lemma unwind2_rmap_m_dx (f) (p):
90       ▶[f]p = ▶[f](p◖𝗺).
91 // qed.
92
93 lemma unwind2_rmap_L_dx (f) (p):
94       ▶[⫯f]p = ▶[f](p◖𝗟).
95 // qed.
96
97 lemma unwind2_rmap_A_dx (f) (p):
98       ▶[f]p = ▶[f](p◖𝗔).
99 // qed.
100
101 lemma unwind2_rmap_S_dx (f) (p):
102       ▶[f]p = ▶[f](p◖𝗦).
103 // qed.