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/cpr.ma".
16 include "basic_2/rt_computation/cpms.ma".
18 (* CONTEXT-SENSITIVE PARALLEL R-COMPUTATION FOR TERMS ***********************)
20 (* Basic eliminators ********************************************************)
22 (* Basic_2A1: was: cprs_ind_dx *)
23 lemma cprs_ind_sn (h) (G) (L) (T2) (R:predicate …):
25 (∀T1,T. ⦃G, L⦄ ⊢ T1 ➡[h] T → ⦃G, L⦄ ⊢ T ➡*[h] T2 → R T → R T1) →
26 ∀T1. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 → R T1.
27 #h #G #L #T2 #R #IH1 #IH2 #T1
28 @(insert_eq_0 … 0) #n #H
29 @(cpms_ind_sn … H) -n -T1 //
30 #n1 #n2 #T1 #T #HT1 #HT2 #IH #H
31 elim (plus_inv_O3 n1 n2) // -H #H1 #H2 destruct
35 (* Basic_2A1: was: cprs_ind *)
36 lemma cprs_ind_dx (h) (G) (L) (T1) (R:predicate …):
38 (∀T,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T → ⦃G, L⦄ ⊢ T ➡[h] T2 → R T → R T2) →
39 ∀T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 → R T2.
40 #h #G #L #T1 #R #IH1 #IH2 #T2
41 @(insert_eq_0 … 0) #n #H
42 @(cpms_ind_dx … H) -n -T2 //
43 #n1 #n2 #T #T2 #HT1 #IH #HT2 #H
44 elim (plus_inv_O3 n1 n2) // -H #H1 #H2 destruct
48 (* Basic properties *********************************************************)
50 (* Basic_1: was: pr3_step *)
51 (* Basic_2A1: was: cprs_strap2 *)
52 lemma cprs_step_sn (h) (G) (L):
53 ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡[h] T →
54 ∀T2. ⦃G, L⦄ ⊢ T ➡*[h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[h] T2.
55 /2 width=3 by cpms_step_sn/ qed-.
57 (* Basic_2A1: was: cprs_strap1 *)
58 lemma cprs_step_dx (h) (G) (L):
59 ∀T1,T. ⦃G, L⦄ ⊢ T1 ➡*[h] T →
60 ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[h] T2.
61 /2 width=3 by cpms_step_dx/ qed-.
63 (* Basic_1: was only: pr3_thin_dx *)
64 lemma cprs_flat_dx (h) (I) (G) (L):
65 ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
66 ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 →
67 ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2.
68 #h #I #G #L #V1 #V2 #HV12 #T1 #T2 #H @(cprs_ind_sn … H) -T1
69 /3 width=3 by cprs_step_sn, cpm_cpms, cpr_flat/
72 lemma cprs_flat_sn (h) (I) (G) (L):
73 ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h] T2 → ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 →
74 ⦃G, L⦄ ⊢ ⓕ{I} V1. T1 ➡*[h] ⓕ{I} V2. T2.
75 #h #I #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cprs_ind_sn … H) -V1
76 /3 width=3 by cprs_step_sn, cpm_cpms, cpr_flat/
79 (* Basic inversion lemmas ***************************************************)
81 (* Basic_1: was: pr3_gen_sort *)
82 lemma cprs_inv_sort1 (h) (G) (L): ∀X2,s. ⦃G, L⦄ ⊢ ⋆s ➡*[h] X2 → X2 = ⋆s.
83 /2 width=4 by cpms_inv_sort1/ qed-.
85 (* Basic_1: was: pr3_gen_cast *)
86 lemma cprs_inv_cast1 (h) (G) (L): ∀W1,T1,X2. ⦃G, L⦄ ⊢ ⓝW1.T1 ➡*[h] X2 →
87 ∨∨ ⦃G, L⦄ ⊢ T1 ➡*[h] X2
88 | ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ➡*[h] W2 & ⦃G, L⦄ ⊢ T1 ➡*[h] T2 & X2 = ⓝW2.T2.
89 #h #G #L #W1 #T1 #X2 #H @(cprs_ind_dx … H) -X2
90 [ /3 width=5 by ex3_2_intro, or_intror/
91 | #X #X2 #_ #HX2 * /3 width=3 by cprs_step_dx, or_introl/ *
92 #W #T #HW1 #HT1 #H destruct
93 elim (cpr_inv_cast1 … HX2) -HX2 /3 width=3 by cprs_step_dx, or_introl/ *
94 #W2 #T2 #HW2 #HT2 #H destruct
95 /4 width=5 by cprs_step_dx, ex3_2_intro, or_intror/
99 (* Basic_1: removed theorems 13:
100 pr1_head_1 pr1_head_2 pr1_comp
101 clear_pr3_trans pr3_cflat pr3_gen_bind
102 pr3_head_1 pr3_head_2 pr3_head_21 pr3_head_12
103 pr3_iso_appl_bind pr3_iso_appls_appl_bind pr3_iso_appls_bind