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