]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/relocation/drops_sex.ma
update in ground_2, static_2, basic_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / relocation / drops_sex.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 "static_2/relocation/lifts_lifts_bind.ma".
16 include "static_2/relocation/drops.ma".
17
18 (* GENERIC SLICING FOR LOCAL ENVIRONMENTS ***********************************)
19
20 (* Properties with entrywise extension of context-sensitive relations *******)
21
22 (**) (* changed after commit 13218 *)
23 lemma sex_co_dropable_sn: ∀RN,RP. co_dropable_sn (sex RN RP).
24 #RN #RP #b #f #L1 #K1 #H elim H -f -L1 -K1
25 [ #f #Hf #_ #f2 #X #H #f1 #Hf2 >(sex_inv_atom1 … H) -X
26   /4 width=3 by sex_atom, drops_atom, ex2_intro/
27 | #f #I1 #L1 #K1 #_ #IH #Hf #f2 #X #H #f1 #Hf2
28   elim (coafter_inv_nxx … Hf2) -Hf2 [2,3: // ] #g2 #Hg2 #H2 destruct
29   elim (sex_inv_push1 … H) -H #I2 #L2 #HL12 #HI12 #H destruct
30   elim (IH … HL12 … Hg2) -g2
31   /3 width=3 by isuni_inv_next, drops_drop, ex2_intro/
32 | #f #I1 #J1 #L1 #K1 #HLK #HJI1 #IH #Hf #f2 #X #H #f1 #Hf2
33   lapply (isuni_inv_push … Hf ??) -Hf [3: |*: // ] #Hf
34   lapply (drops_fwd_isid … HLK … Hf) -HLK #H0 destruct
35   lapply (liftsb_fwd_isid … HJI1 … Hf) -HJI1 #H0 destruct
36   elim (coafter_inv_pxx … Hf2) -Hf2 [1,3:* |*: // ] #g1 #g2 #Hg2 #H1 #H2 destruct
37   [ elim (sex_inv_push1 … H) | elim (sex_inv_next1 … H) ] -H #I2 #L2 #HL12 #HI12 #H destruct
38   elim (IH … HL12 … Hg2) -g2 -IH /2 width=1 by isuni_isid/ #K2 #HK12 #HLK2
39   lapply (drops_fwd_isid … HLK2 … Hf) -HLK2 #H0 destruct
40   /4 width=3 by drops_refl, sex_next, sex_push, isid_push, ex2_intro/
41 ]
42 qed-.
43
44 lemma sex_liftable_co_dedropable_bi: ∀RN,RP. d_liftable2_sn … liftsb RN → d_liftable2_sn … liftsb RP →
45                                      ∀f2,L1,L2. L1 ⪤[cfull,RP,f2] L2 → ∀f1,K1,K2. K1 ⪤[RN,RP,f1] K2 →
46                                      ∀b,f. ⇩*[b,f] L1 ≘ K1 → ⇩*[b,f] L2 ≘ K2 →
47                                      f ~⊚ f1 ≘ f2 → L1 ⪤[RN,RP,f2] L2.
48 #RN #RP #HRN #HRP #f2 #L1 #L2 #H elim H -f2 -L1 -L2 //
49 #g2 #I1 #I2 #L1 #L2 #HL12 #HI12 #IH #f1 #Y1 #Y2 #HK12 #b #f #HY1 #HY2 #H
50 [ elim (coafter_inv_xxn … H) [ |*: // ] -H #g #g1 #Hg2 #H1 #H2 destruct
51   elim (drops_inv_skip1 … HY1) -HY1 #J1 #K1 #HLK1 #HJI1 #H destruct
52   elim (drops_inv_skip1 … HY2) -HY2 #J2 #K2 #HLK2 #HJI2 #H destruct
53   elim (sex_inv_next … HK12) -HK12 #HK12 #HJ12
54   elim (HRN … HJ12 … HLK1 … HJI1) -HJ12 -HJI1 #Z #Hz
55   >(liftsb_mono … Hz … HJI2) -Z /3 width=9 by sex_next/
56 | elim (coafter_inv_xxp … H) [1,2: |*: // ] -H *
57   [ #g #g1 #Hg2 #H1 #H2 destruct
58     elim (drops_inv_skip1 … HY1) -HY1 #J1 #K1 #HLK1 #HJI1 #H destruct
59     elim (drops_inv_skip1 … HY2) -HY2 #J2 #K2 #HLK2 #HJI2 #H destruct
60     elim (sex_inv_push … HK12) -HK12 #HK12 #HJ12
61     elim (HRP … HJ12 … HLK1 … HJI1) -HJ12 -HJI1 #Z #Hz
62     >(liftsb_mono … Hz … HJI2) -Z /3 width=9 by sex_push/
63   | #g #Hg2 #H destruct
64     lapply (drops_inv_drop1 … HY1) -HY1 #HLK1
65     lapply (drops_inv_drop1 … HY2) -HY2 #HLK2
66     /3 width=9 by sex_push/
67   ]
68 ]
69 qed-.
70
71 lemma sex_liftable_co_dedropable_sn: ∀RN,RP. (∀L. reflexive … (RN L)) → (∀L. reflexive … (RP L)) →
72                                      d_liftable2_sn … liftsb RN → d_liftable2_sn … liftsb RP →
73                                      co_dedropable_sn (sex RN RP).
74 #RN #RP #H1RN #H1RP #H2RN #H2RP #b #f #L1 #K1 #H elim H -f -L1 -K1
75 [ #f #Hf #X #f1 #H #f2 #Hf2 >(sex_inv_atom1 … H) -X
76   /4 width=4 by drops_atom, sex_atom, ex3_intro/
77 | #f #I1 #L1 #K1 #_ #IHLK1 #K2 #f1 #HK12 #f2 #Hf2
78   elim (coafter_inv_nxx … Hf2) -Hf2 [2,3: // ] #g2 #Hg2 #H destruct
79   elim (IHLK1 … HK12 … Hg2) -K1
80   /3 width=6 by drops_drop, sex_next, sex_push, ex3_intro/
81 | #f #I1 #J1 #L1 #K1 #HLK1 #HJI1 #IHLK1 #X #f1 #H #f2 #Hf2
82   elim (coafter_inv_pxx … Hf2) -Hf2 [1,3: * |*: // ] #g1 #g2 #Hg2 #H1 #H2 destruct
83   [ elim (sex_inv_push1 … H) | elim (sex_inv_next1 … H) ] -H #J2 #K2 #HK12 #HJ12 #H destruct
84   [ elim (H2RP … HJ12 … HLK1 … HJI1) | elim (H2RN … HJ12 … HLK1 … HJI1) ] -J1
85   elim (IHLK1 … HK12 … Hg2) -K1
86   /3 width=6 by drops_skip, sex_next, sex_push, ex3_intro/
87 ]
88 qed-.
89
90 fact sex_dropable_dx_aux: ∀RN,RP,b,f,L2,K2. ⇩*[b,f] L2 ≘ K2 → 𝐔⦃f⦄ →
91                           ∀f2,L1. L1 ⪤[RN,RP,f2] L2 → ∀f1. f ~⊚ f1 ≘ f2 →
92                           ∃∃K1. ⇩*[b,f] L1 ≘ K1 & K1 ⪤[RN,RP,f1] K2.
93 #RN #RP #b #f #L2 #K2 #H elim H -f -L2 -K2
94 [ #f #Hf #_ #f2 #X #H #f1 #Hf2 lapply (sex_inv_atom2 … H) -H
95   #H destruct /4 width=3 by sex_atom, drops_atom, ex2_intro/
96 | #f #I2 #L2 #K2 #_ #IH #Hf #f2 #X #HX #f1 #Hf2
97   elim (coafter_inv_nxx … Hf2) -Hf2 [2,3: // ] #g2 #Hg2 #H destruct
98   elim (sex_inv_push2 … HX) -HX #I1 #L1 #HL12 #HI12 #H destruct
99   elim (IH … HL12 … Hg2) -L2 -I2 -g2
100   /3 width=3 by drops_drop, isuni_inv_next, ex2_intro/
101 | #f #I2 #J2 #L2 #K2 #_ #HJI2 #IH #Hf #f2 #X #HX #f1 #Hf2
102   elim (coafter_inv_pxx … Hf2) -Hf2 [1,3: * |*: // ] #g1 #g2 #Hg2 #H1 #H2 destruct
103   [ elim (sex_inv_push2 … HX) | elim (sex_inv_next2 … HX) ] -HX #I1 #L1 #HL12 #HI12 #H destruct
104   elim (IH … HL12 … Hg2) -L2 -g2 /2 width=3 by isuni_fwd_push/ #K1 #HLK1 #HK12
105   lapply (isuni_inv_push … Hf ??) -Hf [3,6: |*: // ] #Hf
106   lapply (liftsb_fwd_isid … HJI2 … Hf) #H destruct -HJI2
107   lapply (drops_fwd_isid … HLK1 … Hf) #H destruct -HLK1
108   /4 width=5 by sex_next, sex_push, drops_refl, isid_push, ex2_intro/
109 ]
110 qed-.
111
112 lemma sex_co_dropable_dx: ∀RN,RP. co_dropable_dx (sex RN RP).
113 /2 width=5 by sex_dropable_dx_aux/ qed-.
114
115 lemma sex_drops_conf_next: ∀RN,RP.
116                            ∀f2,L1,L2. L1 ⪤[RN,RP,f2] L2 →
117                            ∀b,f,I1,K1. ⇩*[b,f] L1 ≘ K1.ⓘ{I1} → 𝐔⦃f⦄ →
118                            ∀f1. f ~⊚ ↑f1 ≘ f2 →
119                            ∃∃I2,K2. ⇩*[b,f] L2 ≘ K2.ⓘ{I2} & K1 ⪤[RN,RP,f1] K2 & RN K1 I1 I2.
120 #RN #RP #f2 #L1 #L2 #HL12 #b #f #I1 #K1 #HLK1 #Hf #f1 #Hf2
121 elim (sex_co_dropable_sn … HLK1 … Hf … HL12 … Hf2) -L1 -f2 -Hf
122 #X #HX #HLK2 elim (sex_inv_next1 … HX) -HX
123 #I2 #K2 #HK12 #HI12 #H destruct /2 width=5 by ex3_2_intro/
124 qed-.
125
126 lemma sex_drops_conf_push: ∀RN,RP.
127                            ∀f2,L1,L2. L1 ⪤[RN,RP,f2] L2 →
128                            ∀b,f,I1,K1. ⇩*[b,f] L1 ≘ K1.ⓘ{I1} → 𝐔⦃f⦄ →
129                            ∀f1. f ~⊚ ⫯f1 ≘ f2 →
130                            ∃∃I2,K2. ⇩*[b,f] L2 ≘ K2.ⓘ{I2} & K1 ⪤[RN,RP,f1] K2 & RP K1 I1 I2.
131 #RN #RP #f2 #L1 #L2 #HL12 #b #f #I1 #K1 #HLK1 #Hf #f1 #Hf2
132 elim (sex_co_dropable_sn … HLK1 … Hf … HL12 … Hf2) -L1 -f2 -Hf
133 #X #HX #HLK2 elim (sex_inv_push1 … HX) -HX
134 #I2 #K2 #HK12 #HI12 #H destruct /2 width=5 by ex3_2_intro/
135 qed-.
136
137 lemma sex_drops_trans_next: ∀RN,RP,f2,L1,L2. L1 ⪤[RN,RP,f2] L2 →
138                             ∀b,f,I2,K2. ⇩*[b,f] L2 ≘ K2.ⓘ{I2} → 𝐔⦃f⦄ →
139                             ∀f1. f ~⊚ ↑f1 ≘ f2 →
140                             ∃∃I1,K1. ⇩*[b,f] L1 ≘ K1.ⓘ{I1} & K1 ⪤[RN,RP,f1] K2 & RN K1 I1 I2.
141 #RN #RP #f2 #L1 #L2 #HL12 #b #f #I2 #K2 #HLK2 #Hf #f1 #Hf2
142 elim (sex_co_dropable_dx … HL12 … HLK2 … Hf … Hf2) -L2 -f2 -Hf
143 #X #HLK1 #HX elim (sex_inv_next2 … HX) -HX
144 #I1 #K1 #HK12 #HI12 #H destruct /2 width=5 by ex3_2_intro/
145 qed-.
146
147 lemma sex_drops_trans_push: ∀RN,RP,f2,L1,L2. L1 ⪤[RN,RP,f2] L2 →
148                             ∀b,f,I2,K2. ⇩*[b,f] L2 ≘ K2.ⓘ{I2} → 𝐔⦃f⦄ →
149                             ∀f1. f ~⊚ ⫯f1 ≘ f2 →
150                             ∃∃I1,K1. ⇩*[b,f] L1 ≘ K1.ⓘ{I1} & K1 ⪤[RN,RP,f1] K2 & RP K1 I1 I2.
151 #RN #RP #f2 #L1 #L2 #HL12 #b #f #I2 #K2 #HLK2 #Hf #f1 #Hf2
152 elim (sex_co_dropable_dx … HL12 … HLK2 … Hf … Hf2) -L2 -f2 -Hf
153 #X #HLK1 #HX elim (sex_inv_push2 … HX) -HX
154 #I1 #K1 #HK12 #HI12 #H destruct /2 width=5 by ex3_2_intro/
155 qed-.
156
157 lemma drops_sex_trans_next: ∀RN,RP. (∀L. reflexive ? (RN L)) → (∀L. reflexive ? (RP L)) →
158                             d_liftable2_sn … liftsb RN → d_liftable2_sn … liftsb RP →
159                             ∀f1,K1,K2. K1 ⪤[RN,RP,f1] K2 →
160                             ∀b,f,I1,L1. ⇩*[b,f] L1.ⓘ{I1} ≘ K1 →
161                             ∀f2. f ~⊚ f1 ≘ ↑f2 →
162                             ∃∃I2,L2. ⇩*[b,f] L2.ⓘ{I2} ≘ K2 & L1 ⪤[RN,RP,f2] L2 & RN L1 I1 I2 & L1.ⓘ{I1} ≡[f] L2.ⓘ{I2}.
163 #RN #RP #H1RN #H1RP #H2RN #H2RP #f1 #K1 #K2 #HK12 #b #f #I1 #L1 #HLK1 #f2 #Hf2
164 elim (sex_liftable_co_dedropable_sn … H1RN H1RP H2RN H2RP … HLK1 … HK12 … Hf2) -K1 -f1 -H1RN -H1RP -H2RN -H2RP
165 #X #HX #HLK2 #H1L12 elim (sex_inv_next1 … HX) -HX
166 #I2 #L2 #H2L12 #HI12 #H destruct /2 width=6 by ex4_2_intro/
167 qed-.
168
169 lemma drops_sex_trans_push: ∀RN,RP. (∀L. reflexive ? (RN L)) → (∀L. reflexive ? (RP L)) →
170                             d_liftable2_sn … liftsb RN → d_liftable2_sn … liftsb RP →
171                             ∀f1,K1,K2. K1 ⪤[RN,RP,f1] K2 →
172                             ∀b,f,I1,L1. ⇩*[b,f] L1.ⓘ{I1} ≘ K1 →
173                             ∀f2. f ~⊚ f1 ≘ ⫯f2 →
174                             ∃∃I2,L2. ⇩*[b,f] L2.ⓘ{I2} ≘ K2 & L1 ⪤[RN,RP,f2] L2 & RP L1 I1 I2 & L1.ⓘ{I1} ≡[f] L2.ⓘ{I2}.
175 #RN #RP #H1RN #H1RP #H2RN #H2RP #f1 #K1 #K2 #HK12 #b #f #I1 #L1 #HLK1 #f2 #Hf2
176 elim (sex_liftable_co_dedropable_sn … H1RN H1RP H2RN H2RP … HLK1 … HK12 … Hf2) -K1 -f1 -H1RN -H1RP -H2RN -H2RP
177 #X #HX #HLK2 #H1L12 elim (sex_inv_push1 … HX) -HX
178 #I2 #L2 #H2L12 #HI12 #H destruct /2 width=6 by ex4_2_intro/
179 qed-.
180
181 lemma drops_atom2_sex_conf: ∀RN,RP,b,f1,L1. ⇩*[b,f1] L1 ≘ ⋆ → 𝐔⦃f1⦄ →
182                             ∀f,L2. L1 ⪤[RN,RP,f] L2 →
183                             ∀f2. f1 ~⊚ f2 ≘f → ⇩*[b,f1] L2 ≘ ⋆.
184 #RN #RP #b #f1 #L1 #H1 #Hf1 #f #L2 #H2 #f2 #H3
185 elim (sex_co_dropable_sn … H1 … H2 … H3) // -H1 -H2 -H3 -Hf1
186 #L #H #HL2 lapply (sex_inv_atom1 … H) -H //
187 qed-.