]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift.ma
b1ed7662361b232de071f08b4972c6fe1cb3247d
[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∘𝐮❨n❩)
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∘𝐮❨ninj n❩❩ = ↑{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.
84
85 (* Basic constructions with proj_path ***************************************)
86
87 lemma lift_path_d_empty_sn (f) (n):
88       𝗱(f@❨n❩)◗𝐞 = ↑[f](𝗱n◗𝐞).
89 // qed.
90
91 lemma lift_path_d_lcons_sn (f) (p) (l) (n):
92       ↑[f∘𝐮❨ninj n❩](l◗p) = ↑[f](𝗱n◗l◗p).
93 // qed.
94
95 (* Basic constructions with proj_rmap ***************************************)
96
97 lemma lift_rmap_d_sn (f) (p) (n):
98       ↑[p](f∘𝐮❨ninj n❩) = ↑[𝗱n◗p]f.
99 #f * // qed.
100
101 lemma lift_rmap_L_sn (f) (p):
102       ↑[p](⫯f) = ↑[𝗟◗p]f.
103 // qed.
104
105 lemma lift_rmap_A_sn (f) (p):
106       ↑[p]f = ↑[𝗔◗p]f.
107 // qed.
108
109 lemma lift_rmap_S_sn (f) (p):
110       ↑[p]f = ↑[𝗦◗p]f.
111 // qed.
112
113 (* Advanced constructions with proj_rmap and path_append ********************)
114
115 lemma lift_rmap_append (p2) (p1) (f):
116       ↑[p2]↑[p1]f = ↑[p1●p2]f.
117 #p2 #p1 elim p1 -p1 // * [ #n ] #p1 #IH #f //
118 [ <lift_rmap_A_sn <lift_rmap_A_sn //
119 | <lift_rmap_S_sn <lift_rmap_S_sn //
120 ]
121 qed.
122
123 (* Advanced eliminations with path ******************************************)
124
125 lemma path_ind_lift (Q:predicate …):
126       Q (𝐞) →
127       (∀n. Q (𝐞) → Q (𝗱n◗𝐞)) →
128       (∀n,l,p. Q (l◗p) → Q (𝗱n◗l◗p)) →
129       (∀p. Q p → Q (𝗟◗p)) →
130       (∀p. Q p → Q (𝗔◗p)) →
131       (∀p. Q p → Q (𝗦◗p)) →
132       ∀p. Q p.
133 #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #p
134 elim p -p [| * [ #n * ] ]
135 /2 width=1 by/
136 qed-.