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