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/grammar/term_simple.ma".
17 (* CONTEXT-FREE REDUCIBLE AND IRREDUCIBLE TERMS *****************************)
20 inductive trf: predicate term ≝
21 | trf_abst_sn: ∀V,T. trf V → trf (ⓛV. T)
22 | trf_abst_dx: ∀V,T. trf T → trf (ⓛV. T)
23 | trf_appl_sn: ∀V,T. trf V → trf (ⓐV. T)
24 | trf_appl_dx: ∀V,T. trf T → trf (ⓐV. T)
25 | trf_abbr : ∀V,T. trf (ⓓV. T)
26 | trf_cast : ∀V,T. trf (ⓣV. T)
27 | trf_beta : ∀V,W,T. trf (ⓐV. ⓛW. T)
31 "context-free reducibility (term)"
32 'Reducible T = (trf T).
34 (* irreducible terms *)
35 definition tif: predicate term ≝ λT. ℝ[T] → False.
38 "context-free irreducibility (term)"
39 'NotReducible T = (tif T).
41 (* Basic inversion lemmas ***************************************************)
43 fact trf_inv_atom_aux: ∀I,T. ℝ[T] → T = ⓪{I} → False.
45 [ #V #T #_ #H destruct
46 | #V #T #_ #H destruct
47 | #V #T #_ #H destruct
48 | #V #T #_ #H destruct
51 | #V #W #T #H destruct
55 lemma trf_inv_atom: ∀I. ℝ[⓪{I}] → False.
58 fact trf_inv_abst_aux: ∀W,U,T. ℝ[T] → T = ⓛW. U → ℝ[W] ∨ ℝ[U].
60 [ #V #T #HV #H destruct /2 width=1/
61 | #V #T #HT #H destruct /2 width=1/
62 | #V #T #_ #H destruct
63 | #V #T #_ #H destruct
66 | #V #W0 #T #H destruct
70 lemma trf_inv_abst: ∀V,T. ℝ[ⓛV.T] → ℝ[V] ∨ ℝ[T].
73 fact trf_inv_appl_aux: ∀W,U,T. ℝ[T] → T = ⓐW. U →
74 ∨∨ ℝ[W] | ℝ[U] | (𝕊[U] → False).
76 [ #V #T #_ #H destruct
77 | #V #T #_ #H destruct
78 | #V #T #HV #H destruct /2 width=1/
79 | #V #T #HT #H destruct /2 width=1/
82 | #V #W0 #T #H destruct
83 @or3_intro2 #H elim (simple_inv_bind … H)
87 lemma trf_inv_appl: ∀W,U. ℝ[ⓐW.U] → ∨∨ ℝ[W] | ℝ[U] | (𝕊[U] → False).
90 lemma tif_inv_abbr: ∀V,T. 𝕀[ⓓV.T] → False.
93 lemma tif_inv_abst: ∀V,T. 𝕀[ⓛV.T] → 𝕀[V] ∧ 𝕀[T].
96 lemma tif_inv_appl: ∀V,T. 𝕀[ⓐV.T] → ∧∧ 𝕀[V] & 𝕀[T] & 𝕊[T].
97 #V #T #HVT @and3_intro /3 width=1/
98 generalize in match HVT; -HVT elim T -T //
99 * // * #U #T #_ #_ #H elim (H ?) -H /2 width=1/
102 lemma tif_inv_cast: ∀V,T. 𝕀[ⓣV.T] → False.
105 (* Basic properties *********************************************************)
107 lemma tif_atom: ∀I. 𝕀[⓪{I}].
110 lemma tif_abst: ∀V,T. 𝕀[V] → 𝕀[T] → 𝕀[ⓛV.T].
112 elim (trf_inv_abst … H) -H /2 width=1/
115 lemma tif_appl: ∀V,T. 𝕀[V] → 𝕀[T] → 𝕊[T] → 𝕀[ⓐV.T].
117 elim (trf_inv_appl … H) -H /2 width=1/