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/static/ssta_ssta.ma".
16 include "basic_2/unfold/sstas.ma".
18 (* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
20 (* Advanced inversion lemmas ************************************************)
22 lemma sstas_inv_O: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g] U →
23 ∀T0. ⦃G, L⦄ ⊢ T •[h, g] ⦃0, T0⦄ → U = T.
24 #h #g #G #L #T #U #H @(sstas_ind_dx … H) -T //
25 #T0 #U0 #l0 #HTU0 #_ #_ #T1 #HT01
26 elim (ssta_mono … HTU0 … HT01) <plus_n_Sm #H destruct
29 (* Advanced properties ******************************************************)
31 lemma sstas_strip: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •*[h, g] U1 →
32 ∀U2,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U2⦄ →
33 T = U1 ∨ ⦃G, L⦄ ⊢ U2 •*[h, g] U1.
34 #h #g #G #L #T #U1 #H1 @(sstas_ind_dx … H1) -T /2 width=1/
35 #T #U #l0 #HTU #HU1 #_ #U2 #l #H2
36 elim (ssta_mono … H2 … HTU) -H2 -HTU #H1 #H2 destruct /2 width=1/
39 (* Main properties **********************************************************)
41 theorem sstas_trans: ∀h,g,G,L,T1,U. ⦃G, L⦄ ⊢ T1 •*[h, g] U →
42 ∀T2. ⦃G, L⦄ ⊢ U •*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*[h, g] T2.
45 theorem sstas_conf: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •*[h, g] U1 →
46 ∀U2. ⦃G, L⦄ ⊢ T •*[h, g] U2 →
47 ⦃G, L⦄ ⊢ U1 •*[h, g] U2 ∨ ⦃G, L⦄ ⊢ U2 •*[h, g] U1.
48 #h #g #G #L #T #U1 #H1 @(sstas_ind_dx … H1) -T /2 width=1/
49 #T #U #l #HTU #HU1 #IHU1 #U2 #H2
50 elim (sstas_strip … H2 … HTU) #H destruct
51 [ -H2 -IHU1 /3 width=4/