]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/tprs.ma
- lambda_delta: programmed renaming to lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / tprs.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/reducibility/tpr.ma".
16
17 (* CONTEXT-FREE PARALLEL COMPUTATION ON TERMS *******************************)
18
19 (* Basic_1: includes: pr1_pr0 *)
20 definition tprs: relation term ≝ TC … tpr.
21
22 interpretation "context-free parallel computation (term)"
23    'PRedStar T1 T2 = (tprs T1 T2).
24
25 (* Basic eliminators ********************************************************)
26
27 lemma tprs_ind: ∀T1. ∀R:predicate term. R T1 →
28                 (∀T,T2. T1 ➡* T → T ➡ T2 → R T → R T2) →
29                 ∀T2. T1 ➡* T2 → R T2.
30 #T1 #R #HT1 #IHT1 #T2 #HT12
31 @(TC_star_ind … HT1 IHT1 … HT12) //
32 qed-.
33
34 lemma tprs_ind_dx: ∀T2. ∀R:predicate term. R T2 →
35                    (∀T1,T. T1 ➡ T → T ➡* T2 → R T → R T1) →
36                    ∀T1. T1 ➡* T2 → R T1.
37 #T2 #R #HT2 #IHT2 #T1 #HT12
38 @(TC_star_ind_dx … HT2 IHT2 … HT12) //
39 qed-.
40
41 (* Basic properties *********************************************************)
42
43 lemma tprs_refl: reflexive … tprs.
44 /2 width=1/ qed.
45
46 lemma tprs_strap1: ∀T1,T,T2. T1 ➡* T → T ➡ T2 → T1 ➡* T2.
47 /2 width=3/ qed.
48
49 lemma tprs_strap2: ∀T1,T,T2. T1 ➡ T → T ➡* T2 → T1 ➡* T2.
50 /2 width=3/ qed.
51
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
56 [1,3: /3 width=1/
57 |2,4: #V #V2 #_ #HV2 #IHV1
58       @(tprs_strap1 … IHV1) -IHV1 /2 width=1/
59 ]
60 qed.
61
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
66 [1,3: /3 width=1/
67 |2,4: #T #T2 #_ #HT2 #IHT1
68       @(tprs_strap1 … IHT1) -IHT1 /2 width=1/
69 ]
70 qed.
71
72 (* Basic inversion lemmas ***************************************************)
73
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 //
78 qed-.
79
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/
87 qed-.