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/tshf.ma".
16 include "basic_2/reducibility/tpr.ma".
18 (* CONTEXT-FREE WEAK HEAD NORMAL TERMS **************************************)
20 definition thnf: predicate term ≝ NF … tpr tshf.
23 "context-free head normality (term)"
24 'HdNormal T = (thnf T).
26 (* Basic inversion lemmas ***************************************************)
28 lemma thnf_inv_tshf: ∀T. 𝐇𝐍⦃T⦄ → T ≈ T.
32 (* Basic properties *********************************************************)
34 lemma tpr_tshf: ∀T1,T2. T1 ➡ T2 → T1 ≈ T1 → T1 ≈ T2.
35 #T1 #T2 #H elim H -T1 -T2 //
36 [ #I #V1 #V2 #T1 #T2 #_ #_ #_ #IHT12 #H
37 elim (tshf_inv_flat1 … H) -H #W2 #U2 #HT1U2 #HT1 #_ #H1 #H2 destruct
38 lapply (IHT12 HT1U2) -IHT12 -HT1U2 #HUT2
39 lapply (simple_tshf_repl_dx … HUT2 HT1) /2 width=1/
40 | #a #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #H
41 elim (tshf_inv_flat1 … H) -H #W2 #U2 #_ #H
42 elim (simple_inv_bind … H)
43 | #a #I #V1 #V2 #T1 #T #T2 #_ #_ #_ #_ #_ #H
44 elim (tshf_inv_bind1 … H) -H #W2 #U2 #H1 * #H2 destruct //
45 | #a #V2 #V1 #V #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H
46 elim (tshf_inv_flat1 … H) -H #U1 #U2 #_ #H
47 elim (simple_inv_bind … H)
48 | #V #T #T1 #T2 #_ #_ #_ #H
49 elim (tshf_inv_bind1 … H) -H #W2 #U2 #H1 * #H2 destruct
51 elim (tshf_inv_flat1 … H) -H #W2 #U2 #_ #_ #_ #H destruct
55 lemma thnf_tshf: ∀T. T ≈ T → 𝐇𝐍⦃T⦄.