]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift.ma
a396beb46df884ea68ea7e59845d8356500f1af1
[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 "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".
20
21 (* LIFT FOR PATH ***********************************************************)
22
23 definition lift_continuation (A:Type[0]) ≝
24            path → tr_map → A.
25
26 (* Note: inner numeric labels are not liftable, so they are removed *)
27 rec definition lift_gen (A:Type[0]) (k:lift_continuation A) (p) (f) on p ≝
28 match p with
29 [ list_empty     ⇒ k 𝐞 f
30 | list_lcons l q ⇒
31   match l with
32   [ label_node_d n ⇒
33     match q with
34     [ list_empty     ⇒ lift_gen (A) (λp. k (𝗱❨f@❨n❩❩◗p)) q f
35     | list_lcons _ _ ⇒ lift_gen (A) k q (f∘𝐮❨n❩)
36     ]
37   | label_edge_L   ⇒ lift_gen (A) (λp. k (𝗟◗p)) q (⫯f)
38   | label_edge_A   ⇒ lift_gen (A) (λp. k (𝗔◗p)) q f
39   | label_edge_S   ⇒ lift_gen (A) (λp. k (𝗦◗p)) q f
40   ]
41 ].
42
43 interpretation
44   "lift (gneric)"
45   'UpArrow A k p f = (lift_gen A k p f).
46
47 definition proj_path (p:path) (f:tr_map) ≝ p.
48
49 definition proj_rmap (p:path) (f:tr_map) ≝ f.
50
51 interpretation
52   "lift (path)"
53   'UpArrow f p = (lift_gen ? proj_path p f).
54
55 interpretation
56   "lift (relocation map)"
57   'UpArrow p f = (lift_gen ? proj_rmap p f).
58
59 (* Basic constructions ******************************************************)
60
61 lemma lift_empty (A) (k) (f):
62       k 𝐞 f = ↑{A}❨k, 𝐞, f❩.
63 // qed.
64
65 lemma lift_d_empty_sn (A) (k) (n) (f):
66       ↑❨(λp. k (𝗱❨f@❨n❩❩◗p)), 𝐞, f❩ = ↑{A}❨k, 𝗱❨n❩◗𝐞, f❩.
67 // qed.
68
69 lemma lift_d_lcons_sn (A) (k) (p) (l) (n) (f):
70       ↑❨k, l◗p, f∘𝐮❨ninj n❩❩ = ↑{A}❨k, 𝗱❨n❩◗l◗p, f❩.
71 // qed.
72
73 lemma lift_L_sn (A) (k) (p) (f):
74       ↑❨(λp. k (𝗟◗p)), p, ⫯f❩ = ↑{A}❨k, 𝗟◗p, f❩.
75 // qed.
76
77 lemma lift_A_sn (A) (k) (p) (f):
78       ↑❨(λp. k (𝗔◗p)), p, f❩ = ↑{A}❨k, 𝗔◗p, f❩.
79 // qed.
80
81 lemma lift_S_sn (A) (k) (p) (f):
82       ↑❨(λp. k (𝗦◗p)), p, f❩ = ↑{A}❨k, 𝗦◗p, f❩.
83 // qed.