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/scpes.ma".
17 include "basic_2/dynamic/snv.ma".
19 (* STRATIFIED HIGHER NATIVE VALIDITY FOR TERMS ******************************)
21 inductive shnv (h) (o) (d1) (G) (L): predicate term ≝
22 | shnv_cast: ∀U,T. ⦃G, L⦄ ⊢ U ¡[h, o] → ⦃G, L⦄ ⊢ T ¡[h, o] →
23 (∀d2. d2 ≤ d1 → ⦃G, L⦄ ⊢ U •*⬌*[h, o, d2, d2+1] T) →
24 shnv h o d1 G L (ⓝU.T)
27 interpretation "stratified higher native validity (term)"
28 'NativeValid h o d G L T = (shnv h o d G L T).
30 (* Basic inversion lemmas ***************************************************)
32 fact shnv_inv_cast_aux: ∀h,o,G,L,X,d1. ⦃G, L⦄ ⊢ X ¡[h, o, d1] → ∀U,T. X = ⓝU.T →
33 ∧∧ ⦃G, L⦄ ⊢ U ¡[h, o] & ⦃G, L⦄ ⊢ T ¡[h, o]
34 & (∀d2. d2 ≤ d1 → ⦃G, L⦄ ⊢ U •*⬌*[h, o, d2, d2+1] T).
35 #h #o #G #L #X #d1 * -X
36 #U #T #HU #HT #HUT #U1 #T1 #H destruct /3 width=1 by and3_intro/
39 lemma shnv_inv_cast: ∀h,o,G,L,U,T,d1. ⦃G, L⦄ ⊢ ⓝU.T ¡[h, o, d1] →
40 ∧∧ ⦃G, L⦄ ⊢ U ¡[h, o] & ⦃G, L⦄ ⊢ T ¡[h, o]
41 & (∀d2. d2 ≤ d1 → ⦃G, L⦄ ⊢ U •*⬌*[h, o, d2, d2+1] T).
42 /2 width=3 by shnv_inv_cast_aux/ qed-.
44 lemma shnv_inv_snv: ∀h,o,G,L,T,d. ⦃G, L⦄ ⊢ T ¡[h, o, d] → ⦃G, L⦄ ⊢ T ¡[h, o].
45 #h #o #G #L #T #d * -T
46 #U #T #HU #HT #HUT elim (HUT 0) -HUT /2 width=3 by snv_cast/
49 (* Basic properties *********************************************************)
51 lemma snv_shnv_cast: ∀h,o,G,L,U,T. ⦃G, L⦄ ⊢ ⓝU.T ¡[h, o] → ⦃G, L⦄ ⊢ ⓝU.T ¡[h, o, 0].
52 #h #o #G #L #U #T #H elim (snv_inv_cast … H) -H
53 #U0 #HU #HT #HU0 #HTU0 @shnv_cast // -HU -HT
54 #d #H <(le_n_O_to_eq … H) -d /2 width=3 by scpds_div/