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 "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".
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 (* Basic properties *********************************************************)
57 lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2).
58 #L1 elim L1 -L1 [| #L1 #I1 #IHL1 ] * [2,4: #L2 #I2 ]
59 [3: /2 width=1 by or_introl/
60 |2: elim (eq_bind_dec I1 I2) #HI
61 [ elim (IHL1 L2) -IHL1 #HL /2 width=1 by or_introl/ ]
63 @or_intror #H destruct /2 width=1 by/
66 lemma cfull_dec: ∀L,T1,T2. Decidable (cfull L T1 T2).
67 /2 width=1 by or_introl/ qed-.
69 (* Basic inversion lemmas ***************************************************)
71 fact destruct_lbind_lbind_aux: ∀I1,I2,L1,L2. L1.ⓘ[I1] = L2.ⓘ[I2] →
73 #I1 #I2 #L1 #L2 #H destruct /2 width=1 by conj/
76 (* Basic_2A1: uses: discr_lpair_x_xy *)
77 lemma discr_lbind_x_xy: ∀I,L. L = L.ⓘ[I] → ⊥.
80 | #L #J #IHL #H elim (destruct_lbind_lbind_aux … H) -H (**) (* destruct lemma needed *)
81 #H1 #H2 destruct /2 width=1 by/
85 (* Basic_2A1: uses: discr_lpair_xy_x *)
86 lemma discr_lbind_xy_x: ∀I,L. L.ⓘ[I] = L → ⊥.
87 /2 width=4 by discr_lbind_x_xy/ qed-.