]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/computation/cprs.ma
5ea230f9b91af1b7d17eda7d453a2779ea36a605
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / computation / cprs.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/cnf.ma".
16
17 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
18
19 (* Basic_1: includes: pr3_pr2 *)
20 definition cprs: lenv → relation term ≝
21                  λL. TC … (cpr L).
22
23 interpretation "context-sensitive parallel computation (term)"
24    'PRedStar L T1 T2 = (cprs L T1 T2).
25
26 (* Basic eliminators ********************************************************)
27
28 lemma cprs_ind: ∀L,T1. ∀R:predicate term. R T1 →
29                 (∀T,T2. L ⊢ T1 ➡* T → L ⊢ T ➡ T2 → R T → R T2) →
30                 ∀T2. L ⊢ T1 ➡* T2 → R T2.
31 #L #T1 #R #HT1 #IHT1 #T2 #HT12
32 @(TC_star_ind … HT1 IHT1 … HT12) //
33 qed-.
34
35 lemma cprs_ind_dx: ∀L,T2. ∀R:predicate term. R T2 →
36                    (∀T1,T. L ⊢ T1 ➡ T → L ⊢ T ➡* T2 → R T → R T1) →
37                    ∀T1. L ⊢ T1 ➡* T2 → R T1.
38 #L #T2 #R #HT2 #IHT2 #T1 #HT12
39 @(TC_star_ind_dx … HT2 IHT2 … HT12) //
40 qed-.
41
42 (* Basic properties *********************************************************)
43
44 (* Basic_1: was: pr3_refl *)
45 lemma cprs_refl: ∀L,T. L ⊢ T ➡* T.
46 /2 width=1/ qed.
47
48 lemma cprs_strap1: ∀L,T1,T,T2.
49                    L ⊢ T1 ➡* T → L ⊢ T ➡ T2 → L ⊢ T1 ➡* T2.
50 /2 width=3/ qed.
51
52 (* Basic_1: was: pr3_step *)
53 lemma cprs_strap2: ∀L,T1,T,T2.
54                    L ⊢ T1 ➡ T → L ⊢ T ➡* T2 → L ⊢ T1 ➡* T2.
55 /2 width=3/ qed.
56
57 (* Note: it does not hold replacing |L1| with |L2| *)
58 lemma cprs_lsubs_conf: ∀L1,T1,T2. L1 ⊢ T1 ➡* T2 →
59                        ∀L2. L1 [0, |L1|] ≼ L2 → L2 ⊢ T1 ➡* T2.
60 /3 width=3/
61 qed.
62
63 lemma cprs_flat_dx: ∀I,L,V1,V2. L ⊢ V1 ➡ V2 → ∀T1,T2. L ⊢ T1 ➡* T2 →
64                     L ⊢ ⓕ{I} V1. T1 ➡* ⓕ{I} V2. T2.
65 #I #L #V1 #V2 #HV12 #T1 #T2 #HT12 @(cprs_ind … HT12) -T2 /3 width=1/
66 #T #T2 #_ #HT2 #IHT2
67 @(cprs_strap1 … IHT2) -IHT2 /2 width=1/
68 qed.
69
70 (* Basic inversion lemmas ***************************************************)
71
72 (* Basic_1: was: pr3_gen_sort *)
73 lemma cprs_inv_sort1: ∀L,U2,k. L ⊢ ⋆k ➡* U2 → U2 = ⋆k.
74 #L #U2 #k #H @(cprs_ind … H) -U2 //
75 #U2 #U #_ #HU2 #IHU2 destruct
76 >(cpr_inv_sort1 … HU2) -HU2 //
77 qed-.
78
79 (* Basic_1: was: pr3_gen_cast *)
80 lemma cprs_inv_cast1: ∀L,W1,T1,U2. L ⊢ ⓣW1.T1 ➡* U2 → L ⊢ T1 ➡* U2 ∨
81                       ∃∃W2,T2. L ⊢ W1 ➡* W2 & L ⊢ T1 ➡* T2 & U2 = ⓣW2.T2.
82 #L #W1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5/
83 #U2 #U #_ #HU2 * /3 width=3/ *
84 #W #T #HW1 #HT1 #H destruct
85 elim (cpr_inv_cast1 … HU2) -HU2 /3 width=3/ *
86 #W2 #T2 #HW2 #HT2 #H destruct /4 width=5/
87 qed-.
88
89 lemma cprs_inv_cnf1: ∀L,T,U. L ⊢ T ➡* U → L ⊢ 𝐍[T] → T = U.
90 #L #T #U #H @(cprs_ind_dx … H) -T //
91 #T0 #T #H1T0 #_ #IHT #H2T0
92 lapply (H2T0 … H1T0) -H1T0 #H destruct /2 width=1/
93 qed-.
94
95 (* Basic_1: removed theorems 6:
96    clear_pr3_trans pr3_cflat pr3_gen_bind
97    pr3_iso_appl_bind pr3_iso_appls_appl_bind pr3_iso_appls_bind
98 *)