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