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".
19 include "ground/xoa/ex_3_2.ma".
21 (* LIFT FOR PATH ***********************************************************)
23 (* Basic constructions with structure **************************************)
25 lemma structure_lift (p) (f):
27 #p @(path_ind_lift … p) -p // #p #IH #f
31 lemma lift_structure (p) (f):
33 #p @(path_ind_lift … p) -p //
36 (* Destructions with structure **********************************************)
38 lemma lift_des_structure (q) (p) (f):
42 (* Constructions with proper condition for path *****************************)
44 lemma lift_append_proper_dx (p2) (p1) (f): Ꝕp2 →
45 (⊗p1)●(↑[↑[p1]f]p2) = ↑[f](p1●p2).
46 #p2 #p1 @(path_ind_lift … p1) -p1 //
47 [ #n | #n #l #p1 |*: #p1 ] #IH #f #Hp2
48 [ elim (ppc_inv_lcons … Hp2) -Hp2 #l #q #H destruct //
49 | <lift_path_d_lcons_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_L_dx (p) (f):
65 #p #f <lift_append_proper_dx //
68 lemma lift_A_dx (p) (f):
70 #p #f <lift_append_proper_dx //
73 lemma lift_S_dx (p) (f):
75 #p #f <lift_append_proper_dx //
78 (* Advanced inversions with proj_path ***************************************)
80 lemma lift_path_inv_d_sn (k) (q) (p) (f):
82 ∃∃r,h. 𝐞 = ⊗r & (↑[r]f)@❨h❩ = k & 𝐞 = q & r◖𝗱h = p.
83 #k #q #p @(path_ind_lift … p) -p
84 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
85 [ <lift_path_empty #H destruct
86 | <lift_path_d_empty_sn #H destruct -IH
87 /2 width=5 by ex4_2_intro/
88 | <lift_path_d_lcons_sn #H
89 elim (IH … H) -IH -H #r #h #Hr #Hh #Hq #Hp destruct
90 /2 width=5 by ex4_2_intro/
91 | <lift_path_L_sn #H destruct
92 | <lift_path_A_sn #H destruct
93 | <lift_path_S_sn #H destruct
97 lemma lift_path_inv_L_sn (q) (p) (f):
99 ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[⫯↑[r1]f]r2 & r1●𝗟◗r2 = p.
100 #q #p @(path_ind_lift … p) -p
101 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
102 [ <lift_path_empty #H destruct
103 | <lift_path_d_empty_sn #H destruct
104 | <lift_path_d_lcons_sn #H
105 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
106 /2 width=5 by ex3_2_intro/
107 | <lift_path_L_sn #H destruct -IH
108 /2 width=5 by ex3_2_intro/
109 | <lift_path_A_sn #H destruct
110 | <lift_path_S_sn #H destruct
114 lemma lift_path_inv_A_sn (q) (p) (f):
116 ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[↑[r1]f]r2 & r1●𝗔◗r2 = p.
117 #q #p @(path_ind_lift … p) -p
118 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
119 [ <lift_path_empty #H destruct
120 | <lift_path_d_empty_sn #H destruct
121 | <lift_path_d_lcons_sn #H
122 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
123 /2 width=5 by ex3_2_intro/
124 | <lift_path_L_sn #H destruct
125 | <lift_path_A_sn #H destruct -IH
126 /2 width=5 by ex3_2_intro/
127 | <lift_path_S_sn #H destruct
131 lemma lift_path_inv_S_sn (q) (p) (f):
133 ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[↑[r1]f]r2 & r1●𝗦◗r2 = p.
134 #q #p @(path_ind_lift … p) -p
135 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
136 [ <lift_path_empty #H destruct
137 | <lift_path_d_empty_sn #H destruct
138 | <lift_path_d_lcons_sn #H
139 elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
140 /2 width=5 by ex3_2_intro/
141 | <lift_path_L_sn #H destruct
142 | <lift_path_A_sn #H destruct
143 | <lift_path_S_sn #H destruct -IH
144 /2 width=5 by ex3_2_intro/
148 (* Inversions with proper condition for path ********************************)
150 lemma lift_inv_append_proper_dx (q2) (q1) (p) (f): Ꝕq2 →
152 ∃∃p1,p2. ⊗p1 = q1 & ↑[↑[p1]f]p2 = q2 & p1●p2 = p.
154 [ #p #f #Hq2 <list_append_empty_sn #H destruct
155 /2 width=5 by ex3_2_intro/
156 | * [ #n1 ] #q1 #IH #p #f #Hq2 <list_append_lcons_sn #H
157 [ elim (lift_path_inv_d_sn … H) -H #r1 #m1 #_ #_ #H0 #_ -IH
158 elim (eq_inv_list_empty_append … H0) -H0 #_ #H0 destruct
160 | elim (lift_path_inv_L_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
161 elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
162 @(ex3_2_intro … (r1●𝗟◗p1)) //
163 <structure_append <Hr1 -Hr1 //
164 | elim (lift_path_inv_A_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
165 elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
166 @(ex3_2_intro … (r1●𝗔◗p1)) //
167 <structure_append <Hr1 -Hr1 //
168 | elim (lift_path_inv_S_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
169 elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
170 @(ex3_2_intro … (r1●𝗦◗p1)) //
171 <structure_append <Hr1 -Hr1 //