]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/dynamic/lsubn.ma
9a4eaac8892245b628a9cd6c2e586a80b5320bf8
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / dynamic / lsubn.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/dynamic/nta.ma".
16
17 (* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE TYPE ASSIGNMENT ******************)
18
19 (* Note: may not be transitive *)
20 inductive lsubn (h:sh): relation lenv ≝
21 | lsubn_atom: lsubn h (⋆) (⋆)
22 | lsubn_pair: ∀I,L1,L2,W. lsubn h L1 L2 → lsubn h (L1. ⓑ{I} W) (L2. ⓑ{I} W)
23 | lsubn_abbr: ∀L1,L2,V,W. ⦃h, L1⦄ ⊢ V : W → ⦃h, L2⦄ ⊢ V : W →
24               lsubn h L1 L2 → lsubn h (L1. ⓓV) (L2. ⓛW)
25 .
26
27 interpretation
28   "local environment refinement (native type assigment)"
29   'CrSubEqN h L1 L2 = (lsubn h L1 L2).
30
31 (* Basic inversion lemmas ***************************************************)
32
33 fact lsubn_inv_atom1_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L1 = ⋆ → L2 = ⋆.
34 #h #L1 #L2 * -L1 -L2
35 [ //
36 | #I #L1 #L2 #V #_ #H destruct
37 | #L1 #L2 #V #W #_ #_ #_ #H destruct
38 ]
39 qed.
40
41 lemma lsubn_inv_atom1: ∀h,L2. h ⊢ ⋆ :⊑ L2 → L2 = ⋆.
42 /2 width=4/ qed-.
43
44 fact lsubn_inv_pair1_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀I,K1,V. L1 = K1. ⓑ{I} V →
45                           (∃∃K2. h ⊢ K1 :⊑ K2 & L2 = K2. ⓑ{I} V) ∨
46                           ∃∃K2,W. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W &
47                                   h ⊢ K1 :⊑ K2 & L2 = K2. ⓛW & I = Abbr.
48 #h #L1 #L2 * -L1 -L2
49 [ #I #K1 #V #H destruct
50 | #J #L1 #L2 #V #HL12 #I #K1 #W #H destruct /3 width=3/
51 | #L1 #L2 #V #W #H1VW #H2VW #HL12 #I #K1 #V1 #H destruct /3 width=7/
52 ]
53 qed.
54
55 lemma lsubn_inv_pair1: ∀h,I,K1,L2,V. h ⊢ K1. ⓑ{I} V :⊑ L2 →
56                        (∃∃K2. h ⊢ K1 :⊑ K2 & L2 = K2. ⓑ{I} V) ∨
57                        ∃∃K2,W. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W &
58                                h ⊢ K1 :⊑ K2 & L2 = K2. ⓛW & I = Abbr.
59 /2 width=3/ qed-.
60
61 fact lsubn_inv_atom2_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → L2 = ⋆ → L1 = ⋆.
62 #h #L1 #L2 * -L1 -L2
63 [ //
64 | #I #L1 #L2 #V #_ #H destruct
65 | #L1 #L2 #V #W #_ #_ #_ #H destruct
66 ]
67 qed.
68
69 lemma lsubc_inv_atom2: ∀h,L1. h ⊢ L1 :⊑ ⋆ → L1 = ⋆.
70 /2 width=4/ qed-.
71
72 fact lsubn_inv_pair2_aux: ∀h,L1,L2. h ⊢ L1 :⊑ L2 → ∀I,K2,W. L2 = K2. ⓑ{I} W →
73                           (∃∃K1. h ⊢ K1 :⊑ K2 & L1 = K1. ⓑ{I} W) ∨
74                           ∃∃K1,V. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W &
75                                   h ⊢ K1 :⊑ K2 & L1 = K1. ⓓV & I = Abst.
76 #h #L1 #L2 * -L1 -L2
77 [ #I #K2 #W #H destruct
78 | #J #L1 #L2 #V #HL12 #I #K2 #W #H destruct /3 width=3/
79 | #L1 #L2 #V #W #H1VW #H2VW #HL12 #I #K2 #W2 #H destruct /3 width=7/
80 ]
81 qed.
82
83 (* Basic_1: was: csubt_gen_bind *)
84 lemma lsubn_inv_pair2: ∀h,I,L1,K2,W. h ⊢ L1 :⊑ K2. ⓑ{I} W →
85                        (∃∃K1. h ⊢ K1 :⊑ K2 & L1 = K1. ⓑ{I} W) ∨
86                        ∃∃K1,V. ⦃h, K1⦄ ⊢ V : W & ⦃h, K2⦄ ⊢ V : W &
87                                h ⊢ K1 :⊑ K2 & L1 = K1. ⓓV & I = Abst.
88 /2 width=3/ qed-.
89
90 (* Basic properties *********************************************************)
91
92 (* Basic_1: was: csubt_refl *)
93 lemma lsubn_refl: ∀h,L. h ⊢ L :⊑ L.
94 #h #L elim L -L // /2 width=1/
95 qed.
96
97 (* Basic_1: removed theorems 6:
98             csubt_gen_flat csubt_drop_flat csubt_clear_conf
99             csubt_getl_abbr csubt_getl_abst csubt_ty3_ld
100 *)