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_reqx.ma".
16 include "basic_2/rt_computation/lpxs_lpxs.ma".
17 include "basic_2/rt_computation/rsx_rsx.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 rsx_intro_lpxs (h) (G):
25 ∀L1,T. (∀L2. ❪G,L1❫ ⊢ ⬈*[h] L2 → (L1 ≛[T] L2 → ⊥) → G ⊢ ⬈*𝐒[h,T] L2) →
27 /4 width=1 by lpx_lpxs, rsx_intro/ qed-.
29 (* Basic_2A1: uses: lsx_lpxs_trans *)
30 lemma rsx_lpxs_trans (h) (G):
31 ∀L1,T. G ⊢ ⬈*𝐒[h,T] L1 →
32 ∀L2. ❪G,L1❫ ⊢ ⬈*[h] L2 → G ⊢ ⬈*𝐒[h,T] L2.
33 #h #G #L1 #T #HL1 #L2 #H @(lpxs_ind_dx … H) -L2
34 /2 width=3 by rsx_lpx_trans/
37 (* Eliminators with unbound rt-computation for full local environments ******)
39 lemma rsx_ind_lpxs_reqx (h) (G) (T) (Q:predicate lenv):
40 (∀L1. G ⊢ ⬈*𝐒[h,T] L1 →
41 (∀L2. ❪G,L1❫ ⊢ ⬈*[h] L2 → (L1 ≛[T] L2 → ⊥) → Q L2) →
44 ∀L1. G ⊢ ⬈*𝐒[h,T] L1 →
45 ∀L0. ❪G,L1❫ ⊢ ⬈*[h] L0 → ∀L2. L0 ≛[T] L2 → Q L2.
46 #h #G #T #Q #IH #L1 #H @(rsx_ind … H) -L1
47 #L1 #HL1 #IH1 #L0 #HL10 #L2 #HL02
48 @IH -IH /3 width=3 by rsx_lpxs_trans, rsx_reqx_trans/ -HL1 #K2 #HLK2 #HnLK2
49 lapply (reqx_rneqx_trans … HL02 … HnLK2) -HnLK2 #H
50 elim (reqx_lpxs_trans … HLK2 … HL02) -L2 #K0 #HLK0 #HK02
51 lapply (rneqx_reqx_canc_dx … H … HK02) -H #HnLK0
52 elim (reqx_dec L1 L0 T) #H
53 [ lapply (reqx_rneqx_trans … H … HnLK0) -H -HnLK0 #Hn10
54 lapply (lpxs_trans … HL10 … HLK0) -L0 #H10
55 elim (lpxs_rneqx_inv_step_sn … H10 … Hn10) -H10 -Hn10
56 /3 width=8 by reqx_trans/
57 | elim (lpxs_rneqx_inv_step_sn … HL10 … H) -HL10 -H #L #K #HL1 #HnL1 #HLK #HKL0
58 elim (reqx_lpxs_trans … HLK0 … HKL0) -L0
59 /3 width=8 by lpxs_trans, reqx_trans/
63 (* Basic_2A1: uses: lsx_ind_alt *)
64 lemma rsx_ind_lpxs (h) (G) (T) (Q:predicate lenv):
65 (∀L1. G ⊢ ⬈*𝐒[h,T] L1 →
66 (∀L2. ❪G,L1❫ ⊢ ⬈*[h] L2 → (L1 ≛[T] L2 → ⊥) → Q L2) →
69 ∀L. G ⊢ ⬈*𝐒[h,T] L → Q L.
70 #h #G #T #Q #IH #L #HL
71 @(rsx_ind_lpxs_reqx … IH … HL) -IH -HL // (**) (* full auto fails *)
74 (* Advanced properties ******************************************************)
76 fact rsx_bind_lpxs_aux (h) (G):
77 ∀p,I,L1,V. G ⊢ ⬈*𝐒[h,V] L1 →
78 ∀Y,T. G ⊢ ⬈*𝐒[h,T] Y →
79 ∀L2. Y = L2.ⓑ[I]V → ❪G,L1❫ ⊢ ⬈*[h] L2 →
80 G ⊢ ⬈*𝐒[h,ⓑ[p,I]V.T] L2.
81 #h #G #p #I #L1 #V #H @(rsx_ind_lpxs … H) -L1
82 #L1 #_ #IHL1 #Y #T #H @(rsx_ind_lpxs … H) -Y
83 #Y #HY #IHY #L2 #H #HL12 destruct
84 @rsx_intro_lpxs #L0 #HL20
85 lapply (lpxs_trans … HL12 … HL20) #HL10 #H
86 elim (rneqx_inv_bind … H) -H [ -IHY | -HY -IHL1 -HL12 ]
87 [ #HnV elim (reqx_dec L1 L2 V)
88 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
89 /3 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx, reqx_canc_sn/ (**) (* full auto too slow *)
90 | -HnV -HL10 /4 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx/
92 | /3 width=4 by lpxs_bind_refl_dx/
96 (* Basic_2A1: uses: lsx_bind *)
97 lemma rsx_bind (h) (G):
98 ∀p,I,L,V. G ⊢ ⬈*𝐒[h,V] L →
99 ∀T. G ⊢ ⬈*𝐒[h,T] L.ⓑ[I]V →
100 G ⊢ ⬈*𝐒[h,ⓑ[p,I]V.T] L.
101 /2 width=3 by rsx_bind_lpxs_aux/ qed.
103 (* Basic_2A1: uses: lsx_flat_lpxs *)
104 lemma rsx_flat_lpxs (h) (G):
105 ∀I,L1,V. G ⊢ ⬈*𝐒[h,V] L1 →
106 ∀L2,T. G ⊢ ⬈*𝐒[h,T] L2 → ❪G,L1❫ ⊢ ⬈*[h] L2 →
107 G ⊢ ⬈*𝐒[h,ⓕ[I]V.T] L2.
108 #h #G #I #L1 #V #H @(rsx_ind_lpxs … H) -L1
109 #L1 #HL1 #IHL1 #L2 #T #H @(rsx_ind_lpxs … H) -L2
110 #L2 #HL2 #IHL2 #HL12 @rsx_intro_lpxs
111 #L0 #HL20 lapply (lpxs_trans … HL12 … HL20)
112 #HL10 #H elim (rneqx_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ]
113 [ #HnV elim (reqx_dec L1 L2 V)
114 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
115 /3 width=5 by rsx_lpxs_trans, reqx_canc_sn/ (**) (* full auto too slow: 47s *)
116 | -HnV -HL10 /3 width=4 by rsx_lpxs_trans/
122 (* Basic_2A1: uses: lsx_flat *)
123 lemma rsx_flat (h) (G):
124 ∀I,L,V. G ⊢ ⬈*𝐒[h,V] L →
125 ∀T. G ⊢ ⬈*𝐒[h,T] L → G ⊢ ⬈*𝐒[h,ⓕ[I]V.T] L.
126 /2 width=3 by rsx_flat_lpxs/ qed.
128 fact rsx_bind_lpxs_void_aux (h) (G):
129 ∀p,I,L1,V. G ⊢ ⬈*𝐒[h,V] L1 →
130 ∀Y,T. G ⊢ ⬈*𝐒[h,T] Y →
131 ∀L2. Y = L2.ⓧ → ❪G,L1❫ ⊢ ⬈*[h] L2 →
132 G ⊢ ⬈*𝐒[h,ⓑ[p,I]V.T] L2.
133 #h #G #p #I #L1 #V #H @(rsx_ind_lpxs … H) -L1
134 #L1 #_ #IHL1 #Y #T #H @(rsx_ind_lpxs … H) -Y
135 #Y #HY #IHY #L2 #H #HL12 destruct
136 @rsx_intro_lpxs #L0 #HL20
137 lapply (lpxs_trans … HL12 … HL20) #HL10 #H
138 elim (rneqx_inv_bind_void … H) -H [ -IHY | -HY -IHL1 -HL12 ]
139 [ #HnV elim (reqx_dec L1 L2 V)
140 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
141 /3 width=6 by rsx_lpxs_trans, lpxs_bind_refl_dx, reqx_canc_sn/ (**) (* full auto too slow *)
142 | -HnV -HL10 /4 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx/
144 | /3 width=4 by lpxs_bind_refl_dx/
148 lemma rsx_bind_void (h) (G):
149 ∀p,I,L,V. G ⊢ ⬈*𝐒[h,V] L →
150 ∀T. G ⊢ ⬈*𝐒[h,T] L.ⓧ →
151 G ⊢ ⬈*𝐒[h,ⓑ[p,I]V.T] L.
152 /2 width=3 by rsx_bind_lpxs_void_aux/ qed.