Formalization of Lemma for Adjacent Replacement Paths

ISSN 1346-5597
NII Technical Report
Formalization of Lemma for Adjacent Replacement
Paths
Makoto Tatsuta
NII-2012-002E
Feb. 2012
Formalization of Lemma for Adjacent Replacement Paths
Makoto Tatsuta
National Institute of Informatics
Abstract
This paper formalizes the proof of a lemma for adjacent replacement paths given in some paper
so that one can verify it with a theorem prover such as HOL by just typing the content of this
paper. The proof in the original paper is simplified by reorganizing case analysis. Several properties
implicitly used in the original paper are explicitly stated and proved.
1
Introduction
Lemma A13 in [1] is an important lemma for adjacent replacement paths. This paper formalizes the proof
of Lemma A13 given in [1], so that one can verify it with a theorem prover such as HOL by just typing
the content of this paper. The proof in the original paper is simplified by reorganizing case analysis.
Several properties implicitly used in the original paper are explicitly stated and proved.
Section 2 formalizes basic properties of lambda-calculus. Section 3 formalizes the proof of Lemma
A13 by using pure lambda-calculus. Section 4 gives formalization of a translation between pure lambdacalculus and pre-lambda-calculus. Section 5 gives formalization of Lemma A13 by using pre-lambdacalculus.
This paper corresponds to [1] in the following way. Section 2 corresponds to small auxiliary lemmas,
and the three lines beginning from the second last line on page 484 of [1], which they described by only
words without mathematical expressions and assumed it as a basic property of lambda-calculus. The
part from the beginning of Section 3 to Proposition 22 corresponds to the properties itemized with bullets
such as the lines 3–7 of the page 486 of [1], which they described by only words without calculations or
proofs. The part from Lemma 23 to the end of Section 3 corresponds to the part from the line 3 on
page 485 of [1] to the end of the proof on page 489 except the properties itemized with bullets mentioned
above, which is the main part of the proof given [1] and they proved it with calculations.
2
Lambda Calculus Basics
Notation. ∆ = λw.ww. M = N denotes the syntactical identity. Var denotes the set of variables.
We will write M nf for stating that M is in normal form.
→
We nuse vector notations forn sequences. When we use −
x , xi denotes an element of the sequence
−
→
−
→
−
→
x . M ≡ M1 M2 . . . Mn . M m ≡ Mm Mm+1 . . . Mn . We use vector notations also for substitution
−
→
→
[x := X, y := Y ], and [−
x := X ] denotes [x1 := X1 , . . . , xn := Xn ]. We sometimes use a sequence as a
−
→
set. For example, M ∈ N denotes that for some i, M = Ni . In order to say that every element x of the
set S is in the set R, that is, x ∈ R (x ∈ S), we sometimes write S ∈ R by writing S itself instead of x.
−
→ −
→
−
→
M ∈ N denotes for every i, Mi ∈ N .
−
→
−
→
−
→
→
→
→
→
Lemma 1 If −
x are distinct, −
x ∈
6 FV( N ), then (λ−
x .M ) N →∗ M [−
x := N ].
→
Proof. Induction on n = |−
x |.
Case 1. n = 0. The claim holds.
Case 2. n > 0.
−
→
−
→
→
→
Let −
x = x1 −
x , N = N1 N 2 .
−
→
−
→ 2
−
→
−
→
−
→
→
(λ x .M ) N = (λx1 x 2 .M )N1 N 2 →∗ (λ−
x 2 .M [x1 := N1 ]) N 2 .
−
→
−
→
→
→
By IH, (λ−
x 2 .M [x1 := N1 ]) N 2 = M [x1 := N1 ][−
x 2 := N 2 ].
1
−
→
−
→
→
→
→
By −
x 2 6∈ N1 , M [x1 := N1 ][−
x 2 := N 2 ] = M [−
x := N ]. The last part is proved by induction on M . 2
The next is the lemma saying that we can rename bound variables, which is a basic property of
lambda-calculus.
→
→
→
→
→
Lemma 2 (1) If −
x−
y are distinct, −
y 6∈ z, yi 6∈ FV(M ) for z = xi , then (λz.M )[−
x := −
y] =
→
→
→
→
λ(z[−
x := −
y ]).M [−
x := −
y ].
→
→
→
→
→
→
→
→
(2) If −
x−
y are distinct, −
y 6∈ −
z , {yi |xi ∈ −
z } 6∈ FV(M ), then (λ−
z .M )[−
x := −
y] =
−−−−
−−−−−
−→
→
−
→
−
→
−
→
λ(z[ x := y ]).M [ x := y ].
−−−
−−−−−→
−−→
→
→
→
→
→
→
→
→
(3) If −
x 1−
y 1 are distinct, −
y 1 6∈ FV(M ), −
x =−
x 1 as sets, then λ−
x .M = λ(x[−
x 1 := −
y 1 ]).M [−
x 1 :=
−
→
y 1 ].
→
We will sometimes write “we can suppose that −
x such that ...” when we use the claim (3).
Proof. (1)
→
Case 1. z ∈ −
x.
−
→
−
→
→
→
Let x = z x 2 , −
y = y1 −
y 2.
−
→
−
→
−
→
→
→
→
→
λ(z[ x := y ]).M [ x
:= −
y ] = λy1 .M [−
x
:= −
y ] = λy1 .M [z
:= y1 ][−
x2
−
→
−
→
−
→
−
→
−
→
y 2 ](This follows from M [ x := y ] = M [z := y1 ][ x 2 := y 2 ]. This is proved by induction on M )
→
→
→
→
(λy1 .M [z := y1 ])[−
x 2 := −
y 2 ] = (λz.M )[−
x 2 := −
y 2 ]. The last part follows from y1 6∈ FV(M ).
→
→
→
→
(λz.M )[−
x 2 := −
y 2 ] = (λz.M )[−
x := −
y ].
→
Case 2. z 6∈ −
x.
→
→
→
→
→
→
→
→
λ(z[−
x := −
y ]).M [−
x := −
y ] = λz.M [−
x := −
y ] = (λz.M )[−
x := −
y ].
→
(2) Induction on |−
z | and by (1).
→
→
→
→
→
→
(3) In (2) we can take −
x to be −
x 1, −
y to be −
y 1 , and −
z to be −
x.
→
→
→
→
By (λ−
x .M )[−
x 1 := −
y 1 ] = λ−
x .M , the claim holds. 2
Lemma 3 (1) If M →∗ M 0 , M 6∈ WN, then M 0 6∈ WN.
(2) If M →∗ M 0 , M 0 6∈ WN, then M 6∈ WN.
Proof. (1) Assume M 0 ∈ WN.
M 0 →∗ M 00 nf.
M →∗ M 0 →∗ M 00 .
This contradicts with M 6∈ WN.
Hence M 0 6∈ WN.
(2) Assume M ∈ WN.
M →∗ M 00 nf.
By CR, we have M 000 such that M 0 →∗ M 000 , M 00 →∗ M 000 .
By M 00 nf, M 00 = M 000 .
M 0 →∗ M 00 nf.
This contradicts with M 0 6∈ WN.
Hence M 6∈ WN. 2
Lemma 4 (1) M ∈ WN implies M [x := y] ∈ WN.
(2) M [x := y] ∈ WN implies M ∈ WN.
(3) If M ∈ WN, y1 = y2 (for x1 = x2 ), y1 6= y2 (for x1 6= x2 ), then M [x1 := y1 , x2 := y2 ] ∈ WN.
(4) If M [x1 := y1 , x2 := y2 ] ∈ WN, y1 = y2 (for x1 = x2 ), y1 6= y2 (for x1 6= x2 ), then M ∈ WN.
(5) If M [x := y] →1 N 0 , we have N such that M →1 N , N [x := y] = N 0 .
Proof. (1) Let M →∗ M 0 nf.
By a basic theorem of lambda-calculus, M [x := y] →∗ M 0 [x := y].
By a basic theorem of lambda-calculus, M 0 [x := y] nf.
(2) Let M [x := y] →∗ N 0 nf.
b denotes [x := y].
Induction on n = |M [x := y] →∗ N 0 |.
Case 1. n = 0.
M [x := y] = N 0 nf. M [x := y] nf. By a basic property of lambda-calculus, M nf. M ∈ WN.
Case 2. n > 0.
c →1 L0 →∗ N 0 .
Let M
2
:=
=
b = L0 .
By (5), we have L such that M →1 L, L
∗
0
b → N , we have N such that L →∗ N nf.
By IH for L
Hence M →1 L →∗ N .
M ∈ WN.
(3)
Case 1. x1 = x2 . (1) shows the claim.
Case 2. x1 6= x2 .
y1 6= y2 .
Choose z such that z 6∈ FV(M ) ∪ {x1 , y1 }.
M [x1 := y1 , x2 := y2 ] = M [x2 := z][x1 := y1 ][z := y2 ] by induction on M .
By applying (1) three times to M , M [x2 := z][x1 := y1 ][z := y2 ] ∈ WN.
Hence M [x1 := y1 , x2 := y2 ] ∈ WN.
(4)
Case 1. x1 = x2 . (2) shows the claim.
Case 2. x1 6= x2 .
y1 6= y2 .
Choose z such that z 6∈ FV(M ) ∪ {x1 , y1 }.
M [x1 := y1 , x2 := y2 ] = M [x2 := z][x1 := y1 ][z := y2 ] by induction on M .
M [x2 := z][x1 := y1 ][z := y2 ] ∈ WN.
By applying (2) three times to M [x2 := z][x1 := y1 ][z := y2 ], M ∈ WN.
(5) Induction on M .
b denotes [x := y].
Case 1. M = λz.P .
By Lemma 2 (3), we can suppose z such that z 6= x, y.
c = λz.Pb.
M
N 0 = λz.Q0 , Pb →1 Q0 .
b
By IH, we have Q such that P →1 Q, Q0 = Q.
We can let N = λz.Q.
Case 2. M = M1 M2 .
c=M
c1 M
c2 .
M
c →1 N classifies cases.
M
c1 →1 N 0 , N 0 = N 0 M
c
Case 2.1. M
1
1 2.
c1 .
By IH, we have N1 such that M1 →1 N1 , N10 = N
We can let N = N1 M2 .
c2 →1 N 0 , N 0 = M
c1 N 0 .
Case 2.2. M
2
2
c2 .
By IH, we have N2 such that M2 →1 N2 , N20 = N
We can let N = M1 N2 .
c = (λz.P )M
c2 , N 0 = P [z := M
c2 ].
Case 2.3. M
c1 = λz.P , by analyzing the shape of M1 , M1 = λw.R.
From M
By applying Lemma 2 (3) to λz.P , we can suppose z 6∈ FV(R) ∪ {x, y}.
By α-equivalence and z 6∈ FV(R), λw.R = λz.R[w := z].
Let R0 = R[w := z].
M1 = λz.R0 .
c1 = λz.R
c0 .
M
c1 = λz.P and λz.P = λz.R
c0 , P = R
c0 .
By M
c0 [z := M
c2 ].
N0 = R
c0 [z := M
c2 ] = (R0 [z := M2 ])[x := y].
By a property of substitution, R
0
We can let N = R [z := M2 ]. 2
→
The normal form of a lambda-term N can be defined syntactically by N ::= λ−
x .yN1 . . . Nn , and it
is recursive repetitions of head normal forms. By replacing one of Ni by [ ], we will obtain a hereditary
head normal context H defined in the next definition. In pure lambda-calculus on HOL, a context is
defined as a function from lambda-terms to lambda-terms, and hence it allows renaming bound variables.
For this reason λx.x(λxy.[ ]) equals λy.y(λxy.[ ]). In this paper, we want to prohibit renaming variables
that bind the hole, so we represent a context by (H, s) instead of H, where s is the sequence of variables
3
that bind the hole. Since the variable sequences xxy and yxy are different, in the previous example,
(λx.x(λxy.[ ]), xxy) and (λy.y(λxy.[ ]), yxy) are different.
Definition 5 A hereditary head normal context pair HP is defined as follows.
([ ], φ) ∈ HP,
−
→ −
→ →
→
(λ−
x .y N H L , −
x s) ∈ HP if (H, s) ∈ HP.
Their meaning is as follows. When (H, s) ∈ HP, H is a hereditary head normal context, and s is the
sequence of variables that bind [ ] in H.
We will write HP(H, s) for (H, s) ∈ HP.
The next lemma gives the condition for equal hereditary head normal contexts, which is obtained
from its definition by writing it down.
−
→ −
→
→
Lemma 6 If (H1 , s1 ) = (H2 , s2 ), then H1 = H2 = [ ], s1 = s2 = φ, or H1 = λ−
x .y N H3 L , H2 =
−
→
−
→
→
→
→
λ−
x .y N H4 L , s1 = −
x s3 , s2 = −
x s4 , (H3 , s3 ) = (H4 , s4 ).
Proof.
s1 = s2 .
As functions for pure lambda terms, H1 = H2 .
Induction on (H1 , s1 ).
Case 1. H1 = [ ], s1 = φ.
By case analysis with (H2 , s2 ), H2 = [ ], s2 = φ.
−
→ −
→
→
→
Case 2. H1 = λ−
x .y N H3 L , s1 = −
x s3 , (H3 , s3 ) ∈ HP.
−
→ −
→
→
→
By case analysis with (H2 , s2 ), we will show that H2 = λ−
x .y N H4 L , s2 = −
x s4 , (H3 , s3 ) = (H4 , s4 ).
Case 2.1. H2 = [ ].
From H1 = H2 , it is not the case.
−
→0 −
→0
→
→
x 0 s4 , (H4 , s4 ) ∈ HP.
Case 2.2. H2 = λ−
x 0 .y 0 N H4 L , s2 = −
0
−
→
−
→
By H1 = H2 , | x | = | x |.
→
→
By s1 = s2 , we have −
x =−
x 0 , s3 = s4 .
0
0
−
→
−
→
0
→
H2 = λ −
x .y N H4 L .
−
→ −
→0
−
→ −
→0
By H1 = H2 , we have y = y 0 , N = N , H3 = H4 , L = L .
−
→
−
→
→
→
H2 = λ −
x .y N H3 L , s2 = −
x s3 , (H3 , s3 ) = (H4 , s4 ). 2
Lemma 7 (H, s), (H 0 , s0 ) ∈ HP implies (H[H 0 ], ss0 ) ∈ HP.
Proof. Induction on (H, s).
Case 1. H = [ ], s = φ.
H[H 0 ] = H 0 , ss0 = s0 .
(H[H 0 ], ss0 ) ∈ HP.
−
→ −
→
→
→
Case 2. H = λ−
x .y N H1 L , s = −
x s1 , (H1 , s1 ) ∈ HP.
0
0
By IH, (H1 [H ], s1 s ) ∈ HP.
−
→
−
→
→
→
By H[H 0 ] = λ−
x .y N H1 [H 0 ] L , ss0 = −
x s1 s0 , we have (H[H 0 ], ss0 ) ∈ HP. 2
Lemma 8 H[M ] nf implies M nf.
Proof. Induction on (H, s).
Case 1. H = [ ].
By the assumption, M nf.
−
→ −
→
→
Case 2. H = λ−
x .y N H1 L .
H1 [M ] nf. Proof: Assume that H1 [M ] nf does not hold. We have M 0 such that H1 [M ] →1 M 0 . We
−
→ −
→
→
have H[M ] →1 λ−
x .y N M 0 L , and this contradicts with H[M ] nf. Hence H1 [M ] nf.
By IH, M nf. 2
Lemma 9 (1) If H[M ] →∗ N, HP(H, s), then we have (H 0 , s0 ), M 0 such that M →∗ M 0 , N = H 0 [M 0 ],
s = s0 .
(2) M 6∈ WN implies H[M ] 6∈ WN.
4
Proof. Induction on (H, s).
Case 1. H = [ ]. The claim holds.
→
−
→ −
→
→
Case 2. H = λ−
x .y L H1 K , s = −
x s1 .
−
→
−
→
0
−
→
By head reduction, N = λ x .y L N1 K 0 , Li , Ki →∗ L0i , Ki0 , H1 [M ] →∗ N1 .
By IH, we have (H10 , s01 ), M 0 such that M →∗ M 0 , N1 = H10 [M 0 ], s1 = s01 .
−
→ −
→
→
→
We can let H 0 = λ−
x .y L0 H10 K 0 , s0 = −
x s01 .
0
0
−
→
−
→
s = x s1 = x s1 = s.
(2) Assume H[M ] ∈ WN.
H[M ] →∗ N nf.
By (1), N = H 0 [M 0 ], M →∗ M 0 .
By Lemma 8, M 0 nf.
M ∈ WN. A contradiction.
Hence H[M ] 6∈ WN. 2
→
Lemma 10 (1) M nf implies M −
x ∈ WN.
−
→
(2) L ∈ WN implies L x ∈ WN.
→
Proof. (1) By induction on M , we will show M −
x ∈ WN.
−
→
→
→
→
From Lemma 2 (3), by choosing bound variable names as −
x , we can suppose that M = λ−
x−
z .y N ,
−
→
→
→
→
→
or M = λ−
x 1 .y N , −
x =−
x 1−
x .
−
→ 2
→
→
Case 1. M = λ−
x−
z .y N .
−
→
→
→
M−
x →∗ λ−
z .y N nf.
−
→ → −
→
→
Case 2. M = λ−
x 1 .y N , −
x =→
x 1−
x 2.
−
→
→
→
M−
x →∗ y N −
x 2 nf.
(2) Let L →∗ M nf.
→
→
L−
x →∗ M −
x.
→
By (1), M −
x ∈ WN.
→
By Lemma 3 (1), L−
x ∈ WN. 2
→
→
→
→
λ−
w .x−
w (wi −
u ) is just a function that puts a given input −
w after the head variable x, or puts it there
→
after applying it to −
u . The next lemma says a normal form with substitution of such a function is still
WN.
→
→
→
→
→
→
Lemma 11 If M nf, X = λ−
w .x−
w (wi −
u ), x−
w are distinct, −
u ∈
6 −
w , then M [x := X] ∈ WN.
Proof. Induction on M .
−
→
→
Let M = λ−
x .y N .
→
→
→
By Lemma 2 (3), we can suppose −
x such that x, −
u 6∈ −
x.
0
b →∗ E 0 nf.
b denotes [x := X]. E denotes a normal form such that E
−
→
c
Case 1. x ∈ x . M = M nf.
→
Case 2. x 6∈ −
x.
Case 2.1. y 6= x.
−
→
→
c = λ−
b.
M
x .y N
b
By IH, Ni ∈ WN. We have Ni0 .
−
→
→
c →∗ λ−
Hence M
x .y N 0 nf.
Case 2.2. y = x.
−
→
−
→
→
→
→
→
→
c = λ−
b = λ−
b.
M
x .X N
x .(λ−
w .x−
w (wi −
u )) N
bi ∈ WN. We have N 0 .
By IH, N
i
−
→
−
→
→ →
−
→
−
→ −
−
→
−
→ →
→
→
→
→
→
→
→
c →∗ λ−
w 2 ||N 0 2 | = 0.
w 1 | = |N 0 1 |, |−
w =−
w 1−
w 2 , N 0 = N 0 1 N 0 2 , |−
w 2 (Wi −
u )N 0 2 , where −
M
x−
w 2 .xN 0 1 −
→
c ∈ WN. 2
Wi = wi or Ni0 . By Lemma 10 (1), Ni0 −
u ∈ WN. Hence M
For a normal form M , when we apply it to a variable u, then M u is WN. Since a WN term uQ1 . . . Qn
is also stable in the same way as u, we can extend it in a one more step so that M (uQ1 . . . Qn ) becomes
WN. The next lemma says it.
−
→
−
→
Lemma 12 If M nf, Pi = ui Q i ∈ WN, then M P ∈ WN.
5
Proof. Induction on |M |.
−
→
→
Let M = λ−
x .y N .
−
→
→
→
By Lemma 2 (3), we can suppose −
x such that FV( P ) 6∈ −
x.
−
→
−
→
−
→
−
→
−
→
→
→
→
→
→
Let −
x =−
x 1−
x 2 , P = P 1 P 2 , |−
x 1 | = | P 1 |, |−
x 2 || P 2 | = 0.
−
→
→
b denotes [−
x 1 := P 1 ].
−
→
→
→
By IH for λ−
x 1 .Ni , (λ−
x 1 .Ni ) P 1 ∈ WN.
−
→
∗
→
ci .
(λ−
x 1 .Ni ) P 1 → N
ci ∈ WN.
By Lemma 3 (2), N
−
→
Case 1. y 6∈ x 1 .
−
→−
−
→
−
→−
→
→
→
b→
M P = (λ−
x .y N ) P →∗ λ−
x 2 .y N
P 2.
c ∈ WN.
M
→
Case 2. y = xk ∈ −
x 1.
−
→−
→−
−
→
−
→
−
→
−
→ −
−
→
→
→
b→
b→
M P = (λ x .xk N ) P →∗ λ−
x 2 .Pk N
P 2 = λ−
x 2 .uk Q k N
P 2.
c ∈ WN. 2
M
→
→
→
→
Since a normal form of the shape λ−
w .p−
w (wi −
u ) has only p, −
u as its free variables, it becomes WN
by substituting normal forms for free variables. When we substitute it for p, since the normal form
wi X1 . . . Xn is as stable as the variable wi , it remains WN still after we apply the normal form substituted
for p to them. The next lemma says it.
→
→
→
→
→
→
Lemma 13 If M = λ−
w .p−
w (wi −
u ), −
u ∈
6 −
w (the lemma holds without this condition), p−
w are distinct,
−
→
−
→
−
→
X nf, then M [ x := X ] ∈ WN.
−
→
→
→
→
Proof. By Lemma 2 (3), we can suppose −
w such that FV( X ) ∪ {−
x } 6∈ −
w.
−
→
−
→
b denotes [ x := X ].
Case 1. p 6∈ ~x.
−
→
→
→
c = λ−
M
w .p−
w (wi u
b ).
→
ubj = Xk (uj = xk ) or uj (uj 6∈ −
x ). ubj nf.
c
c
M nf. M ∈ WN.
→
Case 2. p = xk ∈ −
x.
−
→
−
→
Let Xk = λ u .y P .
→
ubj = Xk (uj = xk ) or uj (uj 6∈ −
x ).
ubj nf.
−
→
→
→
c = λ−
M
w .Xk −
w (wi u
b ).
−
→
→
By Lemma 12, Xk −
w (wi u
b ) ∈ WN.
c
M ∈ WN. 2
For a hereditary head normal context (H, s), in order to rename variables s that bind the hole, we
will use the following restricted substitution [p1 , . . . , pn := q1 , . . . , qn |S]. S is a set of variables and gives
a restriction. H[p1 , . . . , pn := q1 , . . . , qn |S] replaces a hole-binding variable pi in H by qi , and replaces a
free variable pi in H by qi only when pi ∈ S. H[p1 , . . . , pn := q1 , . . . , qn |φ] replaces a hole-biding variable
pi of H by qi , keeping its functionality from lambda-terms to lambda-terms.
For a lambda-term M , the restricted renaming M [p1 , . . . , pn := q1 , . . . , qn |S] is an auxiliary notation
and it is the renaming p1 , . . . , pn := q1 , . . . , qn only for variables in S.
→
→
→
→
Definition 14 For HP(H, s), variable sequences −
p,−
q , a set S of variables, we define (H, s)[−
p := −
q |S]
by induction on (H, s) as follows.
→
→
→
→
M [−
p := −
q |S] = M [−
p 0 := −
q 0 ],
−
→
−
→
([ ], φ)[ p := q |S] = ([ ], φ),
−
→ −
→
→
→
→
(λ−
x .y M H N , s)[−
p := −
q |S] =
−
→→
→
→
→
→
→
→
→
→
(λ(−
x [−
p := −
q ]).(y[−
p := −
q |S ∪ −
x ])(M [−
p := −
q |S ∪ −
x ])
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
(H[ p := q |S ∪ x ])( N [ p := q |S ∪ x ]), s[ p := q ]),
→
→
→
→
where −
p 0 = {pi ∈ −
p |pi ∈ S}, −
q 0 = {qi ∈ −
q |pi ∈ S}.
0
−
→
−
→
→
→
We define H[ p := q |S] as H such that (H, s)[−
p := −
q |S] = (H 0 , s0 ).
−
→
−
→
We define q |−
→
p ,S = {qi ∈ q |pi ∈ S}.
6
We define H1 = H2 when for every M , H1 [M ] = H2 [M ]. (This is the same for HOL)
→
→
→
→
→
→
→
→
We define M [−
p := −
q ] = M [−
p := −
q |Var], (H, s)[−
p := −
q ] = (H, s)[−
p := −
q |Var].
The next lemma (2) is necessary for HOL, which says that a restricted renaming for (H, s) maps the
same contexts to the same contexts. (1) is a basic property of substitution in lambda-calculus.
→
→
→
→
Lemma 15 (1) If M1 = M2 , then M1 [−
p := −
q |S] = M2 [−
p := −
q |S].
−
→
−
→
→
→
(2) If (H1 , s1 ) = (H2 , s2 ), then (H1 , s1 )[ p := q |S] = (H2 , s2 )[−
p := −
q |S].
Proof.
→
→
→
→
(1) By a basic property of lambda-calculus, M1 [−
p 0 := −
q 0 ] = M2 [−
p 0 := −
q 0 ].
→
→
→
→
Hence M1 [−
p := −
q |S] = M2 [−
p := −
q |S].
(2) Induction on (H1 , s1 ).
Case 1. H1 = [ ], s1 = φ.
By Lemma 6, H1 = H2 = [ ], s1 = s2 = φ.
→
→
→
→
(H1 , s1 )[−
p := −
q |S] = ([ ], φ) = (H2 , s2 )[−
p := −
q |S].
−
→ −
→
−
→
−
→
Case 2. H1 = λ x .y N H3 L , s1 = x s3 , (H3 , s3 ) ∈ HP.
−
→ −
→
→
→
By Lemma 6, we have H2 = λ−
x .y N H4 L , s2 = −
x s4 , (H3 , s3 ) = (H4 , s4 ).
S
−
→
−
→
−
→
−
→
e denotes [ p := q |S]. denotes [ p := q ].
→
→
S∪−
x
S∪−
x
g
By IH, (Hg
,
s
)
=
(H
,
s
)
.
3 3
4 4
→
→
S∪−
x
S∪−
x
f3
f4
H
=H
.
→
→
−−−−−
→ S∪−
−−→
→
−−−→
→ S∪−
−−→
→
x −−S∪
x −−S∪
S
S
→
→−
→ S∪−
−
→ S∪−
xH
x = λ(−
xH
x =H
x
e S∪→
f3
e −
e S∪−
f4
e −
f2 .
f
N
L
L
y
x ).e
y xN
H1 = λ( x ).e
s3 = s4 .
→
→
s1 = −
x s3 = −
x s4 = s2 .
→
→
→
→
Hence (H1 , s1 )[−
p := −
q |S] = (H2 , s2 )[−
p := −
q |S]. 2
Since H[p1 , . . . , pn := q1 , . . . , qn |S] replaces hole-binding variables pi of H by qi , and free variables pi
of H by qi with pi ∈ S, the restricted renaming of H[M ] equals the combination of H, M after renaming
both with appropriate restrictions. The next lemma says it.
→
→
→
→
→
→
→
Lemma 16 (1) If HP(H, s), −
p−
q are distinct, −
q 6∈ FV(H[M ]) ∪ s, then H[−
p := −
q |S][M [−
p := −
q |S ∪
→
→
s]] = (H[M ])[−
p := −
q |S].
→
→
→
→
→
→
→
(2) For (H, s), M , −
p , if −
p−
q are distinct, −
q 6∈ FV(H[M ]) ∪ s, then H[M ] = H[−
p := −
q |φ][M [−
p :=
−
→
q |s]].
→
→
→
→
→
→
→
→
(3) If HP(H, s), −
p−
q are distinct, −
q 6∈ FV(H[M ])∪s, then H[−
p := −
q ][M [−
p := −
q ]] = (H[M ])[−
p :=
−
→
q ].
Proof. (1) Induction on (H, s).
Case 1. H = [ ].
s = φ.
→
→
The left-hand side is M [−
p := −
q |S]. The right-hand side is the same.
−
→ −
→
−
→
→
Case 2. H = λ x .y N H1 L , s = −
x s1 .
S
S
−
→
−
→
e
E and (E)e denote E[ p := q |S].
→
→
denotes [−
p := −
q ].
→
−
−−−
→ S∪−
−−→
→
x −−S∪
→
−
→
→ S∪ x e−S∪
x.
f1
e −
e S = λ−
x .e
y
N xH
L
H
→
−
−
−
−
→
−−−−−
→
S∪−
x
→
→ e S∪−
→ S∪−
xH
x.
e S [M
fS∪s ] = λ−
f1
fS∪s ]L
e S∪→
H
x .e
y xN
[M
−
→
S ∪ s = S ∪ x ∪ s1 .
→
→
→
S∪−
x
S∪−
x
S∪−
x
→
x ∪s1 ] = Hg
f1
fS∪s ] = H
f1
fS∪−
H
[M
[M
. The last part is proved by IH. The condition is
1 [M ]
−
→
→
→
q 6∈ FV(H1 [M ]) ∪ s1 . This is proved by FV(H[M ]) ∪ s = (FV(H1 [M ]) − −
x ) ∪ s1 ∪ −
x ⊇ FV(H1 [M ]) ∪ s1 .
−
→
−
−
−
−
→
−
−
−
−
→
S∪ x
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
S∪
x
e S∪ x Hg
e S∪ x = λ x .(y N H1 [M ] L )e
e S [M
fS∪s ] = λ x .e
y S∪ x N
L
.
H
1 [M ]
−
→
−
→ −
→
−
→
−
→
−
→
−
→
S∪
x
→
→
Since −
p−
q are distinct, (y N H1 [M ] L )e
= ((y N H1 [M ] L )eS− x )e x .
7
−
→
−
→ −
→
−
→ −
→
→
−
→
−
→
−
→
−
→
−
→
−
→ −
−
→
→
λ x .(y N H1 [M ] L )eS∪ x = λ x .((y N H1 [M ] L )eS− x )e x = (λ−
x .(y N H1 [M ] L )eS− x )e x . Tha last
−
→
−
→
−
→
→
→
→
→
q |−
part is by Lemma 2 (2). The conditions are −
q 6∈ −
x and FV(λ−
x .(y N H1 [M ] L )eS− x ) 63 −
→
→
p ,−
x . The
−
→
−
→ −
−
→
−
→
→
first one is proved by q 6∈ S. The second one is proved by FV(λ x .y N H1 [M ] L ) ∪ q |−
→
→
→
→
p ,S−−
x 63 q|−
p ,−
x.
−
→
−
→
−
→
−
→
−
→
−
→
→
→
→
→
→
→
λ−
x .(y N H1 [M ] L )eS− x = (λ−
x .y N H1 [M ] L )eS− x . The conditions are −
x 6∈ −
p ∩ (S − −
x ), −
x 6∈
−
→
−
→
−
→
q |−
.
The
second
one
is
proved
by
the
fact
that
since
q
∈
6
s,
~
q
∈
6
x
.
→
−
→
p ,S− x
−
→ −
→
−
→
−
→
−
→
−
→
→
→
((λ−
x .y N H1 [M ] L )eS− x )e x = (λ−
x .y N H1 [M ] L )eS = (H[M ])eS .
S
g] .
e S [M
fS∪s ] = H[M
Hence H
(2) In (1), we can let S = φ.
(3) In (1), we can let S = Var.
→
→
→
→
→
→
→
→
→
→
(H[M ])[−
p := −
q ] = H[−
p := −
q ][M [−
p := −
q |Var ∪ s]] = H[−
p := −
q ][M [−
p := −
q ]]. 2
For a normal form of the shape λy1 . . . ym .xN1 . . . Nn , if each yi appears in N1 , . . . , Nn , when we
substitute such a normal form for x in an arbitrary normal form M and the result is WN, its normal form
M 0 has the same head variable as the original normal form M since its head variable is x, and moreover
each subterm of M after the substitution is not erased by reduction and its normal form remains in M 0 ,
since each yi appears in N1 , . . . , Nn . The next definition defines the lambda-terms of this shape.
−
→ →
→
Definition 17 We say that M nf is PR(M, x) (X is preserving with x) when M = λ−
y .x N , x−
y are
−
→
→
distinct, −
y ∈ N.
When PR(M, x), we substitute M for x in an arbitrary normal form N , and the result is WN, its
normal form N 0 has the same head variable as the original normal form N , and moreover for each subterm
of N its normal form after the substitution is not erased by reduction and remains in N 0 . The next lemma
says it. This property was described in the first paragraph of the proof (p.484) of Lemma A13 in [1] by
just stating that “...λ-terms in which all abstracted variables occur at least once as arguments of a free
variable. This makes sure that all subterms of all terms obtained out of M [x := X, y := Y ] by reduction
will never be erased.” and they used it without proofs since it is a basic property of lambda-calculus.
−
→
→
Lemma 18 (1) If HP(H, s), V is a finite set of variables, M nf, R nf, −
r are distinct, PR(Ri , ri ),
−
→
0 0
→
FV(Ri ) 6∈ s (1 ≤ i ≤ n), M = H[F ], then we have (H , s ) such that M [−
r := R ] →∗ H 0 [F 0 ],
−
→
0
c
0
c
→
s ⊆ s ⊆ s ∪ V , where F = F [−
r := R |s ].
c →∗
(2) If M nf, X nf, HP(H, s), V is a finite set of variables, PR(X, x), FV(X) 6∈ s, M = H[F ], M
0
00 00
00
0
00
00
00
c
∗
M nf, then we have (H , s ), F such that M = H [F ], s ⊆ s ⊆ s ∪ V , where F [x := X] → F 00 for
x 6∈ s, F 00 = F for x ∈ s.
−
→
→
Proof. (1) b denotes [−
r := R ].
Induction on (H, s).
Case 1. H = [ ]. The claim holds.
−
→ −
→
→
→
Case 2. H = λ−
x .y L H1 K , s = −
x s1 .
→
By FV(Ri ) 6∈ s, FV(Ri ) 6∈ −
x.
→
ri 6∈ −
x.
FV(Ri ) 6∈ s1 .
−
→ c
∗
0
0
0
c
0
−
→
By IH, we have (H10 , s01 ) such that Hd
1 [F ] → H1 [F ], s1 ⊆ s1 ⊆ s1 ∪ V , F = F [ r := R |s1 ].
−
→
−
→
→
→
→
By s = −
x s1 , ri ∈ s and ri ∈ s1 are equivalent. Hence F [−
r := R |sc1 ] = F [−
r := R |sc ].
−
→
Case 2.1. y 6∈ r .
−
→
−
→
→
d ] = λ−
b Hd
b
H[F
x .y L
1 [F ] K .
→
−
→ −
→
→
b , s0 = −
b H0 K
x s0 .
Let H 0 = λ−
x .y L
−
→ c 1 −
−
→ 1c
−
→
−
→
→
→
By F [ r := R |s1 ] = F [ r := R |s ], F 0 = F [−
r := R |sc ].
→
→
x s1 = s.
s0 = −
x s01 ⊇ −
0
0
−
→
−
s = xs ⊆ →
x s1 ∪ V c = s ∪ V c .
1
Case 2.2. y = ri .
−
→
→
Let Ri = λ−
w .ri N .
−
→
→
→
ri −
w are distinct and −
w ∈ N.
−
→
−
→
→
−
→
→
−
→
→−
→−
→
−
→ −
→ −
→ −
→ −
d ] = λ−
b Hd
b
b d b ∗ −
b b0 0 b
H[F
x .Ri L
1 [F ] K = λ x .(λ w .ri N ) L H1 [F ] K → λ x .(λ w .ri N ) L H1 [F ] K .
8
→
−
→
−
→ −
bH
b 0 [F 0 ] K
b.
Let P = L
1
−
→
→
→
By Lemma 2 (3), we can suppose −
w such that −
w 6∈ FV( P ) ∪ V .
→
−
→
−
→−
−
→−
−
→
−
→−
→
→
→
→
→
→
→
→
→
→
→
bH
b 0 [F 0 ] K
b = λ−
w 2, P =
x .(λ−
w .ri N ) P →∗ λ−
x−
w 2 .ri N 0 P 2 , where we let −
w =−
w 1−
λ−
x .(λ−
w .ri N ) L
1
−
→ −
−
→ −
→ →
−
→
−
→
→→
−
→
→
P 1 P 2 , |−
w 1 | = | P 1 |, |−
w 2 || P 2 | = 0, N 0 = N [−
w 1 := P 1 ].
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
→
By −
w ∈ N , P 1 ∈ N 0 . P ∈ N 0 P 2 . H10 [F 0 ] ∈ N 0 P 2 .
−
→−
→
→
→
Choose j such that Pj = H10 [F 0 ]. We can let λ−
x−
w 2 .ri N 0 P 2 with replacing Pj = H10 [F 0 ] by H10 be
→
→
H 0 , s0 = −
x−
w 2 s01 .
−
→
−
→
−
→
→
→
→
By F [−
r := R |sc1 ] = F [−
r := R |sc ], F 0 = F [−
r := R |sc ].
0
0
0
→
→
→
→
s =−
x−
w 2 s1 ⊇ −
x s1 ⊇ −
x s1 = s.
→
→
→
→
s0 = −
x−
w 2 s01 ⊆ −
x s01 ∪ V c ⊆ −
x s1 ∪ V c = s ∪ V c .
→
(2) In the above (1) with −
r = x, we have H 0 , F 0 . x 6∈ s implies F 0 = Fb, and x ∈ s implies F 0 = F .
00
By CR, we have M such that M 0 →∗ M 00 , H 0 [F 0 ] →∗ M 00 .
By M 0 nf, M 00 = M 0 . H 0 [F 0 ] →∗ M 0 .
By Lemma 9 (1), we have (H 00 , s00 ), F 00 such that F 0 →∗ F 00 , s0 = s00 , M 0 = H 00 [F 00 ].
In the case x 6∈ s. F [x := X] →∗ F 00 .
In the case x ∈ s. By F = F 0 nf, F 0 = F 00 . F 00 = F . 2
3
Adjacent Control Paths for Pure Lambda-Terms
In this paper, we use “control paths” for “replacement paths” defined in [1].
Definition 19 For a set S of variables, M nf, we define AC by induction on n as follows.
AC(M, S, n) =
−
→ → −
→−
→
→
→
→
M = H[λ−
g .x N (λ−
u .y L ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u & n = 0,
−
→ −
→
j
∗ −
−
→
→
−
→
→
M = H[λ g .x N (λ u .M ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ g & y 6∈ −
uj &
−
→
∗
∗
→
→
(x 6= y & AC(M , {y, uj }, m) & n = m + 1 ∨ x = y & M = λ−
v .uj L & uj 6∈ −
v & n = 1),
−
→ −
→
k
∗ −
−
→
→
−
→
→
M = H[λ g .x N (λ u .M ) G ] & HP(H, s) & S = {x} & x 6∈ s ∪ g & j ≤ k & uj 6∈ −
u kj+1 &
∗
AC(M , {uj , uk }, m) & n = m + 2.
→
→
→
→
→
→
→
Lemma 20 (1) For −
p ,−
q ,−
z , if HP(H, s), −
p−
q−
z are distinct, −
q
6∈ FV(M ), M =
−
→
−
→
−
→
→
→
→
→
H[λ−
g .x N (λ−
u .y L ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u & n = 0, then we have
−
→0 →0 −
−
→0 −
→0
→
→
→
→
→
→
→
→
(H 0 , s0 ), H 0 [λ−
g 0 .x[−
p := −
q ] N (λ−
u .y[→
p := −
q ] L ) G ] such that M [−
p := −
q ] = H 0 [λ−
g 0 .x[−
p :=
0
0
0
−
→
−
→
−
→
0
0 0
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
→
q ] N (λ u .y[ p := q ] L ) G ]&HP(H , s )&S[ p := q ] = {x[ p := q ], y[ p := q ]}&x[ p := q ], y[−
p :=
0
0
0
0
0
0
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
q ] 6∈ s ∪ g & y[ p := q ] 6∈ u & n = 0, and z 6∈ s ∪ g ∪ u .
−
→ →j ∗ −
→
→
→
→
→
→
→
→
→
(2) For −
p ,−
q ,−
z , if HP(H, s), −
p−
q−
z are distinct, −
q 6∈ FV(M ), M = H[λ−
g .x N (λ−
u .M ) G ] &
→
→
HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u j & (x 6= y & AC(M ∗ , {y, uj }, m) & n = m + 1 ∨ x = y & M ∗ =
→j
−
→
−
→0 −
−
→0
→
→
→
→
→
λ−
v .uj L & uj 6∈ −
v & n = 1), then we have (H 0 , s0 ), H 0 [λ−
g 0 .x[−
p := −
q ] N (λ u0 .M ∗ 0 ) G ] such that
→j
−
→0 −
−
→0
→
→
→
→
→
→
→
→
→
→
M [−
p := −
q ] = H 0 [λ−
g 0 .x[−
p := −
q ] N (λ u0 .M ∗ 0 ) G ] & HP(H 0 , s0 ) & S[−
p := −
q ] = {x[−
p := −
q ], y[−
p :=
j
−
→
0
0
0 −
∗0
−
→
−
→
−
→
−
→
−
→
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
q ]}&x[ p := q ], y[ p := q ] 6∈ s ∪ g &y[ p := q ] 6∈ u &(x[ p := q ] 6= y[ p := q ]&AC(M , {y[ p :=
−
→0
−
→
→
→
→
→
→
→
q ], u0j }, m) & n = m + 1 ∨ x[−
p := −
q ] = y[−
p := −
q ] & M ∗ 0 = λ−
v 0 .u0j L & u0j 6∈ −
v 0 & n = 1), and
j
j
j
−
→
→
−
→ −
→ −
−
→
−
→
→
z 6∈ s0 ∪ −
g 0 ∪ u0 , s0 ∪ g 0 6∈ u0 , u0 6∈ v 0 .
−
→ →k ∗ −
→
−
→
−
→
−
→
−
→
−
→
→
→
→
(3) For p , q , z , if HP(H, s), p q −
z are distinct, −
q 6∈ FV(M ), M = H[λ−
g .x N (λ−
u .M ) G ] &
k
∗
−
→
−
→
HP(H, s) & S = {x} & x 6∈ s ∪ g & j ≤ k & uj 6∈ u j+1 & AC(M , {uj , uk }, m) & n = m + 2,
→k
−
→0
−
→0 −
→
→
→
→
→
→
→
then we have (H 0 , s0 ), H 0 [λ−
g 0 .x[−
p := −
q ] N (λ u0 .M ∗ 0 ) G ] such that M [−
p := −
q ] = H 0 [λ−
g 0 .x[−
p :=
k
0
0 −
→
−
→
−
→
0
0
∗0
0 0
0
−
→
−
→
−
→
−
→
−
→
−
→
−
→
−
→
q ] N (λ u .M ) G ] & HP(H , s ) & S[ p := q ] = {x[ p := q ]} & x[ p := q ] 6∈ s ∪ g & j ≤ k & u0j 6∈
−
→0 k
−
→ −
→k
−
→k
→
→
u j+1 & AC(M ∗ 0 , {u0j , u0k }, m) & n = m + 2, and −
z 6∈ s0 ∪ −
g 0 ∪ u0 , s0 ∪ g 0 6∈ u0 .
→
→
→
→
→
→
→
(4) If AC(M, S, n), −
p−
q are distinct, −
q 6∈ FV(M ), then AC(M [−
p := −
q ], S[−
p := −
q ], n).
Proof.
Let P1 (n), P2 (n), P3 (n), P4 (n) be the statements (1), (2), (3), (4) with a fixed n.
9
By Induction on n, we will show P1 (n) & P2 (n) & P3 (n) & (P1 (n) & P2 (n) & P3 (n) → P4 (n)).
(1’) We will show P1 (n).
−
→ −
→
−
→−
→
−
→−
→
→
→
→
Choose z , q such that z q 6∈ FV(M ) ∪ s, −
z−
p−
q z q are distinct.
−
→−
→ →
−
→
−
→
−
→
−
→
By Lemma 2 (3), we can suppose g such that z p q z q 6∈ −
g . Moreover, by Lemma 2 (3), we can
−
→−
→ −
−
→
−
→
−
→
−
→
→
suppose u such that z p q z q 6∈ u .
Let
−
→ → −
→−
→
→
F = λ−
g .x N (λ−
u .y L ) G .
Let
−
→−
→
→
→
H1 = H[−
z−
q := z q |φ],
−
→
−
→
→
→
s1 = s[−
z−
q := z q ],
−
→−
→
−
→
→
F1 = F [ z −
q := z q |s].
By Lemma 16 (2), we have HP(H1 , s1 ), H[F ] = H1 [F1 ].
→
→
s1 63 −
z−
q.
−
→−
→
→
→
denotes [−
z−
q := z q |s].
By x, y 6∈ s, x = x, y = y.
−
→ → −
→−
→
→
F1 = λ −
g .x N (λ−
u .y L ) G .
→
→
b denotes [−
p := −
q ].
−
→
c c
By q 6∈ s1 ∪ FV(M ) and Lemma 16 (3), Hd
1 [F1 ] = H1 [F1 ].
−
→
−
→−
→
b (λ−
b )G
b.
→
→
c1 = λ−
F
g .b
xN
u .y L
→
→ −
−
→
0
−
→0 −
−
→0 −
b ,−
b ,→
b.
→
→
→
→
c1 , s0 = sb1 , −
We can let H 0 = H
g0=−
g ,N = N
u0 =−
u, L = L
G =G
x, y 6∈ s1 .
x
b, yb 6∈ sb1 .
s0 = sb1 .
x
b, yb 6∈ s0 .
d ] = Hd
c c
By H[F
1 [F1 ] = H1 [F1 ], we have the claim.
(2’) We will show P2 (n).
−
→ −
→
−
→−
→
−
→−
→
→
→
→
Choose z , q such that z q 6∈ FV(M ) ∪ s, −
z−
p−
q z q are distinct.
Since m < n, by IH, P1 (m) & P2 (m) & P3 (m) & (P1 (m) & P2 (m) & P3 (m) → P4 (m)). Hence P4 (m).
−
→−
→ →
→
→
→
→
→
By Lemma 2 (3), we can suppose −
g such that −
z−
p−
q z q 6∈ −
g . By Lemma 2 (3), we can suppose −
uj
−
→−
→−
j
∗
−
→
−
→
−
→
→
−
→
such that z p q z q g s 6∈ u . By applying P4 (m) twice, we can suppose x 6= y → AC(M , {y, uj }, m).
−
→−
→→j −
→
→
→
→
Moreover, by Lemma 2 (3), we can suppose −
v such that −
z−
p−
q z q−
u 6∈ →
v.
Let
−
→ →j ∗ −
→
→
F = λ−
g .x N (λ−
u .M ) G .
Let
−
→−
→
→
→
H1 = H[−
z−
q := z q |φ],
−
→−
→
→
→
s1 = s[−
z−
q := z q ],
−
→−
→
−
→
−
→
F1 = F [ z q := z q |s].
By Lemma 16 (2), we have HP(H1 , s1 ), H[F ] = H1 [F1 ].
→
→
s1 63 −
z−
q.
−
→−
→
→
→
denotes [−
z−
q := z q |s].
By x, y 6∈ s, x = x, y = y.
→
−
→ →j ∗ −
→
u .M ) G .
F1 = λ −
g .x N (λ−
→
→
b denotes [−
p := −
q ].
→
c c
By −
q 6∈ s1 and Lemma 16 (3), Hd
1 [F1 ] = H1 [F1 ].
−
→
−
→
b (λ−
b.
d∗ ) G
→
→
c = λ−
F
g .b
xN
u j .M
1
Case A. x 6= y & AC(M ∗ , {y, uj }, m) & n = m + 1.
Since m < n, by IH, P1 (m) & P2 (m) & P3 (m) & (P1 (m) & P2 (m) & P3 (m) → P4 (m)). Hence P4 (m).
−
→
→
p−
z 6∈ S.
10
→
→
By −
q 6∈ FV(M ), y 6∈ −
q.
−
→
−
→
−
→
Hence y 6∈ p q z .
b
y = y.
−
→ −
→ →j
→
→
→
→
By the choice of −
u j, −
p−
q−
z , q , z 6∈ −
u .
−
→
−
→
−
→
Hence uj 6∈ p q z .
ubj = uj .
−
→ −
→
→
→
By FV(M ∗ ) ⊆ FV(M ) ∪ −
uj ∪−
g ∪ s, we have q , z 6∈ FV(M ∗ ).
k
−
→
−
→
−
→
∗
By FV(M ) ⊆ FV(M ) ∪ u ∪ g ∪ s, we have q 6∈ FV(M ∗ ).
d∗ , {y, u }, m).
By applying P4 (m) twice to AC(M ∗ , {y, uj }, m), AC(M
j
−
→
→
→
Case B. x = y & M ∗ = λ−
v .uj L & uj 6∈ −
v & n = 1.
−
→
−
→0
d∗ = λ−
b , M ∗ 0 = λ−
→
→
v 0 .u0j L .
By M
v .uj L
→ −
→
→
j
−
→0 −
→0 −
−
→0 −
b ,→
d∗ , −
b ,−
b.
→
→
→
→
→
c1 , s0 = sb1 , −
g0=−
g ,N = N
We can let H 0 = H
u0 = −
u j , M ∗0 = M
G =G
v0=−
v,L = L
x, y 6∈ s1 .
x
b, yb 6∈ sb1 .
s0 = sb1 .
x
b, yb 6∈ s0 .
d ] = Hd
c c
H[F
1 [F1 ] = H1 [F1 ].
(3’) We will show P3 (n).
→
−
→−
→
−
→−
→
−
→ −
→
→
→
Choose z , q such that z q 6∈ FV(M ) ∪ s, −
z−
p−
q z q are distinct.
Since m < n, by IH, P1 (m) & P2 (m) & P3 (m) & (P1 (m) & P2 (m) & P3 (m) → P4 (m)). Hence P4 (m).
→
−
→−
→
→
→
→
→
g . Moreover, by Lemma 2 (3), we
By Lemma 2 (3), we can suppose −
g such that −
z−
p−
q z q 6∈ −
−
→−
→−
k
k
k
−
→
−
→
−
→
−
→
→
−
→
−
→
can suppose u such that z p q z q g s 6∈ u , uj 6∈ u j+1 . By applying P4 (m) twice, we can suppose
AC(M ∗ , {uj , uk }, m).
Let
−
→ →k ∗ −
→
→
F = λ−
g .x N (λ−
u .M ) G .
Let
−
→−
→
→
→
H1 = H[−
z−
q := z q |φ],
−
→
−
→
→
→
s1 = s[−
z−
q := z q ],
−
→−
→
−
→
→
F1 = F [ z −
q := z q |s].
By Lemma 16 (2), we have HP(H1 , s1 ), H[F ] = H1 [F1 ].
→
→
s1 63 −
z−
q.
−
→−
→
→
→
denotes [−
z−
q := z q |s].
By x 6∈ s, x = x.
−
→ →k ∗ −
→
→
F1 = λ −
g .x N (λ−
u .M ) G .
→
→
b denotes [−
p := −
q ].
−
→
−
→
c c
By p q 6∈ s1 and Lemma 16 (3), we have Hd
1 [F1 ] = H1 [F1 ].
−
→
−
→
b (λ−
d∗ ) G
b.
→
→
c = λ−
F
g .b
xN
u k .M
1
Since m < n, by IH, P1 (m) & P2 (m) & P3 (m) & (P1 (m) & P2 (m) & P3 (m) → P4 (m)). Hence P4 (m).
→ →k
−
→ −
→
→
→
→
u .
By the choice of −
u k , we have −
p−
q−
z , q , z 6∈ −
→
→
→
Hence uj , uk 6∈ −
p−
q−
z.
ck = uk .
ubj = uj , u
−
→ −
→
→
→
By FV(M ∗ ) ⊆ FV(M ) ∪ −
uk ∪−
g ∪ s, we have q , z 6∈ FV(M ∗ ).
k
−
→
−
→
−
→
By FV(M ∗ ) ⊆ FV(M ) ∪ u ∪ g ∪ s, q 6∈ FV(M ∗ ).
d∗ , {u , u }, m).
By applying P4 (m) twice to AC(M ∗ , {uj , uk }, m), AC(M
j
k
−
→
−
→
k
0
0
−
→
−
→
−
→
b , M ∗0 = M
b.
d∗ , G = G
→
→
→
c1 , −
u k, N = N
We can let H 0 = H
g0=−
g , u0 = −
x 6∈ s1 .
x
b 6∈ sb1 .
s0 = sb1 .
x
b 6∈ s0 .
11
d ] = Hd
c c
H[F
1 [F1 ] = H1 [F1 ].
(4’) We will show P1 (n) & P2 (n) & P3 (n) → P4 (n).
→
→
Assume AC(M, S, n). We will show AC(M [−
p := −
q ], S, n).
Cases are considered by AC(M, S, n).
−
→ → −
→−
→
→
→
→
Case 1. M = H[λ−
g .x N (λ−
u .y L ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u & n = 0.
→
→
→
By taking −
z to be empty in P1 (n), AC(M [−
p := −
q ], S, n).
−
→ →j ∗ −
→
→
→
→
Case 2. M = H[λ−
g .x N (λ−
u .M ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u j & (x 6=
−
→
∗
∗
−
→
−
→
y & AC(M , {y, uj }, m) & n = m + 1 ∨ x = y & M = λ v .uj L & uj 6∈ v & n = 1).
→
→
→
By taking −
z to be empty in P2 (n), AC(M [−
p := −
q ], S, n).
−
→ −
→
k
∗ −
−
→
→
→
→
Case 3. M = H[λ g .x N (λ u .M ) G ] & HP(H, s) & S = {x} & x 6∈ s ∪ −
g & j ≤ k & uj 6∈ −
u kj+1 &
∗
AC(M , {uj , uk }, m) & n = m + 2.
→
→
→
By taking −
z = φ in P3 (n), AC(M [−
p := −
q ], S, n). 2
−
→
→
→
→
→
→
→
Lemma 21 If p−
w are distinct, V is a finite set of variables, p−
w 6∈ −
q , P = λ−
w .p−
w (wi −
q ), (x N )[p :=
→
−
→ −
−
→
−
→ →
→
P ] →∗ M 0 nf, Ni [p := P ] →∗ Ni0 nf, then we have L , −
w 2 .x L , N 0 ∈ L ,
w 2 such that M 0 = λ−
−
→
w 2 6∈ V ∪ {x}.
Proof. Case 1. p 6= x.
→
−
→ −
→
We can let −
w 2 = φ, L = N 0 .
→ −
−
→ −
→
→
w 2 .x L , N 0 ∈ L .
M 0 = λ−
Case 2. p = x.
−
→
Let M = x N .
b denotes [p := P ].
−
→ −
→ −
→ → −
−
→
−
→ →
→
→
Let N = N 1 N 2 , −
w =→
w 1−
w 2 , | N 1 | = |−
w 1 |, | N 2 ||−
w 2 | = 0.
−
→ →
→
→
→
By Lemma 2 (3), we can suppose −
w such that −
w 6∈ N , −
w are distinct, −
w 6∈ V ∪ {x}.
−
→
−
→
−
→
0 −
0
∗ −
−
→
−
→
−
→
→
→
−
→
c
b
M = (λ w .x w (wi q )) N → λ w 2 .xN 1 w 2 (Wi q )N 2 , where Wi = wi or Ni0 .
→
By Lemma 10 (2), Wi −
q ∈ WN. Let its nf be Wi0 .
−
→
−
→
→
→
M 0 = λ−
w 2 .xN 0 1 −
w 2 Wi0 N 0 2 .
−
→
−
→
−
→
→
Let L = N 0 1 −
w 2 Wi0 N 0 2 .
−
→0 −
→0 −
→ −
→ →
−
→
−
→ −
→
By N ∈ N , N 0 ∈ N 0 1 −
w 2 W 0 N 0 2 . Hence N 0 ∈ L . 2
i
→
→
→
→
→
→
Proposition 22 If AC(M, {x, y}, n) (including x = y), p−
w are distinct, p−
w ∈
6 −
q , P = λ−
w .p−
w (wi −
q ),
∗
0
0
(including p ∈ {x, y}), M [p := P ] → M nf, then AC(M , {x, y}, n).
Proof.
b denotes [p := P ].
b →∗ E 0 nf. This term exists by Lemma 11.
E 0 denotes the term such that E
−
→
→
Choose q 1 such that they are distinct and it equals −
q as sets.
Induction on n.
−
→ → −
→−
→
→
→
→
Case 1. M = H[λ−
g .x N (λ−
u .y L ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u & n = 0.
−
→
−
→
−
→
−
→
−
→
→
→
By Lemma 20 (1) with letting z = p q 1 , p = q = φ, we can suppose x, y, p, q 6∈ s ∪ −
g ∪−
u.
Let
−
→ → −
→−
→
→
F1 = λ−
g .x N (λ−
u .y L ) G ,
−
→ −
−
→
−
→
F = x N (λ→
u .y L ) G ,
−
→
R = yL.
−
→ → −
→−
→
Fb = (x N (λ−
u .y L ) G )b.
−
→
−
→
→
→
→
b
(λ−
u .y L )b = λ−
u .(y L )b = λ−
u .R.
−
→
→
→
By taking V = φ in Lemma 21, we have R0 = λ−
r .y K , y 6∈ −
r.
−
→ −
−
→
0
−
→
→
By taking V = {y} in Lemma 21, we have F = λ w 2 .x Q , λ→
u .R0 ∈ Q , x, y 6∈ −
w 2.
−
→ −
−
→ −
→
0
−
→
−
→
→
−
→
F1 = λ g w 2 .x Q , λ u r .y K ∈ Q .
→
By Lemma 18 (2) and p, −
q 6∈ s, we have (H2 , s2 ) such that M 0 = H2 [F10 ], s2 ⊆ s ∪ {x, y}c .
c
By x, y 6∈ s ∪ {x, y} , we have x, y 6∈ s2 . By M 0 = H2 [F10 ], AC(M 0 , {x, y}, 0).
12
−
→ →j ∗ −
→
→
→
→
Case 2. M = H[λ−
g .x N (λ−
u .M ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u j & (x 6=
−
→
∗
∗
−
→
−
→
y & AC(M , {y, uj }, m) & n = m + 1 ∨ x = y & M = λ v .uj L & uj 6∈ v & n = 1).
→
→
→
→
→
→
→
By Lemma 20 (2) with letting −
z = p−
q 1, −
p = −
q = φ, we can suppose x, y, p, −
q 6∈ s ∪ −
g ∪−
u j,
j
−
→
−
→
−
→
−
→
p, q , y 6∈ u , p, q 6∈ v .
Let
−
→ →j ∗ −
→
→
F1 = λ−
g .x N (λ−
u .M ) G ,
−
→ →j ∗ −
→
F = x N (λ−
u .M ) G .
−
→ →j ∗ −
→
Fb = (x N (λ−
u .M ) G )b.
→
→
→
d∗ →∗ λ−
(λ−
u j .M ∗ )b = λ−
u j .M
u j .M ∗ 0 .
→
−
→ →j ∗ 0 −
→
→
w 2.
By taking V = {y} in Lemma 21, we have F 0 = λ−
w 2 .x Q , λ−
u .M ∈ Q , x, y 6∈ −
−
→
0
−
→
−
→
F1 = λ g w 2 .x Q .
Case A. AC(M ∗ , {y, uj }, m).
By IH, AC(M ∗ 0 , {y, uj }, m).
−
→
→
→
Case B. M ∗ = λ−
v .uj L & uj 6∈ −
v.
−
→
0
0
→
→
M ∗ = λ−
v .uj L & uj 6∈ −
v.
→
By taking V = {x, y} in Lemma 18 (2) and p, −
q 6∈ s, we have (H2 , s2 ) such that M 0 = H2 [F10 ],
s2 ⊆ s ∪ {x, y}c .
By x, y 6∈ s ∪ {x, y}c , x, y 6∈ s2 . By M 0 = H2 [F10 ], AC(M 0 , {x, y}, n).
−
→ →k ∗ −
→
→
→
→
Case 3. M = H[λ−
g .x N (λ−
u .M ) G ] & HP(H, s) & S = {x} & x 6∈ s ∪ −
g & j ≤ k & uj 6∈ −
u kj+1 &
∗
AC(M , {uj , uk }, m) & n = m + 2..
→
→
→
→
→
→
→
By Lemma 20 (3) with letting −
z = p−
q 1, −
p = −
q = φ, we can suppose x, p, −
q 6∈ s ∪ −
g ∪−
u k,
k
k
−
→
−
→
−
→
p, q 6∈ u , uj 6∈ u j+1 .
Let
−
→ →k ∗ −
→
→
F1 = λ−
g .x N (λ−
u .M ) G ,
−
→ −
−
→
F = x N (λ→
u k .M ∗ ) G .
−
→ →k ∗ −
→
Fb = (x N (λ−
u .M ) G )b.
k
k
∗
→
→
→
(λ−
u .M )b = λ−
u .(M ∗ )b →∗ λ−
u k .M ∗ 0 .
−
→ →k ∗ 0 −
→
→
→
By taking V = φ in Lemma 21, we have F 0 = λ−
w 2 .x Q , λ−
u .M ∈ Q , x 6∈ −
w 2.
−
→
0
−
→
−
→
F1 = λ g w 2 .x Q .
→
By taking V = {x} in Lemma 18 (2) and p, −
q 6∈ s, we have (H2 , s2 ) such that M 0 = H2 [F10 ],
c
s2 ⊆ s ∪ {x} .
By x 6∈ s ∪ {x}c , x 6∈ s2 . By M 0 = H2 [F10 ], AC(M 0 , {x, y}, n). 2
Lemma 23 If AC(M, S, n), HP(H 0 , s0 ), M 0 = H 0 [M ], S 6∈ s0 , then AC(M 0 , S, n).
Proof. Cases are considered according to AC(M, S, n).
−
→ → −
→−
→
→
→
→
Case 1. M = H[λ−
g .x N (λ−
u .y L ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u & n = 0.
0
0
Let H1 = H [H], s1 = s s.
By Lemma 7, HP(H1 , s1 ).
x, y 6∈ s1 .
AC(M 0 , S, n).
−
→ →j ∗ −
→
→
→
→
Case 2. M = H[λ−
g .x N (λ−
u .M ) G ] & HP(H, s) & S = {x, y} & x, y 6∈ s ∪ −
g & y 6∈ −
u j & (x 6=
−
→
∗
∗
−
→
−
→
y & AC(M , {y, uj }, m) & n = m + 1 ∨ x = y & M = λ v .uj L & uj 6∈ v & n = 1).
Let H1 = H 0 [H], s1 = s0 s.
By Lemma 7, HP(H1 , s1 ).
x, y 6∈ s1 .
AC(M 0 , S, n).
−
→ →k ∗ −
→
→
→
→
Case 3. M = H[λ−
g .x N (λ−
u .M ) G ] & HP(H, s) & S = {x} & x 6∈ s ∪ −
g & j ≤ k & uj 6∈ −
u kj+1 &
∗
AC(M , {uj , uk }, m) & n = m + 2.
Let H1 = H 0 [H], s1 = s0 s.
By Lemma 7, HP(H1 , s1 ).
x 6∈ s1 .
13
AC(M 0 , S, n). 2
The next proposition formalizes the lemma A13 of [1] by using pure lambda-calculus.
Proposition 24 (Lemma A13 of [1] in Pure Lambda-Calculus) If M nf, AC(M, S, l), we have
x, y ∈ S, X, Y nf such that M [x := X, y := Y ] 6∈ WN, X = Y for |S| = 1, x 6= y for |S| = 2.
Proof. Induction on l.
−
→m −
−
→i−1 −
→
→
→
g & n = 0, and
Case 1. M = H1 [λ−
g .x N
(λ→
u n .y N 0 ) G ] & HP(H1 , s1 ) & S = {x, y} & x, y 6∈ s1 ∪ −
moreover x 6= y. (p.485 Base.1)
−
→m
→
→
→
u n 6∈ s ∪ −
g.
By applying Lemma 2 (3) to λ−
u n .y N 0 , we can suppose x, y 6∈ −
Let
−
→m
−
→i−1 −
F = xN
(λ→
u n .y N 0 ),
−
→
→
F1 = λ −
g .F G .
→
→
→
→
Choose −
v i, −
w m w such that x−
v i are distinct, and y −
w m w are distinct.
Let
→
→
→
X = λ−
v i .x−
v i (vi −
u n ∆),
m
m
−
→
−
→
Y = λ w w.y w w(ww).
b denotes [x := X, y := Y ].
→
By taking V = φ in Lemma 18 (1), x, y, −
u n 6∈ s1 , and M = H1 [F1 ], we have (H 0 , s0 ) such that
∗
0
c → H [F
c1 ].
M
→m
→m
−
→n
−
→n →n −
−
→n −
→
By Lemma 2 (3), we can suppose u such that −
u n , x, y 6∈ u , λ−
u .y N 0 = λ u .y N 0 .
→m →n ∗ −
→m
−
→n −
(λ u .Y N 0 )−
u → Y N0 .
−
→
−
→
→
→
By Ni0 [x := X, y := Y ][ u := −
u ] = Ni0 [ u := −
u ][x := X, y := Y ] = Ni0 [x := X, y := Y ], we have
−
→m
−
→m
→m
→i−1 −
−
→i−1 −
n
n
c0 ) →∗ x−
c0 )(Y −
→
→
→
b (λ→
c0 ∆).
b (λ→
u .Y N
N
u .Y N
N
Fb = (λ−
v i .x−
v i (vi −
u n ∆)) N
−
→m
→
→
→
c0 , −
By Lemma 2 (3), we can suppose −
w such that −
w 6∈ N
w are distinct.
m
m
−
→m
−
→
−
→
m
m
∗
→
→
c0 ∆ = (λ−
c0 ∆ → y N
c0 ∆(∆∆).
YN
w w.y −
w w(ww))N
−
→m −
m
→
−
→i−1 −
n
c0 )(y N
b (λ→
c0 ∆(∆∆)).
Hence Fb →∗ x N
u .Y N
−
→m
→m
−
→i−1 −
−
→
n
c0 )(y −
→
→
→
b (λ→
c0 ∆(∆∆)) G
b.
By x, y, −
u 6∈ −
g , we have Fb1 →∗ λ−
g .x N
u .Y N
N
By letting
−
→m
→m
−
→i−1
−
→
c0 )(y −
→
→
→
b (λ−
c0 ∆[ ]) G
b ], s = s0 −
H = H 0 [λ−
g .x N
u n .Y N
N
g,
c →∗ H[∆∆].
we have HP(H, s), M
By Lemma 9 (2), H[∆∆] 6∈ WN.
c 6∈ WN.
By Lemma 3 (2), M
−
→m −
−
→i−1 −
→
→
→
Case 2. M = H1 [λ−
g .x N
(λ→
u n .y N 0 ) G ] & S = {x, y} & HP(H1 , s1 ) & x, y 6∈ s1 ∪ −
g & n = 0 and
moreover x = y. (p.485 Base.2)
−
→m
→
→
→
u n 6∈ s1 ∪ −
g.
By Lemma 2 (3) for λ−
u n .y N 0 , we can suppose x 6∈ −
Let
−
→m
−
→i−1 −
F = xN
(λ→
u n .xN 0 ),
−
→
→
F1 = λ−
g .F G .
Let
k = max(i, m + 1).
−
→m
→
→
→
→
Choose −
v k such that x−
v k are distinct, x−
vk∈
6 −
u n ∪ FV(N 0 ).
14
Let
→
→
→
X = λ−
v k .x−
v k (vm+1 vm+1 )(vi −
u n ∆).
b denotes [x := X].
→
By taking V = φ in Lemma 18 (1) and x, −
u n 6∈ s1 for M = H1 [F1 ], we have (H 0 , s0 ) such that
c →∗ H 0 [F
c1 ].
M
→m
−
→m →n
−
→n
−
→n −
−
→n
→
→
u n .xN 0 , −
u , x, −
v k 6∈ FV( u ).
By Lemma 2 (3), we can suppose u such that λ u .xN 0 = λ−
→
c−
→
Let Ňi = Ni0 [ u := −
u ].
−
→m
−
→i−1 −
n
c0 ) →∗
k
k
→
→
→
b (λ→
Fb = (λ−
v .x−
v (vm+1 vm+1 )(vi −
u n ∆)) N
u .X N
−
→m
−
→i−1 −
n
c0 )−
→
→
b (λ→
λ−
v ki+1 .x N
u .X N
v ki+1 (P P )(Q∆), where we take P, Q as follows: If i < m + 1, P = vm+1 . If
m
−
→
−
→m
−
→n c0
bm+1 . Q = X Ň .
. If i > m + 1, P = N
i = m + 1, P = λ u .X N
−
→m
−
→
v k 6∈ FV( Ň Q).
−
→m
−
→m →k
→
→
→
→
→
Q∆ = (λ−
v k .x−
v k (vm+1 vm+1 )(vi −
u n ∆)) Ň ∆ →∗ λ−
v km+2 .x Ň ∆−
v m+2 (∆∆)(R−
u n ∆)), where we
take i as follows: If i ≤ m, R = Ňi . If i = m + 1, R = ∆. If i > m + 1, R = vi .
By letting
−
→m →k
→
→
H2 = λ−
v km+2 .x Ň Q−
v m+2 [ ](R−
u n ∆),
we have Q∆ →∗ H2 [∆∆].
By Lemma 9 (2), H2 [∆∆] 6∈ WN.
By Lemma 3 (2), Q∆ 6∈ WN.
−
→m →
−
→i−1 −
n
c0 )−
→
c1
b (λ→
b
we
have
F
=
λ−
g .X N
u .X N
G
=
m −
−
→
i−1
→
−
→
n
−
→
c
k
k
n
→
→
→
→
b.
b (λ u .X N 0 ) G
λ−
g .(λ−
v .x−
v (vm+1 vm+1 )(vi −
u ∆)) N
−
→
−
→ −
→
−
→
−
→
k
→
→
→
→
→
b = G
b1G
b 2, | G
b 1 | = |−
b 2 ||−
r 1−
r 2, G
r 1 |, | G
r 2 | = 0, we have Fb1 →∗
By letting −
v i+1 = −
m −
−
→
−
→i−1 −
→
−
→
n
c0 ) G
→
→
→
b (λ→
b 1−
b 2.
λ−
g−
r 2 .x N
u .X N
r 2 (P P )(Q∆) G
We define H by
−
→m →
−
→
−
→i−1 −
n
c0 )−
→
→
→
b 1−
b 2 ],
b (λ→
u .X N
G
r 2 (P P )[ ] G
H = H 0 [λ−
g−
r 2 .x N
0−
→
−
→
s = s g r 2.
By
−
→
un
6∈
−
→
g,
c →∗ H[Q∆].
M
By Lemma 9 (2), H[Q∆] 6∈ WN.
c 6∈ WN.
By Lemma 3 (2), M
−
→i−1 →j ∗ −
→
→
→
→
Case 3. M = H1 [λ−
g .xM (λ−
u .M ) G ] & HP(H1 , s1 ) & S = {x, y} & x, y 6∈ s1 ∪ −
g & y 6∈ −
u j & (x 6=
−
→
∗
∗
−
→
−
→
y & AC(M , {y, uj }, m) & l = m + 1 ∨ x = y & M = λ v .uj L & uj 6∈ v & l = 1). (p.486 (i))
→
→
→
→
→
By taking −
z = FV(M ), −
p =−
q = φ in Lemma 20 (2), we can suppose x, y 6∈ −
u j 6∈ s1 ∪ FV(M ) ∪ −
g,
j
−
→
−
→
u 6∈ v .
→
x, y, −
u j 6∈ s1 .
Let
−
→i−1 →j ∗
F = xM (λ−
u .M ),
−
→
→
F1 = λ −
g .F G .
→
→
→
→
Choose −
w i such that −
w i x 6∈ −
u j, −
w i x are distinct.
Let
→
→
→
X 0 = λ−
w i .x−
w i (wi −
u j ).
e denotes [x := X 0 ].
e →∗ E 0 nf. By Lemma 11, such E 0 exists.
Let E
→
By taking V = {y, uj } in Lemma 18 (2) and x, y, −
u j 6∈ s1 , we have (H2 , s2 ) such that M 0 = H2 [F10 ],
f1 →∗ F 0 , y, uj 6∈ s2 .
F
1
15
−
→
→
f1 = λ−
e.
F
g .Fe G
−
→j
−
→j
−
→j
→
→
By Lemma 2 (3), we have ǔ , M̌ ∗ such that λ ǔ .M̌ ∗ = λ−
u j .M ∗ , −
u j , x, FV(M ∗ ) 6∈ ǔ .
ě →∗ E 00 nf. By Lemma 11, such E 00 exists.
Let E
−
→
−
→
−
→
ǧ∗ [ ǔ := −
→
→
→
g∗ .
M
u ] = M̌ ∗ [x := X 0 ][ ǔ := −
u ] = M̌ ∗ [ ǔ := −
u ][x := X 0 ] = M ∗ [x := X 0 ] = M
−
→j ǧ∗ −
j
g∗ .
(λ ǔ .M )→
u →∗ M
−
→i−1 −
→i−1 −
j
→j
ǧ∗ ) →∗ x−
f (λ→
Fe = X 0 M
ǔ .M
M 0 (λ ǔ .M ∗ 00 )M ∗ 0 .
−→i−1 −
−
→
→j
→
→
→
By −
u j 6∈ −
g , F10 = λ−
g .xM 0 (λ ǔ .M ∗ 00 )M ∗ 0 G0 .
By case analysis with Cases A, B, we will show AC(M 0 , {y, uj }, m).
Case A. AC(M ∗ , {y, uj }, m) & l = m + 1.
By Proposition 22, AC(M ∗ 0 , {y, uj }, m).
By Lemma 23 and y, uj 6∈ s2 , AC(M 0 , {y, uj }, m).
−
→
→
→
Case B. x = y & M ∗ = λ−
v .uj L & uj 6∈ −
v & l = 1.
−
→
0
∗0
−
→
M = λ v .uj L .
m = 0.
AC(M 0 , {y, uj }, m).
In both Cases A, B, AC(M 0 , {y, uj }, m).
By IH, we have Uj , Y such that M 0 [uj := Uj , y := Y ] 6∈ WN.
Let
X1 = X 0 [uj := Uj , y := Y ].
By Lemma 13, X1 ∈ WN. Let X1 →∗ X nf.
b denotes [x := X1 , y := Y ].
c=M
f[uj := Uj , y := Y ] →∗ M 0 [uj := Uj , y := Y ].
By uj 6∈ FV(M ), M
c 6∈ WN.
By Lemma 3 (2) and the fact that the right-hand side is not WN, M
∗
c
By Lemma 3 (1) and M → M [x := X, y := Y ], M [x := X, y := Y ] 6∈ WN.
−
→i−1 →k ∗ −
→
→
→
Case 4. M = H1 [λ−
g .xM (λ−
u .M ) G ] & S = {x} & HP(H1 , s1 ) & x 6∈ s1 ∪ −
g & j ≤ k & uj 6∈
k
∗
−
→
u j+1 & AC(M , {uj , uk }, m) & l = m + 2. (p.486 (iii))
→
→
→
→
→
By taking −
z = FV(M ), −
p =−
q = φ in Lemma 20 (3), we can suppose x 6∈ −
u k 6∈ s1 ∪ FV(M ) ∪ −
g,
k
−
→
uj 6∈ u j+1 .
→
→
→
→
Choose −
w i such that x−
w i 6∈ −
u k , x−
w i are distinct.
Let
−
→i−1 →k ∗
F = xM (λ−
u .M ),
−
→
−
→
F1 = λ g .F G .
Let
→
→
→
X 0 = λ−
w i .x−
w i (wi −
u k ).
e denotes [x := X 0 ].
e →∗ E 0 nf. By Lemma 11, such E 0 exists.
Let E
→
By taking V = {uj , uk } in Lemma 18 (2) and x, −
u k 6∈ s1 , we have (H2 , s2 ) such that M 0 = H2 [F10 ],
∗
0
f1 → F , uj , uk 6∈ s2 .
F
1
−
→
→
f1 = λ−
e.
F
g .Fe G
−
→k
−
→k
−
→k
→
→
By Lemma 2 (3), we have ǔ , M̌ ∗ such that λ ǔ .M̌ ∗ = λ−
u k .M ∗ , −
u k , x, FV(M ∗ ) 6∈ ǔ .
ě →∗ E 00 nf. By Lemma 11, such E 00 exists.
Let E
→
−
→
−
→
ǧ∗ [−
→
→
→
g∗ .
M
ǔ := −
u ] = M̌ ∗ [x := X 0 ][ ǔ := −
u ] = M̌ ∗ [ ǔ := −
u ][x := X 0 ] = M ∗ [x := X 0 ] = M
−
→k ǧ∗ −
k
∗ g
→
∗
(λ ǔ .M ) u → M .
−
→i−1 −
−→i−1 −
k ǧ
→k
∗ ) →∗ xM 0
f (λ→
Fe = X 0 M
ǔ .M
(λ ǔ .M ∗ 00 )M ∗ 0 .
−
→
−→i−1 −
→j
→
→
→
By x, −
u k 6∈ −
g , F 0 = λ−
g .xM 0 (λ ǔ .M ∗ 00 )M ∗ 0 G0 .
1
By Proposition 22, AC(M ∗ 0 , {uj , uk }, m).
16
By Lemma 23 and uj , uk 6∈ s2 , AC(M 0 , {uj , uk }, m).
By IH, we have Uj , Uk such that M 0 [uj := Uj , uk := Uk ] 6∈ WN.
Let
X1 = X 0 [uj := Uj , uk := Uk ].
By Lemma 13, X1 ∈ WN. Let X1 →∗ X nf.
b denotes [x := X1 ].
c=M
f[uj := Uj , uk := Uk ] →∗ M 0 [uj := Uj , uk := Uk ].
By uj , uk 6∈ FV(M ), M
c 6∈ WN.
By Lemma 3 (2) and the fact that the right-hand side is not WN, M
∗
c
By Lemma 3 (1), M → M [x := X], so M [x := X] 6∈ WN. 2
4
Pre-Lambda-Terms To Pure Lambda-Terms
Definition 25 We assume that α is an indicator, and M is a pre-lambda-term.
We denote the subterm of M at the position α by M |α .
We write αβ and α · β for concatenation of sequences. We write hn1 , n2 , . . . , nk i for the sequence
consisting of n1 , n2 , . . . , nk . ε denotes the empty sequence.
We define a context pair CP as follows.
([ ], φ) ∈ CP,
(λx.C, xs), (CM, s), (M C, s) ∈ CP if (C, s) ∈ CP.
(C, s) ∈ CP means that C is an ordinary context, and s is the sequence of variables that bind [ ] by C.
We call C a context.
We define an inner context pair DP as follows.
([ ], φ) ∈ DP,
(D[λx.[ ]]), sx), (D[M [ ]], s), (D[[ ]M ]), s) ∈ DP if (D, s) ∈ DP.
(D, s) ∈ DP means that D is an inner context, s is the sequence of variables that bind [ ] by D. We call
D an inner context.
We define (C 0 , s0 ) ≤n (C, s) as follows.
(C, s) ≤1 (λx.C, xs)
(C, s) ≤1 (CM, s),
(C, s) ≤1 (M C, s),
(C1 , s1 ) ≤1 . . . ≤1 (Cn , sn ) implies (C1 , s1 ) ≤n−1 (Cn , sn ) for n ≥ 1.
We define (D0 , s0 ) ≤n (D, s) as follows.
(D, s) ≤1 (D[λx.[ ]], sx),
(D, s) ≤1 (D[M [ ]], s),
(D, s) ≤1 (D[[ ]M ], s),
(D1 , s1 ) ≤1 . . . ≤1 (Dn , sn ) implies (D1 , s1 ) ≤n−1 (Dn , sn ) for n ≥ 1.
Lemma 26 We assume a pre lambda term M , M |α = F , a set of variables S ⊆ FV(F ). We also assume
that every variable occurrence of S in F is free also in M . Then we have a context pair (C, s) such that
bM c = C[bF c], S 6∈ s.
Proof. Induction on α.
Case 1. α = ε.
M = F.
We can let C = [ ], s = φ.
Case 2. α = h0iα1 and M = λx.M1 .
By IH, we have C1 , s1 such that bM1 c = C1 [bF c], S 6∈ s1 .
We can let C = λx.C1 , s = xs1 .
Since free occurrences of S are not bound, x 6∈ S. Hence S 6∈ xs1 .
17
Case 3. α = h0iα1 and M = M1 N .
By IH, we have C1 , s1 such that bM1 c = C1 [bF c], S 6∈ s1 .
We can let C = C1 N, s = s1 .
Case 4. α = h1iα1 and M = N M1 .
By IH, we have C1 , s1 such that bM1 c = C1 [bF c], S ∈
6 s1 .
We can let C = N C1 , s = s1 . 2
Lemma 27 (1) For (D, s), (C, r), if (C 0 , s0 ) ≤n (C, s), we have (D0 , r0 ) such that (D[C], rs) =
(D0 [C 0 ], r0 s0 ).
(2) For (C, s), we have D such that (C, s) = (D, s).
Proof.
(1) Induction on n.
Case 1. n = 0.
We can let D0 = D, s0 = s.
Case 2. n > 0.
Let (C 0 , s0 ) ≤n−1 ≤ (C1 , s1 ) ≤1 C.
Cases are considered according to (C1 , s1 ) ≤1 (C, s).
Case 2.1. C = λx.C1 , s = xs1 .
(D[C], rs) = (D[λx.C1 ], rs).
Let (D1 , r1 ) = (D[λx.[ ]], rx).
(D[C], rs) = (D1 [C1 ], r1 s1 ). The part for variable sequences follows from rs = rxs1 = r1 s1 .
By IH for (C 0 , s0 ) ≤n−1 ≤ (C1 , s1 ), we have (D0 , r0 ) such that (D1 [C1 ], r1 s1 ) = (D0 [C 0 ], r0 s0 ).
Hence (D[C], rs) = (D0 [C 0 ], r0 s0 ).
Case 2.2. (C, s) = (C1 M, s1 ).
(D[C], rs) = (D[C1 M ], rs).
Let (D1 , r1 ) = (D[[ ]M ], r).
(D[C], rs) = (D1 [C1 ], r1 s1 ). The part for variable sequences follows from r = r1 , s = s1 .
By IH for C 0 ≤n−1 ≤ C1 , we have (D0 , r0 ) such that (D1 [C1 ], r1 s1 ) = (D0 [C 0 ], r0 s0 ).
Hence (D[C], rs) = (D0 [C 0 ], r0 s0 ).
Case 2.3. (C, s) = (M C1 , s1 ).
(D[C], rs) = (D[M C1 ], rs1 ).
Let (D1 , r1 ) = (D[M [ ]], r).
(D[C], rs) = (D1 [C1 ], r1 s1 ).
By IH for (C 0 , s0 ) ≤n−1 (C1 , s1 ), we have (D0 , r0 ) such that (D1 [C1 ], r1 s1 ) = (D0 [C 0 ], r0 s0 ).
Hence (D[C], rs) = (D0 [C 0 ], r0 s0 ).
(2) By (1) with (D, r) = ([ ], φ), (C 0 , s0 ) = ([ ], φ), we have (D0 , r0 ) such that (C, s) = (D0 , r0 ).
We can let (D, r) = (D0 , r0 ).
r0 = s.
(C, s) = (D, s). 2
−
→
−
→
Lemma 28 (1) If D[M ] nf, (D, r) ∈ DP, we have (D0 , r0 ) ∈ DP, G such that D[M ] = D0 [M G ], r = r0
0
and D 6= D1 [[ ]G].
→
→
→
(2) If D[M ] nf, (D, r) ∈ DP, we have (D0 , r0 ) ∈ DP, −
g such that D[M ] = D0 [λ−
g .M ], r = r0 −
g,
0
0
−
→
D 6= D1 [λg.[ ]], and g = φ implies D = D.
−
→ →
−
→
→
→
(3) If D[M ] nf, (D, r) ∈ DP, we have (D0 , r0 ) ∈ DP, G , −
g such that D[M ] = D0 [λ−
g .M G ], r = r0 −
g,
0
0
−
→
and (a) D 6= D1 [λg.[ ]], (b) g = φ implies D 6= D1 [[ ]G].
Proof.
(1) Induction on D.
Case 1. D = [ ], or D = D1 [λx.[ ]], or D = D1 [G[ ]].
−
→
We can let D0 = D, r0 = r, G = φ.
−
→
0
0
D[M ] = D [M G ], r = r and D0 6= D1 [[ ]G].
Case 2. D = D1 [[ ]G].
−
→
−
→
→
By IH, we have (D0 , r0 ), G 1 such that D1 [M G] = D0 [M G G 1 ], r1 = r0 −
g.
−
→
−
→
0
0
We can let D = D , r = r , G = G G 1 .
18
−
→
D[M ] = D0 [M G ], r = r0 and D0 6= D1 [[ ]G].
(2) Induction on D.
Case 1. D = [ ], r = φ, or D = D1 [[ ]G], r = r1 , or D = D1 [G[ ]], r = r1 .
→
We can let D0 = D, r0 = r, −
g = φ.
0 −
0−
→
→
D[M ] = D [λ g .M ], r = r g and D0 6= D1 [λg.[ ]].
Case 2. D = D1 [λg.[ ]], r = r1 g.
→
→
→
By IH, we have (D0 , r0 ), −
g 1 such that D1 [λg.M ] = D0 [λ−
g 1 g.M ], r1 = r0 −
g 1.
0
0 −
→
−
→
We can let D = D , r = r g, g = g 1 g.
→
→
D[M ] = D0 [λ−
g .M ], r = r0 −
g and D0 6= D1 [λg.[ ]].
−
→
−
→
(3) By (1), we have (D1 , r1 ), G such that D[M ] = D1 [M G ], r = r1 , D1 6= D10 [[ ]G].
−
→
−
→
−
→
→
→
→
By (2) for D1 [M G ], we have (D0 , r0 ), −
g such that D1 [M G ] = D0 [λ−
g .M G ], r1 = r0 −
g , D0 6= D10 [λg.G],
0
→
and −
g = φ implies D1 = D .
By D0 6= D10 [λg.G], we have (a).
→
In the case −
g = φ. D0 = D1 . D0 6= D10 [[ ]G].
We have (b). 2
Lemma 29 (1) For (D, r), (C, r), if (D0 , r0 ) ≤n (D, r), then we have (C 0 , s0 ) such that (D[C], rs) =
(D0 [C 0 ], r0 s0 ).
(2) For (D, r), we have C such that (C, r) = (D, r).
Proof.
(1) Induction on n.
Case 1. n = 0.
We can let C 0 = C, s0 = s.
Case 2. n > 0.
Let (D0 , r0 ) ≤n−1 ≤ (D1 , r1 ) ≤1 (D, r).
Cases are considered according to (D1 , r1 ) ≤1 (D, r).
Case 2.1. D = D1 [λx.[ ]], r = r1 x.
D[C] = D1 [λx.C].
Let (C1 , s1 ) = (λx.C, xs).
(D[C], rs) = (D1 [C1 ], r1 s1 ).
By IH for (D0 , r0 ) ≤n−1 (D1 , r1 ), we have (D0 , r0 ) such that (D1 [C1 ], r1 s1 ) = (D0 [C 0 ], r0 s0 ).
Hence (D[C], rs) = (D0 [C 0 ], r0 s0 ).
Case 2.2. D = D1 [[ ]M ], r = r1 .
D[C] = D1 [CM ].
Let (C1 , s1 ) = (CM, s).
(D[C], rs) = (D1 [C1 ], r1 s1 ).
By IH for (D0 , r0 ) ≤n−1 ≤ (D1 , r1 ), we have (C 0 , r0 ) such that (D1 [C1 ], r1 s1 ) = (D0 [C 0 ], r0 s0 ).
Hence (D[C], rs) = (D0 [C 0 ], r0 s0 ).
Case 2.3. D = D1 [M [ ]], r = r1 .
D[C] = D1 [M C].
Let (C1 , s1 ) = (M C, s).
D[C] = D1 [C1 ].
By IH for (D0 , s0 ) ≤n−1 ≤ (D1 , s1 ), we have (C 0 , s0 ) such that (D1 [C1 ], r1 s1 ) = (D0 [C 0 ], r0 s0 ).
Hence (D[C], rs) = (D0 [C 0 ], r0 s0 ).
(2) By (1) with (C, s) = ([ ], φ), (D0 , r0 ) = ([ ], φ), we have (C 0 , s0 ) such that (D, r) = (C 0 , s0 ).
We can let C = C 0 .
(C, r) = (D, r). 2
−
→
−
→
Lemma 30 If M N nf, we have z, M such that M = z M .
Proof. Induction on M .
Case 1. M = z.
−
→
We can let M = φ.
−
→
M = zM .
Case 2. M = λx.M1 .
19
By M N nf, it is not the case.
Case 3. M = M1 M2 .
−
→
By M1 M2 nf and IH for M1 , M1 = z M 1 .
−
→
M = z M 1 M2 .
−
→ −
→
Let M = M 1 M2 .
−
→
M = zM . 2
→
→
Lemma 31 We assume C[λ−
g .L] nf, (C, s) ∈ CP, (a) C 0 6= C1 [λg.[ ]], and (b) −
g = φ implies C 0 6=
C1 [[ ]G]. Then (C, s) ∈ HP.
Proof.
→
Let F = λ−
g .L.
Induction on (C, s).
Case 1. C = [ ], s = φ.
The claim holds.
Case 2. C = λx.C1 , s = xs1 .
By C[F ] nf, C1 [F ] nf.
By (a)(b) for C, we have (a)(b) for C1 .
By IH, (C1 , s1 ) ∈ HP.
Cases are considered according to (C1 , s1 ) ∈ HP.
Case 2.1. C1 = [ ], s1 = φ.
By (a) it is not the case.
−
→ −
→
→
→
Case 2.2. C1 = λ−
x .y P H Q , s1 = −
x r, (H, r) ∈ HP.
−
→ −
→ −
−
→
→
(C, s) = (λx x .y P H Q , x x r).
(C, s) ∈ HP.
Case 3. C = N C1 , s = s1 .
−
→
−
→
By C[F ] = N C1 [F ] nf and Lemma 30, we have z, N such that N = z N .
By IH, (C1 , s1 ) ∈ HP.
−
→
(C, s) = (z N C1 , s1 ).
(C, r) ∈ HP.
Case 4. C = C1 N, s = s1 .
By IH, (C1 , s1 ) ∈ HP.
Cases are considered according to (C1 , s1 ) ∈ HP.
Case 4.1. C1 = [ ], s1 = φ.
C = [ ]N .
→
→
C[λ−
g .L] = (λ−
g .L)N .
−
→
→
By (λ g .L)N nf, −
g = φ.
By (b), it is not the case.
−
→ −
→
→
→
Case 2.2. C1 = λ−
x .y P H Q , s1 = −
x r.
−
→
−
→
−
→
C[F ] = (λ x .y P H[F ] Q )N .
−
→
−
→
→
→
By (λ−
x .y P H[F ] Q )N nf, −
x = φ.
−
→ −
→
(C, s) = (y P H Q N, r).
(C, s) ∈ HP. 2
Lemma 32 We assume a normal pre-term M , M |α = F , a set of variables S ⊆ FV(F ). We also
−
→
→
assume that free occurrences of S in F is free also in M . Then we have (H, r) ∈ HP, −
g , G such that
−
→
→
→
bM c = H[λ−
g .bF c G ], S 6∈ r ∪ −
g.
Proof.
Let M 0 = bM c and F 0 = bF c.
By Lemma 26, we have (C, s) ∈ CP such that M 0 = C[F 0 ], S 6∈ s.
By Lemma 27 (2), we have D such that (C, s) = (D, s). By D[F 0 ] nf, (D, s) ∈ DP and Lemma 28
−
→ →
−
→
→
→
(3), we have (D0 , r0 ) ∈ DP, G , −
g such that D[F 0 ] = D0 [λ−
g .F 0 G ], s = r0 −
g , and (a) D0 6= D1 [λg.[ ]], (b)
0
−
→
g = φ implies D 6= D1 [[ ]G].
By Lemma 29 (2), we have C 0 such that (D0 , r0 ) = (C 0 , r0 ).
−
→
→
→
→
We have C[F 0 ] = C 0 [λ−
g .F 0 G ], s = r0 −
g , and (a) C 0 6= C1 [λg.[ ]], (b) −
g = φ implies C 0 6= C1 [[ ]G].
20
Proof of (a): Assume C 0 = C1 [λg.[ ]]. By Lemma 27 (2), we have D1 = C1 such that D1 . Since
→
C = D0 , D0 = D1 [λg.[ ]], which contradicts with the above (a). Proof of (b): Assume −
g = φ. Assume
0
0
0
0
C = C1 [[ ]G]. By Lemma 27 (2), we have D1 = C1 such that D1 . Since C = D , D = D1 [[ ]G], which
contradicts with the above (b).
By Lemma 31, (C 0 , r0 ) ∈ HP.
Let (H, r) = (C 0 , r0 ).
−
→
→
By M 0 = C[F 0 ], M 0 = H[λ−
g .F 0 G ].
0
0−
→
→
By r = r , s = r g , S 6∈ s, we have S 6∈ r ∪ −
g. 2
0
5
Adjacent Control Paths for Pre Lambda Terms
Definition 33 For indicators α, β, we define α ≤ β as follows.
∃γ(αγ = β).
For a pre-lambda-term M , indicators α, β, we define α <M β as follows.
∃γ(M |γ = app & γh0i ≤ α & γh1i ≤ β).
For a pre-lambda-term M and an indicator α, α ≤ β means that the indicator α is an initial segment of
β. α <M β means that M |α appears to the left of M |β .
We write Control1(M, α, β) for saying that M |α , M |β are variables, and M |α ;1 M |β in M .
We define Adjacent(M, α, β) in a similar way.
We define ControlPath(M, hα1 , . . . , αn i) by Control1(M, M |αi , M |αi+1 ) (1 ≤ i < n).
We define βα − β = α.
−
→n
Lemma 34 Assume Control1(M, α, β), M |γ = x N .
(1) If α ≥ γh0i 1i, then β ≥ γh0i 1i.
(2) If β ≥ γh0i 1i, then α ≥ γh0i 1i or α = γh0n i.
Proof. (1) By definition of Control1.
By α ≥ γh0i 1i, M 1 ≥ γh0i 1i. Hence β ≥ γh0i 1i.
(2) By definition of Control1.
By β ≥ γh0i 1i, we have M 1 = γ or M 1 ≥ γh0i 1i. In the first case, α = γh0n i. In the second case,
α ≥ γh0i 1i. 2
−
→n
Lemma 35 Assume Adjacent(M, α, β), M |γ = x N .
(1) If α ≥ γh0i 1i, then β ≥ γh0i 1i.
(2) If β ≥ γh0i 1i, then α ≥ γh0i 1i or α = γh0n i.
Proof. (1) By definition of Adjacent.
By α ≥ γh0i 1i, M 1 ≥ γh0i 1i. Hence β ≥ γh0i 1i.
(2) By definition of Adjacent.
By β ≥ γh0i 1i, we have M 1 = γ or M 1 ≥ γh0i 1i. In the first case, α = γh0n i. In the second case,
α ≥ γh0i 1i. 2
−
→n
→
Lemma 36 Assume ControlPath(M, −
α n ), M |γ = x N .
i
i
(1) If α1 ≥ γh0 1i, then αn ≥ γh0 1i.
(2) If αn ≥ γh0i 1i, then we have α1 ≥ γh0i 1i or ∃j(αj = γh0n i).
Proof. (1) Induction on n. Lemma 34 (1) applies.
(2) Induction on n. Lemma 34 (2) applies. 2
Lemma 37 (1) If α ≥ β ≥ γ, then α ≥ γ.
(2) If α ≥ β, α ≥ γ, |β| ≥ |γ|, then β ≥ γ.
21
Proof. (1) By α = ββ 0 , β = γγ 0 , we have α = γγ 0 β.
(2) α = ββ 0 . α = γγ 0 .
ββ 0 = γγ 0 .
β ≥ γ or β < γ.
If we assume β < γ, we have |β| < |γ|, which contradicts.
Hence β ≥ γ. 2
Lemma 38 α1 <M α2 <M α3 implies α1 <M α3 .
Proof. By α1 <M α2 , we have γ1 such that M |γ1 = app, α1 ≥ γ1 h0i, α2 ≥ γ1 h1i.
By α2 <M α3 , we have γ2 such that M |γ2 = app, α2 ≥ γ2 h0i, α3 ≥ γ2 h1i.
Let γ be the shortest one among γ1 , γ2 .
By case analysis with γ1 , γ2 , we will show M |γ = app, α1 ≥ γh0i, α3 ≥ γh1i.
Case 1. γ1 ≤ γ2 .
γ = γ1 .
α1 ≥ γh0i.
α2 ≥ γh1i, γ2 h0i.
By |γh1i| ≤ |γ2 h0i| and Lemma 37 (2), γh1i ≤ γ2 .
By α3 ≥ γ2 h1i ≥ γ2 ≥ γh1i, Lemma 37 (1), we have α3 ≥ γh1i.
Case 2. γ1 > γ2 .
γ = γ2 .
α3 ≥ γh1i.
α2 ≥ γh0i, γ1 h1i.
By |γh0i| ≤ |γ1 h1i| and Lemma 37 (2), γh0i ≤ γ1
By α1 ≥ γ1 h0i ≥ γ1 ≥ γh0i, Lemma 37 (1), we have α1 ≥ γh0i. 2
Lemma 39 (1) Control1(M, α, β) implies α <M β.
(2) If αi <M αi+1 (1 ≤ i < n), α1 , αn ≥ β, then αi ≥ β (1 ≤ i ≤ n).
→
(3) If ControlPath(M, −
α n ), α1 , αn ≥ β, then αi ≥ β (1 ≤ i ≤ n).
−
→
(4) ControlPath(M, α ) implies α1 <M αn .
(5) If Control1(M, α, β), α, β ≥ γ, then Control1(M |γ , α − γ, β − γ).
−−−→n
→
(6) If ControlPath(M, −
α n ), α1 , αn ≥ β, then ControlPath(M |β , α − β ).
Proof.
(1) By the definition of Control1, we have α ≥ M 1h0i, β ≥ M 1h1i.
(2) By αi <M αi+1 , we have γi such that αi ≥ γi h0i, αi+1 ≥ γi h1i.
Let γk be the shortest one among γi .
We have (∀i > k)(αi ≥ γk h1i). Proof: Induction on i − k. Case 1. i = k + 1. The claim holds. Case
2. i > k + 1. By IH, αi−1 ≥ γk h1i. αi−1 ≥ γi−1 h0i. By |γk h1i| ≤ |γi−1 h0i| and Lemma 37 (2), we have
γk h1i ≤ γi−1 . By αi ≥ γi−1 h1i ≥ γi−1 ≥ γk h1i and Lemma 37 (1), we have αi ≥ γk h1i.
Hence αn ≥ γk h1i.
We have (∀i ≤ k)(αi ≥ γk h0i). Proof: Induction on k − i. Case 1. k = i. The claim holds. Case
2. k − i > 0. By IH, αi+1 ≥ γk h0i. αi+1 ≥ γi h1i. By |γk h0i| ≤ |γi h1i| and Lemma 37 (2), we have
γk h0i ≤ γi . By αi ≥ γi h0i ≥ γi ≥ γk h0i and Lemma 37 (1), we have αi ≥ γk h0i.
Hence α1 ≥ γk h0i.
Case A. |β| ≤ |γk |.
By α1 ≥ γk , α1 ≥ β, Lemma 37 (2), we have β ≤ γk .
αi ≥ γi h0i ≥ γi ≥ γk ≥ β.
By Lemma 37 (1), αi ≥ β.
Case B. |β| > |γk |.
By Lemma 37 (2), α1 ≥ γk h0i, α1 ≥ β, we have β ≥ γk h0i.
By Lemma 37 (2), αn ≥ γk h1i, αn ≥ β, we have β ≥ γk h1i.
Contradiction. It is not the case.
(3) By the definition of ControlPath, Control1(M, αi , αi+1 ) (1 ≤ i < n).
By (1), αi <M αi+1 (1 ≤ i < n).
By (2) and α1 , αn ≥ β, we have αi ≥ β (1 ≤ i < n).
22
(4) By the definition of ControlPath, Control1(M, αi , αi+1 ) (1 ≤ i < n).
By (1), αi <M αi+1 .
By Lemma 38 and induction on n, α1 <M αn .
(5) By the definition of Control1.
(6) By (3), αi ≥ β (1 < i < n).
By the definition of ControlPath, Control1(M, αi , αi+1 ).
By (5), Control1(M |β , αi − β, αi+1 − β).
−−−→n
By the definition of ControlPath, ControlPath(M |β , α − β ). 2
Lemma 40 For a pre-term M nf, x ; z, y ; q adjacent control paths in M , by taking n = |x ;
z| + |y ; q|, we have AC(bM c, {x, y}, n).
Proof.
Suppose that the positions of x, y, z, q in M be denoted by indicators X, Y, Z, Q.
We
have
ControlPath(M, hX, . . . , Zi),
ControlPath(M, hY, . . . , Qi),
Adjacent(M, Z, Q),
|hX, . . . , Zi)| + |hY, . . . , Qi| = n.
Induction on n.
Case 1. n = 0.
X = Z, Y = Q.
−
→ → −
→
M ⊇ x N (λ−
u .y L ), and these occurrences x, y are free in M .
−
→ → −
→ −
→
→
→
By Lemma 32, we have bM c = H[λ−
g .bx N (λ−
u .y L )c G ] & HP(H, s) & x, y 6∈ s ∪ −
g.
Hence AC(bM c, {x, y}, n).
Case 2. n > 0.
Case 2.1. X = Y (x, y are the same).
Case 2.1.1. (A) X = Z or (B) X = Q.
(A) |x ; q| > 0 or (B) |x ; z| > 0.
Let (A) ControlPath(M, hX, Uj , . . . , Qi) or (B) ControlPath(M, hX, Uj , . . . , Zi).
−
→ →j ∗
We have M ⊇ x N (λ−
u .M ).
Let M |A = M ∗ .
Remark that Z ≥ A means that z appears in M ∗ .
By Lemma 36 (1), and (A) ControlPath(M, hUj , . . . , Qi) or (B) ControlPath(M, hUj , . . . , Zi), we have
(A) Q ≥ A or (B) Z ≥ A.
(A) Adjacent(M, X, Q) or (B) Adjacent(M, Z, X).
−
→
→
→
In the case (A). By the definition of adjacent occurrences, M ∗ = λ−
v .uj L , uj 6∈ −
v , n = 1.
In the case (B). By Lemma 35 (1), X ≥ A. X <M A, which contradicts. It is not the case.
−
→ →j ∗ −
→
→
→
→
By Lemma 32, bM c = H[λ−
g .b N (λ−
u .M )c G ] & HP(H, s) & x, y 6∈ s ∪ −
g & y 6∈ −
u j.
Hence AC(bM c, {x, y}, n).
Case 2.1.2. |x ; z| > 0 and |x ; q| > 0.
Let x ;1 u, x ;1 uk . Let λu be the same as or to the left of λuk .
Let (A) ControlPath(M, hX, Uk , . . . , Qi), ControlPath(M, hX, U, . . . , Zi), or
(B) ControlPath(M, hX, Uk , . . . , Zi), ControlPath(M, hX, U, . . . , Qi).
0
−
→n
By the definition of Control1, M |α = x L , X = αh0n i, Uk ≥ αh0p 1i, U ≥ αh0p 1i.
0
By Lemma 36 (1), (A) Q ≥ αh0p 1i, Z ≥ αh0p 1i, or
0
(B) Z ≥ αh0p 1i, Q ≥ αh0p 1i.
By Lemma 35 (1), p = p0 .
→
Let M |αh0p 1i = λ−
u k .M ∗ .
→
u∈−
u k.
Let u = uj , j ≤ k. Let U = Uj .
Let the indicator of M ∗ be A.
Uk , Uj ≥ A.
Let (A) m = |hUj , . . . , Zi| + |hUk , . . . , Qi|, or (B) m = |hUj , . . . , Qi| + |hUk , . . . , Zi|.
n = m + 2.
By Lemma 39 (6), we have
(A) ControlPath(M ∗ , hUk − A, . . . , Q − Ai), ControlPath(M ∗ , hUj − A, . . . , Z − Ai), or
(B) ControlPath(M ∗ , hUk − A, . . . , Z − Ai), ControlPath(M ∗ , hUj − A, . . . , Q − Ai).
23
In M ∗ , we have two cases: (A) uj ; z, uk ; q. Or (B) uj ; q, uk ; z. By IH for m to it,
AC(bM ∗ c, {uj , uk }, m).
−
→ →k ∗ −
→
→
→
By Lemma 32, bM c = H[λ−
g .bx N (λ−
u .M )c G ] & HP(H, s) & x 6∈ s ∪ −
g.
Hence AC(bM c, {x, y}, n).
Case 2.2. X 6= Y (x, y are different occurrences).
Case 2.2.1. X <M Y .
We have |x ; z| > 0. Proof: Assume |x ; z| = 0. X = Z. |y ; q| > 0. Let y ;1 uj . We have an
−
→ →j ∗
indicator L such that Z ≥ Lh0i, Y ≥ Lh1i. M |Lh1i ⊇ y M (λ−
u .M ). Let the indicator of M ∗ in M be
A. Uj ≥ A. By Lemma 36 (1) for ControlPath(M, hUj , . . . , Qi), we have Q ≥ A. By Adjacent(M, Z, Q)
and Lemma 35 (2), we have Z = Y or Z ≥ A. In the first case, Z ≥ Lh1i. In the second case, by
Z ≥ A ≥ Lh1i and Lemma 38, we have Z ≥ Lh1i. In both cases, we have Z ≥ Lh1i, which contradicts
with Z ≥ Lh0i. Hence |x ; z| > 0.
Let x ;1 uj .
−
→ →j ∗
Let M ⊇ x N (λ−
u .M ). Let the indicator of M ∗ , uj be A, Uj .
ControlPath(M, hX, Uj , . . . , Zi).
Uj ≥ A.
By applying Lemma 36 (1) to ControlPath(M, hUj , . . . , Zi), Z ≥ A.
By Lemma 35 (1) and Adjacent(M, Z, Q), Q ≥ A.
By Lemma 36 (2), we have Y ≥ A or ControlPath(M, hY, . . . , Xi).
If ControlPath(M, hY, . . . , Xi) holds, by Lemma 39 (4), we have Y <M X, which contradicts with
X <M Y .
Hence Y ≥ A.
Let m = |hUj , . . . , Zi| + |hY, . . . , Qi|.
n = m + 1.
By Lemma 39 (6), we have ControlPath(M ∗ , hUj − A, . . . , Z − Ai), ControlPath(M ∗ , hY − A, . . . , Q −
Ai).
By applying IH for m to uj ; z, y ; q in M ∗ , we have AC(bM ∗ c, {uj , y}, m).
−
→ →j ∗ −
→
→
→
→
By Lemma 32, bM c = H[λ−
g .bx N (λ−
u .M )c G ] & HP(H, s) & x, y 6∈ s ∪ −
g & y 6∈ −
u j.
Hence AC(bM c, {x, y}, n).
Case 2.2.2. Y <M X.
We have |y ; q| > 0. Proof: By Adjacent(M, Z, Q), Z <M Q. By ControlPath(M, hX, . . . , Zi) and
Lemma 39 (4), X <M Z. By Lemma 38 and Y <M X <M Z <M Q, we have Y <M Q. Y 6= Q. We
have |y ; q| > 0.
Let y ;1 uj .
−
→ →j ∗
Let M ⊇ y N (λ−
u .M ).
Let indicators of M ∗ , uj in M be A, Uj .
ControlPath(M, hY, Uj , . . . , Qi).
Uj ≥ A.
By Lemma 36 (1) for ControlPath(M, hUj , . . . , Qi), Q ≥ A.
By Lemma 35 (2) and Adjacent(M, Z, Q), we have Z = Y or Z ≥ A.
By Lemma 36 (1) and ControlPath(M, hX, . . . , Zi), X <M Z.
By Y <M X <M Z and Lemma 38, Y <M Z. Y 6= Z.
Hence Z ≥ A.
By Lemma 36 (2) and ControlPath(M, hX, . . . , Zi), we have X ≥ A or ControlPath(M, hX, . . . , Y i).
If ControlPath(M, hX, . . . , Y i), by Lemma 39 (4) we have X <M Y , which contradicts with Y <M X.
Hence X ≥ A.
Let m = |x ; z| + |uj ; q|.
n = m + 1.
By Lemma 39 (6), we have ControlPath(M ∗ , hX − A, . . . , Z − Ai), ControlPath(M ∗ , hUj − A, . . . , Q −
Ai).
By IH for m to x ; z, uj ; q in M ∗ , AC(bM ∗ c, {x, uj }, m).
−
→ →j ∗ −
→
→
→
→
By Lemma 32, bM c = H[λ−
g .by N (λ−
u .M )c G ] & HP(H, s) & x, y 6∈ s ∪ −
g & y 6∈ −
u j.
Hence AC(bM c, {x, y}, n). 2
The next lemma formalizes the lemma A13 of [1] by using the pre-lambda-calculus.
24
Lemma 41 (Lemma A13 of [1] in Pre-Lambda-Calclus) If M nf, x ; z, y ; q adjacent control
paths in M , then we have X, Y nf such that M [x := X, y := Y ] 6∈ WN. (in the case x = y, the claim is
M [x := X] 6∈ WN.)
Proof. Let n = |x ; z| + |y ; q|.
By Lemma 40, AC(bM c, {x, y}, n).
Let S = {x, y}.
By Proposition 24, we have x0 , y 0 ∈ S, X 0 , Y 0 nf such that M [x0 := X 0 , y 0 := Y 0 ] 6∈ WN, and X 0 = Y 0
for |S| = 1, x0 6= y 0 for |S| = 2.
In the case x 6= y. |S| = 2. x0 6= y 0 . (x, y) = (x0 , y 0 ) or (x, y) = (y 0 , x0 ). If (x, y) = (x0 , y 0 ), we can let
X = X 0 , Y = Y 0 . If (x, y) = (y 0 , x0 ), we can let X = Y 0 , Y = X 0 .
In the case x = y. |S| = 1. x0 = y 0 . X 0 = Y 0 . We can let X = X 0 . 2
References
[1] M. Dezani-Ciancaglini, F. Honsell, and Y. Motohama, Compositional characterizations of λ-terms
using intersection types, Theoretical Computer Science 340 (3) (2005) 459–495.
25