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/rt_transition/cpm.ma".
17 (* CONTEXT-SENSITIVE PARALLEL R-TRANSITION FOR TERMS ************************)
19 (* Basic inversion properties ***********************************************)
21 lemma cpr_inv_atom1: ∀h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[h] T2 →
23 | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≡ T2 &
24 L = K.ⓓV1 & J = LRef 0
25 | ∃∃I,K,V,T,i. ⦃G, K⦄ ⊢ #i ➡[h] T & ⬆*[1] T ≡ T2 &
26 L = K.ⓑ{I}V & J = LRef (⫯i).
27 #h #J #G #L #T2 #H elim (cpm_inv_atom1 … H) -H *
28 /3 width=9 by or3_intro0, or3_intro1, or3_intro2, ex4_5_intro, ex4_3_intro/
29 [ #n #_ #_ #H destruct
30 | #n #K #V1 #V2 #_ #_ #_ #_ #H destruct
34 (* Basic_1: includes: pr0_gen_sort pr2_gen_sort *)
35 lemma cpr_inv_sort1: ∀h,G,L,T2,s. ⦃G, L⦄ ⊢ ⋆s ➡[h] T2 → T2 = ⋆s.
36 #h #G #L #T2 #s #H elim (cpm_inv_sort1 … H) -H * // #_ #H destruct
39 lemma cpr_inv_zero1: ∀h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[h] T2 →
41 ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≡ T2 &
43 #h #G #L #T2 #H elim (cpm_inv_zero1 … H) -H *
44 /3 width=6 by ex3_3_intro, or_introl, or_intror/
45 #n #K #V1 #V2 #_ #_ #_ #H destruct
48 lemma cpr_inv_lref1: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #⫯i ➡[h] T2 →
50 ∃∃I,K,V,T. ⦃G, K⦄ ⊢ #i ➡[h] T & ⬆*[1] T ≡ T2 & L = K.ⓑ{I}V.
51 #h #G #L #T2 #i #H elim (cpm_inv_lref1 … H) -H *
52 /3 width=7 by ex3_4_intro, or_introl, or_intror/
55 lemma cpr_inv_gref1: ∀h,G,L,T2,l. ⦃G, L⦄ ⊢ §l ➡[h] T2 → T2 = §l.
56 #h #G #L #T2 #l #H elim (cpm_inv_gref1 … H) -H //
59 lemma cpr_inv_flat1: ∀h,I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡[h] U2 →
60 ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[h] T2 &
62 | (⦃G, L⦄ ⊢ U1 ➡[h] U2 ∧ I = Cast)
63 | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ W1 ➡[h] W2 &
64 ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[h] T2 & U1 = ⓛ{p}W1.T1 &
65 U2 = ⓓ{p}ⓝW2.V2.T2 & I = Appl
66 | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≡ V2 &
67 ⦃G, L⦄ ⊢ W1 ➡[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h] T2 &
69 U2 = ⓓ{p}W2.ⓐV2.T2 & I = Appl.
70 #h #I #G #L #V1 #U1 #U2 #H elim (cpm_inv_flat1 … H) -H *
71 /3 width=13 by or4_intro0, or4_intro1, or4_intro2, or4_intro3, ex7_7_intro, ex6_6_intro, ex3_2_intro, conj/
75 (* Basic_1: includes: pr0_gen_cast pr2_gen_cast *)
76 lemma cpr_inv_cast1: ∀h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝ V1. U1 ➡[h] U2 → (
77 ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[h] T2 &
79 ) ∨ ⦃G, L⦄ ⊢ U1 ➡[h] U2.
80 #h #G #L #V1 #U1 #U2 #H elim (cpm_inv_cast1 … H) -H
81 /2 width=1 by or_introl, or_intror/ * #n #_ #H destruct
84 (* Basic_1: removed theorems 12:
85 pr0_subst0_back pr0_subst0_fwd pr0_subst0
87 pr2_head_2 pr2_cflat clear_pr2_trans
88 pr2_gen_csort pr2_gen_cflat pr2_gen_cbind
89 pr2_gen_ctail pr2_ctail
91 (* Basic_1: removed local theorems 4:
92 pr0_delta_eps pr0_cong_delta
93 pr2_free_free pr2_free_delta