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 "ground/relocation/tr_compose.ma".
16 include "ground/relocation/tr_uni.ma".
17 include "delayed_updating/syntax/path.ma".
18 include "delayed_updating/notation/functions/uparrow_4.ma".
19 include "delayed_updating/notation/functions/uparrow_2.ma".
21 (* LIFT FOR PATH ***********************************************************)
23 definition lift_continuation (A:Type[0]) ≝
26 (* Note: inner numeric labels are not liftable, so they are removed *)
27 rec definition lift_gen (A:Type[0]) (k:lift_continuation A) (f) (p) on p ≝
29 [ list_empty ⇒ k f (𝐞)
34 [ list_empty ⇒ lift_gen (A) (λg,p. k g (𝗱(f@❨n❩)◗p)) (f∘𝐮❨n❩) q
35 | list_lcons _ _ ⇒ lift_gen (A) k (f∘𝐮❨n❩) q
37 | label_m ⇒ lift_gen (A) k f q
38 | label_L ⇒ lift_gen (A) (λg,p. k g (𝗟◗p)) (⫯f) q
39 | label_A ⇒ lift_gen (A) (λg,p. k g (𝗔◗p)) f q
40 | label_S ⇒ lift_gen (A) (λg,p. k g (𝗦◗p)) f q
46 'UpArrow A k f p = (lift_gen A k f p).
48 definition proj_path: lift_continuation … ≝
51 definition proj_rmap: lift_continuation … ≝
56 'UpArrow f p = (lift_gen ? proj_path f p).
59 "lift (relocation map)"
60 'UpArrow p f = (lift_gen ? proj_rmap f p).
62 (* Basic constructions ******************************************************)
64 lemma lift_empty (A) (k) (f):
65 k f (𝐞) = ↑{A}❨k, f, 𝐞❩.
68 lemma lift_d_empty_sn (A) (k) (n) (f):
69 ↑❨(λg,p. k g (𝗱(f@❨n❩)◗p)), f∘𝐮❨ninj n❩, 𝐞❩ = ↑{A}❨k, f, 𝗱n◗𝐞❩.
72 lemma lift_d_lcons_sn (A) (k) (p) (l) (n) (f):
73 ↑❨k, f∘𝐮❨ninj n❩, l◗p❩ = ↑{A}❨k, f, 𝗱n◗l◗p❩.
76 lemma lift_m_sn (A) (k) (p) (f):
77 ↑❨k, f, p❩ = ↑{A}❨k, f, 𝗺◗p❩.
80 lemma lift_L_sn (A) (k) (p) (f):
81 ↑❨(λg,p. k g (𝗟◗p)), ⫯f, p❩ = ↑{A}❨k, f, 𝗟◗p❩.
84 lemma lift_A_sn (A) (k) (p) (f):
85 ↑❨(λg,p. k g (𝗔◗p)), f, p❩ = ↑{A}❨k, f, 𝗔◗p❩.
88 lemma lift_S_sn (A) (k) (p) (f):
89 ↑❨(λg,p. k g (𝗦◗p)), f, p❩ = ↑{A}❨k, f, 𝗦◗p❩.
92 (* Basic constructions with proj_path ***************************************)
94 lemma lift_path_empty (f):
98 lemma lift_path_d_empty_sn (f) (n):
99 𝗱(f@❨n❩)◗𝐞 = ↑[f](𝗱n◗𝐞).
102 lemma lift_path_d_lcons_sn (f) (p) (l) (n):
103 ↑[f∘𝐮❨ninj n❩](l◗p) = ↑[f](𝗱n◗l◗p).
106 lemma lift_path_m_sn (f) (p):
110 (* Basic constructions with proj_rmap ***************************************)
112 lemma lift_rmap_d_sn (f) (p) (n):
113 ↑[p](f∘𝐮❨ninj n❩) = ↑[𝗱n◗p]f.
116 lemma lift_rmap_m_sn (f) (p):
120 lemma lift_rmap_L_sn (f) (p):
124 lemma lift_rmap_A_sn (f) (p):
128 lemma lift_rmap_S_sn (f) (p):
132 (* Advanced constructions with proj_rmap and path_append ********************)
134 lemma lift_rmap_append (p2) (p1) (f):
135 ↑[p2]↑[p1]f = ↑[p1●p2]f.
136 #p2 #p1 elim p1 -p1 // * [ #n ] #p1 #IH #f //
137 [ <lift_rmap_m_sn <lift_rmap_m_sn //
138 | <lift_rmap_A_sn <lift_rmap_A_sn //
139 | <lift_rmap_S_sn <lift_rmap_S_sn //
143 (* Advanced eliminations with path ******************************************)
145 lemma path_ind_lift (Q:predicate …):
147 (∀n. Q (𝐞) → Q (𝗱n◗𝐞)) →
148 (∀n,l,p. Q (l◗p) → Q (𝗱n◗l◗p)) →
149 (∀p. Q p → Q (𝗺◗p)) →
150 (∀p. Q p → Q (𝗟◗p)) →
151 (∀p. Q p → Q (𝗔◗p)) →
152 (∀p. Q p → Q (𝗦◗p)) →
154 #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #p
155 elim p -p [| * [ #n * ] ]