1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
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".
24 (* LOCAL ENVIRONMENTS *******************************************************)
26 (* local environments *)
27 inductive lenv: Type[0] ≝
28 | LAtom: lenv (* empty *)
29 | LBind: lenv → bind → lenv (* binding construction *)
32 interpretation "sort (local environment)"
35 interpretation "local environment binding construction (generic)"
36 'DxItem L I = (LBind L I).
38 interpretation "local environment binding construction (unary)"
39 'DxBind1 L I = (LBind L (BUnit I)).
41 interpretation "local environment binding construction (binary)"
42 'DxBind2 L I T = (LBind L (BPair I T)).
44 interpretation "void (local environment)"
45 'DxVoid L = (LBind L (BUnit Void)).
47 interpretation "abbreviation (local environment)"
48 'DxAbbr L T = (LBind L (BPair Abbr T)).
50 interpretation "abstraction (local environment)"
51 'DxAbst L T = (LBind L (BPair Abst T)).
53 definition cfull: relation3 lenv bind bind ≝ λL,I1,I2. ⊤.
55 definition ceq: relation3 lenv term term ≝ λL. eq ….
57 (* Basic properties *********************************************************)
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/ ]
65 @or_intror #H destruct /2 width=1 by/
68 lemma cfull_dec: ∀L,T1,T2. Decidable (cfull L T1 T2).
69 /2 width=1 by or_introl/ qed-.
71 (* Basic inversion lemmas ***************************************************)
73 fact destruct_lbind_lbind_aux: ∀I1,I2,L1,L2. L1.ⓘ{I1} = L2.ⓘ{I2} →
75 #I1 #I2 #L1 #L2 #H destruct /2 width=1 by conj/
78 (* Basic_2A1: uses: discr_lpair_x_xy *)
79 lemma discr_lbind_x_xy: ∀I,L. L = L.ⓘ{I} → ⊥.
82 | #L #J #IHL #H elim (destruct_lbind_lbind_aux … H) -H (**) (* destruct lemma needed *)
83 #H1 #H2 destruct /2 width=1 by/
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-.