]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/lfsx_lfpxs.ma
d1e4f4de8054f7bbae46785500a8fc1be3e720b1
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / lfsx_lfpxs.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/rt_computation/lfpxs_lfdeq.ma".
16 include "basic_2/rt_computation/lfpxs_cpxs.ma".
17 include "basic_2/rt_computation/lfpxs_lfpxs.ma".
18 include "basic_2/rt_computation/lfsx_lfsx.ma".
19
20 (* STRONGLY NORMALIZING LOCAL ENV.S FOR UNCOUNTED PARALLEL RT-TRANSITION ****)
21
22 (* Properties with uncounted rt-computation on referred entries *************)
23
24 (* Basic_2A1: uses: lsx_intro_alt *)
25 lemma lfsx_intro_lfpxs: ∀h,o,G,L1,T.
26                         (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h, T] L2 → (L1 ≡[h, o, T] L2 → ⊥) → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄) →
27                         G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄.
28 /4 width=1 by lfpx_lfpxs, lfsx_intro/ qed-.
29
30 (* Basic_2A1: uses: lsx_lpxs_trans *)
31 lemma lfsx_lfpxs_trans: ∀h,o,G,L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
32                         ∀L2. ⦃G, L1⦄ ⊢ ⬈*[h, T] L2 → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄.
33 #h #o #G #L1 #T #HL1 #L2 #H @(lfpxs_ind … H) -L2
34 /2 width=3 by lfsx_lfpx_trans/
35 qed-.
36
37 (* Eliminators with uncounted rt-computation on referred entries ************)
38
39 lemma lfsx_ind_lfpxs_lfdeq: ∀h,o,G,T. ∀R:predicate lenv.
40                             (∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
41                                   (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h, T] L2 → (L1 ≡[h, o, T] L2 → ⊥) → R L2) →
42                                   R L1
43                             ) →
44                             ∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄  →
45                             ∀L0. ⦃G, L1⦄ ⊢ ⬈*[h, T] L0 → ∀L2. L0 ≡[h, o, T] L2 → R L2.
46 #h #o #G #T #R #IH #L1 #H @(lfsx_ind … H) -L1
47 #L1 #HL1 #IH1 #L0 #HL10 #L2 #HL02
48 @IH -IH /3 width=3 by lfsx_lfpxs_trans, lfsx_lfdeq_trans/ -HL1 #K2 #HLK2 #HnLK2
49 lapply (lfdeq_lfdneq_trans … HL02 … HnLK2) -HnLK2 #H
50 elim (lfdeq_lfpxs_trans … HLK2 … HL02) -L2 #K0 #HLK0 #HK02
51 lapply (lfdneq_lfdeq_canc_dx … H … HK02) -H #HnLK0
52 elim (lfdeq_dec h o L1 L0 T) #H
53 [ lapply (lfdeq_lfdneq_trans … H … HnLK0) -H -HnLK0 #Hn10
54   lapply (lfpxs_trans … HL10 … HLK0) -L0 #H10
55   elim (lfpxs_lfdneq_inv_step_sn … H10 …  Hn10) -H10 -Hn10
56   /3 width=8 by lfdeq_trans/
57 | elim (lfpxs_lfdneq_inv_step_sn … HL10 … H) -HL10 -H #L #K #HL1 #HnL1 #HLK #HKL0
58   elim (lfdeq_lfpxs_trans … HLK0 … HKL0) -L0
59   /3 width=8 by lfpxs_trans, lfdeq_trans/
60 ]
61 qed-.
62
63 (* Basic_2A1: uses: lsx_ind_alt *)
64 lemma lfsx_ind_lfpxs: ∀h,o,G,T. ∀R:predicate lenv.
65                       (∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
66                             (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h, T] L2 → (L1 ≡[h, o, T] L2 → ⊥) → R L2) →
67                             R L1
68                       ) →
69                       ∀L. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄  → R L.
70 #h #o #G #T #R #IH #L #HL
71 @(lfsx_ind_lfpxs_lfdeq … IH … HL) -IH -HL // (**) (* full auto fails *)
72 qed-.
73
74 (* Advanced properties ******************************************************)
75
76 fact lsx_bind_lpxs_aux: ∀h,o,p,I,G,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ →
77                         ∀Y,T. G ⊢ ⬈*[h, o, T] 𝐒⦃Y⦄ →
78                         ∀L2. Y = L2.ⓑ{I}V → ⦃G, L1⦄ ⊢ ⬈*[h, ⓑ{p,I}V.T] L2 →
79                         G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L2⦄.
80 #h #o #p #I #G #L1 #V #H @(lfsx_ind_lfpxs … H) -L1
81 #L1 #HL1 #IHL1 #Y #T #H @(lfsx_ind_lfpxs … H) -Y
82 #Y #HY #IHY #L2 #H #HL12 destruct @lfsx_intro_lfpxs
83 #L0 #HL20 lapply (lfpxs_trans … HL12 … HL20)
84 #HL10 #H elim (lfdneq_inv_bind … H) -H [ -HL1 -IHY | -HY -IHL1 ]
85 [ #HnV elim (lfdeq_dec h o L1 L2 V)
86   [ #HV @(IHL1 … L0) -IHL1
87     [2: /3 width=5 by lfdeq_canc_sn/
88     |5: // |3: skip
89     |6: //
90   
91    lfdeq_lfdneq_trans/
92   
93   /3 width=5 by lfsx_lfpxs_trans, lfpxs_pair, lfdeq_canc_sn/ (**) (* full auto too slow *)
94   | -HnV -HL10 /4 width=5 by lsx_lpxs_trans, lpxs_pair/
95   ]
96 | /3 width=4 by lpxs_pair/
97 ]
98 qed-.
99
100 lemma lsx_bind: ∀h,o,a,I,G,L,V,l. G ⊢ ⬈*[h, o, V, l] L →
101                 ∀T. G ⊢ ⬈*[h, o, T, ⫯l] L.ⓑ{I}V →
102                 G ⊢ ⬈*[h, o, ⓑ{a,I}V.T, l] L.
103 /2 width=3 by lsx_bind_lpxs_aux/ qed.
104
105 lemma lsx_flat_lpxs: ∀h,o,I,G,L1,V,l. G ⊢ ⬈*[h, o, V, l] L1 →
106                      ∀L2,T. G ⊢ ⬈*[h, o, T, l] L2 → ⦃G, L1⦄ ⊢ ⬈*[h, o] L2 →
107                      G ⊢ ⬈*[h, o, ⓕ{I}V.T, l] L2.
108 #h #o #I #G #L1 #V #l #H @(lsx_ind_lfpxs … H) -L1
109 #L1 #HL1 #IHL1 #L2 #T #H @(lsx_ind_lfpxs … H) -L2
110 #L2 #HL2 #IHL2 #HL12 @lsx_intro_lfpxs
111 #L0 #HL20 lapply (lpxs_trans … HL12 … HL20)
112 #HL10 #H elim (nlleq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ]
113 [ #HnV elim (lleq_dec V L1 L2 l)
114   [ #HV @(IHL1 … L0) /3 width=3 by lsx_lpxs_trans, lleq_canc_sn/ (**) (* full auto too slow: 47s *)
115   | -HnV -HL10 /3 width=4 by lsx_lpxs_trans/
116   ]
117 | /3 width=1 by/
118 ]
119 qed-.
120
121 lemma lsx_flat: ∀h,o,I,G,L,V,l. G ⊢ ⬈*[h, o, V, l] L →
122                 ∀T. G ⊢ ⬈*[h, o, T, l] L → G ⊢ ⬈*[h, o, ⓕ{I}V.T, l] L.
123 /2 width=3 by lsx_flat_lpxs/ qed.