]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/reduction/cix.ma
fb49b0de71ab3ae0af660e54d8ac3fba04e3c231
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / reduction / cix.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/reduction/cir.ma".
16 include "basic_2/reduction/crx.ma".
17
18 (* CONTEXT-SENSITIVE EXTENDED IRREDUCIBLE TERMS *****************************)
19
20 definition cix: ∀h. sd h → lenv → predicate term ≝ λh,g,L,T. ⦃h, L⦄ ⊢ 𝐑[g]⦃T⦄ → ⊥.
21
22 interpretation "context-sensitive extended irreducibility (term)"
23    'NotReducible h g L T = (cix h g L T).
24
25 (* Basic inversion lemmas ***************************************************)
26
27 lemma cix_inv_sort: ∀h,g,L,k,l. deg h g k (l+1) → ⦃h, L⦄ ⊢ 𝐈[g]⦃⋆k⦄ → ⊥.
28 /3 width=2/ qed-.
29
30 lemma cix_inv_delta: ∀h,g,I,L,K,V,i. ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃h, L⦄ ⊢ 𝐈[g]⦃#i⦄ → ⊥.
31 /3 width=4/ qed-.
32
33 lemma cix_inv_ri2: ∀h,g,I,L,V,T. ri2 I → ⦃h, L⦄ ⊢ 𝐈[g]⦃②{I}V.T⦄ → ⊥.
34 /3 width=1/ qed-.
35
36 lemma cix_inv_ib2: ∀h,g,a,I,L,V,T. ib2 a I → ⦃h, L⦄ ⊢ 𝐈[g]⦃ⓑ{a,I}V.T⦄ →
37                    ⦃h, L⦄ ⊢ 𝐈[g]⦃V⦄ ∧ ⦃h, L.ⓑ{I}V⦄ ⊢ 𝐈[g]⦃T⦄.
38 /4 width=1/ qed-.
39
40 lemma cix_inv_bind: ∀h,g,a,I,L,V,T. ⦃h, L⦄ ⊢ 𝐈[g]⦃ⓑ{a,I}V.T⦄ →
41                     ∧∧ ⦃h, L⦄ ⊢ 𝐈[g]⦃V⦄ & ⦃h, L.ⓑ{I}V⦄ ⊢ 𝐈[g]⦃T⦄ & ib2 a I.
42 #h #g #a * [ elim a -a ]
43 [ #L #V #T #H elim H -H /3 width=1/
44 |*: #L #V #T #H elim (cix_inv_ib2 … H) -H /2 width=1/ /3 width=1/
45 ]
46 qed-.
47
48 lemma cix_inv_appl: ∀h,g,L,V,T. ⦃h, L⦄ ⊢ 𝐈[g]⦃ⓐV.T⦄ →
49                     ∧∧ ⦃h, L⦄ ⊢ 𝐈[g]⦃V⦄ & ⦃h, L⦄ ⊢ 𝐈[g]⦃T⦄ & 𝐒⦃T⦄.
50 #h #g #L #V #T #HVT @and3_intro /3 width=1/
51 generalize in match HVT; -HVT elim T -T //
52 * // #a * #U #T #_ #_ #H elim H -H /2 width=1/
53 qed-.
54
55 lemma cix_inv_flat: ∀h,g,I,L,V,T. ⦃h, L⦄ ⊢ 𝐈[g]⦃ⓕ{I}V.T⦄ →
56                     ∧∧ ⦃h, L⦄ ⊢ 𝐈[g]⦃V⦄ & ⦃h, L⦄ ⊢ 𝐈[g]⦃T⦄ & 𝐒⦃T⦄ & I = Appl.
57 #h #g * #L #V #T #H
58 [ elim (cix_inv_appl … H) -H /2 width=1/
59 | elim (cix_inv_ri2 … H) -H /2 width=1/
60 ]
61 qed-.
62
63 (* Basic forward lemmas *****************************************************)
64
65 lemma cix_inv_cir: ∀h,g,L,T. ⦃h, L⦄ ⊢ 𝐈[g]⦃T⦄ → L ⊢ 𝐈⦃T⦄. 
66 /3 width=1/ qed-.
67
68 (* Basic properties *********************************************************)
69
70 lemma cix_sort: ∀h,g,L,k. deg h g k 0 → ⦃h, L⦄ ⊢ 𝐈[g]⦃⋆k⦄.
71 #h #g #L #k #Hk #H elim (crx_inv_sort … H) -L #l #Hkl
72 lapply (deg_mono … Hk Hkl) -h -k <plus_n_Sm #H destruct
73 qed.
74
75 lemma tix_lref: ∀h,g,i. ⦃h, ⋆⦄ ⊢ 𝐈[g]⦃#i⦄.
76 #h #g #i #H elim (trx_inv_atom … H) -H #k #l #_ #H destruct
77 qed.
78
79 lemma cix_gref: ∀h,g,L,p. ⦃h, L⦄ ⊢ 𝐈[g]⦃§p⦄.
80 #h #g #L #p #H elim (crx_inv_gref … H)
81 qed.
82
83 lemma cix_ib2: ∀h,g,a,I,L,V,T. ib2 a I → ⦃h, L⦄ ⊢ 𝐈[g]⦃V⦄ → ⦃h, L.ⓑ{I}V⦄ ⊢ 𝐈[g]⦃T⦄ →
84                                ⦃h, L⦄ ⊢ 𝐈[g]⦃ⓑ{a,I}V.T⦄.
85 #h #g #a #I #L #V #T #HI #HV #HT #H
86 elim (crx_inv_ib2 … HI H) -HI -H /2 width=1/
87 qed.
88
89 lemma cix_appl: ∀h,g,L,V,T. ⦃h, L⦄ ⊢ 𝐈[g]⦃V⦄ → ⦃h, L⦄ ⊢ 𝐈[g]⦃T⦄ →  𝐒⦃T⦄ → ⦃h, L⦄ ⊢ 𝐈[g]⦃ⓐV.T⦄.
90 #h #g #L #V #T #HV #HT #H1 #H2
91 elim (crx_inv_appl … H2) -H2 /2 width=1/
92 qed.