1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/notation/relations/prednotreducible_5.ma".
16 include "basic_2/reduction/cir.ma".
17 include "basic_2/reduction/crx.ma".
19 (* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE EXTENDED REDUCTION ***************)
21 definition cix: ∀h. sd h → relation3 genv lenv term ≝
22 λh,g,G,L,T. ⦃G, L⦄ ⊢ ➡[h, g] 𝐑⦃T⦄ → ⊥.
24 interpretation "irreducibility for context-sensitive extended reduction (term)"
25 'PRedNotReducible h g G L T = (cix h g G L T).
27 (* Basic inversion lemmas ***************************************************)
29 lemma cix_inv_sort: ∀h,g,G,L,k,l. deg h g k (l+1) → ⦃G, L⦄ ⊢ ➡[h, g] 𝐈⦃⋆k⦄ → ⊥.
30 /3 width=2 by crx_sort/ qed-.
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-.
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-.
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-.
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/
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/
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 //
64 (* Basic forward lemmas *****************************************************)
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-.
69 (* Basic properties *********************************************************)
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 #l #Hkl
73 lapply (deg_mono … Hk Hkl) -h -k <plus_n_Sm #H destruct
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 #l #_ #H destruct
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)
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/
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/