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 "delayed_updating/substitution/lift_eq.ma".
16 include "delayed_updating/syntax/path_structure.ma".
17 include "delayed_updating/syntax/path_proper.ma".
18 include "ground/xoa/ex_4_2.ma".
20 (* LIFT FOR PATH ***********************************************************)
22 (* Basic constructions with structure **************************************)
24 lemma structure_lift (p) (f):
26 #p @(path_ind_lift … p) -p // #p #IH #f
30 lemma lift_structure (p) (f):
32 #p @(path_ind_lift … p) -p //
35 (* Destructions with structure **********************************************)
37 lemma lift_des_structure (q) (p) (f):
41 (* Constructions with proper condition for path *****************************)
43 lemma lift_append_proper_dx (p2) (p1) (f): p2 ϵ 𝐏 →
44 (⊗p1)●(↑[↑[p1]f]p2) = ↑[f](p1●p2).
45 #p2 #p1 @(path_ind_lift … p1) -p1 //
46 [ #n | #n #l #p1 |*: #p1 ] #IH #f #Hp2
47 [ elim (ppc_inv_lcons … Hp2) -Hp2 #l #q #H destruct //
48 | <lift_path_d_lcons_sn <IH //
49 | <lift_path_m_sn <IH //
50 | <lift_path_L_sn <IH //
51 | <lift_path_A_sn <IH //
52 | <lift_path_S_sn <IH //
56 (* Advanced constructions with structure ************************************)
58 lemma lift_d_empty_dx (n) (p) (f):
59 (⊗p)◖𝗱((↑[p]f)@❨n❩) = ↑[f](p◖𝗱n).
60 #n #p #f <lift_append_proper_dx //
63 lemma lift_m_dx (p) (f):
65 #p #f <lift_append_proper_dx //
68 lemma lift_L_dx (p) (f):
70 #p #f <lift_append_proper_dx //
73 lemma lift_A_dx (p) (f):
75 #p #f <lift_append_proper_dx //
78 lemma lift_S_dx (p) (f):
80 #p #f <lift_append_proper_dx //
83 lemma lift_root (f) (p):
84 ∃∃r. 𝐞 = ⊗r & ⊗p●r = ↑[f]p.
85 #f #p @(list_ind_rcons … p) -p
86 [ /2 width=3 by ex2_intro/
87 | #p * [ #n ] /2 width=3 by ex2_intro/
91 (* Advanced inversions with proj_path ***************************************)
93 lemma lift_path_inv_d_sn (k) (q) (p) (f):
95 ∃∃r,h. 𝐞 = ⊗r & (↑[r]f)@❨h❩ = k & 𝐞 = q & r◖𝗱h = p.
96 #k #q #p @(path_ind_lift … p) -p
97 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
98 [ <lift_path_empty #H destruct
99 | <lift_path_d_empty_sn #H destruct -IH
100 /2 width=5 by ex4_2_intro/
101 | <lift_path_d_lcons_sn #H
102 elim (IH … H) -IH -H #r #h #Hr #Hh #Hq #Hp destruct
103 /2 width=5 by ex4_2_intro/
105 elim (IH … H) -IH -H #r #h #Hr #Hh #Hq #Hp destruct
106 /2 width=5 by ex4_2_intro/
107 | <lift_path_L_sn #H destruct
108 | <lift_path_A_sn #H destruct
109 | <lift_path_S_sn #H destruct
113 lemma lift_path_inv_m_sn (q) (p) (f):
115 #q #p @(path_ind_lift … p) -p
116 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
117 [ <lift_path_empty #H destruct
118 | <lift_path_d_empty_sn #H destruct
119 | <lift_path_d_lcons_sn #H /2 width=2 by/
120 | <lift_path_m_sn #H /2 width=2 by/
121 | <lift_path_L_sn #H destruct
122 | <lift_path_A_sn #H destruct
123 | <lift_path_S_sn #H destruct
127 lemma lift_path_inv_L_sn (q) (p) (f):
129 ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[⫯↑[r1]f]r2 & r1●𝗟◗r2 = p.
130 #q #p @(path_ind_lift … p) -p
131 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
132 [ <lift_path_empty #H destruct
133 | <lift_path_d_empty_sn #H destruct
134 | <lift_path_d_lcons_sn #H
135 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
136 /2 width=5 by ex3_2_intro/
138 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
139 /2 width=5 by ex3_2_intro/
140 | <lift_path_L_sn #H destruct -IH
141 /2 width=5 by ex3_2_intro/
142 | <lift_path_A_sn #H destruct
143 | <lift_path_S_sn #H destruct
147 lemma lift_path_inv_A_sn (q) (p) (f):
149 ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[↑[r1]f]r2 & r1●𝗔◗r2 = p.
150 #q #p @(path_ind_lift … p) -p
151 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
152 [ <lift_path_empty #H destruct
153 | <lift_path_d_empty_sn #H destruct
154 | <lift_path_d_lcons_sn #H
155 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
156 /2 width=5 by ex3_2_intro/
158 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
159 /2 width=5 by ex3_2_intro/
160 | <lift_path_L_sn #H destruct
161 | <lift_path_A_sn #H destruct -IH
162 /2 width=5 by ex3_2_intro/
163 | <lift_path_S_sn #H destruct
167 lemma lift_path_inv_S_sn (q) (p) (f):
169 ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[↑[r1]f]r2 & r1●𝗦◗r2 = p.
170 #q #p @(path_ind_lift … p) -p
171 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
172 [ <lift_path_empty #H destruct
173 | <lift_path_d_empty_sn #H destruct
174 | <lift_path_d_lcons_sn #H
175 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
176 /2 width=5 by ex3_2_intro/
178 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
179 /2 width=5 by ex3_2_intro/| <lift_path_L_sn #H destruct
180 | <lift_path_A_sn #H destruct
181 | <lift_path_S_sn #H destruct -IH
182 /2 width=5 by ex3_2_intro/
186 (* Inversions with proper condition for path ********************************)
188 lemma lift_inv_append_proper_dx (q2) (q1) (p) (f):
189 q2 ϵ 𝐏 → q1●q2 = ↑[f]p →
190 ∃∃p1,p2. ⊗p1 = q1 & ↑[↑[p1]f]p2 = q2 & p1●p2 = p.
192 [ #p #f #Hq2 <list_append_empty_sn #H destruct
193 /2 width=5 by ex3_2_intro/
194 | * [ #n1 ] #q1 #IH #p #f #Hq2 <list_append_lcons_sn #H
195 [ elim (lift_path_inv_d_sn … H) -H #r1 #m1 #_ #_ #H0 #_ -IH
196 elim (eq_inv_list_empty_append … H0) -H0 #_ #H0 destruct
198 | elim (lift_path_inv_m_sn … H)
199 | elim (lift_path_inv_L_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
200 elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
201 @(ex3_2_intro … (r1●𝗟◗p1)) //
202 <structure_append <Hr1 -Hr1 //
203 | elim (lift_path_inv_A_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
204 elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
205 @(ex3_2_intro … (r1●𝗔◗p1)) //
206 <structure_append <Hr1 -Hr1 //
207 | elim (lift_path_inv_S_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
208 elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
209 @(ex3_2_intro … (r1●𝗦◗p1)) //
210 <structure_append <Hr1 -Hr1 //