]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/static/lsubc.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / static / lsubc.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 "ground_2/xoa/ex_6_4.ma".
16 include "static_2/notation/relations/lrsubeqc_4.ma".
17 include "static_2/static/aaa.ma".
18 include "static_2/static/gcp_cr.ma".
19
20 (* LOCAL ENVIRONMENT REFINEMENT FOR GENERIC REDUCIBILITY ********************)
21
22 inductive lsubc (RP) (G): relation lenv ≝
23 | lsubc_atom: lsubc RP G (⋆) (⋆)
24 | lsubc_bind: ∀I,L1,L2. lsubc RP G L1 L2 → lsubc RP G (L1.ⓘ[I]) (L2.ⓘ[I])
25 | lsubc_beta: ∀L1,L2,V,W,A. ❪G,L1,V❫ ϵ ⟦A⟧[RP] → ❪G,L1,W❫ ϵ ⟦A⟧[RP] → ❪G,L2❫ ⊢ W ⁝ A →
26               lsubc RP G L1 L2 → lsubc RP G (L1. ⓓⓝW.V) (L2.ⓛW)
27 .
28
29 interpretation
30   "local environment refinement (generic reducibility)"
31   'LRSubEqC RP G L1 L2 = (lsubc RP G L1 L2).
32
33 (* Basic inversion lemmas ***************************************************)
34
35 fact lsubc_inv_atom1_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → L1 = ⋆ → L2 = ⋆.
36 #RP #G #L1 #L2 * -L1 -L2
37 [ //
38 | #I #L1 #L2 #_ #H destruct
39 | #L1 #L2 #V #W #A #_ #_ #_ #_ #H destruct
40 ]
41 qed-.
42
43 (* Basic_1: was just: csubc_gen_sort_r *)
44 lemma lsubc_inv_atom1: ∀RP,G,L2. G ⊢ ⋆ ⫃[RP] L2 → L2 = ⋆.
45 /2 width=5 by lsubc_inv_atom1_aux/ qed-.
46
47 fact lsubc_inv_bind1_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K1. L1 = K1.ⓘ[I] →
48                           (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ[I]) ∨
49                           ∃∃K2,V,W,A. ❪G,K1,V❫ ϵ ⟦A⟧[RP] & ❪G,K1,W❫ ϵ ⟦A⟧[RP] & ❪G,K2❫ ⊢ W ⁝ A &
50                                       G ⊢ K1 ⫃[RP] K2 &
51                                       L2 = K2. ⓛW & I = BPair Abbr (ⓝW.V).
52 #RP #G #L1 #L2 * -L1 -L2
53 [ #I #K1 #H destruct
54 | #J #L1 #L2 #HL12 #I #K1 #H destruct /3 width=3 by ex2_intro, or_introl/
55 | #L1 #L2 #V1 #W2 #A #HV1 #H1W2 #H2W2 #HL12 #I #K1 #H destruct
56   /3 width=10 by ex6_4_intro, or_intror/
57 ]
58 qed-.
59
60 (* Basic_1: was: csubc_gen_head_r *)
61 lemma lsubc_inv_bind1: ∀RP,I,G,K1,L2. G ⊢ K1.ⓘ[I] ⫃[RP] L2 →
62                        (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ[I]) ∨
63                        ∃∃K2,V,W,A. ❪G,K1,V❫ ϵ ⟦A⟧[RP] & ❪G,K1,W❫ ϵ ⟦A⟧[RP] & ❪G,K2❫ ⊢ W ⁝ A &
64                                    G ⊢ K1 ⫃[RP] K2 &
65                                    L2 = K2.ⓛW & I = BPair Abbr (ⓝW.V).
66 /2 width=3 by lsubc_inv_bind1_aux/ qed-.
67
68 fact lsubc_inv_atom2_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → L2 = ⋆ → L1 = ⋆.
69 #RP #G #L1 #L2 * -L1 -L2
70 [ //
71 | #I #L1 #L2 #_ #H destruct
72 | #L1 #L2 #V #W #A #_ #_ #_ #_ #H destruct
73 ]
74 qed-.
75
76 (* Basic_1: was just: csubc_gen_sort_l *)
77 lemma lsubc_inv_atom2: ∀RP,G,L1. G ⊢ L1 ⫃[RP] ⋆ → L1 = ⋆.
78 /2 width=5 by lsubc_inv_atom2_aux/ qed-.
79
80 fact lsubc_inv_bind2_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K2. L2 = K2.ⓘ[I] →
81                           (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1. ⓘ[I]) ∨
82                           ∃∃K1,V,W,A. ❪G,K1,V❫ ϵ ⟦A⟧[RP] & ❪G,K1,W❫ ϵ ⟦A⟧[RP] & ❪G,K2❫ ⊢ W ⁝ A &
83                                       G ⊢ K1 ⫃[RP] K2 &
84                                       L1 = K1.ⓓⓝW.V & I = BPair Abst W.
85 #RP #G #L1 #L2 * -L1 -L2
86 [ #I #K2 #H destruct
87 | #J #L1 #L2 #HL12 #I #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
88 | #L1 #L2 #V1 #W2 #A #HV1 #H1W2 #H2W2 #HL12 #I #K2 #H destruct
89   /3 width=10 by ex6_4_intro, or_intror/
90 ]
91 qed-.
92
93 (* Basic_1: was just: csubc_gen_head_l *)
94 lemma lsubc_inv_bind2: ∀RP,I,G,L1,K2. G ⊢ L1 ⫃[RP] K2.ⓘ[I] →
95                        (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1.ⓘ[I]) ∨
96                        ∃∃K1,V,W,A. ❪G,K1,V❫ ϵ ⟦A⟧[RP] & ❪G,K1,W❫ ϵ ⟦A⟧[RP] & ❪G,K2❫ ⊢ W ⁝ A &
97                                    G ⊢ K1 ⫃[RP] K2 &
98                                    L1 = K1.ⓓⓝW.V & I = BPair Abst W.
99 /2 width=3 by lsubc_inv_bind2_aux/ qed-.
100
101 (* Basic properties *********************************************************)
102
103 (* Basic_1: was just: csubc_refl *)
104 lemma lsubc_refl: ∀RP,G,L. G ⊢ L ⫃[RP] L.
105 #RP #G #L elim L -L /2 width=1 by lsubc_bind/
106 qed.
107
108 (* Basic_1: removed theorems 3:
109             csubc_clear_conf csubc_getl_conf csubc_csuba
110 *)