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/nativevalid_6.ma".
16 include "basic_2/equivalence/cpes.ma".
17 include "basic_2/dynamic/snv.ma".
19 (* HIGHER ORDER STRATIFIED NATIVE VALIDITY FOR TERMS ************************)
21 inductive hsnv (h) (g) (l1) (G) (L): predicate term ≝
22 | hsnv_cast: ∀U,T. ⦃G, L⦄ ⊢ U ¡[h, g] → ⦃G, L⦄ ⊢ T ¡[h, g] →
23 (∀l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ U •*⬌*[h, g, l2, l2+1] T) →
24 hsnv h g l1 G L (ⓝU.T)
27 interpretation "higher order stratified native validity (term)"
28 'NativeValid h g l G L T = (hsnv h g l G L T).
30 (* Basic inversion lemmas ***************************************************)
32 fact hsnv_inv_cast_aux: ∀h,g,G,L,X,l1. ⦃G, L⦄ ⊢ X ¡[h, g, l1] → ∀U,T. X = ⓝU.T →
33 ∧∧ ⦃G, L⦄ ⊢ U ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g]
34 & (∀l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ U •*⬌*[h, g, l2, l2+1] T).
35 #h #g #G #L #X #l1 * -X
36 #U #T #HU #HT #HUT #U1 #T1 #H destruct /3 width=1 by and3_intro/
39 lemma hsnv_inv_cast: ∀h,g,G,L,U,T,l1. ⦃G, L⦄ ⊢ ⓝU.T ¡[h, g, l1] →
40 ∧∧ ⦃G, L⦄ ⊢ U ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g]
41 & (∀l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ U •*⬌*[h, g, l2, l2+1] T).
42 /2 width=3 by hsnv_inv_cast_aux/ qed-.
44 lemma hsnv_inv_snv: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ¡[h, g, l] → ⦃G, L⦄ ⊢ T ¡[h, g].
45 #h #g #G #L #T #l * -T
46 #U #T #HU #HT #HUT elim (HUT 0) -HUT
47 /3 width=3 by snv_cast, cpds_fwd_cprs/