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/reducibility/tpr.ma".
17 (* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************)
19 (* Basic_1: includes: pr1_pr0 *)
20 definition tprs: relation term ≝ TC … tpr.
22 interpretation "context-free parallel computation (term)"
23 'PRedStar T1 T2 = (tprs T1 T2).
25 (* Basic eliminators ********************************************************)
27 lemma tprs_ind: ∀T1. ∀R:predicate term. R T1 →
28 (∀T,T2. T1 ➡* T → T ➡ T2 → R T → R T2) →
30 #T1 #R #HT1 #IHT1 #T2 #HT12
31 @(TC_star_ind … HT1 IHT1 … HT12) //
34 lemma tprs_ind_dx: ∀T2. ∀R:predicate term. R T2 →
35 (∀T1,T. T1 ➡ T → T ➡* T2 → R T → R T1) →
37 #T2 #R #HT2 #IHT2 #T1 #HT12
38 @(TC_star_ind_dx … HT2 IHT2 … HT12) //
41 (* Basic properties *********************************************************)
43 lemma tprs_refl: reflexive … tprs.
46 lemma tprs_strap1: ∀T1,T,T2. T1 ➡* T → T ➡ T2 → T1 ➡* T2.
49 lemma tprs_strap2: ∀T1,T,T2. T1 ➡ T → T ➡* T2 → T1 ➡* T2.
52 (* Basic_1: was only: pr1_head_1 *)
53 lemma tprs_pair_sn: ∀I,T1,T2. T1 ➡ T2 → ∀V1,V2. V1 ➡* V2 →
54 ②{I} V1. T1 ➡* ②{I} V2. T2.
55 * [ #a ] #I #T1 #T2 #HT12 #V1 #V2 #H @(tprs_ind … H) -V2
57 |2,4: #V #V2 #_ #HV2 #IHV1
58 @(tprs_strap1 … IHV1) -IHV1 /2 width=1/
62 (* Basic_1: was only: pr1_head_2 *)
63 lemma tprs_pair_dx: ∀I,V1,V2. V1 ➡ V2 → ∀T1,T2. T1 ➡* T2 →
64 ②{I} V1. T1 ➡* ②{I} V2. T2.
65 * [ #a ] #I #V1 #V2 #HV12 #T1 #T2 #H @(tprs_ind … H) -T2
67 |2,4: #T #T2 #_ #HT2 #IHT1
68 @(tprs_strap1 … IHT1) -IHT1 /2 width=1/
72 (* Basic inversion lemmas ***************************************************)
74 lemma tprs_inv_atom1: ∀U2,k. ⋆k ➡* U2 → U2 = ⋆k.
75 #U2 #k #H @(tprs_ind … H) -U2 //
76 #U #U2 #_ #HU2 #IHU1 destruct
77 >(tpr_inv_atom1 … HU2) -HU2 //
80 lemma tprs_inv_cast1: ∀W1,T1,U2. ⓝW1.T1 ➡* U2 → T1 ➡* U2 ∨
81 ∃∃W2,T2. W1 ➡* W2 & T1 ➡* T2 & U2 = ⓝW2.T2.
82 #W1 #T1 #U2 #H @(tprs_ind … H) -U2 /3 width=5/
83 #U #U2 #_ #HU2 * /3 width=3/ *
84 #W #T #HW1 #HT1 #H destruct
85 elim (tpr_inv_cast1 … HU2) -HU2 /3 width=3/ *
86 #W2 #T2 #HW2 #HT2 #H destruct /4 width=5/