]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/static/lsubr.ma
- partial commit of rt_transition ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / lsubr.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/relations/lrsubeqc_2.ma".
16 include "basic_2/grammar/lenv.ma".
17
18 (* RESTRICTED REFINEMENT FOR LOCAL ENVIRONMENTS *****************************)
19
20 inductive lsubr: relation lenv ≝
21 | lsubr_atom: ∀L. lsubr L (⋆)
22 | lsubr_pair: ∀I,L1,L2,V. lsubr L1 L2 → lsubr (L1.ⓑ{I}V) (L2.ⓑ{I}V)
23 | lsubr_beta: ∀L1,L2,V,W. lsubr L1 L2 → lsubr (L1.ⓓⓝW.V) (L2.ⓛW)
24 .
25
26 interpretation
27   "restricted refinement (local environment)"
28   'LRSubEqC L1 L2 = (lsubr L1 L2).
29
30 (* Basic properties *********************************************************)
31
32 lemma lsubr_refl: ∀L. L ⫃ L.
33 #L elim L -L /2 width=1 by lsubr_atom, lsubr_pair/
34 qed.
35
36 (* Basic inversion lemmas ***************************************************)
37
38 fact lsubr_inv_atom1_aux: ∀L1,L2. L1 ⫃ L2 → L1 = ⋆ → L2 = ⋆.
39 #L1 #L2 * -L1 -L2 //
40 [ #I #L1 #L2 #V #_ #H destruct
41 | #L1 #L2 #V #W #_ #H destruct
42 ]
43 qed-.
44
45 lemma lsubr_inv_atom1: ∀L2. ⋆ ⫃ L2 → L2 = ⋆.
46 /2 width=3 by lsubr_inv_atom1_aux/ qed-.
47
48 fact lsubr_inv_abst1_aux: ∀L1,L2. L1 ⫃ L2 → ∀K1,W. L1 = K1.ⓛW →
49                           L2 = ⋆ ∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓛW.
50 #L1 #L2 * -L1 -L2
51 [ #L #K1 #W #H destruct /2 width=1 by or_introl/
52 | #I #L1 #L2 #V #HL12 #K1 #W #H destruct /3 width=3 by ex2_intro, or_intror/
53 | #L1 #L2 #V1 #V2 #_ #K1 #W #H destruct
54 ]
55 qed-.
56
57 lemma lsubr_inv_abst1: ∀K1,L2,W. K1.ⓛW ⫃ L2 →
58                        L2 = ⋆ ∨ ∃∃K2. K1 ⫃ K2 & L2 = K2.ⓛW.
59 /2 width=3 by lsubr_inv_abst1_aux/ qed-.
60
61 fact lsubr_inv_abbr2_aux: ∀L1,L2. L1 ⫃ L2 → ∀K2,V. L2 = K2.ⓓV →
62                           ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓓV.
63 #L1 #L2 * -L1 -L2
64 [ #L #K2 #W #H destruct
65 | #I #L1 #L2 #V #HL12 #K2 #W #H destruct /2 width=3 by ex2_intro/
66 | #L1 #L2 #V1 #V2 #_ #K2 #W #H destruct
67 ]
68 qed-.
69
70 lemma lsubr_inv_abbr2: ∀L1,K2,V. L1 ⫃ K2.ⓓV →
71                        ∃∃K1. K1 ⫃ K2 & L1 = K1.ⓓV.
72 /2 width=3 by lsubr_inv_abbr2_aux/ qed-.
73
74 fact lsubr_inv_abst2_aux: ∀L1,L2. L1 ⫃ L2 → ∀K2,W. L2 = K2.ⓛW →
75                           (∃∃K1. K1 ⫃ K2 & L1 = K1.ⓛW) ∨
76                           ∃∃K1,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V.
77 #L1 #L2 * -L1 -L2
78 [ #L #K2 #W #H destruct
79 | #I #L1 #L2 #V #HL12 #K2 #W #H destruct /3 width=3 by ex2_intro, or_introl/
80 | #L1 #L2 #V1 #V2 #HL12 #K2 #W #H destruct /3 width=4 by ex2_2_intro, or_intror/
81 ]
82 qed-.
83
84 lemma lsubr_inv_abst2: ∀L1,K2,W. L1 ⫃ K2.ⓛW →
85                        (∃∃K1. K1 ⫃ K2 & L1 = K1.ⓛW) ∨
86                        ∃∃K1,V. K1 ⫃ K2 & L1 = K1.ⓓⓝW.V.
87 /2 width=3 by lsubr_inv_abst2_aux/ qed-.
88
89 (* Basic forward lemmas *****************************************************)
90
91 lemma lsubr_fwd_pair2: ∀I2,L1,K2,V2. L1 ⫃ K2.ⓑ{I2}V2 →
92                        ∃∃I1,K1,V1. K1 ⫃ K2 & L1 = K1.ⓑ{I1}V1.
93 * #L1 #K2 #V2 #H
94 [ elim (lsubr_inv_abbr2 … H) | elim (lsubr_inv_abst2 … H) * ] -H
95 /2 width=5 by ex2_3_intro/
96 qed-.