]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda-delta/Basic-2/reduction/tpr_tps.ma
- the theory of parallel substitution of local environments (ltps) is ready
[helm.git] / matita / matita / contribs / lambda-delta / Basic-2 / reduction / tpr_tps.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/substitution/tps_tps.ma".
16 include "Basic-2/reduction/ltpr_drop.ma".
17
18 (* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************)
19
20 axiom tpr_tps_ltpr: ∀T1,T2. T1 ⇒ T2 →
21                     ∀L1,d,e,U1. L1 ⊢ T1 [d, e] ≫ U1 →
22                     ∀L2. L1 ⇒ L2 →
23                     ∃∃U2. U1 ⇒ U2 & L2 ⊢ T2 [d, e] ≫ U2.
24 (*
25 #T1 #T2 #H elim H -H T1 T2
26 [ #I #L1 #d #e #X #H
27   elim (tps_inv_atom1 … H) -H
28   [ #H destruct -X /2/
29   | * #K1 #V1 #i #Hdi #Hide #HLK1 #HVU1 #H #L2 #HL12 destruct -I;
30     elim (ltpr_drop_conf … HLK1 … HL12) -HLK1 HL12 #X #HLK2 #H
31     elim (ltpr_inv_pair1 … H) -H #K2 #V2 #_ #HV12 #H destruct -X;
32     elim (lift_total V2 0 (i+1)) #U2 #HVU2
33     lapply (tpr_lift … HV12 … HVU1 … HVU2) -HV12 HVU1 #HU12
34     @ex2_1_intro [2: @HU12 | skip | /2/ ] (**) (* /3 width=6/ is too slow *)
35   ]
36 | #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12
37   elim (tps_inv_flat1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct -X;
38   elim (IHV12 … HVW1 … HL12) -IHV12 HVW1;
39   elim (IHT12 … HTU1 … HL12) -IHT12 HTU1 HL12 /3 width=5/
40 | #V1 #V2 #W #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12
41   elim (tps_inv_flat1 … H) -H #VV1 #Y #HVV1 #HY #HX destruct -X;
42   elim (tps_inv_bind1 … HY) -HY #WW #TT1 #_ #HTT1 #H destruct -Y;
43   elim (IHV12 … HVV1 … HL12) -IHV12 HVV1 #VV2 #HVV12 #HVV2
44   elim (IHT12 … HTT1 (L2. 𝕓{Abst} W) ?) -IHT12 HTT1 /2/ -HL12 #TT2 #HTT12 #HTT2
45   lapply (tps_leq_repl … HTT2 (L2. 𝕓{Abbr} V2) ?) -HTT2 /3 width=5/
46 | #I #V1 #V2 #T1 #T2 #U2 #HV12 #_ #HTU2 #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12
47   elim (tps_inv_bind1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct -X;
48   elim (IHV12 … HVV1 … HL12) -IHV12 HVV1 #VV2 #HVV12 #HVV2
49   elim (IHT12 … HTT1 (L2. 𝕓{I} V2) ?) -IHT12 HTT1 /2/ -HL12 #TT2 #HTT12 #HTT2
50 (*lapply (tps_leq_repl … HTT2 (L2. 𝕓{I} VV2) ?) -HTT2 /2/ #HTT2 *)
51   elim (tps_conf_neq … HTU2 … HTT2 ?) -HTU2 HTT2 T2 /2/ #T2 #HUT2 #HTT2
52   @ex2_1_intro
53   [2: @tpr_delta [4: @HVV12 |5: @HTT12 |1,2: skip |6: ] (*|6: ]1,2: skip ]*)
54   |1: skip
55   |3: @tps_bind [@HVV2 | @HUT2 ]
56   ]
57 *)
58
59 lemma tpr_tps_bind: ∀I,V1,V2,T1,T2,U1. V1 ⇒ V2 → T1 ⇒ T2 →
60                     ⋆. 𝕓{I} V1 ⊢ T1 [0, 1] ≫ U1 →
61                     ∃∃U2. U1 ⇒ U2 & ⋆. 𝕓{I} V2 ⊢ T2 [0, 1] ≫ U2.
62 /3 width=7/ qed.