]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/computation/cprs_tstc.ma
- property S4 of strongly normalizing term proved!
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / computation / cprs_tstc.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/grammar/tstc.ma".
16 include "basic_2/computation/cprs_lift.ma".
17 include "basic_2/computation/cprs_lcprs.ma".
18
19 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
20
21 (* Forward lemmas involving same top term constructor ***********************)
22
23 (* Basic_1: was: pr3_iso_beta *)
24 lemma cprs_fwd_beta: ∀L,V,W,T,U. L ⊢ ⓐV. ⓛW. T ➡* U →
25                      ⓐV. ⓛW. T ≃ U ∨ L ⊢ ⓓV. T ➡* U.
26 #L #V #W #T #U #H
27 elim (cprs_inv_appl1 … H) -H *
28 [ #V0 #T0 #_ #_ #H destruct /2 width=1/
29 | #V0 #W0 #T0 #HV0 #HT0 #HU
30   elim (cprs_inv_abst1 Abbr V … HT0) -HT0 #W1 #T1 #_ #HT1 #H destruct -W1
31   @or_intror -W
32   @(cprs_trans … HU) -U /2 width=1/ (**) (* explicit constructor *)
33 | #V1 #V2 #V0 #T1 #_ #_ #HT1 #_
34   elim (cprs_inv_abst1 Abbr V … HT1) -HT1 #W2 #T2 #_ #_ #H destruct
35 ]
36 qed-.
37
38 (* Note: probably this is an inversion lemma *)
39 lemma cprs_fwd_delta: ∀L,K,V1,i. ⇩[0, i] L ≡ K. ⓓV1 →
40                       ∀V2. ⇧[0, i + 1] V1 ≡ V2 →
41                       ∀U. L ⊢ #i ➡* U →
42                       #i ≃ U ∨ L ⊢ V2 ➡* U.
43 #L #K #V1 #i #HLK #V2 #HV12 #U #H
44 elim (cprs_inv_lref1 … H) -H /2 width=1/
45 * #K0 #V0 #U0 #HLK0 #HVU0 #HU0 #_
46 lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
47 lapply (ldrop_fwd_ldrop2 … HLK) -HLK /3 width=9/
48 qed-.
49
50 lemma cprs_fwd_theta: ∀L,V1,V,T,U. L ⊢ ⓐV1. ⓓV. T ➡* U →
51                       ∀V2. ⇧[0, 1] V1 ≡ V2 → ⓐV1. ⓓV. T ≃ U ∨
52                       L ⊢ ⓓV. ⓐV2. T ➡* U.
53 #L #V1 #V #T #U #H #V2 #HV12
54 elim (cprs_inv_appl1 … H) -H *
55 [ -HV12 #V0 #T0 #_ #_ #H destruct /2 width=1/
56 | #V0 #W #T0 #HV10 #HT0 #HU
57   elim (cprs_inv_abbr1 … HT0) -HT0 *
58   [ #V3 #T3 #_ #_ #H destruct
59   | #X #H #HT2
60     elim (lift_inv_bind1 … H) -H #W2 #T2 #HW2 #HT02 #H destruct
61     @or_intror @(cprs_trans … HU) -U (**) (* explicit constructor *)
62     @(cprs_trans … (ⓓV.ⓐV2.ⓛW2.T2)) [ /3 width=1/ ] -T
63     @(cprs_strap2 … (ⓐV1.ⓛW.T0)) [ /5 width=3/ ] -V -V2 -W2 -T2
64     @(cprs_strap2 … (ⓓV1.T0)) [ /3 width=1/ ] -W /2 width=1/
65   ]
66 | #V3 #V4 #V0 #T0 #HV13 #HV34 #HT0 #HU
67   @or_intror @(cprs_trans … HU) -U (**) (* explicit constructor *)
68   elim (cprs_inv_abbr1 … HT0) -HT0 *
69   [ #V5 #T5 #HV5 #HT5 #H destruct
70     lapply (cprs_lift (L.ⓓV) … HV12 … HV13 … HV34) -V1 -V3 /2 width=1/
71     /3 width=1/
72   | #X #H #HT1
73     elim (lift_inv_bind1 … H) -H #V5 #T5 #HV05 #HT05 #H destruct
74     lapply (cprs_lift (L.ⓓV0) … HV12 … HV13 … HV34) -V3 /2 width=1/ #HV24
75     @(cprs_trans … (ⓓV.ⓐV2.ⓓV5.T5)) [ /3 width=1/ ] -T
76     @(cprs_strap2 … (ⓐV1.ⓓV0.T0)) [ /5 width=3/ ] -V -V5 -T5
77     @(cprs_strap2 … (ⓓV0.ⓐV2.T0)) [ /3 width=3/ ] -V1 /3 width=9/
78   ]
79 ]
80 qed-.
81
82 lemma cprs_fwd_tau: ∀L,W,T,U. L ⊢ ⓣW. T ➡* U →
83                     ⓣW. T ≃ U ∨ L ⊢ T ➡* U.
84 #L #W #T #U #H
85 elim (cprs_inv_cast1 … H) -H /2 width=1/ *
86 #W0 #T0 #_ #_ #H destruct /2 width=1/
87 qed-.