]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/s_computation/fqus.ma
- improved fqu allows to prove fqu_cpx_trans and its derivatives
[helm.git] / matita / matita / contribs / lambdadelta / basic_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 "basic_2/notation/relations/suptermstar_6.ma".
16 include "basic_2/s_transition/fquq.ma".
17
18 (* STAR-ITERATED SUPCLOSURE *************************************************)
19
20 definition fqus: tri_relation genv lenv term ≝ tri_TC … fquq.
21
22 interpretation "star-iterated structural successor (closure)"
23    'SupTermStar G1 L1 T1 G2 L2 T2 = (fqus G1 L1 T1 G2 L2 T2).
24
25 (* Basic eliminators ********************************************************)
26
27 lemma fqus_ind: ∀G1,L1,T1. ∀R:relation3 …. R G1 L1 T1 →
28                 (∀G,G2,L,L2,T,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐⸮ ⦃G2, L2, T2⦄ → R G L T → R G2 L2 T2) →
29                 ∀G2,L2,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ → R G2 L2 T2.
30 #G1 #L1 #T1 #R #IH1 #IH2 #G2 #L2 #T2 #H
31 @(tri_TC_star_ind … IH1 IH2 G2 L2 T2 H) //
32 qed-.
33
34 lemma fqus_ind_dx: ∀G2,L2,T2. ∀R:relation3 …. R G2 L2 T2 →
35                    (∀G1,G,L1,L,T1,T. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐* ⦃G2, L2, T2⦄ → R G L T → R G1 L1 T1) →
36                    ∀G1,L1,T1. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ → R G1 L1 T1.
37 #G2 #L2 #T2 #R #IH1 #IH2 #G1 #L1 #T1 #H
38 @(tri_TC_star_ind_dx … IH1 IH2 G1 L1 T1 H) //
39 qed-.
40
41 (* Basic properties *********************************************************)
42
43 lemma fqus_refl: tri_reflexive … fqus.
44 /2 width=1 by tri_inj/ qed.
45
46 lemma fquq_fqus: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ → ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄.
47 /2 width=1 by tri_inj/ qed.
48
49 lemma fqus_strap1: ∀G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
50                    ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄.
51 /2 width=5 by tri_step/ qed-.
52
53 lemma fqus_strap2: ∀G1,G,G2,L1,L,L2,T1,T,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G, L, T⦄ → ⦃G, L, T⦄ ⊐* ⦃G2, L2, T2⦄ →
54                    ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄.
55 /2 width=5 by tri_TC_strap/ qed-.
56
57 (* Basic inversion lemmas ***************************************************)
58
59 lemma fqus_inv_fqu_sn: ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
60                        (∧∧ G1 = G2 & L1 = L2 & T1 = T2) ∨
61                        ∃∃G,L,T. ⦃G1, L1, T1⦄ ⊐ ⦃G, L, T⦄ & ⦃G, L, T⦄ ⊐* ⦃G2, L2, T2⦄.
62 #G1 #G2 #L1 #L2 #T1 #T2 #H12 @(fqus_ind_dx … H12) -G1 -L1 -T1 /3 width=1 by and3_intro, or_introl/
63 #G1 #G #L1 #L #T1 #T * /3 width=5 by ex2_3_intro, or_intror/
64 * #HG #HL #HT #_ destruct //
65 qed-.
66
67 lemma fqus_inv_sort1: ∀G1,G2,L1,L2,T2,s. ⦃G1, L1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄ →
68                       (∧∧ G1 = G2 & L1 = L2 & ⋆s = T2) ∨
69                       ∃∃J,L,V. ⦃G1, L, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V.
70 #G1 #G2 #L1 #L2 #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
71 #G #L #T #H elim (fqu_inv_sort1 … H) -H /3 width=5 by ex2_3_intro, or_intror/
72 qed-.
73
74 lemma fqus_inv_lref1: ∀G1,G2,L1,L2,T2,i. ⦃G1, L1, #i⦄ ⊐* ⦃G2, L2, T2⦄ →
75                       ∨∨ ∧∧ G1 = G2 & L1 = L2 & #i = T2
76                        | ∃∃J,L,V. ⦃G1, L, V⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V & i = 0
77                        | ∃∃J,L,V,j. ⦃G1, L, #j⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V & i = ⫯j.
78 #G1 #G2 #L1 #L2 #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or3_intro0/
79 #G #L #T #H elim (fqu_inv_lref1 … H) -H * /3 width=7 by or3_intro1, or3_intro2, ex3_4_intro, ex3_3_intro/
80 qed-.
81
82 lemma fqus_inv_gref1: ∀G1,G2,L1,L2,T2,l. ⦃G1, L1, §l⦄ ⊐* ⦃G2, L2, T2⦄ →
83                       (∧∧ G1 = G2 & L1 = L2 & §l = T2) ∨
84                       ∃∃J,L,V. ⦃G1, L, §l⦄ ⊐* ⦃G2, L2, T2⦄ & L1 = L.ⓑ{J}V.
85 #G1 #G2 #L1 #L2 #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
86 #G #L #T #H elim (fqu_inv_gref1 … H) -H /3 width=5 by ex2_3_intro, or_intror/
87 qed-.
88
89 lemma fqus_inv_bind1: ∀p,I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓑ{p,I}V1.T1⦄ ⊐* ⦃G2, L2, T2⦄ →
90                       ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓑ{p,I}V1.T1 = T2
91                        | ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄
92                        | ⦃G1, L1.ⓑ{I}V1, T1⦄ ⊐* ⦃G2, L2, T2⦄
93                        | ∃∃J,L,V,T. ⦃G1, L, T⦄ ⊐* ⦃G2, L2, T2⦄ & ⬆*[1] T ≡ ⓑ{p,I}V1.T1 & L1 = L.ⓑ{J}V.
94 #p #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or4_intro0/
95 #G #L #T #H elim (fqu_inv_bind1 … H) -H *
96 [3: #J #V ] #H1 #H2 #H3 #H destruct
97 /3 width=7 by or4_intro1, or4_intro2, or4_intro3, ex3_4_intro/
98 qed-.
99
100 lemma fqus_inv_flat1: ∀I,G1,G2,L1,L2,V1,T1,T2. ⦃G1, L1, ⓕ{I}V1.T1⦄ ⊐* ⦃G2, L2, T2⦄ →
101                       ∨∨ ∧∧ G1 = G2 & L1 = L2 & ⓕ{I}V1.T1 = T2
102                        | ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄
103                        | ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄
104                        | ∃∃J,L,V,T. ⦃G1, L, T⦄ ⊐* ⦃G2, L2, T2⦄ & ⬆*[1] T ≡ ⓕ{I}V1.T1 & L1 = L.ⓑ{J}V.
105 #I #G1 #G2 #L1 #L2 #V1 #T1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or4_intro0/
106 #G #L #T #H elim (fqu_inv_flat1 … H) -H *
107 [3: #J #V ] #H1 #H2 #H3 #H destruct
108 /3 width=7 by or4_intro1, or4_intro2, or4_intro3, ex3_4_intro/
109 qed-.
110
111 (* Advanced inversion lemmas ************************************************)
112
113 lemma fqus_inv_atom1: ∀I,G1,G2,L2,T2. ⦃G1, ⋆, ⓪{I}⦄ ⊐* ⦃G2, L2, T2⦄ →
114                       ∧∧ G1 = G2 & ⋆ = L2 & ⓪{I} = T2.
115 #I #G1 #G2 #L2 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /2 width=1 by and3_intro/
116 #G #L #T #H elim (fqu_inv_atom1 … H)
117 qed-.
118
119 lemma fqus_inv_sort1_pair: ∀I,G1,G2,L1,L2,V1,T2,s. ⦃G1, L1.ⓑ{I}V1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄ →
120                            (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & ⋆s = T2) ∨ ⦃G1, L1, ⋆s⦄ ⊐* ⦃G2, L2, T2⦄.
121 #I #G1 #G2 #L1 #L2 #V #T2 #s #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
122 #G #L #T #H elim (fqu_inv_sort1_pair … H) -H
123 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
124 qed-.
125
126 lemma fqus_inv_zero1_pair: ∀I,G1,G2,L1,L2,V1,T2. ⦃G1, L1.ⓑ{I}V1, #0⦄ ⊐* ⦃G2, L2, T2⦄ →
127                            (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #0 = T2) ∨ ⦃G1, L1, V1⦄ ⊐* ⦃G2, L2, T2⦄.
128 #I #G1 #G2 #L1 #L2 #V1 #T2 #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
129 #G #L #T #H elim (fqu_inv_zero1_pair … H) -H
130 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
131 qed-.
132
133 lemma fqus_inv_lref1_pair: ∀I,G1,G2,L1,L2,V1,T2,i. ⦃G1, L1.ⓑ{I}V1, #⫯i⦄ ⊐* ⦃G2, L2, T2⦄ →
134                            (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & #(⫯i) = T2) ∨ ⦃G1, L1, #i⦄ ⊐* ⦃G2, L2, T2⦄.
135 #I #G1 #G2 #L1 #L2 #V #T2 #i #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
136 #G #L #T #H elim (fqu_inv_lref1_pair … H) -H
137 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
138 qed-.
139
140 lemma fqus_inv_gref1_pair: ∀I,G1,G2,L1,L2,V1,T2,l. ⦃G1, L1.ⓑ{I}V1, §l⦄ ⊐* ⦃G2, L2, T2⦄ →
141                            (∧∧ G1 = G2 & L1.ⓑ{I}V1 = L2 & §l = T2) ∨ ⦃G1, L1, §l⦄ ⊐* ⦃G2, L2, T2⦄.
142 #I #G1 #G2 #L1 #L2 #V #T2 #l #H elim (fqus_inv_fqu_sn … H) -H * /3 width=1 by and3_intro, or_introl/
143 #G #L #T #H elim (fqu_inv_gref1_pair … H) -H
144 #H1 #H2 #H3 #H destruct /2 width=1 by or_intror/
145 qed-.
146
147 (* Basic_2A1: removed theorems 1: fqus_drop *)