]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma
some improvements before setting up the exclusion binder
[helm.git] / matita / matita / contribs / lambdadelta / basic_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 "basic_2/notation/constructors/star_0.ma".
16 include "basic_2/notation/constructors/dxitem_2.ma".
17 include "basic_2/notation/constructors/dxbind1_2.ma".
18 include "basic_2/notation/constructors/dxbind2_3.ma".
19 include "basic_2/notation/constructors/dxvoid_1.ma".
20 include "basic_2/notation/constructors/dxabbr_2.ma".
21 include "basic_2/notation/constructors/dxabst_2.ma".
22 include "basic_2/syntax/bind.ma".
23
24 (* LOCAL ENVIRONMENTS *******************************************************)
25
26 (* local environments *)
27 inductive lenv: Type[0] ≝
28 | LAtom: lenv                       (* empty *)
29 | LPair: lenv → bind2 → term → lenv (* binary binding construction *)
30 .
31
32 interpretation "sort (local environment)"
33    'Star = LAtom.
34 (*
35 interpretation "local environment binding construction (unary)"
36    'DxBind1 L I = (LUnit L I).
37 *)
38 interpretation "local environment binding construction (binary)"
39    'DxBind2 L I T = (LPair L I T).
40 (*
41 interpretation "void (local environment)"
42    'DxVoid L = (LPair L Void).
43 *)
44 interpretation "abbreviation (local environment)"
45    'DxAbbr L T = (LPair L Abbr T).
46
47 interpretation "abstraction (local environment)"
48    'DxAbst L T = (LPair L Abst T).
49
50 definition ceq: relation3 lenv term term ≝ λL,T1,T2. T1 = T2.
51
52 definition cfull: relation3 lenv term term ≝ λL,T1,T2. ⊤.
53
54 (* Basic properties *********************************************************)
55
56 lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2).
57 #L1 elim L1 -L1 [| #L1 #I1 #V1 #IHL1 ] * [2,4: #L2 #I2 #V2 ]
58 [1,4: @or_intror #H destruct
59 | elim (eq_bind2_dec I1 I2) #HI
60   [ elim (eq_term_dec V1 V2) #HV
61     [ elim (IHL1 L2) -IHL1 /2 width=1 by or_introl/ #HL ]
62   ]
63   @or_intror #H destruct /2 width=1 by/
64 | /2 width=1 by or_introl/
65 ]
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_lpair_lpair_aux: ∀I1,I2,L1,L2,V1,V2. L1.ⓑ{I1}V1 = L2.ⓑ{I2}V2 →
74                                ∧∧L1 = L2 & I1 = I2 & V1 = V2.
75 #I1 #I2 #L1 #L2 #V1 #V2 #H destruct /2 width=1 by and3_intro/
76 qed-.
77
78 lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥.
79 #I #V #L elim L -L
80 [ #H destruct
81 | #L #J #W #IHL #H
82   elim (destruct_lpair_lpair_aux … H) -H #H1 #H2 #H3 destruct /2 width=1 by/ (**) (* destruct lemma needed *)
83 ]
84 qed-.
85
86 lemma discr_lpair_xy_x: ∀I,V,L. L.ⓑ{I}V = L → ⊥.
87 /2 width=4 by discr_lpair_x_xy/ qed-.