]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_structure.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / substitution / lift_structure.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 "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".
20
21 (* LIFT FOR PATH ***********************************************************)
22
23 (* Basic constructions with structure **************************************)
24
25 lemma structure_lift (p) (f):
26       ⊗p = ⊗↑[f]p.
27 #p @(path_ind_lift … p) -p // #p #IH #f
28 <lift_path_L_sn //
29 qed.
30
31 lemma lift_structure (p) (f):
32       ⊗p = ↑[f]⊗p.
33 #p @(path_ind_lift … p) -p //
34 qed.
35
36 (* Destructions with structure **********************************************)
37
38 lemma lift_des_structure (q) (p) (f):
39       ⊗q = ↑[f]p → ⊗q = ⊗p.
40 // qed-.
41
42 (* Constructions with proper condition for path *****************************)
43
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 //
53 ]
54 qed-.
55
56 (* Advanced constructions with structure ************************************)
57
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 // 
61 qed.
62
63 lemma lift_L_dx (p) (f):
64       (⊗p)◖𝗟 = ↑[f](p◖𝗟).
65 #p #f <lift_append_proper_dx //
66 qed.
67
68 lemma lift_A_dx (p) (f):
69       (⊗p)◖𝗔 = ↑[f](p◖𝗔).
70 #p #f <lift_append_proper_dx //
71 qed.
72
73 lemma lift_S_dx (p) (f):
74       (⊗p)◖𝗦 = ↑[f](p◖𝗦).
75 #p #f <lift_append_proper_dx //
76 qed.
77
78 lemma lift_root (f) (p):
79       ∃∃r. 𝐞 = ⊗r & ⊗p●r = ↑[f]p.
80 #f #p @(list_ind_rcons … p) -p
81 [ /2 width=3 by ex2_intro/
82 | #p * [ #n ] /2 width=3 by ex2_intro/
83 ]
84 qed-.
85
86 (* Advanced inversions with proj_path ***************************************)
87
88 lemma lift_path_inv_d_sn (k) (q) (p) (f):
89       (𝗱k◗q) = ↑[f]p →
90       ∃∃r,h. 𝐞 = ⊗r & (↑[r]f)@❨h❩ = k & 𝐞 = q & r◖𝗱h = p.
91 #k #q #p @(path_ind_lift … p) -p
92 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
93 [ <lift_path_empty #H destruct
94 | <lift_path_d_empty_sn #H destruct -IH
95   /2 width=5 by ex4_2_intro/
96 | <lift_path_d_lcons_sn #H
97   elim (IH … H) -IH -H #r #h #Hr #Hh #Hq #Hp destruct
98   /2 width=5 by ex4_2_intro/
99 | <lift_path_L_sn #H destruct
100 | <lift_path_A_sn #H destruct
101 | <lift_path_S_sn #H destruct
102 ]
103 qed-.
104
105 lemma lift_path_inv_L_sn (q) (p) (f):
106       (𝗟◗q) = ↑[f]p →
107       ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[⫯↑[r1]f]r2 & r1●𝗟◗r2 = p.
108 #q #p @(path_ind_lift … p) -p
109 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
110 [ <lift_path_empty #H destruct
111 | <lift_path_d_empty_sn #H destruct
112 | <lift_path_d_lcons_sn #H
113   elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
114   /2 width=5 by ex3_2_intro/
115 | <lift_path_L_sn #H destruct -IH
116   /2 width=5 by ex3_2_intro/
117 | <lift_path_A_sn #H destruct
118 | <lift_path_S_sn #H destruct
119 ]
120 qed-.
121
122 lemma lift_path_inv_A_sn (q) (p) (f):
123       (𝗔◗q) = ↑[f]p →
124       ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[↑[r1]f]r2 & r1●𝗔◗r2 = p.
125 #q #p @(path_ind_lift … p) -p
126 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
127 [ <lift_path_empty #H destruct
128 | <lift_path_d_empty_sn #H destruct
129 | <lift_path_d_lcons_sn #H
130   elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
131   /2 width=5 by ex3_2_intro/
132 | <lift_path_L_sn #H destruct
133 | <lift_path_A_sn #H destruct -IH
134   /2 width=5 by ex3_2_intro/
135 | <lift_path_S_sn #H destruct
136 ]
137 qed-.
138
139 lemma lift_path_inv_S_sn (q) (p) (f):
140       (𝗦◗q) = ↑[f]p →
141       ∃∃r1,r2. 𝐞 = ⊗r1 & q = ↑[↑[r1]f]r2 & r1●𝗦◗r2 = p.
142 #q #p @(path_ind_lift … p) -p
143 [| #n | #n #l #p |*: #p ] [|*: #IH ] #f
144 [ <lift_path_empty #H destruct
145 | <lift_path_d_empty_sn #H destruct
146 | <lift_path_d_lcons_sn #H
147   elim (IH … H) -IH -H #r1 #r2 #Hr1 #Hq #Hp destruct
148   /2 width=5 by ex3_2_intro/
149 | <lift_path_L_sn #H destruct
150 | <lift_path_A_sn #H destruct
151 | <lift_path_S_sn #H destruct -IH
152   /2 width=5 by ex3_2_intro/
153 ]
154 qed-.
155
156 (* Inversions with proper condition for path ********************************)
157
158 lemma lift_inv_append_proper_dx (q2) (q1) (p) (f): Ꝕq2 →
159       q1●q2 = ↑[f]p →
160       ∃∃p1,p2. ⊗p1 = q1 & ↑[↑[p1]f]p2 = q2 & p1●p2 = p.
161 #q2 #q1 elim q1 -q1
162 [ #p #f #Hq2 <list_append_empty_sn #H destruct
163   /2 width=5 by ex3_2_intro/
164 | * [ #n1 ] #q1 #IH #p #f #Hq2 <list_append_lcons_sn #H
165   [ elim (lift_path_inv_d_sn … H) -H #r1 #m1 #_ #_ #H0 #_ -IH
166     elim (eq_inv_list_empty_append … H0) -H0 #_ #H0 destruct
167     elim Hq2 -Hq2 //
168   | elim (lift_path_inv_L_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 //
172   | elim (lift_path_inv_A_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
173     elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
174     @(ex3_2_intro … (r1●𝗔◗p1)) //
175     <structure_append <Hr1 -Hr1 //
176   | elim (lift_path_inv_S_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
177     elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
178     @(ex3_2_intro … (r1●𝗦◗p1)) //
179     <structure_append <Hr1 -Hr1 //
180   ]
181 ]
182 qed-.