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/reqx_drops.ma".
16 include "static_2/static/reqx_fqup.ma".
17 include "static_2/static/reqx_reqx.ma".
18 include "basic_2/rt_transition/rpx_fsle.ma".
20 (* EXTENDED PARALLEL RT-TRANSITION FOR REFERRED LOCAL ENVIRONMENTS **********)
22 (* Properties with sort-irrelevant equivalence for local environments *******)
24 lemma rpx_pair_sn_split (G):
25 ∀L1,L2,V. ❪G,L1❫ ⊢ ⬈[V] L2 → ∀I,T.
26 ∃∃L. ❪G,L1❫ ⊢ ⬈[②[I]V.T] L & L ≛[V] L2.
27 /3 width=5 by rpx_fsge_comp, rex_pair_sn_split/ qed-.
29 lemma rpx_flat_dx_split (G):
30 ∀L1,L2,T. ❪G,L1❫ ⊢ ⬈[T] L2 → ∀I,V.
31 ∃∃L. ❪G,L1❫ ⊢ ⬈[ⓕ[I]V.T] L & L ≛[T] L2.
32 /3 width=5 by rpx_fsge_comp, rex_flat_dx_split/ qed-.
34 lemma rpx_bind_dx_split (G):
35 ∀I,L1,L2,V1,T. ❪G,L1.ⓑ[I]V1❫ ⊢ ⬈[T] L2 → ∀p.
36 ∃∃L,V. ❪G,L1❫ ⊢ ⬈[ⓑ[p,I]V1.T] L & L.ⓑ[I]V ≛[T] L2 & ❪G,L1❫ ⊢ V1 ⬈ V.
37 /3 width=5 by rpx_fsge_comp, rex_bind_dx_split/ qed-.
39 lemma rpx_bind_dx_split_void (G):
40 ∀K1,L2,T. ❪G,K1.ⓧ❫ ⊢ ⬈[T] L2 → ∀p,I,V.
41 ∃∃K2. ❪G,K1❫ ⊢ ⬈[ⓑ[p,I]V.T] K2 & K2.ⓧ ≛[T] L2.
42 /3 width=5 by rpx_fsge_comp, rex_bind_dx_split_void/ qed-.
44 lemma rpx_teqx_conf_sn (G): s_r_confluent1 … cdeq (rpx G).
45 /2 width=5 by teqx_rex_conf_sn/ qed-.
47 lemma rpx_teqx_div (G):
48 ∀T1,T2. T1 ≛ T2 → ∀L1,L2. ❪G,L1❫ ⊢ ⬈[T2] L2 → ❪G,L1❫ ⊢ ⬈[T1] L2.
49 /2 width=5 by teqx_rex_div/ qed-.
51 lemma cpx_teqx_repl_reqx (G) (L0) (T0):
52 ∀T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → ∀T2. T0 ≛ T2 → ∀T3. T1 ≛ T3 →
53 ∀L2. L0 ≛[T0] L2 → ❪G,L2❫ ⊢ T2 ⬈ T3.
54 #G #L0 #T0 #T1 #H @(cpx_ind … H) -G -L0 -T0 -T1
55 [ * #x0 #G #L0 #X2 #HX2 #X3 #HX3 #L2 #_
56 [ elim (teqx_inv_sort1 … HX2) -HX2 #x2 #H destruct
57 elim (teqx_inv_sort1 … HX3) -HX3 #x3 #H destruct //
58 | lapply (teqx_inv_lref1 … HX2) -HX2 #H destruct
59 lapply (teqx_inv_lref1 … HX3) -HX3 #H destruct //
60 | lapply (teqx_inv_gref1 … HX2) -HX2 #H destruct
61 lapply (teqx_inv_gref1 … HX3) -HX3 #H destruct //
63 | #G #L0 #s0 #s1 #X2 #HX2 #X3 #HX3 #L2 #HL02
64 elim (teqx_inv_sort1 … HX2) -HX2 #s2 #H destruct
65 elim (teqx_inv_sort1 … HX3) -HX3 #s3 #H destruct //
66 | #I #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #X2 #HX2 #X3 #HX3 #L2 #HL2
67 lapply (teqx_inv_lref1 … HX2) -HX2 #H destruct
68 elim (reqx_inv_zero_pair_sn … HL2) -HL2 #K2 #V2 #HK02 #HV02 #H destruct
69 elim (teqx_inv_lifts_sn … HX3 … HVW1) -W1 #V3 #HVX3 #HV13
70 /3 width=3 by cpx_delta/
71 | #I0 #G #K0 #V1 #W1 #i #_ #IH #HVW1 #X2 #HX2 #X3 #HX3 #L2 #HL2
72 lapply (teqx_inv_lref1 … HX2) -HX2 #H destruct
73 elim (reqx_inv_lref_bind_sn … HL2) -HL2 #I2 #K2 #HK02 #H destruct
74 elim (teqx_inv_lifts_sn … HX3 … HVW1) -W1 #V3 #HVX3 #HV13
75 /3 width=3 by cpx_lref/
76 | #p #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02
77 elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #HT02 #H destruct
78 elim (teqx_inv_pair1 … HX3) -HX3 #V3 #T3 #HV13 #HT13 #H destruct
79 elim (reqx_inv_bind … HL02) -HL02 #HV0 #HT0
80 lapply (reqx_bind_repl_dx … HT0 (BPair I V2) ?) -HT0
81 /2 width=1 by ext2_pair/ #HT0
82 /3 width=1 by cpx_bind/
83 | #I #G #L0 #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02
84 elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #HT02 #H destruct
85 elim (teqx_inv_pair1 … HX3) -HX3 #V3 #T3 #HV13 #HT13 #H destruct
86 elim (reqx_inv_flat … HL02) -HL02 #HV0 #HT0
87 /3 width=1 by cpx_flat/
88 | #G #L0 #V0 #U0 #T0 #T1 #HTU0 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02
89 elim (teqx_inv_pair1 … HX2) -HX2 #V2 #U2 #HV02 #HU02 #H destruct
90 elim (reqx_inv_bind … HL02) -HL02 #HV0 #HU0
91 lapply (reqx_inv_lifts_bi … HU0 (Ⓣ) … HTU0) -HU0
92 [6:|*: /3 width=2 by drops_refl, drops_drop/ ] #HT0
93 elim (teqx_inv_lifts_sn … HU02 … HTU0) -U0 #T2 #HTU2 #HT02
94 /3 width=3 by cpx_zeta/
95 | #G #L0 #V0 #T0 #T1 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02
96 elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #_ #HT02 #H destruct
97 elim (reqx_inv_flat … HL02) -HL02 #HV0 #HT0
98 /3 width=1 by cpx_eps/
99 | #G #L0 #V0 #T0 #T1 #_ #IH #X2 #HX2 #X3 #HX3 #L2 #HL02
100 elim (teqx_inv_pair1 … HX2) -HX2 #V2 #T2 #HV02 #_ #H destruct
101 elim (reqx_inv_flat … HL02) -HL02 #HV0 #HT1
102 /3 width=1 by cpx_ee/
103 | #p #G #L0 #V0 #V1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #X2 #HX2 #X3 #HX3 #L2 #HL02
104 elim (teqx_inv_pair1 … HX2) -HX2 #V2 #X #HV02 #HX #H destruct
105 elim (teqx_inv_pair1 … HX) -HX #W2 #T2 #HW02 #HT02 #H destruct
106 elim (teqx_inv_pair1 … HX3) -HX3 #X #T3 #HX #HT13 #H destruct
107 elim (teqx_inv_pair1 … HX) -HX #W3 #V3 #HW13 #HV13 #H destruct
108 elim (reqx_inv_flat … HL02) -HL02 #HV0 #HL02
109 elim (reqx_inv_bind … HL02) -HL02 #HW0 #HT0
110 lapply (reqx_bind_repl_dx … HT0 (BPair Abst W2) ?) -HT0
111 /2 width=1 by ext2_pair/ #H2T0
112 /3 width=1 by cpx_beta/
113 | #p #G #L0 #V0 #V1 #U1 #W0 #W1 #T0 #T1 #_ #_ #_ #IHV #IHW #IHT #HVU1 #X2 #HX2 #X3 #HX3 #L2 #HL02
114 elim (teqx_inv_pair1 … HX2) -HX2 #V2 #X #HV02 #HX #H destruct
115 elim (teqx_inv_pair1 … HX) -HX #W2 #T2 #HW02 #HT02 #H destruct
116 elim (teqx_inv_pair1 … HX3) -HX3 #W3 #X #HW13 #HX #H destruct
117 elim (teqx_inv_pair1 … HX) -HX #U3 #T3 #HU13 #HT13 #H destruct
118 elim (reqx_inv_flat … HL02) -HL02 #HV0 #HL02
119 elim (reqx_inv_bind … HL02) -HL02 #HW0 #HT0
120 lapply (reqx_bind_repl_dx … HT0 (BPair Abbr W2) ?) -HT0
121 /2 width=1 by ext2_pair/ #HT0
122 elim (teqx_inv_lifts_sn … HU13 … HVU1) -U1 #V3 #HVU3 #HV13
123 /3 width=3 by cpx_theta/
127 lemma cpx_teqx_conf (G) (L):
128 ∀T0:term. ∀T1. ❪G,L❫ ⊢ T0 ⬈ T1 → ∀T2. T0 ≛ T2 → ❪G,L❫ ⊢ T2 ⬈ T1.
129 /2 width=7 by cpx_teqx_repl_reqx/ qed-.
131 lemma teqx_cpx_trans (G) (L):
132 ∀T2. ∀T0:term. T2 ≛ T0 → ∀T1. ❪G,L❫ ⊢ T0 ⬈ T1 → ❪G,L❫ ⊢ T2 ⬈ T1.
133 /3 width=3 by cpx_teqx_conf, teqx_sym/
136 lemma teqx_cpx (G) (L):
137 ∀T1,T2:term. T1 ≛ T2 → ❪G,L❫ ⊢ T1 ⬈ T2.
138 /2 width=3 by teqx_cpx_trans/ qed.
140 (* Basic_2A1: uses: cpx_lleq_conf *)
141 lemma cpx_reqx_conf (G):
142 ∀L0,T0,T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → ∀L2. L0 ≛[T0] L2 → ❪G,L2❫ ⊢ T0 ⬈ T1.
143 /2 width=7 by cpx_teqx_repl_reqx/ qed-.
145 (* Basic_2A1: uses: lleq_cpx_trans *)
146 lemma reqx_cpx_trans (G):
147 ∀L2,L0,T0. L2 ≛[T0] L0 → ∀T1. ❪G,L0❫ ⊢ T0 ⬈ T1 → ❪G,L2❫ ⊢ T0 ⬈ T1.
148 /3 width=3 by cpx_reqx_conf, reqx_sym/
151 lemma rpx_reqx_conf (G) (T):
152 confluent1 … (rpx G T) (reqx T).
153 /3 width=7 by reqx_fsge_comp, cpx_teqx_repl_reqx, rex_conf1/ qed-.
155 lemma reqx_rpx_trans (G) (T) (L):
156 ∀L1. L1 ≛[T] L → ∀L2. ❪G,L❫ ⊢ ⬈[T] L2 → ❪G,L1❫ ⊢ ⬈[T] L2.
157 /3 width=3 by rpx_reqx_conf, reqx_sym/ qed-.
159 lemma reqx_rpx (G) (T):
160 ∀L1,L2. L1 ≛[T] L2 → ❪G,L1❫ ⊢ ⬈[T] L2.
161 /2 width=3 by reqx_rpx_trans/ qed.