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/relocation/lifts_tueq.ma".
16 include "basic_2/rt_transition/cpm.ma".
18 (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
20 (* Properties with tail sort-irrelevant equivalence on terms ****************)
22 lemma cpm_tueq_conf (h) (n) (G) (L) (T0):
23 ∀T1. ⦃G,L⦄ ⊢ T0 ➡[n,h] T1 → ∀T2. T0 ≅ T2 →
24 ∃∃T. ⦃G,L⦄ ⊢ T2 ➡[n,h] T & T1 ≅ T.
25 #h #n #G #L #T0 #T1 #H @(cpm_ind … H) -G -L -T0 -T1 -n
26 [ /2 width=3 by ex2_intro/
28 elim (tueq_inv_sort1 … H2) -H2 #s2 #H destruct
29 /3 width=3 by tueq_sort, ex2_intro/
30 | #n #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #X2 #H2
31 >(tueq_inv_lref1 … H2) -X2
32 elim (IH V0) [| // ] -IH #V #HV0 #HV1
33 elim (tueq_lifts_sn … HV1 … HVW1) -V1
34 /3 width=3 by cpm_delta, ex2_intro/
35 | #n #G #K0 #V0 #V1 #W1 #_ #IH #HVW1 #X2 #H2
36 >(tueq_inv_lref1 … H2) -X2
37 elim (IH V0) [| // ] -IH #V #HV0 #HV1
38 elim (tueq_lifts_sn … HV1 … HVW1) -V1
39 /3 width=3 by cpm_ell, ex2_intro/
40 | #n #I #G #K0 #V1 #W1 #i #_ #IH #HVW1 #X2 #H2
41 >(tueq_inv_lref1 … H2) -X2
42 elim (IH (#i)) [| // ] -IH #V #HV0 #HV1
43 elim (tueq_lifts_sn … HV1 … HVW1) -V1
44 /3 width=3 by cpm_lref, ex2_intro/
45 | #n #p #I #G #L #V0 #V1 #T0 #T1 #HV01 #_ #_ #IHT #X2 #H2
46 elim (tueq_inv_bind1 … H2) -H2 #T2 #HT02 #H destruct
47 elim (IHT … HT02) -T0 #T #HT2 #HT1
48 /3 width=3 by cpm_bind, tueq_bind, ex2_intro/
49 | #n #G #L #V0 #V1 #T0 #T1 #HV10 #_ #_ #IHT #X2 #H2
50 elim (tueq_inv_appl1 … H2) -H2 #T2 #HT02 #H destruct
51 elim (IHT … HT02) -T0 #T #HT2 #HT1
52 /3 width=3 by cpm_appl, tueq_appl, ex2_intro/
53 | #n #G #L #V0 #V1 #T0 #T1 #_ #_ #IHV #IHT #X2 #H2
54 elim (tueq_inv_cast1 … H2) -H2 #V2 #T2 #HV02 #HT02 #H destruct
55 elim (IHV … HV02) -V0 #V #HV2 #HV1
56 elim (IHT … HT02) -T0 #T #HT2 #HT1
57 /3 width=5 by cpm_cast, tueq_cast, ex2_intro/
58 | #n #G #L #V0 #U0 #T0 #T1 #HTU0 #_ #IH #X2 #H2
59 elim (tueq_inv_bind1 … H2) -H2 #U2 #HU02 #H destruct
60 elim (tueq_inv_lifts_sn … HU02 … HTU0) -U0 #T2 #HTU2 #HT02
61 elim (IH … HT02) -T0 #T #HT2 #HT1
62 /3 width=3 by cpm_zeta, ex2_intro/
63 | #n #G #L #V0 #T0 #T1 #_ #IH #X2 #H2
64 elim (tueq_inv_cast1 … H2) -H2 #V2 #T2 #_ #HT02 #H destruct
65 elim (IH … HT02) -V0 -T0
66 /3 width=3 by cpm_eps, ex2_intro/
67 | #n #G #L #V0 #T0 #T1 #_ #IH #X2 #H2
68 elim (tueq_inv_cast1 … H2) -H2 #V2 #T2 #HV02 #_ #H destruct
69 elim (IH … HV02) -V0 -T1
70 /3 width=3 by cpm_ee, ex2_intro/
71 | #n #p #G #L #V0 #V1 #W0 #W1 #T0 #T1 #HV01 #HW01 #_ #_ #_ #IHT #X2 #H2
72 elim (tueq_inv_appl1 … H2) -H2 #X #H2 #H destruct
73 elim (tueq_inv_bind1 … H2) -H2 #T2 #HT02 #H destruct
75 /4 width=3 by cpm_beta, tueq_cast, tueq_bind, ex2_intro/
76 | #n #p #G #L #V0 #V1 #U1 #W0 #W1 #T0 #T1 #HV01 #HW01 #_ #_ #_ #IHT #HVU1 #X2 #H2
77 elim (tueq_inv_appl1 … H2) -H2 #X #H2 #H destruct
78 elim (tueq_inv_bind1 … H2) -H2 #T2 #HT02 #H destruct
79 elim (IHT … HT02) -T0 #T #HT2 #HT1
80 /4 width=3 by cpm_theta, tueq_appl, tueq_bind, ex2_intro/
84 lemma tueq_cpm_trans (h) (n) (G) (L) (T0):
85 ∀T1. T1 ≅ T0 → ∀T2. ⦃G,L⦄ ⊢ T0 ➡[n,h] T2 →
86 ∃∃T. ⦃G,L⦄ ⊢ T1 ➡[n,h] T & T ≅ T2.
87 #h #n #G #L #T0 #T1 #HT10 #T2 #HT02
88 elim (cpm_tueq_conf … HT02 T1)
89 /3 width=3 by tueq_sym, ex2_intro/