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 "static_2/static/reqg_drops.ma".
16 include "static_2/static/reqg_fqup.ma".
17 include "static_2/static/reqg_reqg.ma".
18 include "basic_2/rt_transition/rpx_fsle.ma".
20 (* EXTENDED PARALLEL RT-TRANSITION FOR REFERRED LOCAL ENVIRONMENTS **********)
22 (* Properties with generic equivalence for local environments ***************)
24 lemma rpx_pair_sn_split (S) (G):
26 ∀L1,L2,V. ❨G,L1❩ ⊢ ⬈[V] L2 → ∀I,T.
27 ∃∃L. ❨G,L1❩ ⊢ ⬈[②[I]V.T] L & L ≛[S,V] L2.
28 /3 width=5 by rpx_fsge_comp, rex_pair_sn_split, teqg_refl/ qed-.
30 lemma rpx_flat_dx_split (S) (G):
32 ∀L1,L2,T. ❨G,L1❩ ⊢ ⬈[T] L2 → ∀I,V.
33 ∃∃L. ❨G,L1❩ ⊢ ⬈[ⓕ[I]V.T] L & L ≛[S,T] L2.
34 /3 width=5 by rpx_fsge_comp, rex_flat_dx_split, teqg_refl/ qed-.
36 lemma rpx_bind_dx_split (S) (G):
38 ∀I,L1,L2,V1,T. ❨G,L1.ⓑ[I]V1❩ ⊢ ⬈[T] L2 → ∀p.
39 ∃∃L,V. ❨G,L1❩ ⊢ ⬈[ⓑ[p,I]V1.T] L & L.ⓑ[I]V ≛[S,T] L2 & ❨G,L1❩ ⊢ V1 ⬈ V.
40 /3 width=5 by rpx_fsge_comp, rex_bind_dx_split, teqg_refl/ qed-.
42 lemma rpx_bind_dx_split_void (S) (G):
44 ∀K1,L2,T. ❨G,K1.ⓧ❩ ⊢ ⬈[T] L2 → ∀p,I,V.
45 ∃∃K2. ❨G,K1❩ ⊢ ⬈[ⓑ[p,I]V.T] K2 & K2.ⓧ ≛[S,T] L2.
46 /3 width=5 by rpx_fsge_comp, rex_bind_dx_split_void, teqg_refl/ qed-.
48 lemma rpx_teqg_conf_sn (S) (G):
50 s_r_confluent1 … (ceqg S) (rpx G).
51 /2 width=5 by teqg_rex_conf_sn/ qed-.
53 lemma rpx_teqg_div (S) (G):
54 reflexive … S → symmetric … S →
55 ∀T1,T2. T1 ≛[S] T2 → ∀L1,L2. ❨G,L1❩ ⊢ ⬈[T2] L2 → ❨G,L1❩ ⊢ ⬈[T1] L2.
56 /2 width=6 by teqg_rex_div/ qed-.
58 lemma cpx_teqg_repl_reqg (S) (G) (L0) (T0):
60 ∀T1. ❨G,L0❩ ⊢ T0 ⬈ T1 → ∀T2. T0 ≛[S] T2 → ∀T3. T1 ≛[S] T3 →
61 ∀L2. L0 ≛[S,T0] L2 → ❨G,L2❩ ⊢ T2 ⬈ T3.
62 #S #G #L0 #T0 #HS #T1 #H @(cpx_ind … H) -G -L0 -T0 -T1
63 [ * #x0 #G #L0 #X2 #HX2 #X3 #HX3 #L2 #_
64 [ elim (teqg_inv_sort1 … HX2) -HX2 #x2 #Hx02 #H destruct
65 elim (teqg_inv_sort1 … HX3) -HX3 #x3 #Hx03 #H destruct //
66 | lapply (teqg_inv_lref1 … HX2) -HX2 #H destruct
67 lapply (teqg_inv_lref1 … HX3) -HX3 #H destruct //
68 | lapply (teqg_inv_gref1 … HX2) -HX2 #H destruct
69 lapply (teqg_inv_gref1 … HX3) -HX3 #H destruct //
71 | #G #L0 #s0 #s1 #X2 #HX2 #X3 #HX3 #L2 #HL02
72 elim (teqg_inv_sort1 … HX2) -HX2 #s2 #H destruct
73 elim (teqg_inv_sort1 … HX3) -HX3 #s3 #H destruct //
74 | #I #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #X2 #HX2 #X3 #HX3 #L2 #HL2
75 lapply (teqg_inv_lref1 … HX2) -HX2 #H destruct
76 elim (reqg_inv_zero_pair_sn … HL2) -HL2 #K2 #V2 #HK02 #HV02 #H destruct
77 elim (teqg_inv_lifts_sn … HX3 … HVW1) -W1 #V3 #HVX3 #HV13
78 /3 width=3 by cpx_delta/
79 | #I0 #G #K0 #V1 #W1 #i #_ #IH #HVW1 #X2 #HX2 #X3 #HX3 #L2 #HL2
80 lapply (teqg_inv_lref1 … HX2) -HX2 #H destruct
81 elim (reqg_inv_lref_bind_sn … HL2) -HL2 #I2 #K2 #HK02 #H destruct
82 elim (teqg_inv_lifts_sn … HX3 … HVW1) -W1 #V3 #HVX3 #HV13
83 /3 width=3 by cpx_lref/
84 | #p #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02
85 elim (teqg_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #HT02 #H destruct
86 elim (teqg_inv_pair1 … HX3) -HX3 #V3 #T3 #HV13 #HT13 #H destruct
87 elim (reqg_inv_bind_refl … HL02) -HL02 // #HV0 #HT0
88 lapply (reqg_bind_repl_dx … HT0 (BPair I V2) ?) -HT0
89 /2 width=1 by ext2_pair/ #HT0
90 /3 width=1 by cpx_bind/
91 | #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02
92 elim (teqg_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #HT02 #H destruct
93 elim (teqg_inv_pair1 … HX3) -HX3 #V3 #T3 #HV13 #HT13 #H destruct
94 elim (reqg_inv_flat … HL02) -HL02 #HV0 #HT0
95 /3 width=1 by cpx_flat/
96 | #G #L0 #V0 #U0 #T0 #T1 #HTU0 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02
97 elim (teqg_inv_pair1 … HX2) -HX2 #V2 #U2 #HV02 #HU02 #H destruct
98 elim (reqg_inv_bind_refl … HL02) -HL02 // #HV0 #HU0
99 lapply (reqg_inv_lifts_bi … HU0 (Ⓣ) … HTU0) -HU0
100 [6:|*: /3 width=2 by drops_refl, drops_drop/ ] #HT0
101 elim (teqg_inv_lifts_sn … HU02 … HTU0) -U0 #T2 #HTU2 #HT02
102 /3 width=3 by cpx_zeta/
103 | #G #L0 #V0 #T0 #T1 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02
104 elim (teqg_inv_pair1 … HX2) -HX2 #V2 #T2 #_ #HT02 #H destruct
105 elim (reqg_inv_flat … HL02) -HL02 #HV0 #HT0
106 /3 width=1 by cpx_eps/
107 | #G #L0 #V0 #T0 #T1 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02
108 elim (teqg_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #_ #H destruct
109 elim (reqg_inv_flat … HL02) -HL02 #HV0 #HT1
110 /3 width=1 by cpx_ee/
111 | #p #G #L0 #V0 #V1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02
112 elim (teqg_inv_pair1 … HX2) -HX2 #V2 #X #HV02 #HX #H destruct
113 elim (teqg_inv_pair1 … HX) -HX #W2 #T2 #HW02 #HT02 #H destruct
114 elim (teqg_inv_pair1 … HX3) -HX3 #X #T3 #HX #HT13 #H destruct
115 elim (teqg_inv_pair1 … HX) -HX #W3 #V3 #HW13 #HV13 #H destruct
116 elim (reqg_inv_flat … HL02) -HL02 #HV0 #HL02
117 elim (reqg_inv_bind_refl … HL02) -HL02 // #HW0 #HT0
118 lapply (reqg_bind_repl_dx … HT0 (BPair Abst W2) ?) -HT0
119 /2 width=1 by ext2_pair/ #H2T0
120 /3 width=1 by cpx_beta/
121 | #p #G #L0 #V0 #V1 #U1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #HVU1 #X2 #HX2 #X3 #HX3 #L2 #HL02
122 elim (teqg_inv_pair1 … HX2) -HX2 #V2 #X #HV02 #HX #H destruct
123 elim (teqg_inv_pair1 … HX) -HX #W2 #T2 #HW02 #HT02 #H destruct
124 elim (teqg_inv_pair1 … HX3) -HX3 #W3 #X #HW13 #HX #H destruct
125 elim (teqg_inv_pair1 … HX) -HX #U3 #T3 #HU13 #HT13 #H destruct
126 elim (reqg_inv_flat … HL02) -HL02 #HV0 #HL02
127 elim (reqg_inv_bind_refl … HL02) -HL02 // #HW0 #HT0
128 lapply (reqg_bind_repl_dx … HT0 (BPair Abbr W2) ?) -HT0
129 /2 width=1 by ext2_pair/ #HT0
130 elim (teqg_inv_lifts_sn … HU13 … HVU1) -U1 #V3 #HVU3 #HV13
131 /3 width=3 by cpx_theta/
135 lemma cpx_teqg_conf (S) (G) (L):
137 ∀T0:term. ∀T1. ❨G,L❩ ⊢ T0 ⬈ T1 → ∀T2. T0 ≛[S] T2 → ❨G,L❩ ⊢ T2 ⬈ T1.
138 /3 width=9 by cpx_teqg_repl_reqg, reqg_refl, teqg_refl/ qed-.
140 lemma teqg_cpx_trans (S) (G) (L):
141 reflexive … S → symmetric … S →
142 ∀T2. ∀T0:term. T2 ≛[S] T0 → ∀T1. ❨G,L❩ ⊢ T0 ⬈ T1 → ❨G,L❩ ⊢ T2 ⬈ T1.
143 /3 width=6 by cpx_teqg_conf, teqg_sym/
146 lemma teqg_cpx (S) (G) (L):
147 reflexive … S → symmetric … S →
148 ∀T1,T2:term. T1 ≛[S] T2 → ❨G,L❩ ⊢ T1 ⬈ T2.
149 /2 width=6 by teqg_cpx_trans/ qed.
151 (* Basic_2A1: uses: cpx_lleq_conf *)
152 lemma cpx_reqg_conf (S) (G):
154 R_confluent1_rex (cpx G) (ceqg S).
155 /3 width=9 by cpx_teqg_repl_reqg, teqg_refl/ qed-.
157 (* Basic_2A1: uses: lleq_cpx_trans *)
158 lemma reqg_cpx_trans (S) (G):
159 reflexive … S → symmetric … S →
160 ∀L2,L0,T0. L2 ≛[S,T0] L0 → ∀T1. ❨G,L0❩ ⊢ T0 ⬈ T1 → ❨G,L2❩ ⊢ T0 ⬈ T1.
161 /3 width=7 by cpx_reqg_conf, reqg_sym/
164 lemma rpx_reqg_conf (S) (G) (T):
166 confluent1 … (rpx G T) (reqg S T).
167 /3 width=9 by reqg_fsge_comp, cpx_teqg_repl_reqg, rex_conf1, teqg_refl/ qed-.
169 lemma reqg_rpx_trans (S) (G) (T) (L):
170 reflexive … S → symmetric … S →
171 ∀L1. L1 ≛[S,T] L → ∀L2. ❨G,L❩ ⊢ ⬈[T] L2 → ❨G,L1❩ ⊢ ⬈[T] L2.
172 /3 width=7 by rpx_reqg_conf, reqg_sym/ qed-.
174 lemma reqg_rpx (S) (G) (T):
175 reflexive … S → symmetric … S →
176 ∀L1,L2. L1 ≛[S,T] L2 → ❨G,L1❩ ⊢ ⬈[T] L2.
177 /2 width=6 by reqg_rpx_trans/ qed.