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/notation/relations/topredtysnstrong_5.ma".
16 include "basic_2/rt_computation/rsx.ma".
18 (* COMPATIBILITY OF STRONG NORMALIZATION FOR UNBOUND RT-TRANSITION **********)
20 (* Note: this should be an instance of a more general sex *)
21 (* Basic_2A1: uses: lcosx *)
22 inductive jsx (h) (G): rtmap → relation lenv ≝
23 | jsx_atom: ∀f. jsx h G f (⋆) (⋆)
24 | jsx_push: ∀f,I,K1,K2. jsx h G f K1 K2 →
25 jsx h G (⫯f) (K1.ⓘ{I}) (K2.ⓘ{I})
26 | jsx_unit: ∀f,I,K1,K2. jsx h G f K1 K2 →
27 jsx h G (↑f) (K1.ⓤ{I}) (K2.ⓧ)
28 | jsx_pair: ∀f,I,K1,K2,V. G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ →
29 jsx h G f K1 K2 → jsx h G (↑f) (K1.ⓑ{I}V) (K2.ⓧ)
33 "strong normalization for unbound parallel rt-transition (compatibility)"
34 'ToPRedTySNStrong h f G L1 L2 = (jsx h G f L1 L2).
36 (* Basic inversion lemmas ***************************************************)
38 fact jsx_inv_atom_sn_aux (h) (G):
39 ∀g,L1,L2. G ⊢ L1 ⊒[h,g] L2 → L1 = ⋆ → L2 = ⋆.
40 #h #G #g #L1 #L2 * -g -L1 -L2 //
41 [ #f #I #K1 #K2 #_ #H destruct
42 | #f #I #K1 #K2 #_ #H destruct
43 | #f #I #K1 #K2 #V #_ #_ #H destruct
47 lemma jsx_inv_atom_sn (h) (G): ∀g,L2. G ⊢ ⋆ ⊒[h,g] L2 → L2 = ⋆.
48 /2 width=7 by jsx_inv_atom_sn_aux/ qed-.
50 fact jsx_inv_push_sn_aux (h) (G):
51 ∀g,L1,L2. G ⊢ L1 ⊒[h,g] L2 →
52 ∀f,I,K1. g = ⫯f → L1 = K1.ⓘ{I} →
53 ∃∃K2. G ⊢ K1 ⊒[h,f] K2 & L2 = K2.ⓘ{I}.
54 #h #G #g #L1 #L2 * -g -L1 -L2
55 [ #f #g #J #L1 #_ #H destruct
56 | #f #I #K1 #K2 #HK12 #g #J #L1 #H1 #H2 destruct
57 <(injective_push … H1) -g /2 width=3 by ex2_intro/
58 | #f #I #K1 #K2 #_ #g #J #L1 #H
59 elim (discr_next_push … H)
60 | #f #I #K1 #K2 #V #_ #_ #g #J #L1 #H
61 elim (discr_next_push … H)
65 lemma jsx_inv_push_sn (h) (G):
66 ∀f,I,K1,L2. G ⊢ K1.ⓘ{I} ⊒[h,⫯f] L2 →
67 ∃∃K2. G ⊢ K1 ⊒[h,f] K2 & L2 = K2.ⓘ{I}.
68 /2 width=5 by jsx_inv_push_sn_aux/ qed-.
70 fact jsx_inv_unit_sn_aux (h) (G):
71 ∀g,L1,L2. G ⊢ L1 ⊒[h,g] L2 →
72 ∀f,I,K1. g = ↑f → L1 = K1.ⓤ{I} →
73 ∃∃K2. G ⊢ K1 ⊒[h,f] K2 & L2 = K2.ⓧ.
74 #h #G #g #L1 #L2 * -g -L1 -L2
75 [ #f #g #J #L1 #_ #H destruct
76 | #f #I #K1 #K2 #_ #g #J #L1 #H
77 elim (discr_push_next … H)
78 | #f #I #K1 #K2 #HK12 #g #J #L1 #H1 #H2 destruct
79 <(injective_next … H1) -g /2 width=3 by ex2_intro/
80 | #f #I #K1 #K2 #V #_ #_ #g #J #L1 #_ #H destruct
84 lemma jsx_inv_unit_sn (h) (G):
85 ∀f,I,K1,L2. G ⊢ K1.ⓤ{I} ⊒[h,↑f] L2 →
86 ∃∃K2. G ⊢ K1 ⊒[h,f] K2 & L2 = K2.ⓧ.
87 /2 width=6 by jsx_inv_unit_sn_aux/ qed-.
89 fact jsx_inv_pair_sn_aux (h) (G):
90 ∀g,L1,L2. G ⊢ L1 ⊒[h,g] L2 →
91 ∀f,I,K1,V. g = ↑f → L1 = K1.ⓑ{I}V →
92 ∃∃K2. G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ & G ⊢ K1 ⊒[h,f] K2 & L2 = K2.ⓧ.
93 #h #G #g #L1 #L2 * -g -L1 -L2
94 [ #f #g #J #L1 #W #_ #H destruct
95 | #f #I #K1 #K2 #_ #g #J #L1 #W #H
96 elim (discr_push_next … H)
97 | #f #I #K1 #K2 #_ #g #J #L1 #W #_ #H destruct
98 | #f #I #K1 #K2 #V #HV #HK12 #g #J #L1 #W #H1 #H2 destruct
99 <(injective_next … H1) -g /2 width=4 by ex3_intro/
103 (* Basic_2A1: uses: lcosx_inv_pair *)
104 lemma jsx_inv_pair_sn (h) (G):
105 ∀f,I,K1,L2,V. G ⊢ K1.ⓑ{I}V ⊒[h,↑f] L2 →
106 ∃∃K2. G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ & G ⊢ K1 ⊒[h,f] K2 & L2 = K2.ⓧ.
107 /2 width=6 by jsx_inv_pair_sn_aux/ qed-.
109 (* Advanced inversion lemmas ************************************************)
111 lemma jsx_inv_pair_sn_gen (h) (G): ∀g,I,K1,L2,V. G ⊢ K1.ⓑ{I}V ⊒[h,g] L2 →
112 ∨∨ ∃∃f,K2. G ⊢ K1 ⊒[h,f] K2 & g = ⫯f & L2 = K2.ⓑ{I}V
113 | ∃∃f,K2. G ⊢ ⬈*[h,V] 𝐒⦃K2⦄ & G ⊢ K1 ⊒[h,f] K2 & g = ↑f & L2 = K2.ⓧ.
114 #h #G #g #I #K1 #L2 #V #H
115 elim (pn_split g) * #f #Hf destruct
116 [ elim (jsx_inv_push_sn … H) -H /3 width=5 by ex3_2_intro, or_introl/
117 | elim (jsx_inv_pair_sn … H) -H /3 width=6 by ex4_2_intro, or_intror/
121 (* Advanced forward lemmas **************************************************)
123 lemma jsx_fwd_bind_sn (h) (G):
124 ∀g,I1,K1,L2. G ⊢ K1.ⓘ{I1} ⊒[h,g] L2 →
125 ∃∃I2,K2. G ⊢ K1 ⊒[h,⫱g] K2 & L2 = K2.ⓘ{I2}.
127 elim (pn_split g) * #f #Hf destruct
128 [ #H elim (jsx_inv_push_sn … H) -H
130 [ #H elim (jsx_inv_unit_sn … H) -H
131 | #V #H elim (jsx_inv_pair_sn … H) -H
134 /2 width=4 by ex2_2_intro/
137 (* Basic properties *********************************************************)
139 lemma jsx_eq_repl_back (h) (G): ∀L1,L2. eq_repl_back … (λf. G ⊢ L1 ⊒[h,f] L2).
140 #h #G #L1 #L2 #f1 #H elim H -L1 -L2 -f1 //
141 [ #f #I #L1 #L2 #_ #IH #x #H
142 elim (eq_inv_px … H) -H /3 width=3 by jsx_push/
143 | #f #I #L1 #L2 #_ #IH #x #H
144 elim (eq_inv_nx … H) -H /3 width=3 by jsx_unit/
145 | #f #I #L1 #L2 #V #HV #_ #IH #x #H
146 elim (eq_inv_nx … H) -H /3 width=3 by jsx_pair/
150 lemma jsx_eq_repl_fwd (h) (G): ∀L1,L2. eq_repl_fwd … (λf. G ⊢ L1 ⊒[h,f] L2).
151 #h #G #L1 #L2 @eq_repl_sym /2 width=3 by jsx_eq_repl_back/
154 (* Advanced properties ******************************************************)
156 (* Basic_2A1: uses: lcosx_O *)
157 lemma jsx_refl (h) (G): ∀f. 𝐈⦃f⦄ → reflexive … (jsx h G f).
158 #h #G #f #Hf #L elim L -L
159 /3 width=3 by jsx_eq_repl_back, jsx_push, eq_push_inv_isid/
162 (* Basic_2A1: removed theorems 2:
163 lcosx_drop_trans_lt lcosx_inv_succ