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 "labelled_sequential_computation.ma".
16 include "labelled_hap_reduction.ma".
18 (* KASHIMA'S "HAP" COMPUTATION (LABELLED MULTISTEP) *************************)
20 (* Note: this is the "head in application" computation of:
21 R. Kashima: "A proof of the Standization Theorem in λ-Calculus". Typescript note, (2000).
23 definition lhap: pseq → relation term ≝ lstar … lhap1.
25 interpretation "labelled 'hap' computation"
26 'HApStar M p N = (lhap p M N).
28 notation "hvbox( M break ⓗ⇀* [ term 46 p ] break term 46 N )"
29 non associative with precedence 45
30 for @{ 'HApStar $M $p $N }.
32 lemma lhap_step_rc: ∀p,M1,M2. M1 ⓗ⇀[p] M2 → M1 ⓗ⇀*[p::◊] M2.
36 lemma lhap_inv_nil: ∀s,M1,M2. M1 ⓗ⇀*[s] M2 → ◊ = s → M1 = M2.
37 /2 width=5 by lstar_inv_nil/
40 lemma lhap_inv_cons: ∀s,M1,M2. M1 ⓗ⇀*[s] M2 → ∀q,r. q::r = s →
41 ∃∃M. M1 ⓗ⇀[q] M & M ⓗ⇀*[r] M2.
42 /2 width=3 by lstar_inv_cons/
45 lemma lhap_inv_step_rc: ∀p,M1,M2. M1 ⓗ⇀*[p::◊] M2 → M1 ⓗ⇀[p] M2.
46 /2 width=1 by lstar_inv_step/
49 lemma lhap_inv_pos: ∀s,M1,M2. M1 ⓗ⇀*[s] M2 → 0 < |s| →
50 ∃∃p,r,M. p::r = s & M1 ⓗ⇀[p] M & M ⓗ⇀*[r] M2.
51 /2 width=1 by lstar_inv_pos/
54 lemma lhap_compatible_dx: ho_compatible_dx lhap.
58 lemma lhap_lift: ∀s. liftable (lhap s).
62 lemma lhap_inv_lift: ∀s. deliftable_sn (lhap s).
63 /3 width=3 by lstar_deliftable_sn, lhap1_inv_lift/
66 lemma lhap_dsubst: ∀s. dsubstable_dx (lhap s).
70 theorem lhap_mono: ∀s. singlevalued … (lhap s).
71 /3 width=7 by lstar_singlevalued, lhap1_mono/
74 theorem lhap_trans: ltransitive … lhap.
75 /2 width=3 by lstar_ltransitive/
78 lemma lhap_step_dx: ∀s,M1,M. M1 ⓗ⇀*[s] M →
79 ∀p,M2. M ⓗ⇀[p] M2 → M1 ⓗ⇀*[s@p::◊] M2.
80 #s #M1 #M #HM1 #p #M2 #HM2
81 @(lhap_trans … HM1) /2 width=1/
84 lemma head_lsreds_lhap: ∀s,M1,M2. M1 ⇀*[s] M2 → is_head s → M1 ⓗ⇀*[s] M2.
85 #s #M1 #M2 #H @(lstar_ind_l ????????? H) -s -M1 //
86 #a #s #M1 #M #HM1 #_ #IHM2 * /3 width=3/
89 lemma lhap_inv_head: ∀s,M1,M2. M1 ⓗ⇀*[s] M2 → is_head s.
90 #s #M1 #M2 #H @(lstar_ind_l ????????? H) -s -M1 //
91 #p #s #M1 #M #HM1 #_ #IHM2
92 lapply (lhap1_inv_head … HM1) -HM1 /2 width=1/
95 lemma lhap_inv_lsreds: ∀s,M1,M2. M1 ⓗ⇀*[s] M2 → M1 ⇀*[s] M2.
96 #s #M1 #M2 #H @(lstar_ind_l ????????? H) -s -M1 //
97 #p #s #M1 #M #HM1 #_ #IHM2
98 lapply (lhap1_inv_lsred … HM1) -HM1 /2 width=3/