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 "basic_2/unfold/tpss_tpss.ma".
16 include "basic_2/unfold/ltpss_tpss.ma".
18 (* PARTIAL UNFOLD ON LOCAL ENVIRONMENTS *************************************)
20 (* Advanced properties ******************************************************)
22 lemma ltpss_tpss_conf: ∀L0,T2,U2,d2,e2. L0 ⊢ T2 [d2, e2] ▶* U2 →
23 ∀L1,d1,e1. L0 [d1, e1] ▶* L1 →
24 ∃∃T. L1 ⊢ T2 [d2, e2] ▶* T &
25 L1 ⊢ U2 [d1, e1] ▶* T.
26 #L0 #T2 #U2 #d2 #e2 #H #L1 #d1 #e1 #HL01 @(tpss_ind … H) -U2 /2 width=3/
27 #U #U2 #_ #HU2 * #X2 #HTX2 #HUX2
28 elim (ltpss_tps_conf … HU2 … HL01) -L0 #X1 #HUX1 #HU2X1
29 elim (tpss_strip_eq … HUX2 … HUX1) -U #X #HX2 #HX1
30 lapply (tpss_trans_eq … HU2X1 … HX1) -X1 /3 width=3/
33 lemma ltpss_tpss_trans_down: ∀L0,L1,T2,U2,d1,e1,d2,e2. d2 + e2 ≤ d1 →
34 L1 [d1, e1] ▶* L0 → L0 ⊢ T2 [d2, e2] ▶* U2 →
35 ∃∃T. L1 ⊢ T2 [d2, e2] ▶* T & L0 ⊢ T [d1, e1] ▶* U2.
36 #L0 #L1 #T2 #U2 #d1 #e1 #d2 #e2 #Hde2d1 #HL10 #H @(tpss_ind … H) -U2
38 | #U #U2 #_ #HU2 * #T #HT2 #HTU
39 elim (tpss_strap1_down … HTU … HU2 ?) -U // #U #HTU #HU2
40 elim (ltpss_tps_trans … HTU … HL10) -HTU -HL10 #X #HTX #HXU
41 lapply (tpss_trans_eq … HXU HU2) -U /3 width=3/
45 (* Main properties **********************************************************)
47 fact ltpss_conf_aux: ∀K,K1,L1,d1,e1. K1 [d1, e1] ▶* L1 →
48 ∀K2,L2,d2,e2. K2 [d2, e2] ▶* L2 → K1 = K → K2 = K →
49 ∃∃L. L1 [d2, e2] ▶* L & L2 [d1, e1] ▶* L.
50 #K @(lw_wf_ind … K) -K #K #IH #K1 #L1 #d1 #e1 * -K1 -L1 -d1 -e1
52 | -IH #K1 #I1 #V1 #K2 #L2 #d2 #e2 * -K2 -L2 -d2 -e2
54 | #K2 #I2 #V2 #H1 #H2 destruct /2 width=3/
55 | #K2 #L2 #I2 #W2 #V2 #e2 #HKL2 #HWV2 #H1 #H2 destruct /3 width=3/
56 | #K2 #L2 #I2 #W2 #V2 #d2 #e2 #HKL2 #HWV2 #H1 #H2 destruct /3 width=3/
58 | #K1 #L1 #I1 #W1 #V1 #e1 #HKL1 #HWV1 #K2 #L2 #d2 #e2 * -K2 -L2 -d2 -e2
59 [ -IH #d2 #e2 #H1 #H2 destruct
60 | -IH #K2 #I2 #V2 #H1 #H2 destruct /3 width=5/
61 | #K2 #L2 #I2 #W2 #V2 #e2 #HKL2 #HWV2 #H1 #H2 destruct
62 elim (IH … HKL1 … HKL2 ? ?) -IH [2,4: // |3: skip |5: /2 width=1/ ] -K1 #L #HL1 #HL2
63 elim (ltpss_tpss_conf … HWV1 … HL1) #U1 #HWU1 #HVU1
64 elim (ltpss_tpss_conf … HWV2 … HL2) #U2 #HWU2 #HVU2
65 elim (tpss_conf_eq … HWU1 … HWU2) -W1 #W #HU1W #HU2W
66 lapply (tpss_trans_eq … HVU1 HU1W) -U1
67 lapply (tpss_trans_eq … HVU2 HU2W) -U2 /3 width=5/
68 | #K2 #L2 #I2 #W2 #V2 #d2 #e2 #HKL2 #HWV2 #H1 #H2 destruct
69 elim (IH … HKL1 … HKL2 ? ?) -IH [2,4: // |3: skip |5: /2 width=1/ ] -K1 #L #HL1 #HL2
70 elim (ltpss_tpss_conf … HWV1 … HL1) #U1 #HWU1 #HVU1
71 elim (ltpss_tpss_conf … HWV2 … HL2) #U2 #HWU2 #HVU2
72 elim (tpss_conf_eq … HWU1 … HWU2) -W1 #W #HU1W #HU2W
73 lapply (tpss_trans_eq … HVU1 HU1W) -U1
74 lapply (tpss_trans_eq … HVU2 HU2W) -U2 /3 width=5/
76 | #K1 #L1 #I1 #W1 #V1 #d1 #e1 #HKL1 #HWV1 #K2 #L2 #d2 #e2 * -K2 -L2 -d2 -e2
77 [ -IH #d2 #e2 #H1 #H2 destruct
78 | -IH #K2 #I2 #V2 #H1 #H2 destruct /3 width=5/
79 | #K2 #L2 #I2 #W2 #V2 #e2 #HKL2 #HWV2 #H1 #H2 destruct
80 elim (IH … HKL1 … HKL2 ? ?) -IH [2,4: // |3: skip |5: /2 width=1/ ] -K1 #L #HL1 #HL2
81 elim (ltpss_tpss_conf … HWV1 … HL1) #U1 #HWU1 #HVU1
82 elim (ltpss_tpss_conf … HWV2 … HL2) #U2 #HWU2 #HVU2
83 elim (tpss_conf_eq … HWU1 … HWU2) -W1 #W #HU1W #HU2W
84 lapply (tpss_trans_eq … HVU1 HU1W) -U1
85 lapply (tpss_trans_eq … HVU2 HU2W) -U2 /3 width=5/
86 | #K2 #L2 #I2 #W2 #V2 #d2 #e2 #HKL2 #HWV2 #H1 #H2 destruct
87 elim (IH … HKL1 … HKL2 ? ?) -IH [2,4: // |3: skip |5: /2 width=1/ ] -K1 #L #HL1 #HL2
88 elim (ltpss_tpss_conf … HWV1 … HL1) #U1 #HWU1 #HVU1
89 elim (ltpss_tpss_conf … HWV2 … HL2) #U2 #HWU2 #HVU2
90 elim (tpss_conf_eq … HWU1 … HWU2) -W1 #W #HU1W #HU2W
91 lapply (tpss_trans_eq … HVU1 HU1W) -U1
92 lapply (tpss_trans_eq … HVU2 HU2W) -U2 /3 width=5/
97 lemma ltpss_conf: ∀L0,L1,d1,e1. L0 [d1, e1] ▶* L1 →
98 ∀L2,d2,e2. L0 [d2, e2] ▶* L2 →
99 ∃∃L. L1 [d2, e2] ▶* L & L2 [d1, e1] ▶* L.