]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/reducibility/thnf.ma
- lambda_delta: programmed renaming to lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / reducibility / thnf.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/grammar/tshf.ma".
16 include "basic_2/reducibility/tpr.ma".
17
18 (* CONTEXT-FREE WEAK HEAD NORMAL TERMS **************************************)
19
20 definition thnf: predicate term ≝ NF … tpr tshf.
21
22 interpretation
23    "context-free head normality (term)"
24    'HdNormal T = (thnf T).
25
26 (* Basic inversion lemmas ***************************************************)
27
28 lemma thnf_inv_tshf: ∀T. 𝐇𝐍⦃T⦄ → T ≈ T.
29 normalize /2 width=1/
30 qed-.
31
32 (* Basic properties *********************************************************)
33
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
50 | #V #T1 #T2 #_ #_ #H
51   elim (tshf_inv_flat1 … H) -H #W2 #U2 #_ #_ #_ #H destruct
52 ]
53 qed.
54
55 lemma thnf_tshf: ∀T. T ≈ T → 𝐇𝐍⦃T⦄.
56 /3 width=1/ qed.