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