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_reqg.ma".
16 include "basic_2/rt_computation/lpxs_lpxs.ma".
17 include "basic_2/rt_computation/rsx_rsx.ma".
19 (* STRONGLY NORMALIZING REFERRED LOCAL ENVS FOR EXTENDED RT-TRANSITION ******)
21 (* Properties with extended rt-computation for full local environments ******)
23 (* Basic_2A1: uses: lsx_intro_alt *)
24 lemma rsx_intro_lpxs (G):
25 ∀L1,T. (∀L2. ❨G,L1❩ ⊢ ⬈* L2 → (L1 ≅[T] L2 → ⊥) → G ⊢ ⬈*𝐒[T] L2) →
27 /4 width=1 by lpx_lpxs, rsx_intro/ qed-.
29 (* Basic_2A1: uses: lsx_lpxs_trans *)
30 lemma rsx_lpxs_trans (G):
31 ∀L1,T. G ⊢ ⬈*𝐒[T] L1 →
32 ∀L2. ❨G,L1❩ ⊢ ⬈* L2 → G ⊢ ⬈*𝐒[T] L2.
33 #G #L1 #T #HL1 #L2 #H @(lpxs_ind_dx … H) -L2
34 /2 width=3 by rsx_lpx_trans/
37 (* Eliminators with extended rt-computation for full local environments *****)
39 lemma rsx_ind_lpxs_reqx (G) (T) (Q:predicate lenv):
41 (∀L2. ❨G,L1❩ ⊢ ⬈* L2 → (L1 ≅[T] L2 → ⊥) → Q L2) →
45 ∀L0. ❨G,L1❩ ⊢ ⬈* L0 → ∀L2. L0 ≅[T] L2 → Q L2.
46 #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 (reqg_rneqg_trans … HL02 … HnLK2) -HnLK2 // #H
50 elim (reqg_lpxs_trans … HLK2 … HL02) -L2 // #K0 #HLK0 #HK02
51 lapply (rneqg_reqg_canc_dx … H … HK02) -H // #HnLK0
52 elim (reqx_dec L1 L0 T) #H
53 [ lapply (reqg_rneqg_trans … H … HnLK0) -H -HnLK0 // #Hn10
54 lapply (lpxs_trans … HL10 … HLK0) -L0 #H10
55 elim (lpxs_rneqg_inv_step_sn … H10 … Hn10) -H10 -Hn10
56 /3 width=8 by reqg_trans, sfull_dec/
57 | elim (lpxs_rneqg_inv_step_sn … HL10 … H) -HL10 -H /2 width=1 by sfull_dec/ #L #K #HL1 #HnL1 #HLK #HKL0
58 elim (reqg_lpxs_trans … HLK0 … HKL0) -L0
59 /3 width=8 by lpxs_trans, reqg_trans/
63 (* Basic_2A1: uses: lsx_ind_alt *)
64 lemma rsx_ind_lpxs (G) (T) (Q:predicate lenv):
66 (∀L2. ❨G,L1❩ ⊢ ⬈* L2 → (L1 ≅[T] L2 → ⊥) → Q L2) →
69 ∀L. G ⊢ ⬈*𝐒[T] L → Q L.
71 @(rsx_ind_lpxs_reqx … IH … HL) -IH -HL
72 /2 width=3 by rex_refl/ (**) (* full auto fails *)
75 (* Advanced properties ******************************************************)
77 fact rsx_bind_lpxs_aux (G):
78 ∀p,I,L1,V. G ⊢ ⬈*𝐒[V] L1 →
80 ∀L2. Y = L2.ⓑ[I]V → ❨G,L1❩ ⊢ ⬈* L2 →
81 G ⊢ ⬈*𝐒[ⓑ[p,I]V.T] L2.
82 #G #p #I #L1 #V #H @(rsx_ind_lpxs … H) -L1
83 #L1 #_ #IHL1 #Y #T #H @(rsx_ind_lpxs … H) -Y
84 #Y #HY #IHY #L2 #H #HL12 destruct
85 @rsx_intro_lpxs #L0 #HL20
86 lapply (lpxs_trans … HL12 … HL20) #HL10 #H
87 elim (rneqg_inv_bind … H) -H /2 width=1 by sfull_dec/ [ -IHY | -HY -IHL1 -HL12 ]
88 [ #HnV elim (reqx_dec L1 L2 V)
89 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
90 /3 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx, reqg_canc_sn/ (**) (* full auto too slow *)
91 | -HnV -HL10 /4 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx/
93 | /3 width=4 by lpxs_bind_refl_dx/
97 (* Basic_2A1: uses: lsx_bind *)
99 ∀p,I,L,V. G ⊢ ⬈*𝐒[V] L →
100 ∀T. G ⊢ ⬈*𝐒[T] L.ⓑ[I]V →
101 G ⊢ ⬈*𝐒[ⓑ[p,I]V.T] L.
102 /2 width=3 by rsx_bind_lpxs_aux/ qed.
104 (* Basic_2A1: uses: lsx_flat_lpxs *)
105 lemma rsx_flat_lpxs (G):
106 ∀I,L1,V. G ⊢ ⬈*𝐒[V] L1 →
107 ∀L2,T. G ⊢ ⬈*𝐒[T] L2 → ❨G,L1❩ ⊢ ⬈* L2 →
109 #G #I #L1 #V #H @(rsx_ind_lpxs … H) -L1
110 #L1 #HL1 #IHL1 #L2 #T #H @(rsx_ind_lpxs … H) -L2
111 #L2 #HL2 #IHL2 #HL12 @rsx_intro_lpxs
112 #L0 #HL20 lapply (lpxs_trans … HL12 … HL20)
113 #HL10 #H elim (rneqg_inv_flat … H) -H /2 width=1 by sfull_dec/ [ -HL1 -IHL2 | -HL2 -IHL1 ]
114 [ #HnV elim (reqx_dec L1 L2 V)
115 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
116 /3 width=5 by rsx_lpxs_trans, reqg_canc_sn/ (**) (* full auto too slow: 47s *)
117 | -HnV -HL10 /3 width=4 by rsx_lpxs_trans/
123 (* Basic_2A1: uses: lsx_flat *)
125 ∀I,L,V. G ⊢ ⬈*𝐒[V] L →
126 ∀T. G ⊢ ⬈*𝐒[T] L → G ⊢ ⬈*𝐒[ⓕ[I]V.T] L.
127 /2 width=3 by rsx_flat_lpxs/ qed.
129 fact rsx_bind_lpxs_void_aux (G):
130 ∀p,I,L1,V. G ⊢ ⬈*𝐒[V] L1 →
132 ∀L2. Y = L2.ⓧ → ❨G,L1❩ ⊢ ⬈* L2 →
133 G ⊢ ⬈*𝐒[ⓑ[p,I]V.T] L2.
134 #G #p #I #L1 #V #H @(rsx_ind_lpxs … H) -L1
135 #L1 #_ #IHL1 #Y #T #H @(rsx_ind_lpxs … H) -Y
136 #Y #HY #IHY #L2 #H #HL12 destruct
137 @rsx_intro_lpxs #L0 #HL20
138 lapply (lpxs_trans … HL12 … HL20) #HL10 #H
139 elim (rneqg_inv_bind_void … H) -H /2 width=1 by sfull_dec/ [ -IHY | -HY -IHL1 -HL12 ]
140 [ #HnV elim (reqx_dec L1 L2 V)
141 [ #HV @(IHL1 … HL10) -IHL1 -HL12 -HL10
142 /3 width=6 by rsx_lpxs_trans, lpxs_bind_refl_dx, reqg_canc_sn/ (**) (* full auto too slow *)
143 | -HnV -HL10 /4 width=4 by rsx_lpxs_trans, lpxs_bind_refl_dx/
145 | /3 width=4 by lpxs_bind_refl_dx/
149 lemma rsx_bind_void (G):
150 ∀p,I,L,V. G ⊢ ⬈*𝐒[V] L →
152 G ⊢ ⬈*𝐒[ⓑ[p,I]V.T] L.
153 /2 width=3 by rsx_bind_lpxs_void_aux/ qed.