]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / substitution / lift.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/notation/functions/uparrow_4.ma".
16 include "delayed_updating/notation/functions/uparrow_2.ma".
17 include "delayed_updating/syntax/path.ma".
18 include "ground/relocation/tr_id_pap.ma".
19
20 (* LIFT FOR PATH ************************************************************)
21
22 definition lift_continuation (A:Type[0]) ≝
23            tr_map → path → A.
24
25 rec definition lift_gen (A:Type[0]) (k:lift_continuation A) (f) (p) on p ≝
26 match p with
27 [ list_empty     ⇒ k f (𝐞)
28 | list_lcons l q ⇒
29   match l with
30   [ label_d n ⇒ lift_gen (A) (λg,p. k g (𝗱(f@⧣❨n❩)◗p)) (𝐢) q
31   | label_m   ⇒ lift_gen (A) (λg,p. k g (𝗺◗p)) f q
32   | label_L   ⇒ lift_gen (A) (λg,p. k g (𝗟◗p)) (⫯f) q
33   | label_A   ⇒ lift_gen (A) (λg,p. k g (𝗔◗p)) f q
34   | label_S   ⇒ lift_gen (A) (λg,p. k g (𝗦◗p)) f q
35   ]
36 ].
37
38 interpretation
39   "lift (gneric)"
40   'UpArrow A k f p = (lift_gen A k f p).
41
42 definition proj_path: lift_continuation … ≝
43            λf,p.p.
44
45 definition proj_rmap: lift_continuation … ≝
46            λf,p.f.
47
48 interpretation
49   "lift (path)"
50   'UpArrow f p = (lift_gen ? proj_path f p).
51
52 interpretation
53   "lift (relocation map)"
54   'UpArrow p f = (lift_gen ? proj_rmap f p).
55
56 (* Basic constructions ******************************************************)
57
58 lemma lift_empty (A) (k) (f):
59       k f (𝐞) = ↑{A}❨k, f, 𝐞❩.
60 // qed.
61
62 lemma lift_d_sn (A) (k) (p) (n) (f):
63       ↑❨(λg,p. k g (𝗱(f@⧣❨n❩)◗p)), 𝐢, p❩ = ↑{A}❨k, f, 𝗱n◗p❩.
64 // qed.
65
66 lemma lift_m_sn (A) (k) (p) (f):
67       ↑❨(λg,p. k g (𝗺◗p)), f, p❩ = ↑{A}❨k, f, 𝗺◗p❩.
68 // qed.
69
70 lemma lift_L_sn (A) (k) (p) (f):
71       ↑❨(λg,p. k g (𝗟◗p)), ⫯f, p❩ = ↑{A}❨k, f, 𝗟◗p❩.
72 // qed.
73
74 lemma lift_A_sn (A) (k) (p) (f):
75       ↑❨(λg,p. k g (𝗔◗p)), f, p❩ = ↑{A}❨k, f, 𝗔◗p❩.
76 // qed.
77
78 lemma lift_S_sn (A) (k) (p) (f):
79       ↑❨(λg,p. k g (𝗦◗p)), f, p❩ = ↑{A}❨k, f, 𝗦◗p❩.
80 // qed.
81
82 (* Basic constructions with proj_path ***************************************)
83
84 lemma lift_path_empty (f):
85       (𝐞) = ↑[f]𝐞.
86 // qed.
87
88 (* Basic constructions with proj_rmap ***************************************)
89
90 lemma lift_rmap_empty (f):
91       f = ↑[𝐞]f.
92 // qed.
93
94 lemma lift_rmap_d_sn (f) (p) (n):
95       ↑[p]𝐢 = ↑[𝗱n◗p]f.
96 // qed.
97
98 lemma lift_rmap_m_sn (f) (p):
99       ↑[p]f = ↑[𝗺◗p]f.
100 // qed.
101
102 lemma lift_rmap_L_sn (f) (p):
103       ↑[p](⫯f) = ↑[𝗟◗p]f.
104 // qed.
105
106 lemma lift_rmap_A_sn (f) (p):
107       ↑[p]f = ↑[𝗔◗p]f.
108 // qed.
109
110 lemma lift_rmap_S_sn (f) (p):
111       ↑[p]f = ↑[𝗦◗p]f.
112 // qed.
113
114 (* Advanced cinstructionswith proj_rmap and tr_id ***************************)
115
116 lemma lift_rmap_id (p):
117       (𝐢) = ↑[p]𝐢.
118 #p elim p -p //
119 * [ #n ] #p #IH //
120 qed.
121
122 (* Advanced constructions with proj_rmap and path_append ********************)
123
124 lemma lift_rmap_append (p2) (p1) (f):
125       ↑[p2]↑[p1]f = ↑[p1●p2]f.
126 #p2 #p1 elim p1 -p1 // * [ #n ] #p1 #IH #f //
127 [ <lift_rmap_d_sn <lift_rmap_d_sn //
128 | <lift_rmap_m_sn <lift_rmap_m_sn //
129 | <lift_rmap_A_sn <lift_rmap_A_sn //
130 | <lift_rmap_S_sn <lift_rmap_S_sn //
131 ]
132 qed.
133
134 (* Advanced constructions with proj_rmap and path_rcons *********************)
135
136 lemma lift_rmap_d_dx (f) (p) (n):
137       (𝐢) = ↑[p◖𝗱n]f.
138 // qed.
139
140 lemma lift_rmap_m_dx (f) (p):
141       ↑[p]f = ↑[p◖𝗺]f.
142 // qed.
143
144 lemma lift_rmap_L_dx (f) (p):
145       (⫯↑[p]f) = ↑[p◖𝗟]f.
146 // qed.
147
148 lemma lift_rmap_A_dx (f) (p):
149       ↑[p]f = ↑[p◖𝗔]f.
150 // qed.
151
152 lemma lift_rmap_S_dx (f) (p):
153       ↑[p]f = ↑[p◖𝗦]f.
154 // qed.
155
156 lemma lift_rmap_pap_d_dx (f) (p) (n) (m):
157       m = ↑[p◖𝗱n]f@⧣❨m❩.
158 // qed.