]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/s_computation/fqus.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / s_computation / fqus.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 "ground_2/xoa/ex_2_3.ma".
16 include "ground_2/xoa/ex_3_3.ma".
17 include "ground_2/xoa/or_5.ma".
18 include "ground_2/lib/star.ma".
19 include "static_2/notation/relations/suptermstar_6.ma".
20 include "static_2/notation/relations/suptermstar_7.ma".
21 include "static_2/s_transition/fquq.ma".
22
23 (* STAR-ITERATED SUPCLOSURE *************************************************)
24
25 definition fqus: bool → tri_relation genv lenv term ≝
26                  λb. tri_TC … (fquq b).
27
28 interpretation "extended star-iterated structural successor (closure)"
29    'SupTermStar b G1 L1 T1 G2 L2 T2 = (fqus b G1 L1 T1 G2 L2 T2).
30
31 interpretation "star-iterated structural successor (closure)"
32    'SupTermStar G1 L1 T1 G2 L2 T2 = (fqus true G1 L1 T1 G2 L2 T2).
33
34 (* Basic eliminators ********************************************************)
35
36 lemma fqus_ind: ∀b,G1,L1,T1. ∀Q:relation3 …. Q G1 L1 T1 →
37                 (∀G,G2,L,L2,T,T2. ❪G1,L1,T1❫ ⬂*[b] ❪G,L,T❫ → ❪G,L,T❫ ⬂⸮[b] ❪G2,L2,T2❫ → Q G L T → Q G2 L2 T2) →
38                 ∀G2,L2,T2. ❪G1,L1,T1❫ ⬂*[b] ❪G2,L2,T2❫ → Q G2 L2 T2.
39 #b #G1 #L1 #T1 #R #IH1 #IH2 #G2 #L2 #T2 #H
40 @(tri_TC_star_ind … IH1 IH2 G2 L2 T2 H) //
41 qed-.
42
43 lemma fqus_ind_dx: ∀b,G2,L2,T2. ∀Q:relation3 …. Q G2 L2 T2 →
44                    (∀G1,G,L1,L,T1,T. ❪G1,L1,T1❫ ⬂⸮[b] ❪G,L,T❫ → ❪G,L,T❫ ⬂*[b] ❪G2,L2,T2❫ → Q G L T → Q G1 L1 T1) →
45                    ∀G1,L1,T1. ❪G1,L1,T1❫ ⬂*[b] ❪G2,L2,T2❫ → Q G1 L1 T1.
46 #b #G2 #L2 #T2 #Q #IH1 #IH2 #G1 #L1 #T1 #H
47 @(tri_TC_star_ind_dx … IH1 IH2 G1 L1 T1 H) //
48 qed-.
49
50 (* Basic properties *********************************************************)
51
52 lemma fqus_refl: ∀b. tri_reflexive … (fqus b).
53 /2 width=1 by tri_inj/ qed.
54
55 lemma fquq_fqus: ∀b,G1,G2,L1,L2,T1,T2. ❪G1,L1,T1❫ ⬂⸮[b] ❪G2,L2,T2❫ →
56                  ❪G1,L1,T1❫ ⬂*[b] ❪G2,L2,T2❫.
57 /2 width=1 by tri_inj/ qed.
58
59 lemma fqus_strap1: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ❪G1,L1,T1❫ ⬂*[b] ❪G,L,T❫ →
60                    ❪G,L,T❫ ⬂⸮[b] ❪G2,L2,T2❫ → ❪G1,L1,T1❫ ⬂*[b] ❪G2,L2,T2❫.
61 /2 width=5 by tri_step/ qed-.
62
63 lemma fqus_strap2: ∀b,G1,G,G2,L1,L,L2,T1,T,T2. ❪G1,L1,T1❫ ⬂⸮[b] ❪G,L,T❫ →
64                    ❪G,L,T❫ ⬂*[b] ❪G2,L2,T2❫ → ❪G1,L1,T1❫ ⬂*[b] ❪G2,L2,T2❫.
65 /2 width=5 by tri_TC_strap/ qed-.
66
67 (* Basic inversion lemmas ***************************************************)
68
69 lemma fqus_inv_fqu_sn: ∀b,G1,G2,L1,L2,T1,T2. ❪G1,L1,T1❫ ⬂*[b] ❪G2,L2,T2❫ →
70                        (∧∧ G1 = G2 & L1 = L2 & T1 = T2) ∨
71                        ∃∃G,L,T. ❪G1,L1,T1❫ ⬂[b] ❪G,L,T❫ & ❪G,L,T❫ ⬂*[b] ❪G2,L2,T2❫.
72 #b #G1 #G2 #L1 #L2 #T1 #T2 #H12 @(fqus_ind_dx … H12) -G1 -L1 -T1 /3 width=1 by and3_intro, or_introl/
73 #G1 #G #L1 #L #T1 #T * /3 width=5 by ex2_3_intro, or_intror/
74 * #HG #HL #HT #_ destruct //
75 qed-.
76
77 lemma fqus_inv_sort1: ∀b,G1,G2,L1,L2,T2,s. ❪G1,L1,⋆s❫ ⬂*[b] ❪G2,L2,T2❫ →
78                       (∧∧ G1 = G2 & L1 = L2 & ⋆s = T2) ∨
79                       ∃∃J,L. ❪G1,L,⋆s❫ ⬂*[b] ❪G2,L2,T2❫ & L1 = L.ⓘ[J].
80 #b #G1 #G2 #L1 #L2 #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
81 #G #L #T #H elim (fqu_inv_sort1 … H) -H /3 width=4 by ex2_2_intro, or_intror/
82 qed-.
83
84 lemma fqus_inv_lref1: ∀b,G1,G2,L1,L2,T2,i. ❪G1,L1,#i❫ ⬂*[b] ❪G2,L2,T2❫ →
85                       ∨∨ ∧∧ G1 = G2 & L1 = L2 & #i = T2
86                        | ∃∃J,L,V. ❪G1,L,V❫ ⬂*[b] ❪G2,L2,T2❫ & L1 = L.ⓑ[J]V & i = 0
87                        | ∃∃J,L,j. ❪G1,L,#j❫ ⬂*[b] ❪G2,L2,T2❫ & L1 = L.ⓘ[J] & i = ↑j.
88 #b #G1 #G2 #L1 #L2 #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or3_intro0/
89 #G #L #T #H elim (fqu_inv_lref1 … H) -H * /3 width=6 by ex3_3_intro, or3_intro1, or3_intro2/
90 qed-.
91
92 lemma fqus_inv_gref1: ∀b,G1,G2,L1,L2,T2,l. ❪G1,L1,§l❫ ⬂*[b] ❪G2,L2,T2❫ →
93                       (∧∧ G1 = G2 & L1 = L2 & §l = T2) ∨
94                       ∃∃J,L. ❪G1,L,§l❫ ⬂*[b] ❪G2,L2,T2❫ & L1 = L.ⓘ[J].
95 #b #G1 #G2 #L1 #L2 #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
96 #G #L #T #H elim (fqu_inv_gref1 … H) -H /3 width=4 by ex2_2_intro, or_intror/
97 qed-.
98
99 lemma fqus_inv_bind1: ∀b,p,I,G1,G2,L1,L2,V1,T1,T2. ❪G1,L1,ⓑ[p,I]V1.T1❫ ⬂*[b] ❪G2,L2,T2❫ →
100                       ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓑ[p,I]V1.T1 = T2
101                        | ❪G1,L1,V1❫ ⬂*[b] ❪G2,L2,T2❫
102                        | ∧∧ ❪G1,L1.ⓑ[I]V1,T1❫ ⬂*[b] ❪G2,L2,T2❫ & b = Ⓣ
103                        | ∧∧ ❪G1,L1.ⓧ,T1❫ ⬂*[b] ❪G2,L2,T2❫ & b = Ⓕ
104                        | ∃∃J,L,T. ❪G1,L,T❫ ⬂*[b] ❪G2,L2,T2❫ & ⇧*[1] T ≘ ⓑ[p,I]V1.T1 & L1 = L.ⓘ[J].
105 #b #p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or5_intro0/
106 #G #L #T #H elim (fqu_inv_bind1 … H) -H *
107 [4: #J ] #H1 #H2 #H3 [3,4: #Hb ] #H destruct
108 /3 width=6 by or5_intro1, or5_intro2, or5_intro3, or5_intro4, ex3_3_intro, conj/
109 qed-.
110
111
112 lemma fqus_inv_bind1_true: ∀p,I,G1,G2,L1,L2,V1,T1,T2. ❪G1,L1,ⓑ[p,I]V1.T1❫ ⬂* ❪G2,L2,T2❫ →
113                            ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓑ[p,I]V1.T1 = T2
114                                | ❪G1,L1,V1❫ ⬂* ❪G2,L2,T2❫
115                                | ❪G1,L1.ⓑ[I]V1,T1❫ ⬂* ❪G2,L2,T2❫
116                                | ∃∃J,L,T. ❪G1,L,T❫ ⬂* ❪G2,L2,T2❫ & ⇧*[1] T ≘ ⓑ[p,I]V1.T1 & L1 = L.ⓘ[J].
117 #p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_bind1 … H) -H [1,3,4: * ]
118 /3 width=1 by and3_intro, or4_intro0, or4_intro1, or4_intro2, or4_intro3/
119 #_ #H destruct
120 qed-.
121
122 lemma fqus_inv_flat1: ∀b,I,G1,G2,L1,L2,V1,T1,T2. ❪G1,L1,ⓕ[I]V1.T1❫ ⬂*[b] ❪G2,L2,T2❫ →
123                       ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓕ[I]V1.T1 = T2
124                        | ❪G1,L1,V1❫ ⬂*[b] ❪G2,L2,T2❫
125                        | ❪G1,L1,T1❫ ⬂*[b] ❪G2,L2,T2❫
126                        | ∃∃J,L,T. ❪G1,L,T❫ ⬂*[b] ❪G2,L2,T2❫ & ⇧*[1] T ≘ ⓕ[I]V1.T1 & L1 = L.ⓘ[J].
127 #b #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or4_intro0/
128 #G #L #T #H elim (fqu_inv_flat1 … H) -H *
129 [3: #J ] #H1 #H2 #H3 #H destruct
130 /3 width=6 by or4_intro1, or4_intro2, or4_intro3, ex3_3_intro/
131 qed-.
132
133 (* Advanced inversion lemmas ************************************************)
134
135 lemma fqus_inv_atom1: ∀b,I,G1,G2,L2,T2. ❪G1,⋆,⓪[I]❫ ⬂*[b] ❪G2,L2,T2❫ →
136                       ∧∧ G1 = G2 & ⋆ = L2 & ⓪[I] = T2.
137 #b #I #G1 #G2 #L2 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /2 width=1 by and3_intro/
138 #G #L #T #H elim (fqu_inv_atom1 … H)
139 qed-.
140
141 lemma fqus_inv_sort1_bind: ∀b,I,G1,G2,L1,L2,T2,s. ❪G1,L1.ⓘ[I],⋆s❫ ⬂*[b] ❪G2,L2,T2❫ →
142                            (∧∧ G1 = G2 & L1.ⓘ[I] = L2 & ⋆s = T2) ∨ ❪G1,L1,⋆s❫ ⬂*[b] ❪G2,L2,T2❫.
143 #b #I #G1 #G2 #L1 #L2 #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
144 #G #L #T #H elim (fqu_inv_sort1_bind … H) -H
145 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
146 qed-.
147
148 lemma fqus_inv_zero1_pair: ∀b,I,G1,G2,L1,L2,V1,T2. ❪G1,L1.ⓑ[I]V1,#0❫ ⬂*[b] ❪G2,L2,T2❫ →
149                            (∧∧ G1 = G2 & L1.ⓑ[I]V1 = L2 & #0 = T2) ∨ ❪G1,L1,V1❫ ⬂*[b] ❪G2,L2,T2❫.
150 #b #I #G1 #G2 #L1 #L2 #V1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
151 #G #L #T #H elim (fqu_inv_zero1_pair … H) -H
152 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
153 qed-.
154
155 lemma fqus_inv_lref1_bind: ∀b,I,G1,G2,L1,L2,T2,i. ❪G1,L1.ⓘ[I],#↑i❫ ⬂*[b] ❪G2,L2,T2❫ →
156                            (∧∧ G1 = G2 & L1.ⓘ[I] = L2 & #(↑i) = T2) ∨ ❪G1,L1,#i❫ ⬂*[b] ❪G2,L2,T2❫.
157 #b #I #G1 #G2 #L1 #L2 #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
158 #G #L #T #H elim (fqu_inv_lref1_bind … H) -H
159 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
160 qed-.
161
162 lemma fqus_inv_gref1_bind: ∀b,I,G1,G2,L1,L2,T2,l. ❪G1,L1.ⓘ[I],§l❫ ⬂*[b] ❪G2,L2,T2❫ →
163                            (∧∧ G1 = G2 & L1.ⓘ[I] = L2 & §l = T2) ∨ ❪G1,L1,§l❫ ⬂*[b] ❪G2,L2,T2❫.
164 #b #I #G1 #G2 #L1 #L2 #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
165 #G #L #T #H elim (fqu_inv_gref1_bind … H) -H
166 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
167 qed-.
168
169 (* Basic_2A1: removed theorems 1: fqus_drop *)