]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/syntax/lenv.ma
syntactic components detached from basic_2 become static_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / syntax / lenv.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 "static_2/notation/functions/star_0.ma".
16 include "static_2/notation/functions/dxitem_2.ma".
17 include "static_2/notation/functions/dxbind1_2.ma".
18 include "static_2/notation/functions/dxbind2_3.ma".
19 include "static_2/notation/functions/dxvoid_1.ma".
20 include "static_2/notation/functions/dxabbr_2.ma".
21 include "static_2/notation/functions/dxabst_2.ma".
22 include "static_2/syntax/bind.ma".
23
24 (* LOCAL ENVIRONMENTS *******************************************************)
25
26 (* local environments *)
27 inductive lenv: Type[0] ≝
28 | LAtom: lenv               (* empty *)
29 | LBind: lenv → bind → lenv (* binding construction *)
30 .
31
32 interpretation "sort (local environment)"
33    'Star = LAtom.
34
35 interpretation "local environment binding construction (generic)"
36    'DxItem L I = (LBind L I).
37
38 interpretation "local environment binding construction (unary)"
39    'DxBind1 L I = (LBind L (BUnit I)).
40
41 interpretation "local environment binding construction (binary)"
42    'DxBind2 L I T = (LBind L (BPair I T)).
43
44 interpretation "void (local environment)"
45    'DxVoid L = (LBind L (BUnit Void)).
46
47 interpretation "abbreviation (local environment)"
48    'DxAbbr L T = (LBind L (BPair Abbr T)).
49
50 interpretation "abstraction (local environment)"
51    'DxAbst L T = (LBind L (BPair Abst T)).
52
53 definition cfull: relation3 lenv bind bind ≝ λL,I1,I2. ⊤.
54
55 definition ceq: relation3 lenv term term ≝ λL. eq ….
56
57 (* Basic properties *********************************************************)
58
59 lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2).
60 #L1 elim L1 -L1 [| #L1 #I1 #IHL1 ] * [2,4: #L2 #I2 ]
61 [3: /2 width=1 by or_introl/
62 |2: elim (eq_bind_dec I1 I2) #HI
63     [ elim (IHL1 L2) -IHL1 #HL /2 width=1 by or_introl/ ]
64 ]
65 @or_intror #H destruct /2 width=1 by/
66 qed-.
67
68 lemma cfull_dec: ∀L,T1,T2. Decidable (cfull L T1 T2).
69 /2 width=1 by or_introl/ qed-.
70
71 (* Basic inversion lemmas ***************************************************)
72
73 fact destruct_lbind_lbind_aux: ∀I1,I2,L1,L2. L1.ⓘ{I1} = L2.ⓘ{I2} →
74                                L1 = L2 ∧ I1 = I2.
75 #I1 #I2 #L1 #L2 #H destruct /2 width=1 by conj/
76 qed-.
77
78 (* Basic_2A1: uses: discr_lpair_x_xy *)
79 lemma discr_lbind_x_xy: ∀I,L. L = L.ⓘ{I} → ⊥.
80 #I #L elim L -L
81 [ #H destruct
82 | #L #J #IHL #H elim (destruct_lbind_lbind_aux … H) -H  (**) (* destruct lemma needed *)
83   #H1 #H2 destruct /2 width=1 by/
84 ]
85 qed-.
86
87 (* Basic_2A1: uses: discr_lpair_xy_x *)
88 lemma discr_lbind_xy_x: ∀I,L. L.ⓘ{I} = L → ⊥.
89 /2 width=4 by discr_lbind_x_xy/ qed-.