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_3.ma".
16 include "basic_2/reduction/crr.ma".
18 (* IRREDUCIBLE TERMS FOR CONTEXT-SENSITIVE REDUCTION ************************)
20 definition cir: relation3 genv lenv term ≝ λG,L,T. ⦃G, L⦄ ⊢ ➡ 𝐑⦃T⦄ → ⊥.
22 interpretation "irreducibility for context-sensitive reduction (term)"
23 'PRedNotReducible G L T = (cir G L T).
25 (* Basic inversion lemmas ***************************************************)
27 lemma cir_inv_delta: ∀G,L,K,V,i. ⇩[i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ ➡ 𝐈⦃#i⦄ → ⊥.
28 /3 width=3 by crr_delta/ qed-.
30 lemma cir_inv_ri2: ∀I,G,L,V,T. ri2 I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃②{I}V.T⦄ → ⊥.
31 /3 width=1 by crr_ri2/ qed-.
33 lemma cir_inv_ib2: ∀a,I,G,L,V,T. ib2 a I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄ →
34 ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄.
35 /4 width=1 by crr_ib2_sn, crr_ib2_dx, conj/ qed-.
37 lemma cir_inv_bind: ∀a,I,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄ →
38 ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄ & ib2 a I.
40 #G #L #V #T #H [ elim H -H /3 width=1 by crr_ri2, or_introl/ ]
41 elim (cir_inv_ib2 … H) -H /3 width=1 by and3_intro, or_introl/
44 lemma cir_inv_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓐV.T⦄ →
45 ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ & 𝐒⦃T⦄.
46 #G #L #V #T #HVT @and3_intro /3 width=1/
47 generalize in match HVT; -HVT elim T -T //
48 * // #a * #U #T #_ #_ #H elim H -H /2 width=1 by crr_beta, crr_theta/
51 lemma cir_inv_flat: ∀I,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓕ{I}V.T⦄ →
52 ∧∧ ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ & ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ & 𝐒⦃T⦄ & I = Appl.
54 [ elim (cir_inv_appl … H) -H /2 width=1 by and4_intro/
55 | elim (cir_inv_ri2 … H) -H //
59 (* Basic properties *********************************************************)
61 lemma cir_sort: ∀G,L,k. ⦃G, L⦄ ⊢ ➡ 𝐈⦃⋆k⦄.
62 /2 width=4 by crr_inv_sort/ qed.
64 lemma cir_gref: ∀G,L,p. ⦃G, L⦄ ⊢ ➡ 𝐈⦃§p⦄.
65 /2 width=4 by crr_inv_gref/ qed.
67 lemma tir_atom: ∀G,I. ⦃G, ⋆⦄ ⊢ ➡ 𝐈⦃⓪{I}⦄.
68 /2 width=3 by trr_inv_atom/ qed.
70 lemma cir_ib2: ∀a,I,G,L,V,T.
71 ib2 a I → ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ → ⦃G, L.ⓑ{I}V⦄ ⊢ ➡ 𝐈⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓑ{a,I}V.T⦄.
72 #a #I #G #L #V #T #HI #HV #HT #H
73 elim (crr_inv_ib2 … HI H) -HI -H /2 width=1 by/
76 lemma cir_appl: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐈⦃V⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃T⦄ → 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐈⦃ⓐV.T⦄.
77 #G #L #V #T #HV #HT #H1 #H2
78 elim (crr_inv_appl … H2) -H2 /2 width=1 by/