]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpr.ma
042e814cdb4b34a4b2718240704da5b3644b9b4f
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_transition / cpr.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/rt_transition/cpm.ma".
16
17 (* CONTEXT-SENSITIVE PARALLEL R-TRANSITION FOR TERMS ************************)
18
19 (* Basic properties *********************************************************)
20
21 (* Note: cpr_flat: does not hold in basic_1 *)
22 (* Basic_1: includes: pr2_thin_dx *)
23 lemma cpr_flat: ∀h,I,G,L,V1,V2,T1,T2.
24                 ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[h] T2 →
25                 ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡[h] ⓕ{I}V2.T2.
26 #h * /2 width=1 by cpm_cast, cpm_appl/
27 qed. 
28
29 (* Basic_1: was: pr2_head_1 *)
30 lemma cpr_pair_sn: ∀h,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
31                    ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ➡[h] ②{I}V2.T.
32 #h * /2 width=1 by cpm_bind, cpr_flat/
33 qed.
34
35 (* Basic inversion properties ***********************************************)
36
37 lemma cpr_inv_atom1: ∀h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[h] T2 →
38                      ∨∨ T2 = ⓪{J}
39                       | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≘ T2 &
40                                    L = K.ⓓV1 & J = LRef 0
41                       | ∃∃I,K,T,i. ⦃G, K⦄ ⊢ #i ➡[h] T & ⬆*[1] T ≘ T2 &
42                                    L = K.ⓘ{I} & J = LRef (↑i).
43 #h #J #G #L #T2 #H elim (cpm_inv_atom1 … H) -H *
44 /3 width=8 by tri_lt, or3_intro0, or3_intro1, or3_intro2, ex4_4_intro, ex4_3_intro/
45 #n #_ #_ #H destruct
46 qed-.
47
48 (* Basic_1: includes: pr0_gen_sort pr2_gen_sort *)
49 lemma cpr_inv_sort1: ∀h,G,L,T2,s. ⦃G, L⦄ ⊢ ⋆s ➡[h] T2 → T2 = ⋆s.
50 #h #G #L #T2 #s #H elim (cpm_inv_sort1 … H) -H * // #_ #H destruct
51 qed-.
52
53 lemma cpr_inv_zero1: ∀h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[h] T2 →
54                      ∨∨ T2 = #0
55                       | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[h] V2 & ⬆*[1] V2 ≘ T2 &
56                                    L = K.ⓓV1.
57 #h #G #L #T2 #H elim (cpm_inv_zero1 … H) -H *
58 /3 width=6 by ex3_3_intro, or_introl, or_intror/
59 #n #K #V1 #V2 #_ #_ #_ #H destruct
60 qed-.
61
62 lemma cpr_inv_lref1: ∀h,G,L,T2,i. ⦃G, L⦄ ⊢ #↑i ➡[h] T2 →
63                      ∨∨ T2 = #(↑i)
64                       | ∃∃I,K,T. ⦃G, K⦄ ⊢ #i ➡[h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}.
65 #h #G #L #T2 #i #H elim (cpm_inv_lref1 … H) -H *
66 /3 width=6 by ex3_3_intro, or_introl, or_intror/
67 qed-.
68
69 lemma cpr_inv_gref1: ∀h,G,L,T2,l. ⦃G, L⦄ ⊢ §l ➡[h] T2 → T2 = §l.
70 #h #G #L #T2 #l #H elim (cpm_inv_gref1 … H) -H //
71 qed-.
72
73 (* Basic_1: includes: pr0_gen_cast pr2_gen_cast *)
74 lemma cpr_inv_cast1: ∀h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝ V1.U1 ➡[h] U2 →
75                      ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[h] T2 &
76                                  U2 = ⓝV2.T2
77                       | ⦃G, L⦄ ⊢ U1 ➡[h] U2.
78 #h #G #L #V1 #U1 #U2 #H elim (cpm_inv_cast1 … H) -H
79 /2 width=1 by or_introl, or_intror/ * #n #_ #H destruct
80 qed-.
81
82 lemma cpr_inv_flat1: ∀h,I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡[h] U2 →
83                      ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[h] T2 &
84                                  U2 = ⓕ{I}V2.T2
85                       | (⦃G, L⦄ ⊢ U1 ➡[h] U2 ∧ I = Cast)
86                       | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ W1 ➡[h] W2 &
87                                             ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[h] T2 & U1 = ⓛ{p}W1.T1 &
88                                             U2 = ⓓ{p}ⓝW2.V2.T2 & I = Appl
89                       | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≘ V2 &
90                                               ⦃G, L⦄ ⊢ W1 ➡[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[h] T2 &
91                                               U1 = ⓓ{p}W1.T1 &
92                                               U2 = ⓓ{p}W2.ⓐV2.T2 & I = Appl.
93 #h * #G #L #V1 #U1 #U2 #H
94 [ elim (cpm_inv_appl1 … H) -H *
95   /3 width=13 by or4_intro0, or4_intro2, or4_intro3, ex7_7_intro, ex6_6_intro, ex3_2_intro/
96 | elim (cpr_inv_cast1 … H) -H [ * ]
97   /3 width=5 by or4_intro0, or4_intro1, ex3_2_intro, conj/
98 ]
99 qed-.
100
101 (* Basic_1: removed theorems 12:
102             pr0_subst0_back pr0_subst0_fwd pr0_subst0
103             pr0_delta1
104             pr2_head_2 pr2_cflat clear_pr2_trans
105             pr2_gen_csort pr2_gen_cflat pr2_gen_cbind
106             pr2_gen_ctail pr2_ctail
107 *)