1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/rt_computation/lpxs_rdeq.ma".
16 include "basic_2/rt_computation/lpxs_lpxs.ma".
17 include "basic_2/rt_computation/rdsx_rdsx.ma".
19 (* STRONGLY NORMALIZING REFERRED LOCAL ENV.S FOR UNBOUND RT-TRANSITION ******)
21 (* Properties with unbound rt-computation for full local environments *******)
23 (* Basic_2A1: uses: lsx_intro_alt *)
24 lemma rdsx_intro_lpxs (h) (o) (G):
25 ∀L1,T. (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄) →
26 G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄.
27 /4 width=1 by lpx_lpxs, rdsx_intro/ qed-.
29 (* Basic_2A1: uses: lsx_lpxs_trans *)
30 lemma rdsx_lpxs_trans (h) (o) (G): ∀L1,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
31 ∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄.
32 #h #o #G #L1 #T #HL1 #L2 #H @(lpxs_ind_dx … H) -L2
33 /2 width=3 by rdsx_lpx_trans/
36 (* Eliminators with unbound rt-computation for full local environments ******)
38 lemma rdsx_ind_lpxs_rdeq (h) (o) (G):
39 ∀T. ∀Q:predicate lenv.
40 (∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
41 (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → Q L2) →
44 ∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
45 ∀L0. ⦃G, L1⦄ ⊢ ⬈*[h] L0 → ∀L2. L0 ≛[h, o, T] L2 → Q L2.
46 #h #o #G #T #Q #IH #L1 #H @(rdsx_ind … H) -L1
47 #L1 #HL1 #IH1 #L0 #HL10 #L2 #HL02
48 @IH -IH /3 width=3 by rdsx_lpxs_trans, rdsx_rdeq_trans/ -HL1 #K2 #HLK2 #HnLK2
49 lapply (rdeq_rdneq_trans … HL02 … HnLK2) -HnLK2 #H
50 elim (rdeq_lpxs_trans … HLK2 … HL02) -L2 #K0 #HLK0 #HK02
51 lapply (rdneq_rdeq_canc_dx … H … HK02) -H #HnLK0
52 elim (rdeq_dec h o L1 L0 T) #H
53 [ lapply (rdeq_rdneq_trans … H … HnLK0) -H -HnLK0 #Hn10
54 lapply (lpxs_trans … HL10 … HLK0) -L0 #H10
55 elim (lpxs_rdneq_inv_step_sn … H10 … Hn10) -H10 -Hn10
56 /3 width=8 by rdeq_trans/
57 | elim (lpxs_rdneq_inv_step_sn … HL10 … H) -HL10 -H #L #K #HL1 #HnL1 #HLK #HKL0
58 elim (rdeq_lpxs_trans … HLK0 … HKL0) -L0
59 /3 width=8 by lpxs_trans, rdeq_trans/
63 (* Basic_2A1: uses: lsx_ind_alt *)
64 lemma rdsx_ind_lpxs (h) (o) (G):
65 ∀T. ∀Q:predicate lenv.
66 (∀L1. G ⊢ ⬈*[h, o, T] 𝐒⦃L1⦄ →
67 (∀L2. ⦃G, L1⦄ ⊢ ⬈*[h] L2 → (L1 ≛[h, o, T] L2 → ⊥) → Q L2) →
70 ∀L. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄ → Q L.
71 #h #o #G #T #Q #IH #L #HL
72 @(rdsx_ind_lpxs_rdeq … IH … HL) -IH -HL // (**) (* full auto fails *)
75 (* Advanced properties ******************************************************)
77 fact rdsx_bind_lpxs_aux (h) (o) (G):
78 ∀p,I,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ →
79 ∀Y,T. G ⊢ ⬈*[h, o, T] 𝐒⦃Y⦄ →
80 ∀L2. Y = L2.ⓑ{I}V → ⦃G, L1⦄ ⊢ ⬈*[h] L2 →
81 G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L2⦄.
82 #h #o #G #p #I #L1 #V #H @(rdsx_ind_lpxs … H) -L1
83 #L1 #_ #IHL1 #Y #T #H @(rdsx_ind_lpxs … H) -Y
84 #Y #HY #IHY #L2 #H #HL12 destruct
85 @rdsx_intro_lpxs #L0 #HL20
86 lapply (lpxs_trans … HL12 … HL20) #HL10 #H
87 elim (rdneq_inv_bind … H) -H [ -IHY | -HY -IHL1 -HL12 ]
88 [ #HnV elim (rdeq_dec h o L1 L2 V)
89 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
90 /3 width=4 by rdsx_lpxs_trans, lpxs_bind_refl_dx, rdeq_canc_sn/ (**) (* full auto too slow *)
91 | -HnV -HL10 /4 width=4 by rdsx_lpxs_trans, lpxs_bind_refl_dx/
93 | /3 width=4 by lpxs_bind_refl_dx/
97 (* Basic_2A1: uses: lsx_bind *)
98 lemma rdsx_bind (h) (o) (G):
99 ∀p,I,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ →
100 ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓑ{I}V⦄ →
101 G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄.
102 /2 width=3 by rdsx_bind_lpxs_aux/ qed.
104 (* Basic_2A1: uses: lsx_flat_lpxs *)
105 lemma rdsx_flat_lpxs (h) (o) (G):
106 ∀I,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ →
107 ∀L2,T. G ⊢ ⬈*[h, o, T] 𝐒⦃L2⦄ → ⦃G, L1⦄ ⊢ ⬈*[h] L2 →
108 G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L2⦄.
109 #h #o #G #I #L1 #V #H @(rdsx_ind_lpxs … H) -L1
110 #L1 #HL1 #IHL1 #L2 #T #H @(rdsx_ind_lpxs … H) -L2
111 #L2 #HL2 #IHL2 #HL12 @rdsx_intro_lpxs
112 #L0 #HL20 lapply (lpxs_trans … HL12 … HL20)
113 #HL10 #H elim (rdneq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ]
114 [ #HnV elim (rdeq_dec h o L1 L2 V)
115 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
116 /3 width=5 by rdsx_lpxs_trans, rdeq_canc_sn/ (**) (* full auto too slow: 47s *)
117 | -HnV -HL10 /3 width=4 by rdsx_lpxs_trans/
123 (* Basic_2A1: uses: lsx_flat *)
124 lemma rdsx_flat (h) (o) (G):
125 ∀I,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ →
126 ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L⦄ → G ⊢ ⬈*[h, o, ⓕ{I}V.T] 𝐒⦃L⦄.
127 /2 width=3 by rdsx_flat_lpxs/ qed.
129 fact rdsx_bind_lpxs_void_aux (h) (o) (G):
130 ∀p,I,L1,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L1⦄ →
131 ∀Y,T. G ⊢ ⬈*[h, o, T] 𝐒⦃Y⦄ →
132 ∀L2. Y = L2.ⓧ → ⦃G, L1⦄ ⊢ ⬈*[h] L2 →
133 G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L2⦄.
134 #h #o #G #p #I #L1 #V #H @(rdsx_ind_lpxs … H) -L1
135 #L1 #_ #IHL1 #Y #T #H @(rdsx_ind_lpxs … H) -Y
136 #Y #HY #IHY #L2 #H #HL12 destruct
137 @rdsx_intro_lpxs #L0 #HL20
138 lapply (lpxs_trans … HL12 … HL20) #HL10 #H
139 elim (rdneq_inv_bind_void … H) -H [ -IHY | -HY -IHL1 -HL12 ]
140 [ #HnV elim (rdeq_dec h o L1 L2 V)
141 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
142 /3 width=6 by rdsx_lpxs_trans, lpxs_bind_refl_dx, rdeq_canc_sn/ (**) (* full auto too slow *)
143 | -HnV -HL10 /4 width=4 by rdsx_lpxs_trans, lpxs_bind_refl_dx/
145 | /3 width=4 by lpxs_bind_refl_dx/
149 lemma rdsx_bind_void (h) (o) (G):
150 ∀p,I,L,V. G ⊢ ⬈*[h, o, V] 𝐒⦃L⦄ →
151 ∀T. G ⊢ ⬈*[h, o, T] 𝐒⦃L.ⓧ⦄ →
152 G ⊢ ⬈*[h, o, ⓑ{p,I}V.T] 𝐒⦃L⦄.
153 /2 width=3 by rdsx_bind_lpxs_void_aux/ qed.