]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/lsubsx.ma
milestone in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / lsubsx.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/notation/relations/lsubeqx_5.ma".
16 include "basic_2/rt_computation/rdsx.ma".
17
18 (* CLEAR OF STRONGLY NORMALIZING ENTRIES FOR UNBOUND RT-TRANSITION **********)
19
20 (* Note: this should be an instance of a more general sex *)
21 (* Basic_2A1: uses: lcosx *)
22 inductive lsubsx (h) (G): rtmap → relation lenv ≝
23 | lsubsx_atom: ∀f. lsubsx h G f (⋆) (⋆)
24 | lsubsx_push: ∀f,I,K1,K2. lsubsx h G f K1 K2 →
25                lsubsx h G (⫯f) (K1.ⓘ{I}) (K2.ⓘ{I})
26 | lsubsx_unit: ∀f,I,K1,K2. lsubsx h G f K1 K2 →
27                lsubsx h G (↑f) (K1.ⓤ{I}) (K2.ⓧ)
28 | lsubsx_pair: ∀f,I,K1,K2,V. G ⊢ ⬈*[h, V] 𝐒⦃K2⦄ →
29                lsubsx h G f K1 K2 → lsubsx h G (↑f) (K1.ⓑ{I}V) (K2.ⓧ)
30 .
31
32 interpretation
33   "local environment refinement (clear)"
34   'LSubEqX h f G L1 L2 = (lsubsx h G f L1 L2).
35
36 (* Basic inversion lemmas ***************************************************)
37
38 fact lsubsx_inv_atom_sn_aux: ∀h,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, g] L2 →
39                              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
44 ]
45 qed-.
46
47 lemma lsubsx_inv_atom_sn: ∀h,g,G,L2. G ⊢ ⋆ ⊆ⓧ[h, g] L2 → L2 = ⋆.
48 /2 width=7 by lsubsx_inv_atom_sn_aux/ qed-.
49
50 fact lsubsx_inv_push_sn_aux: ∀h,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, g] L2 →
51                              ∀f,I,K1. g = ⫯f → L1 = K1.ⓘ{I} →
52                              ∃∃K2. G ⊢ K1 ⊆ⓧ[h, f] K2 & L2 = K2.ⓘ{I}.
53 #h #g #G #L1 #L2 * -g -L1 -L2
54 [ #f #g #J #L1 #_ #H destruct
55 | #f #I #K1 #K2 #HK12 #g #J #L1 #H1 #H2 destruct
56   <(injective_push … H1) -g /2 width=3 by ex2_intro/
57 | #f #I #K1 #K2 #_ #g #J #L1 #H
58   elim (discr_next_push … H)
59 | #f #I #K1 #K2 #V #_ #_ #g #J #L1 #H
60   elim (discr_next_push … H)
61 ]
62 qed-.
63
64 lemma lsubsx_inv_push_sn: ∀h,f,I,G,K1,L2. G ⊢ K1.ⓘ{I} ⊆ⓧ[h, ⫯f] L2 →
65                           ∃∃K2. G ⊢ K1 ⊆ⓧ[h, f] K2 & L2 = K2.ⓘ{I}.
66 /2 width=5 by lsubsx_inv_push_sn_aux/ qed-.
67
68 fact lsubsx_inv_unit_sn_aux: ∀h,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, g] L2 →
69                              ∀f,I,K1. g = ↑f → L1 = K1.ⓤ{I} →
70                              ∃∃K2. G ⊢ K1 ⊆ⓧ[h, f] K2 & L2 = K2.ⓧ.
71 #h #g #G #L1 #L2 * -g -L1 -L2
72 [ #f #g #J #L1 #_ #H destruct
73 | #f #I #K1 #K2 #_ #g #J #L1 #H
74   elim (discr_push_next … H)
75 | #f #I #K1 #K2 #HK12 #g #J #L1 #H1 #H2 destruct
76   <(injective_next … H1) -g /2 width=3 by ex2_intro/
77 | #f #I #K1 #K2 #V #_ #_ #g #J #L1 #_ #H destruct
78 ]
79 qed-.
80
81 lemma lsubsx_inv_unit_sn: ∀h,f,I,G,K1,L2. G ⊢ K1.ⓤ{I} ⊆ⓧ[h, ↑f] L2 →
82                           ∃∃K2. G ⊢ K1 ⊆ⓧ[h, f] K2 & L2 = K2.ⓧ.
83 /2 width=6 by lsubsx_inv_unit_sn_aux/ qed-.
84
85 fact lsubsx_inv_pair_sn_aux: ∀h,g,G,L1,L2. G ⊢ L1 ⊆ⓧ[h, g] L2 →
86                              ∀f,I,K1,V. g = ↑f → L1 = K1.ⓑ{I}V →
87                              ∃∃K2. G ⊢ ⬈*[h, V] 𝐒⦃K2⦄ &
88                                    G ⊢ K1 ⊆ⓧ[h, f] K2 & L2 = K2.ⓧ.
89 #h #g #G #L1 #L2 * -g -L1 -L2
90 [ #f #g #J #L1 #W #_ #H destruct
91 | #f #I #K1 #K2 #_ #g #J #L1 #W #H
92   elim (discr_push_next … H)
93 | #f #I #K1 #K2 #_ #g #J #L1 #W #_ #H destruct
94 | #f #I #K1 #K2 #V #HV #HK12 #g #J #L1 #W #H1 #H2 destruct
95   <(injective_next … H1) -g /2 width=4 by ex3_intro/
96 ]
97 qed-.
98
99 (* Basic_2A1: uses: lcosx_inv_pair *)
100 lemma lsubsx_inv_pair_sn: ∀h,f,I,G,K1,L2,V. G ⊢ K1.ⓑ{I}V ⊆ⓧ[h, ↑f] L2 →
101                           ∃∃K2. G ⊢ ⬈*[h, V] 𝐒⦃K2⦄ &
102                                 G ⊢ K1 ⊆ⓧ[h, f] K2 & L2 = K2.ⓧ.
103 /2 width=6 by lsubsx_inv_pair_sn_aux/ qed-.
104
105 (* Advanced inversion lemmas ************************************************)
106
107 lemma lsubsx_inv_pair_sn_gen: ∀h,g,I,G,K1,L2,V. G ⊢ K1.ⓑ{I}V ⊆ⓧ[h, g] L2 →
108                               ∨∨ ∃∃f,K2. G ⊢ K1 ⊆ⓧ[h, f] K2 & g = ⫯f & L2 = K2.ⓑ{I}V
109                                | ∃∃f,K2. G ⊢ ⬈*[h, V] 𝐒⦃K2⦄ &
110                                          G ⊢ K1 ⊆ⓧ[h, f] K2 & g = ↑f & L2 = K2.ⓧ.
111 #h #g #I #G #K1 #L2 #V #H
112 elim (pn_split g) * #f #Hf destruct
113 [ elim (lsubsx_inv_push_sn … H) -H /3 width=5 by ex3_2_intro, or_introl/
114 | elim (lsubsx_inv_pair_sn … H) -H /3 width=6 by ex4_2_intro, or_intror/
115 ]
116 qed-.
117
118 (* Advanced forward lemmas **************************************************)
119
120 lemma lsubsx_fwd_bind_sn: ∀h,g,I1,G,K1,L2. G ⊢ K1.ⓘ{I1} ⊆ⓧ[h, g] L2 →
121                           ∃∃I2,K2. G ⊢ K1 ⊆ⓧ[h, ⫱g] K2 & L2 = K2.ⓘ{I2}.
122 #h #g #I1 #G #K1 #L2
123 elim (pn_split g) * #f #Hf destruct
124 [ #H elim (lsubsx_inv_push_sn … H) -H
125 | cases I1 -I1 #I1
126   [ #H elim (lsubsx_inv_unit_sn … H) -H
127   | #V #H elim (lsubsx_inv_pair_sn … H) -H
128   ]
129 ]
130 /2 width=4 by ex2_2_intro/
131 qed-.
132
133 (* Basic properties *********************************************************)
134
135 lemma lsubsx_eq_repl_back: ∀h,G,L1,L2. eq_repl_back … (λf. G ⊢ L1 ⊆ⓧ[h, f] L2).
136 #h #G #L1 #L2 #f1 #H elim H -L1 -L2 -f1 //
137 [ #f #I #L1 #L2 #_ #IH #x #H
138   elim (eq_inv_px … H) -H /3 width=3 by lsubsx_push/
139 | #f #I #L1 #L2 #_ #IH #x #H
140   elim (eq_inv_nx … H) -H /3 width=3 by lsubsx_unit/
141 | #f #I #L1 #L2 #V #HV #_ #IH #x #H
142   elim (eq_inv_nx … H) -H /3 width=3 by lsubsx_pair/
143 ]
144 qed-.
145
146 lemma lsubsx_eq_repl_fwd: ∀h,G,L1,L2. eq_repl_fwd … (λf. G ⊢ L1 ⊆ⓧ[h, f] L2).
147 #h #G #L1 #L2 @eq_repl_sym /2 width=3 by lsubsx_eq_repl_back/
148 qed-.
149
150 (* Advanced properties ******************************************************)
151
152 (* Basic_2A1: uses: lcosx_O *)
153 lemma lsubsx_refl: ∀h,f,G. 𝐈⦃f⦄ → reflexive … (lsubsx h G f).
154 #h #f #G #Hf #L elim L -L
155 /3 width=3 by lsubsx_eq_repl_back, lsubsx_push, eq_push_inv_isid/
156 qed.
157
158 (* Basic_2A1: removed theorems 2:
159               lcosx_drop_trans_lt lcosx_inv_succ
160 *)