]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/dynamic/shnv.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / dynamic / shnv.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_2A/notation/relations/nativevalid_6.ma".
16 include "basic_2A/equivalence/scpes.ma".
17 include "basic_2A/dynamic/snv.ma".
18
19 (* STRATIFIED HIGHER NATIVE VALIDITY FOR TERMS ******************************)
20
21 inductive shnv (h) (g) (d1) (G) (L): predicate term ≝
22 | shnv_cast: ∀U,T. ⦃G, L⦄ ⊢ U ¡[h, g] → ⦃G, L⦄ ⊢ T ¡[h, g] →
23              (∀d2. d2 ≤ d1 → ⦃G, L⦄ ⊢ U •*⬌*[h, g, d2, d2+1] T) →
24              shnv h g d1 G L (ⓝU.T)
25 .
26
27 interpretation "stratified higher native validity (term)"
28    'NativeValid h g d G L T = (shnv h g d G L T).
29
30 (* Basic inversion lemmas ***************************************************)
31
32 fact shnv_inv_cast_aux: ∀h,g,G,L,X,d1. ⦃G, L⦄ ⊢ X ¡[h, g, d1] → ∀U,T. X = ⓝU.T →
33                         ∧∧ ⦃G, L⦄ ⊢ U ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g]
34                          & (∀d2. d2 ≤ d1 → ⦃G, L⦄ ⊢ U •*⬌*[h, g, d2, d2+1] T).
35 #h #g #G #L #X #d1 * -X
36 #U #T #HU #HT #HUT #U1 #T1 #H destruct /3 width=1 by and3_intro/
37 qed-.
38
39 lemma shnv_inv_cast: ∀h,g,G,L,U,T,d1. ⦃G, L⦄ ⊢ ⓝU.T ¡[h, g, d1] →
40                      ∧∧ ⦃G, L⦄ ⊢ U ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g]
41                       & (∀d2. d2 ≤ d1 → ⦃G, L⦄ ⊢ U •*⬌*[h, g, d2, d2+1] T).
42 /2 width=3 by shnv_inv_cast_aux/ qed-.
43
44 lemma shnv_inv_snv: ∀h,g,G,L,T,d. ⦃G, L⦄ ⊢ T ¡[h, g, d] → ⦃G, L⦄ ⊢ T ¡[h, g].
45 #h #g #G #L #T #d * -T
46 #U #T #HU #HT #HUT elim (HUT 0) -HUT /2 width=3 by snv_cast/
47 qed-.
48
49 (* Basic properties *********************************************************)
50
51 lemma snv_shnv_cast: ∀h,g,G,L,U,T. ⦃G, L⦄ ⊢ ⓝU.T ¡[h, g] → ⦃G, L⦄ ⊢ ⓝU.T ¡[h, g, 0].
52 #h #g #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/
55 qed.