]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/static/reqg.ma
update in ground and delayed updating
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / static / reqg.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/notation/relations/stareqsn_4.ma".
16 include "static_2/syntax/teqg_ext.ma".
17 include "static_2/static/rex.ma".
18
19 (* GENERIC EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***********)
20
21 definition reqg (S): relation3 โ€ฆ โ‰
22            rex (ceqg S).
23
24 interpretation
25   "generic equivalence on selected entries (local environment)"
26   'StarEqSn S f L1 L2 = (sex (ceqg_ext S) cfull f L1 L2).
27
28 interpretation
29   "generic equivalence on referred entries (local environment)"
30   'StarEqSn S T L1 L2 = (reqg S T L1 L2).
31
32 (* Basic properties ***********************************************************)
33
34 lemma frees_teqg_conf_seqg (S):
35       โˆ€f,L1,T1. L1 โŠข ๐…+โจT1โฉ โ‰˜ f โ†’ โˆ€T2. T1 โ‰›[S] T2 โ†’
36       โˆ€L2. L1 โ‰›[S,f] L2 โ†’ L2 โŠข ๐…+โจT2โฉ โ‰˜ f.
37 #S #f #L1 #T1 #H elim H -f -L1 -T1
38 [ #f #L1 #s1 #Hf #X #H1 #L2 #_
39   elim (teqg_inv_sort1 โ€ฆ H1) -H1 #s2 #_ #H destruct
40   /2 width=3 by frees_sort/
41 | #f #i #Hf #X #H1
42   >(teqg_inv_lref1 โ€ฆ H1) -X #Y #H2
43   >(sex_inv_atom1 โ€ฆ H2) -Y
44   /2 width=1 by frees_atom/
45 | #f #I #L1 #V1 #_ #IH #X #H1
46   >(teqg_inv_lref1 โ€ฆ H1) -X #Y #H2
47   elim (sex_inv_next1 โ€ฆ H2) -H2 #Z #L2 #HL12 #HZ #H destruct
48   elim (ext2_inv_pair_sn โ€ฆ HZ) -HZ #V2 #HV12 #H destruct
49   /3 width=1 by frees_pair/
50 | #f #I #L1 #Hf #X #H1
51   >(teqg_inv_lref1 โ€ฆ H1) -X #Y #H2
52   elim (sex_inv_next1 โ€ฆ H2) -H2 #Z #L2 #_ #HZ #H destruct
53   >(ext2_inv_unit_sn โ€ฆ HZ) -Z /2 width=1 by frees_unit/
54 | #f #I #L1 #i #_ #IH #X #H1
55   >(teqg_inv_lref1 โ€ฆ H1) -X #Y #H2
56   elim (sex_inv_push1 โ€ฆ H2) -H2 #J #L2 #HL12 #_ #H destruct
57   /3 width=1 by frees_lref/
58 | #f #L1 #l #Hf #X #H1 #L2 #_
59   >(teqg_inv_gref1 โ€ฆ H1) -X /2 width=1 by frees_gref/
60 | #f1V #f1T #f1 #p #I #L1 #V1 #T1 #_ #_ #Hf1 #IHV #IHT #X #H1
61   elim (teqg_inv_pair1 โ€ฆ H1) -H1 #V2 #T2 #HV12 #HT12 #H1 #L2 #HL12 destruct
62   /6 width=5 by frees_bind, sex_inv_tl, ext2_pair, sle_sex_trans, pr_sor_inv_sle_dx, pr_sor_inv_sle_sn/
63 | #f1V #f1T #f1 #I #L1 #V1 #T1 #_ #_ #Hf1 #IHV #IHT #X #H1
64   elim (teqg_inv_pair1 โ€ฆ H1) -H1 #V2 #T2 #HV12 #HT12 #H1 #L2 #HL12 destruct
65   /5 width=5 by frees_flat, sle_sex_trans, pr_sor_inv_sle_dx, pr_sor_inv_sle_sn/
66 ]
67 qed-.
68
69 lemma frees_teqg_conf (S):
70       reflexive โ€ฆ S โ†’
71       โˆ€f,L,T1. L โŠข ๐…+โจT1โฉ โ‰˜ f โ†’
72       โˆ€T2. T1 โ‰›[S] T2 โ†’ L โŠข ๐…+โจT2โฉ โ‰˜ f.
73 /5 width=6 by frees_teqg_conf_seqg, sex_refl, teqg_refl, ext2_refl/ qed-.
74
75 lemma frees_seqg_conf (S):
76       reflexive โ€ฆ S โ†’
77       โˆ€f,L1,T. L1 โŠข ๐…+โจTโฉ โ‰˜ f โ†’
78       โˆ€L2. L1 โ‰›[S,f] L2 โ†’ L2 โŠข ๐…+โจTโฉ โ‰˜ f.
79 /3 width=6 by frees_teqg_conf_seqg, teqg_refl/ qed-.
80
81 lemma teqg_rex_conf_sn (S) (R):
82       reflexive โ€ฆ S โ†’
83       s_r_confluent1 โ€ฆ (ceqg S) (rex R).
84 #S #R #HS #L1 #T1 #T2 #HT12 #L2 *
85 /3 width=5 by frees_teqg_conf, ex2_intro/
86 qed-.
87
88 lemma teqg_rex_div (S) (R):
89       reflexive โ€ฆ S โ†’ symmetric โ€ฆ S โ†’
90       โˆ€T1,T2. T1 โ‰›[S] T2 โ†’
91       โˆ€L1,L2. L1 โชค[R,T2] L2 โ†’ L1 โชค[R,T1] L2.
92 /3 width=5 by teqg_rex_conf_sn, teqg_sym/ qed-.
93
94 lemma teqg_reqg_conf_sn (S1) (S2):
95       reflexive โ€ฆ S1 โ†’
96       s_r_confluent1 โ€ฆ (ceqg S1) (reqg S2).
97 /2 width=5 by teqg_rex_conf_sn/ qed-.
98
99 lemma teqg_reqg_div (S1) (S2):
100       reflexive โ€ฆ S1 โ†’ symmetric โ€ฆ S1 โ†’
101       โˆ€T1,T2. T1 โ‰›[S1] T2 โ†’
102       โˆ€L1,L2. L1 โ‰›[S2,T2] L2 โ†’ L1 โ‰›[S2,T1] L2.
103 /2 width=6 by teqg_rex_div/ qed-.
104
105 lemma reqg_atom (S):
106       โˆ€I. โ‹† โ‰›[S,โ“ช[I]] โ‹†.
107 /2 width=1 by rex_atom/ qed.
108
109 lemma reqg_sort (S):
110       โˆ€I1,I2,L1,L2,s.
111       L1 โ‰›[S,โ‹†s] L2 โ†’ L1.โ“˜[I1] โ‰›[S,โ‹†s] L2.โ“˜[I2].
112 /2 width=1 by rex_sort/ qed.
113
114 lemma reqg_pair (S):
115       โˆ€I,L1,L2,V1,V2.
116       L1 โ‰›[S,V1] L2 โ†’ V1 โ‰›[S] V2 โ†’ L1.โ“‘[I]V1 โ‰›[S,#0] L2.โ“‘[I]V2.
117 /2 width=1 by rex_pair/ qed.
118
119 lemma reqg_unit (S):
120       โˆ€f,I,L1,L2. ๐ˆโจfโฉ โ†’ L1 โ‰›[S,f] L2 โ†’
121       L1.โ“ค[I] โ‰›[S,#0] L2.โ“ค[I].
122 /2 width=3 by rex_unit/ qed.
123
124 lemma reqg_lref (S):
125       โˆ€I1,I2,L1,L2,i.
126       L1 โ‰›[S,#i] L2 โ†’ L1.โ“˜[I1] โ‰›[S,#โ†‘i] L2.โ“˜[I2].
127 /2 width=1 by rex_lref/ qed.
128
129 lemma reqg_gref (S):
130       โˆ€I1,I2,L1,L2,l.
131       L1 โ‰›[S,ยงl] L2 โ†’ L1.โ“˜[I1] โ‰›[S,ยงl] L2.โ“˜[I2].
132 /2 width=1 by rex_gref/ qed.
133
134 lemma reqg_bind_repl_dx (S):
135       โˆ€I,I1,L1,L2.โˆ€T:term. L1.โ“˜[I] โ‰›[S,T] L2.โ“˜[I1] โ†’
136       โˆ€I2. I โ‰›[S] I2 โ†’ L1.โ“˜[I] โ‰›[S,T] L2.โ“˜[I2].
137 /2 width=2 by rex_bind_repl_dx/ qed-.
138
139 lemma reqg_co (S1) (S2):
140       S1 โŠ† S2 โ†’
141       โˆ€T:term. โˆ€L1,L2. L1 โ‰›[S1,T] L2 โ†’ L1 โ‰›[S2,T] L2.
142 /3 width=3 by rex_co, teqg_co/ qed-.
143
144 (* Basic inversion lemmas ***************************************************)
145
146 lemma reqg_inv_atom_sn (S):
147       โˆ€Y2. โˆ€T:term. โ‹† โ‰›[S,T] Y2 โ†’ Y2 = โ‹†.
148 /2 width=3 by rex_inv_atom_sn/ qed-.
149
150 lemma reqg_inv_atom_dx (S):
151       โˆ€Y1. โˆ€T:term. Y1 โ‰›[S,T] โ‹† โ†’ Y1 = โ‹†.
152 /2 width=3 by rex_inv_atom_dx/ qed-.
153
154 lemma reqg_inv_zero (S):
155       โˆ€Y1,Y2. Y1 โ‰›[S,#0] Y2 โ†’
156       โˆจโˆจ โˆงโˆง Y1 = โ‹† & Y2 = โ‹†
157        | โˆƒโˆƒI,L1,L2,V1,V2. L1 โ‰›[S,V1] L2 & V1 โ‰›[S] V2 & Y1 = L1.โ“‘[I]V1 & Y2 = L2.โ“‘[I]V2
158        | โˆƒโˆƒf,I,L1,L2. ๐ˆโจfโฉ & L1 โ‰›[S,f] L2 & Y1 = L1.โ“ค[I] & Y2 = L2.โ“ค[I].
159 #S #Y1 #Y2 #H elim (rex_inv_zero โ€ฆ H) -H *
160 /3 width=9 by or3_intro0, or3_intro1, or3_intro2, ex4_5_intro, ex4_4_intro, conj/
161 qed-.
162
163 lemma reqg_inv_lref (S):
164       โˆ€Y1,Y2,i. Y1 โ‰›[S,#โ†‘i] Y2 โ†’
165       โˆจโˆจ โˆงโˆง Y1 = โ‹† & Y2 = โ‹†
166        | โˆƒโˆƒI1,I2,L1,L2. L1 โ‰›[S,#i] L2 & Y1 = L1.โ“˜[I1] & Y2 = L2.โ“˜[I2].
167 /2 width=1 by rex_inv_lref/ qed-.
168
169 (* Basic_2A1: uses: lleq_inv_bind lleq_inv_bind_O *)
170 lemma reqg_inv_bind_refl (S):
171       reflexive โ€ฆ S โ†’
172       โˆ€p,I,L1,L2,V,T. L1 โ‰›[S,โ“‘[p,I]V.T] L2 โ†’
173       โˆงโˆง L1 โ‰›[S,V] L2 & L1.โ“‘[I]V โ‰›[S,T] L2.โ“‘[I]V.
174 /3 width=2 by rex_inv_bind, teqg_refl/ qed-.
175
176 (* Basic_2A1: uses: lleq_inv_flat *)
177 lemma reqg_inv_flat (S):
178       โˆ€I,L1,L2,V,T. L1 โ‰›[S,โ“•[I]V.T] L2 โ†’
179       โˆงโˆง L1 โ‰›[S,V] L2 & L1 โ‰›[S,T] L2.
180 /2 width=2 by rex_inv_flat/ qed-.
181
182 (* Advanced inversion lemmas ************************************************)
183
184 lemma reqg_inv_zero_pair_sn (S):
185       โˆ€I,Y2,L1,V1. L1.โ“‘[I]V1 โ‰›[S,#0] Y2 โ†’
186       โˆƒโˆƒL2,V2. L1 โ‰›[S,V1] L2 & V1 โ‰›[S] V2 & Y2 = L2.โ“‘[I]V2.
187 /2 width=1 by rex_inv_zero_pair_sn/ qed-.
188
189 lemma reqg_inv_zero_pair_dx (S):
190       โˆ€I,Y1,L2,V2. Y1 โ‰›[S,#0] L2.โ“‘[I]V2 โ†’
191       โˆƒโˆƒL1,V1. L1 โ‰›[S,V1] L2 & V1 โ‰›[S] V2 & Y1 = L1.โ“‘[I]V1.
192 /2 width=1 by rex_inv_zero_pair_dx/ qed-.
193
194 lemma reqg_inv_lref_bind_sn (S):
195       โˆ€I1,Y2,L1,i. L1.โ“˜[I1] โ‰›[S,#โ†‘i] Y2 โ†’
196       โˆƒโˆƒI2,L2. L1 โ‰›[S,#i] L2 & Y2 = L2.โ“˜[I2].
197 /2 width=2 by rex_inv_lref_bind_sn/ qed-.
198
199 lemma reqg_inv_lref_bind_dx (S):
200       โˆ€I2,Y1,L2,i. Y1 โ‰›[S,#โ†‘i] L2.โ“˜[I2] โ†’
201       โˆƒโˆƒI1,L1. L1 โ‰›[S,#i] L2 & Y1 = L1.โ“˜[I1].
202 /2 width=2 by rex_inv_lref_bind_dx/ qed-.
203
204 (* Basic forward lemmas *****************************************************)
205
206 lemma reqg_fwd_zero_pair (S):
207       โˆ€I,K1,K2,V1,V2.
208       K1.โ“‘[I]V1 โ‰›[S,#0] K2.โ“‘[I]V2 โ†’ K1 โ‰›[S,V1] K2.
209 /2 width=3 by rex_fwd_zero_pair/ qed-.
210
211 (* Basic_2A1: uses: lleq_fwd_bind_sn lleq_fwd_flat_sn *)
212 lemma reqg_fwd_pair_sn (S):
213       โˆ€I,L1,L2,V,T. L1 โ‰›[S,โ‘ก[I]V.T] L2 โ†’ L1 โ‰›[S,V] L2.
214 /2 width=3 by rex_fwd_pair_sn/ qed-.
215
216 (* Basic_2A1: uses: lleq_fwd_bind_dx lleq_fwd_bind_O_dx *)
217 lemma reqg_fwd_bind_dx (S):
218       reflexive โ€ฆ S โ†’
219       โˆ€p,I,L1,L2,V,T.
220       L1 โ‰›[S,โ“‘[p,I]V.T] L2 โ†’ L1.โ“‘[I]V โ‰›[S,T] L2.โ“‘[I]V.
221 /3 width=2 by rex_fwd_bind_dx, teqg_refl/ qed-.
222
223 (* Basic_2A1: uses: lleq_fwd_flat_dx *)
224 lemma reqg_fwd_flat_dx (S):
225       โˆ€I,L1,L2,V,T. L1 โ‰›[S,โ“•[I]V.T] L2 โ†’ L1 โ‰›[S,T] L2.
226 /2 width=3 by rex_fwd_flat_dx/ qed-.
227
228 lemma reqg_fwd_dx (S):
229       โˆ€I2,L1,K2. โˆ€T:term. L1 โ‰›[S,T] K2.โ“˜[I2] โ†’
230       โˆƒโˆƒI1,K1. L1 = K1.โ“˜[I1].
231 /2 width=5 by rex_fwd_dx/ qed-.