]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/lfsx_lfpxs.ma
- notation change for tdeq and related notions
[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_sn … 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 lfsx_bind_lfpxs_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 #_ #IHL1 #Y #T #H @(lfsx_ind_lfpxs … H) -Y
82 #Y #HY #IHY #L2 #H #HL12 destruct
83 @lfsx_intro_lfpxs #L0 #HL20
84 lapply (lfpxs_trans … HL12 … HL20) #HL10 #H
85 elim (lfdneq_inv_bind … H) -H [ -IHY | -HY -IHL1 -HL12 ]
86 [ #HnV elim (lfdeq_dec h o L1 L2 V)
87   [ #HV @(IHL1 … L0) -IHL1 -HL12
88     /3 width=4 by lfsx_lfpxs_trans, lfpxs_fwd_bind_dx, lfpxs_fwd_pair_sn, lfdeq_canc_sn/ (**) (* full auto too slow *)
89   | -HnV -HL10 /4 width=4 by lfsx_lfpxs_trans, lfpxs_fwd_pair_sn/
90   ]
91 | /3 width=4 by lfpxs_fwd_bind_dx/
92 ]
93 qed-.
94
95 (* Basic_2A1: uses: lsx_bind *)
96 lemma lfsx_bind: ∀h,o,p,I,G,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ →
97                  ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓑ{I}V⦄ →
98                  G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄.
99 /2 width=3 by lfsx_bind_lfpxs_aux/ qed.
100
101 (* Basic_2A1: uses: lsx_flat_lpxs *)
102 lemma lfsx_flat_lfpxs: ∀h,o,I,G,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ →
103                        ∀L2,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄ → ⦃G, L1⦄ ⊢ ⬈*[h, ⓕ{I}V.T] L2 →
104                        G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L2⦄.
105 #h #o #I #G #L1 #V #H @(lfsx_ind_lfpxs … H) -L1
106 #L1 #HL1 #IHL1 #L2 #T #H @(lfsx_ind_lfpxs … H) -L2
107 #L2 #HL2 #IHL2 #HL12 @lfsx_intro_lfpxs
108 #L0 #HL20 lapply (lfpxs_trans … HL12 … HL20)
109 #HL10 #H elim (lfdneq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ]
110 [ #HnV elim (lfdeq_dec h o L1 L2 V)
111   [ #HV @(IHL1 … L0) -IHL1 -HL12
112     /3 width=5 by lfsx_lfpxs_trans, lfpxs_fwd_flat_dx, lfpxs_fwd_pair_sn, lfdeq_canc_sn/ (**) (* full auto too slow: 47s *)
113   | -HnV -HL10 /4 width=4 by lfsx_lfpxs_trans, lfpxs_fwd_pair_sn/
114   ]
115 | /3 width=3 by lfpxs_fwd_flat_dx/
116 ]
117 qed-.
118
119 (* Basic_2A1: uses: lsx_flat *)
120 lemma lfsx_flat: ∀h,o,I,G,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ →
121                  ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄ → G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L⦄.
122 /2 width=3 by lfsx_flat_lfpxs/ qed.
123
124 fact lfsx_bind_lfpxs_void_aux: ∀h,o,p,I,G,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ →
125                                ∀Y,T. G ⊢ ⬈*[h, o, T] 𝐒⦃Y⦄ →
126                                ∀L2. Y = L2.ⓧ → ⦃G, L1⦄ ⊢ ⬈*[h, ⓑ{p,I}V.T] L2 →
127                                G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L2⦄.
128 #h #o #p #I #G #L1 #V #H @(lfsx_ind_lfpxs … H) -L1
129 #L1 #_ #IHL1 #Y #T #H @(lfsx_ind_lfpxs … H) -Y
130 #Y #HY #IHY #L2 #H #HL12 destruct
131 @lfsx_intro_lfpxs #L0 #HL20
132 lapply (lfpxs_trans … HL12 … HL20) #HL10 #H
133 elim (lfdneq_inv_bind_void … H) -H [ -IHY | -HY -IHL1 -HL12 ]
134 [ #HnV elim (lfdeq_dec h o L1 L2 V)
135   [ #HV @(IHL1 … L0) -IHL1 -HL12
136     /3 width=6 by lfsx_lfpxs_trans, lfpxs_fwd_bind_dx_void, lfpxs_fwd_pair_sn, lfdeq_canc_sn/ (**) (* full auto too slow *)
137   | -HnV -HL10 /4 width=4 by lfsx_lfpxs_trans, lfpxs_fwd_pair_sn/
138   ]
139 | /3 width=4 by lfpxs_fwd_bind_dx_void/
140 ]
141 qed-.
142
143 lemma lfsx_bind_void: ∀h,o,p,I,G,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ →
144                       ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓧ⦄ →
145                       G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄.
146 /2 width=3 by lfsx_bind_lfpxs_void_aux/ qed.