]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/grammar/lenv.ma
58a82cd25aac700e519040ac072f84c8485c212d
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / grammar / 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/grammar/term.ma".
16
17 (* LOCAL ENVIRONMENTS *******************************************************)
18
19 (* local environments *)
20 inductive lenv: Type[0] ≝
21 | LAtom: lenv                       (* empty *)
22 | LPair: lenv → bind2 → term → lenv (* binary binding construction *)
23 .
24
25 interpretation "sort (local environment)"
26    'Star = LAtom.
27
28 interpretation "environment construction (binary)"
29    'DxItem2 L I T = (LPair L I T).
30
31 interpretation "environment binding construction (binary)"
32    'DxBind2 L I T = (LPair L I T).
33
34 interpretation "abbreviation (local environment)"
35    'DxAbbr L T = (LPair L Abbr T).
36
37 interpretation "abstraction (local environment)"
38    'DxAbst L T = (LPair L Abst T).
39
40 (* Basic properties *********************************************************)
41
42 axiom lenv_eq_dec: ∀L1,L2:lenv. Decidable (L1 = L2).
43
44 (* Basic inversion lemmas ***************************************************)
45
46 lemma destruct_lpair_lpair: ∀I1,I2,L1,L2,V1,V2. L1.ⓑ{I1}V1 = L2.ⓑ{I2}V2 →
47                             ∧∧L1 = L2 & I1 = I2 & V1 = V2.
48 #I1 #I2 #L1 #L2 #V1 #V2 #H destruct /2 width=1/
49 qed-.
50
51 lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥.
52 #I #V #L elim L -L
53 [ #H destruct
54 | #L #J #W #IHL #H
55   elim (destruct_lpair_lpair … H) -H #H1 #H2 #H3 destruct /2 width=1/ (**) (* destruct lemma needed *)
56 ]
57 qed-.
58
59 (* Basic_1: removed theorems 2: chead_ctail c_tail_ind *)