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 "ground/xoa/and_4.ma".
16 include "basic_2A/notation/relations/prednotreducible_3.ma".
17 include "basic_2A/reduction/crr.ma".
19 (* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION ************************)
21 definition cir: relation3 genv lenv term ≝ λG,L,T. ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄ → ⊥.
23 interpretation "irreducibility for context-sensitive reduction (term)"
24 'PRedNotReducible G L T = (cir G L T).
26 (* Basic inversion lemmas ***************************************************)
28 lemma cir_inv_delta: ∀G,L,K,V,i. ⬇[i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ ➡ 𝐈⦃#i⦄ → ⊥.
29 /3 width=3 by crr_delta/ qed-.
31 lemma cir_inv_ri2: ∀I,G,L,V,T. ri2 I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃②{I}V.T⦄ → ⊥.
32 /3 width=1 by crr_ri2/ qed-.
34 lemma cir_inv_ib2: ∀a,I,G,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄ →
35 ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄.
36 /4 width=1 by crr_ib2_sn, crr_ib2_dx, conj/ qed-.
38 lemma cir_inv_bind: ∀a,I,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄ →
39 ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄ & ib2 a I.
41 #G #L #V #T #H [ elim H -H /3 width=1 by crr_ri2, or_introl/ ]
42 elim (cir_inv_ib2 … H) -H /3 width=1 by and3_intro, or_introl/
45 lemma cir_inv_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓐV.T⦄ →
46 ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ & 𝐒⦃T⦄.
47 #G #L #V #T #HVT @and3_intro /3 width=1 by crr_appl_sn, crr_appl_dx/
48 generalize in match HVT; -HVT elim T -T //
49 * // #a * #U #T #_ #_ #H elim H -H /2 width=1 by crr_beta, crr_theta/
52 lemma cir_inv_flat: ∀I,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓕ{I}V.T⦄ →
53 ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ & 𝐒⦃T⦄ & I = Appl.
55 [ elim (cir_inv_appl … H) -H /2 width=1 by and4_intro/
56 | elim (cir_inv_ri2 … H) -H //
60 (* Basic properties *********************************************************)
62 lemma cir_sort: ∀G,L,k. ⦃G, L⦄ ⊢ ➡ 𝐈⦃⋆k⦄.
63 /2 width=4 by crr_inv_sort/ qed.
65 lemma cir_gref: ∀G,L,p. ⦃G, L⦄ ⊢ ➡ 𝐈⦃§p⦄.
66 /2 width=4 by crr_inv_gref/ qed.
68 lemma tir_atom: ∀G,I. ⦃G, ⋆⦄ ⊢ ➡ 𝐈⦃⓪{I}⦄.
69 /2 width=3 by trr_inv_atom/ qed.
71 lemma cir_ib2: ∀a,I,G,L,V,T.
72 ib2 a I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ → ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄.
73 #a #I #G #L #V #T #HI #HV #HT #H
74 elim (crr_inv_ib2 … HI H) -HI -H /2 width=1 by/
77 lemma cir_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓐV.T⦄.
78 #G #L #V #T #HV #HT #H1 #H2
79 elim (crr_inv_appl … H2) -H2 /2 width=1 by/