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/reducibility/crf.ma".
17 (* CONTEXT-SENSITIVE IRREDUCIBLE TERMS **************************************)
19 definition cif: lenv → predicate term ≝ λL,T. L ⊢ 𝐑⦃T⦄ → ⊥.
21 interpretation "context-sensitive irreducibility (term)"
22 'NotReducible L T = (cif L T).
24 (* Basic inversion lemmas ***************************************************)
26 lemma cif_inv_delta: ∀L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → L ⊢ 𝐈⦃#i⦄ → ⊥.
29 lemma cif_inv_ri2: ∀I,L,V,T. ri2 I → L ⊢ 𝐈⦃②{I}V.T⦄ → ⊥.
32 lemma cif_inv_ib2: ∀a,I,L,V,T. ib2 a I → L ⊢ 𝐈⦃ⓑ{a,I}V.T⦄ →
33 L ⊢ 𝐈⦃V⦄ ∧ L.ⓑ{I}V ⊢ 𝐈⦃T⦄.
36 lemma cif_inv_bind: ∀a,I,L,V,T. L ⊢ 𝐈⦃ⓑ{a,I}V.T⦄ →
37 ∧∧ L ⊢ 𝐈⦃V⦄ & L.ⓑ{I}V ⊢ 𝐈⦃T⦄ & ib2 a I.
39 [ #L #V #T #H elim (H ?) -H /3 width=1/
40 |*: #L #V #T #H elim (cif_inv_ib2 … H) -H /2 width=1/ /3 width=1/
44 lemma cif_inv_appl: ∀L,V,T. L ⊢ 𝐈⦃ⓐV.T⦄ → ∧∧ L ⊢ 𝐈⦃V⦄ & L ⊢ 𝐈⦃T⦄ & 𝐒⦃T⦄.
45 #L #V #T #HVT @and3_intro /3 width=1/
46 generalize in match HVT; -HVT elim T -T //
47 * // #a * #U #T #_ #_ #H elim (H ?) -H /2 width=1/
50 lemma cif_inv_flat: ∀I,L,V,T. L ⊢ 𝐈⦃ⓕ{I}V.T⦄ →
51 ∧∧ L ⊢ 𝐈⦃V⦄ & L ⊢ 𝐈⦃T⦄ & 𝐒⦃T⦄ & I = Appl.
53 [ elim (cif_inv_appl … H) -H /2 width=1/
54 | elim (cif_inv_ri2 … H) -H /2 width=1/
58 (* Basic properties *********************************************************)
60 lemma tif_atom: ∀I. ⋆ ⊢ 𝐈⦃⓪{I}⦄.
61 /2 width=2 by trf_inv_atom/ qed.
63 lemma cif_ib2: ∀a,I,L,V,T. ib2 a I → L ⊢ 𝐈⦃V⦄ → L.ⓑ{I}V ⊢ 𝐈⦃T⦄ → L ⊢ 𝐈⦃ⓑ{a,I}V.T⦄.
64 #a #I #L #V #T #HI #HV #HT #H
65 elim (crf_inv_ib2 … HI H) -HI -H /2 width=1/
68 lemma cif_appl: ∀L,V,T. L ⊢ 𝐈⦃V⦄ → L ⊢ 𝐈⦃T⦄ → 𝐒⦃T⦄ → L ⊢ 𝐈⦃ⓐV.T⦄.
69 #L #V #T #HV #HT #H1 #H2
70 elim (crf_inv_appl … H2) -H2 /2 width=1/