HAL Id: hal-00004358
https://hal.archives-ouvertes.fr/hal-00004358v2
Preprint submitted on 5 Mar 2005
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of
sci-entific research documents, whether they are
pub-lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
Induction principles as the foundation of the theory of
normalisation: Concepts and Techniques
Stéphane Lengrand
To cite this version:
Stéphane Lengrand. Induction principles as the foundation of the theory of normalisation: Concepts
and Techniques. 2005. �hal-00004358v2�
as the foundation of the theory of normalisation:
Con epts & Te hniques
Te hni al report
PPS, Université Denis Diderot, Paris VII
S hool of Computer S ien e, University of St Andrews
Stéphane Lengrand
Introdu tion 2
1 A onstru tive theory of normalisation 3
1.1 Relations. . . 3
1.2 Normalisationand indu tion . . . 4
1.3 Termination by simulation&lexi ographi termination . . . 9
1.4 Multi-set termination . . . 12
1.5 Higher-order syntaxes and rewrite systems . . . 14
2 Of the di ulty of relating the terminations of
λ
- al uli 16 3 The safeness and minimality te hnique 18 3.1 Example:λ
x . . . 203.2 Example:
λ
. . . 234 Simulation in
λI
27 4.1 Chur h-Klop'sλI
- al ulus . . . 284.2 Simulating the perpetual strategy . . . 29
4.3 Example:
λ
lxr . . . 35Con lusion 40
The rst part of this report was originally aimed at dening oherent terminology and
notationsaboutredu tionrelationsand theirnormalisation. Thedenitionofthenotions
of normalisation are inspired by a thread reated by René Vestergaard on the TYPES
mailing-list, gathering and omparing the various denitions. Our rst purpose here is
redening and re-establishing a theory of normalisation that does not rely on lassi al
logi and doublenegation.
Negationusually liesinthe very denitionof strong normalisationalready,when itis
expressed as there is no innite redu tion sequen e. The most striking example is the
useof thedenition inordertoprovethat aredu tionrelationisstronglynormalising. It
usuallystartswithsupposeaninniteredu tionsequen e andendswitha ontradi tion.
We believe that the theory of normalisationis not spe i ally lassi al, but the habit of
using lassi al logi has been taken be ause of onvenien e. Here, we show a theory of
normalisationthat isjust as onvenient but onstru tive.
In this theory, the indu tion prin iple is no longer a property of strongly
normalis-ing relations, but is its very denition. In other words, instead of basing the notion of
strong normalisation on the niteness of redu tion sequen es, we base it on the notion
onindu tion: by denition, arelation is strongly normalising if it satises the indu tion
prin iple. The latter should hold for every predi ate, so the notion of normqlisqtion is
basedon se ond-order quanti ationrather than double-negation.
We express several indu tion prin iplesinthat setting,then were-establish some
tra-ditionalresults, espe iallysome te hniques to prove strong normalisation. We
onstru -tively prove the simulation te hnique and a few renements, as well as the termination
of the lexi ographi redu tions and the multi-setredu tions. A onstru tive proof of the
latter has already been given by Wilfried Bu hholz and is a spe ial ase of Coquand's
onstru tive treatment [Coq94℄ of Ramsey theory.
The se ond part of this report presents two new te hniques for proving strong
nor-malisation. The rst one is fundamentally lassi al but applies to any rewrite system,
whereas the se ond one mighthold in intuitionisti logi and appliesmore spe i ally to
al ulithathavesome onnexionwith
λ
- al ulus. Whenapplyingthete hniques,amajor part of the proofsis a tually independent from the al ulusto whi hthey are applied.As an example, we show how the former te hnique an be used to prove the
nor-malisationof the expli it substitution al ulus
λ
x [BR95℄, whi h yields a short proof of PreservationofStrongNormalisation(PSN).Sin ethete hniqueisgeneri ,wealsoprovethose properties for the expli it substitution al ulus
λ
[Her95℄, and the proof is shorter thanthe existingonesin[DU03℄and [Kik04℄. Inboth al ulithete hnique alsoallowsustoeasilyderivethe strong normalisationof typed terms fromthat oftyped
λ
-terms. Un-fortunately,sin eourte hniqueisfundamentally lassi al,it annotdrawadvantageoftheonstru tiveproofsofstrongnormalisationsu hastheonein[JM03 ℄forthesimply-typed
λ
- al ulus.We also apply the latter te hnique to the PSN property of the expli it substitution
al ulus
λ
lxr [KL05℄, a al ulus with a full omposition of substitutions, for whi h the standard te hniques allfailed. This is anew result.The two te hniques an be ombined in a fruitful way, for instan e for proving
ut-eliminationinvarious powerful sequent al uli, in ludingsome type theories su h asthe
1.1 Relations
We start by establishing some notations about relations and sets.
Denition 1 (Relations) We denote the omposition of relations by
·
, the identity relationby Id, and the inverse relation by−1
, alldened below:
Let
R : A −→ B
andR
′
: B −→ C
.
•
CompositionR · R
′
: A −→ C
is dened as follows: given
M ∈ A
andN ∈ C
,M(R · R
′
)N
if there exists
P ∈ B
su h thatMRP
andP R
′
N
•
IdentityId
: A −→ A
is dened as follows:given
M ∈ A
andN ∈ A
,M
IdN
ifM = N
(Note that for higher-order rewrite systems, the above notion of equality is
α
- onversion)•
InverseR
−1
: B −→ A
isdened asfollows: givenM ∈ B
andN ∈ A
,MR
−1
N
ifNRM
If
D ⊆ A
, we writeR(D)
for{M ∈ B| ∃N ∈ D, NRM}
, or equivalentlyS
N
∈D
{M ∈ B| NRM}
. WhenD
is the singleton{M}
, we writeR(M)
forR({M})
. Now whenA = B
we dene the relation indu ed byR
throughR
′
, writtenR
′
[R]
, asR
′−1
· R · R
′
: C −→ C
.We say that a relation
R : A −→ B
istotal ifR
−1
(B) = A
.
Allthosenotionsandnotations anbeusedintheparti ular asewhen
R
isafun tion, that is,if∀M ∈ A
,R(M)
is of the form{N}
(whi h wesimply writeR(M) = N
). Remark 1 Noti e that omposition is asso iative, and identity relations are neutral forthe omposition operation.
Computationina al ulusisdes ribed by the notionof redu tion relation,dened as
follows.
Denition 2 (Redu tion relation) A redu tion relation on
A
is a relationfromA
toA
(i.e. asubset ofA × A
),whi h weoften write as→
.Given a redu tion relation
→
onA
, we dene the set of→
-redu ible forms (or just redu ible forms when the relation is lear) as rf→
= {M ∈ A| ∃N ∈ →(M)}
. We dene the set of normal forms as nf→
= {M ∈ A| →(M) = ∅}
. Given aredu tionrelation→
onA
,wedene→
n
byindu tiononthenaturalnumber
n
asfollows:→
0
=
Id
→
n+1
= → · →
n
(= →
n
· →)
→
+
denotes the transitive losureof
→
(formally,→
+
=
S
n≥1
→
n
).→
∗
denotes the transitiveand reexive losure of
→
(formally,→
∗
=
S
n≥0
→
n
).
↔
∗
Denition 3 (Finitely bran hing relations) A redu tion relation
→
onA
is nitely bran hing if∀M ∈ A
,→(M)
is nite.Denition 4 Givenaredu tionrelation
→
onA
,wesaythatasubsetT
ofA
is→
-stable (orstable under→
) if→(T ) ⊆ T
.1.2 Normalisation and indu tion
Proving a universally quantied property by indu tion onsists of verifying that the set
ofelements havingthe propertyis stable,in somesense similar to-yet moresubtle
than-the one above. Leading to dierent indu tion prin iples, we dene two su h notions of
stability property: being patriar hal and being paternal.
Denition 5 Given a redu tion relation
→
onA
, wesay that•
a subsetT
ofA
is→
-patriar hal (or just patriar hal when the relation is lear) if∀N ∈ A, →(N) ⊆ T ⇒ N ∈ T
.•
a subsetT
ofA
is→
-paternal (or just paternal when the relation is lear) if it ontains nf→
and is stableunder
→
−1
.
•
a predi ateP
onA
ispatriar hal (resp. paternal)if{M ∈ A| P (M)}
ispatriar hal (resp. paternal).Lemma 2 Suppose thatfor any
N
inA
,N ∈
rf→
or
N ∈
nf→
and suppose
T ⊆ A
. IfT
is paternal, then it is patriar hal.Proof: In order to prove
∀N ∈ A, → (N) ⊆ T ⇒ N ∈ T
, a ase analysis is needed: eitherN ∈
rf→
or
N ∈
nf→
. Inboth ases
N ∈ T
be auseT
is paternal.2
Remark 3 Noti e that we an obtain from lassi al logi the hypothesis for all
N
inA
,N ∈
rf→
or
N ∈
nf→
, be ause it is an instan e of the Law of Ex luded Middle. In
intuitionisti logi , assuming that amounts to saying that being redu ible is de idable,
whi h isvery oftenthe ase.
We would not require this hypothesis if we dened that
T
is paternal whenever∀N ∈ A, N ∈ T ∨ (N ∈
rf→
∧ ( → (N) ∩ T = ∅))
. This is lassi ally equivalent to
thedenition above,but this denitionalsohas some disadvantages asweshall see later.
Typi ally, if we want to prove that a predi ate holds on some set, we a tually prove
that itis patriar halorpaternal, depending onthe indu tion prin ipleweuse.
Hen e,we denenormalisationsothat normalisingelementsare those apturedbyan
indu tion prin iple, whi h should hold for every predi ate satisfying the orresponding
stability property. Wethus get two notions of normalisation: the strongly (resp. weakly)
normalising elements are those inevery patriar hal(resp. paternal) set.
Denition 6 (Normalising elements) Given aredu tion relation
→
onA
:•
The set of→
-strongly normalising elements isSN
→
=
\
T
is patriar hal•
The set of→
-weakly normalising elementsisWN
→
=
\
T
is paternalT
Remark 4 Interestingly enough, WN
→
an also be aptured by an indu tivedenition:
WN
→
=
[
n
WN→
n
whereWN→
n
is dened by indu tion onthe natural numbern
as follows: WN→
0
=
nf→
WN→
n+1
= {M ∈ A| ∃n
′
≤ n, M ∈ →
−1
(
WN→
n
′
)}
With the alternative denition of paternal suggested in Remark 3, the in lusion
WN
→
⊆
S
n
WN→
n
would require the assumption that being redu ible by→
is de idable. We thereforepreferredthe rst denition be ause we an thenextra t from atermM
in WN→
anatural number
n
su hthatM ∈
WN→
n
,without the hypothesis of de idability. Su h a hara terisation gives us the possibility to prove that all weakly normalisingelements satisfy some property by indu tion on
n
. On the other hand, trying to do so with strong normalisation leads to a dierent notion, as we shall see below. Hen e, wela k for SN
→
an indu tion prin iplebased on naturalnumbers, whi h is the reason why
webuilt-in aspe i indu tionprin iple inthe denition of SN
→
.
Denition 7 The set of
→
-bounded elementsis dened as BN→
=
[
n
BN→
n
whereBN→
n
isdened by indu tion onthe naturalnumbern
as follows: BN→
0
=
nf→
BN→
n+1
= {M ∈ A| ∃n
′
≤ n, →(M) ⊆
BN→
n
′
}
But wehave the followingfa t:
Remark 5 Forsome redu tion relations
→
,SN→
6=
BN
→
. Forinstan e, inthe following
relation,
M ∈
SN→
butM 6∈
BN→
.M
uulll
lll
lll
lll
lll
ll
||yy
yy
yy
yy
""D
D
D
D
D
D
D
D
((
M
1,1
M
2,1
. . .
M
i,1
. . .
M
2,2
. . .
M
i,2
. . .
. . .
M
i,i
. . .
However, suppose that
→
is nitely bran hing. Then BN→
is patriar hal. Asa onsequen e, BN→
=
SN→
(the ounter-example ould not be nitely bran hing).
Proof: Suppose
→(M) ⊆
BN→
. Be ause
→
isnitelybran hing,thereexists anaturalnumber
n
su h that→(M) ⊆
BN→
n
. Clearly,M ∈
BN→
n+1
⊆
BN→
.2
Remark 6 As a trivial example, all the natural numbers are
>
-bounded. Indeed, any naturalnumbern
is inBN>
n
, whi h an be proved by indu tion. A anoni al way of proving a statement∀M ∈
BN→
, P (M)
is to prove by indu tionon the natural number
n
that∀M ∈
BN→
n
, P (M)
. Although we an exhibit no su h naturalnumberonwhi hastatement∀M ∈
SN→
, P (M)
anbeproved by indu tion,the
following indu tion prin iples hold by denition of normalisation:
Remark 7 Given apredi ate
P
onA
, 1. SupposeP
ispatriar hal (that is,∀M ∈ A, (∀N ∈ →(M), P (N)) ⇒ P (M)
). Then∀M ∈
SN→
, P (M)
. 2. SupposeP
ispaternal (that is,∀M ∈ A, (M ∈
nf→
∨ ∃N ∈ →(M), P (N)) ⇒ P (M)
). Then∀M ∈
WN→
, P (M)
.Whenweuse this remark toprove
∀M ∈
SN→
, P (M)
(resp.
∀M ∈
WN→
, P (M)
), wesay
that weprove itby rawindu tion in SN
→
(resp. in WN
→
).
Denition 8 (Strongly normalising relations) Given a redu tion relation
→
onA
and a subsetT ⊆ A
, we say that the redu tion relation is strongly normalising or ter-minating onT
ifT ⊆
SN→
. If we do not spe ify
T
, it means that we takeT = A
. we mean Remark 8 1. Ifn < n
′
then BN→
n
⊆
BN→
n
′
⊆
BN→
. In parti ular, nf→
⊆
BN→
n
⊆
BN→
. 2. BN→
⊆
SN→
and BN→
⊆
WN→
.Hen e, allnaturalnumbers are in SN
>
and WN
>
.
3. If being redu ible is de idable (orif wework in lassi allogi ), then SN
→
⊆
WN→
. Proof: 1. By denition.2. Both fa ts an be proved forall BN
→
n
by indu tion onn
.3. This omes fromRemark 2 and thusrequires either lassi allogi or the parti ular
instan e of the Law of Ex luded Middle statingthat for all
N
,N
rf→
∨ N ∈
nf→
1. SN
→
is patriar hal, WN→
ispaternal. 2. IfM ∈
BN→
and→ (M) ⊆
BN→
. IfM ∈
SN→
then→ (M) ⊆
SN→
. IfM ∈
WN→
then eitherM ∈
nf→
orM ∈ →
−1
(
WN→
)
(whi h impliesM ∈
rf→
⇒ M ∈ →
−1
(
WN→
)
). Proof:1. Fortherststatement,let
M ∈ A
su hthat→(M) ⊆
SN→
andlet
T
bepatriar hal. We want to prove thatM ∈ T
. It su es to prove that→(M) ⊆ T
. This is the ase, be ause→(M) ⊆
SN→
⊆ T
.
For the se ond statement, rst noti e that nf
→
⊆
WN
→
. Now let
M, N ∈ A
su h thatM → N
andN ∈
WN→
,andlet
T
bepaternal. WewanttoprovethatM ∈ T
. This is the ase be auseN ∈ T
andT
ispaternal.2. The rst statement is straightforward.
Forthe se ond, weshow that
T = {P ∈ A| →(P ) ⊆
SN→
}
is patriar hal:
Let
P ∈ A
su hthat→(P ) ⊆ T
, that is,∀R ∈ →(P ), →(R) ⊆
SN→
. Be ause SN→
ispatriar hal,∀R ∈ →(P ), R ∈
SN→
. Hen e,→(P ) ⊆
SN→
, that is,
P ∈ T
as required. Nowby denition of SN→
, we get
M ∈ T
. Forthe third statement,we prove thatT =
nf→
∪ →
−1
(
WN
→
)
is paternal:
Clearly, it su es to prove that it is stable under
→
−1
. Let
P, Q ∈ A
su h thatP → Q
andQ ∈ T
. IfQ ∈
nf→
⊆
WN→
, thenP ∈ →
−1
(
WN→
) ⊆ T
. IfQ ∈ →
−1
(
WN→
)
, then, be ause WN→
is paternal, we getQ ∈
WN→
, so thatP ∈ →
−1
(
WN→
) ⊆ T
as required. Nowby denition ofM ∈
WN→
,we getM ∈ T
.2
Noti e that this lemma gives the well-known hara terisation of SN
→
:M ∈
SN→
if and onlyif∀N ∈ →(M), N ∈
SN→
.Now we rene the indu tion prin ipleimmediately ontained inthe denition of
nor-malisationby relaxing the requirement thatthe predi ate shouldbepatriar halor
pater-nal:
Theorem 10 (Indu tion prin iple) Given a predi ate
P
onA
,1. Suppose
∀M ∈
SN→
, (∀N ∈ →(M), P (N)) ⇒ P (M)
. Then∀M ∈
SN→
, P (M)
. 2. Suppose∀M ∈
WN→
, (M ∈
nf→
∨ ∃N ∈ →(M), P (N)) ⇒ P (M)
. Then∀M ∈
WN→
, P (M)
.Whenweusethis theorem toprovea statement
P (M)
forallM
inSN→
(resp. WN
→
),
we just add
(∀N ∈ →(M), P (N))
(resp.M ∈
nf→
∨ ∃N ∈ →(M), P (N)
) to the assump-tions,whi h we all the indu tion hypothesis.We say that we prove the statement by indu tion in SN
→
(resp. inWN
→
1. We prove that
T = {M ∈ A| M ∈
SN→
⇒ P (M)}
is patriar hal.
Let
N ∈ A
su h that→(N) ⊆ T
. Wewant toprove thatN ∈ T
:Suppose that
N ∈
SN→
. By Lemma 9 we get that
∀R ∈ → (N), R ∈
SN→
. By
denition of
T
we then get∀R ∈ → (N), P (R)
. From the main hypothesis we getP (N)
. Hen e, wehave shownN ∈ T
. Now by denition ofM ∈
SN→
, we get
M ∈ T
, whi h an be simpliedasP (M)
as required. 2. We prove thatT = {M ∈ A| M ∈
WN→
∧ P (M)}
is paternal. LetN ∈
nf→
⊆
WN→
. By the main hypothesiswe get
P (N)
. NowletN ∈ →
−1
(T )
, that is, there is
R ∈ T
su h thatN → R
. We want toprove thatN ∈ T
:By denition of
T
, we haveR ∈
WN→
, soN ∈
WN→
(be ause WN→
is paternal).We also have
P (R)
, so we an apply the main hypothesis togetP (N)
. Hen e, we have shownN ∈ T
.Now by denition of
M ∈
WN→
, we get
M ∈ T
, whi h an be simplied asP (M)
as required.2
As arst appli ation of the indu tion prin iple, weprove the following results:
Remark 11
M ∈
SN→
ifand onlyif thereisnoinniteredu tionsequen e startingfrom
R
( lassi ally, with the axiomof hoi e).Proof:
•
onlyif: Considerthepredi ateP (M)
havingnoinniteredu tionsequen estarting fromM
. We prove it by indu tion in SN→
. If
M
starts an innite redu tion sequen e, then thereisaN ∈ →(M)
thatalsostartsaninniteredu tionsequen e, whi h ontradi ts the indu tion hypothesis.•
if: SupposeM 6∈
SN→
. There is a patriar hal set
T
in whi hM
is not. Hen e, there is aN ∈ →(M)
that is not inT
, and we re-iterate onit, reating aninnite redu tion sequen e. This uses the axiomof hoi e.2
Remark 12 1. If→⊆→
′
, then nf→
⊇
nf→
′
, WN→
⊇
WN→
′
, SN→
⊇
SN→
′
,and for all
n
, BN→
n
⊇
BN→
′
n
. 2. nf→
=
nf→
+
,WN→
=
WN→
+
,SN→
=
SN→
+
, and for all
n
,BN→
+
n
=
BN→
n
.Proof:
Forthe rst statement, itremains toprovethat nf
→
⊆
nf→
+
. LetM ∈
nf→
. By denition,→(M) = ∅
,so learly→
+
(M) = ∅
as well.Forthe se ond statement, it remainstoprove that WN
→
⊆
WN→
+
whi hwe doby indu tion in WN→
: AssumeM ∈
WN→
and the indu tion hypothesis that either
M ∈
nf→
or there is
N ∈ → (M)
su h thatN ∈
WN→
+
. In the former ase, we have
M ∈
nf→
=
nf→
+
and nf→
+
⊆
WN→
+
. Inthe latter ase, wehave
N ∈ →
+
(M)
. Be ause ofLemma9, WN→
+
isstable by WN→
+−1
,and hen eM ∈
WN→
+
.For the third statement, it remains to prove that SN
→
⊆
SN
→
+
. We prove the
stronger statementthat
∀M ∈
SN→
, →
∗
(M) ⊆
SN→
+
byindu tioninSN→
: assumeM ∈
SN→
and the indu tion hypothesis
∀N ∈ → (M), →
∗
(N) ⊆
SN→
+
. Clearly,→
+
(M) ⊆
SN→
+
. Be ause of Lemma 9, SN→
+
is→
+
-patriar hal, soM ∈
SN→
+
, and hen e→
∗
(M) ⊆
SN→
+
. The statement BN→
n
⊆
BN→
+
n
an easilybe proved by indu tion onn
.2
Noti ethat this resultenables usto use a stronger indu tion prin iple: inorder toprove
∀M ∈
SN→
, P (M)
, itnow su es to prove
∀M ∈
SN→
, (∀N ∈ →
+
(M), P (N)) ⇒ P (M)
Thisindu tion prin ipleis alled the transitive indu tion in SN
→
.
Lemma 13 (Strong normalisation of disjoint union) Supposethat
(A
i
)
i∈I
isa fam-ily of sets on some index setI
, ea h beingequipped with a redu tionrelation→
i
.Suppose that they are pairwise disjoint (
∀i, j ∈ I
2
, i 6= j ⇒ A
i
∩ A
j
= ∅
). Consider the redu tion relation→=
S
i∈I
→
i
onS
i∈I
A
i
. We haveS
i∈I
SN→
i
⊆
SN→
.Proof: It su es toprovethat forall
j ∈ I
,SN→
j
⊆
SN→
, whi hwe doby indu tionin SN→
j
. AssumeM ∈
SN→
j
and assumethe indu tion hypothesis
→
j
(M) ⊆
SN→
.
We must prove
M ∈
SN→
, so itsu es to prove that for all
N
su h thatM → N
wehave
N ∈
SN→
.
By denition of the disjoint union, all su h
N
are in→
j
(M)
so we an apply theindu tionhypothesis.
2
1.3 Termination by simulation & lexi ographi termination
Now that we have established an indu tion prin iple on strongly normalising elements,
the question arises of how we an prove strong normalisation. In this subse tion we
re-establish in our framework the well-known te hnique of simulation, whi h an be found
forinstan ein[BN98℄. Thebasi te hniquetoprovethataredu tionrelationontheset
A
terminates onsistsinmappingthe elementsofA
toelementsofasetB
equipped withits ownredu tion relationknown tobeterminating,and provingthat theredu tioninA
an besimulatedby that ofB
. Themappingissometimes alledthe measure fun tion orthe weight fun tion. We generalise here the te hnique by repla ing the weight fun tion by arelationbetween
A
andB
. Oddlyenough, wewere unabletond thiseasygeneralisation inthe literature. But the main pointhere is that the simulation te hnique is the typi alexample where the proof usually starts with suppose an innite redu tion sequen e
and ends with a ontradi tion. We show how the use of lassi al logi is ompletely
unne essary, provided that we use a onstru tive denition of SN su h as ours.
Denition 9 (Strong and Weak Simulation)
Let
R
bearelationbetweentwosetsA
andB
,equippedwiththe redu tionrelations→
A
and→
B
respe tively.• →
B
strongly simulates→
A
throughR
if(R
−1
· →
A
) ⊆ (→
+
B
· R
−1
)
.In other words, for all
M, M
′
∈ A
and for all
N ∈ B
,ifMRN
andM →
A
M
′
then there isN
′
∈ B
su h thatM
′
RN
′
andN →
+
B
N
′
.Noti e that when
R
is a fun tion,this impliesR[→
A
] ⊆→
+
B
.• →
B
weakly simulates→
A
throughR
if(R
−1
· →
A
) ⊆ (→
∗
B
· R
−1
)
.In other words, for all
M, M
′
∈ A
and for all
N ∈ B
,ifMRN
andM →
A
M
′
then there isN
′
∈ B
su h thatM
′
RN
′
andN →
∗
B
N
′
.Noti e that when
R
is a fun tion,this impliesR[→
A
] ⊆→
∗
B
.Theorem 14 (Strong normalisation by strong simulation) Let
R
bea relation be-tweenA
andB
, equipped with the redu tion relations→
A
and→
B
.If
→
B
strongly simulates→
A
throughR
, thenR
−1
(
SN→
B
) ⊆
SN→
A
. Proof:R
−1
(
SN→
B
) ⊆
SN→
A
an be reformulated as∀N ∈
SN→
B
, ∀M ∈ A, MRN ⇒ M ∈
SN→
A
whi h we prove by transitive indu tion in SN
→
B
. Assume
N ∈
SN→
B
and assume the
in-du tion hypothesis
∀N
′
∈→
+
B
(N), ∀M
′
∈ A, M
′
RN
′
⇒ M
′
∈
SN→
A
. Now let
M ∈ A
su h thatMRN
. We want to prove thatM ∈
SN→
A
. It su es to prove that
∀M
′
∈ →(M), M
′
∈
SN→
A
. LetM
′
be su h thatM →
A
M
′
. The simulationhypothesis
provides
N
′
∈→
+
B
(N)
su h thatM
′
RN
′
. We apply the indu tion hypothesis on
N
′
, M
′
and getM
′
∈
SN→
A
asrequired.2
Thesimulationte hnique anbeimproved byanotherstandardmethod. It onsistsof
splittingthe redu tion relationintotwo parts,then provingthatthe rst part isstrongly
simulated by a rst auxiliary terminating relation, and then proving that the se ond
part is weakly simulated by it and strongly simulated by a se ond auxiliary terminating
relation.
In some sense, the two auxiliary terminating relations a t as measures that de rease
lexi ographi ally.
We express this methodin our onstru tive framework.
Lemma 15 Given two redu tion relations
→
,→
′
, suppose that SN→
is stable under→
′
. ThenSN→∪→
′
=
SN→
∗
·→
′
∩
SN→
Proof: The left-to-right in lusion is an appli ation of Theorem 14:
→ ∪ →
′
strongly
simulatesboth
→
∗
· →
′
and
→
through Id.Now we prove the right-to-left in lusion. We rst prove the following lemma:
∀M ∈
SN→
, (→
∗
· →
′
)(M) ⊆
SN→∪→
′
⇒ M ∈
SN→∪→
′
We do this by indu tion in SN→
, so not only assume
(→
∗
· →
′
)(M) ⊆
SN
→∪→
′
, but also
assumethe indu tion hypothesis:
∀N ∈ →(M), (→
∗
· →
′
)(N) ⊆
SN→∪→
′
⇒ N ∈
SN→∪→
′
.We want to prove that
M
∈
SN→∪→
′
, so it su es to prove that both
∀N ∈ →
′
(M), N ∈
SN
→∪→
′
and
∀N ∈ → (M), N ∈
SN→∪→
′
. The former ase is a
parti ular ase of the rst hypothesis. The latter ase would be provided by the se ond
hypothesis(theindu tionhypothesis)ifonlywe ouldprovethat
(→
∗
·→
′
)(N) ⊆
SN
→∪→
′
.
Butthis istrue be ause
(→
∗
· →
′
)(N) ⊆ (→
∗
· →
′
)(M)
and the rsthypothesis reapplies.
Now we prove
∀M ∈
SN→
∗
·→
′
, M ∈
SN→
⇒ M ∈
SN→∪→
′
We do this by indu tion inSN→
∗
·→
′
, so not only assume
M ∈
SN→
, but also assumethe
indu tionhypothesis
∀N ∈ (→
∗
· →
′
)(M), N ∈
SN→
⇒ N ∈
SN→∪→
′
.Now we an ombine those two hypotheses, be ause we know that SN
→
is stable under→
′
: sin eM ∈
SN→
,wehave(→
∗
· →
′
)(M) ⊆
SN→
,sothatthe indu tion hypothesis an
besimpliedin
∀N ∈ (→
∗
· →
′
)(M), N ∈
SN
→∪→
′
.
Thisgives usexa tlythe onditions toapply the above lemmato
M
.2
Corollary 16 (Lexi ographi termination)
Let
A
1
, . . . , A
n
be sets, respe tively equipped with the redu tion relations→
A
1
, . . . , →
A
n
. For1 ≤ i ≤ n
, let→
i
be the redu tion relation onA
1
× · · · × A
n
dened as follows:(M
1
, . . . , M
n
) →
i
(N
1
, . . . , N
n
)
if
M
i
→
A
i
N
i
and for all1 ≤ j < i
,M
j
= N
j
and for alli < j ≤ n
,N
j
∈
SN→
Aj
We dene the lexi ographi redu tion
→
lex as→
1
∪ . . . ∪ →
n
. We then have: SN→
A1
× · · · ×
SN→
An
⊆
SN→
lex Inparti ular, if→
A
i
is terminating onA
i
for all1 ≤ i ≤ n
, then→
lexis terminating on
A
1
× · · · × A
n
.Proof: Byindu tion on
n
: forn = 1
,we on lude from→
A
1
=→
1
. Thennoti ethat→
A
n+1
stronglysimulates→
n+1
throughthe(n+ 1)
th
proje tion. Hen e, by Theorem 14, ifN
n+1
∈
SN→
An+1
then(N
1
, . . . , N
n+1
) ∈
SN→
n+1
, whi h we an also
formulate as
A
1
× · · · × A
n
×
SN→
An+1
⊆
SN→
n+1
. Arst onsequen e ofthis isSN→
A1
× · · · ×
SN→
An+1
⊆
SN→
n+1
(1). Ase ond oneis that
SN
→
n+1
is stableunder
→
1
∪ . . . ∪ →
n
(2). Now noti ethat→
1
∪ . . . ∪ →
n
strongly sim-ulates→
∗
n+1
· (→
1
∪ . . . ∪ →
n
)
throughthe proje tionthatdropsthe(n + 1)
th
omponent.
We an thus apply Theorem 14 to get SN
→
1
∪...∪→
n
× A
n+1
⊆
SN→
∗
n+1
·(→
1
∪...∪→
n
)
, whi h,
ombinedwiththeindu tionhypothesis,givesSN
→
A1
×· · ·×
SN→
An+1
⊆
SN→
∗
n+1
·(→
1
∪...∪→
n
)
Corollary 17 Let
A
be a set equipped with a redu tion relation→
. For ea h natural numbern
, let→
lex
n
be the lexi ographi redu tionon
A
n
.
Consider the redu tion relation
→
lex=
S
n
→
lexn
on the disjoint union
S
n
A
n
.[
n
(
SN→
)
n
⊆
SN→
lexProof: It su es to ombine Corollary16 with Lemma13.
2
Corollary 18 Let
→
A
and→
′
A
be two redu tion relations onA
, and→
B
be a redu tion relation onB
. Suppose• →
′
A
isstrongly simulated by→
B
throughR
• →
A
isweakly simulated by→
B
throughR
•
SN→
A
= A
ThenR
−1
(
SN→
B
) ⊆
SN→
A
∪→
′
A
.(In other words, if
MRN
andN ∈
SN→
B
then
M ∈
SN→
A
∪→
′
A
.)
Proof: Clearly, the redu tion relation
→
∗
A
· →
′
A
is strongly simulated by→
B
throughR
,so that by Theorem 14 we getR
−1
(
SN→
B
) ⊆
SN→
∗
A
·→
′
A
. But SN→
∗
A
·→
′
A
=
SN→
∗
A
·→
′
A
∩
SN→
A
=
SN→
A
∪→
′
A
, by the Lemma 15 (sin e SN
→
A
= A
is obviouslystable by→
′
A
).2
The intuitive idea behind this orollary is that after a ertain number of
→
A
-steps and→
′
A
-steps, the only redu tions inA
that an take pla e are those that no longer modify theen oding inB
, thatis,→
A
-steps. Thenitsu estoshowthat→
A
terminate,sothat noinniteredu tion sequen e an start fromM
,as illustrated inFigure 1.1.4 Multi-set termination
Now we dene the notions of multi-sets their redu tions. We onstru tively prove their
termination. A lassi alproof of the result an befound in[Ter03 ℄.
Denition 10 (Multi-Sets) Given aset
A
,amulti-set onA
isatotalfun tion fromA
tothe natural numbers su h that only anite subset of elements are not mapped to0
.Noti e that for two su hmulti-sets
f
andg
,the fun tionf + g
mapping any elementM
ofA
tof (M) + g(M)
is stillamulti-setonA
.We dene the multi-set
{{N
1
, . . . , N
n
}}
asf
1
+ · · · + f
n
, where for all1 ≤ i ≤ n
,f
i
mapsN
i
to1
and every other element to0
.We write abusively
M ∈ f
iff (M) 6= 0
.Denition 11 (Multi-Set redu tion relation) Given
→
isaredu tionrelationonA
, wedene the multi-set redu tion as follows:if
f
andg
are multi-sets onA
,we say thatf →
mulg
if thereis a
M
inA
su hthatf(M) = g(M) + 1
∀N ∈ A, f (N) < g(N) ⇒ M → N
M
A∗
R
+3
N ∈
SN→
B
B∗
M
1
A
′
R
+3
N
1
B+
M
′
1
A∗
R
+3
N
′
1
B∗
M
2
A
′
R
+3
N
2
B+
M
′
i
A∗
R
+3
N
′
i
M
i+j
A∗
R
2:
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
m
R
8@
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
Figure 1: Deriving strongnormalisation by simulation
Lemma 19 If
f
1
, . . . , f
n
, g
are multi-sets onA
andf
1
+ · · · + f
n
→
mulg
then there is1 ≤ i ≤ n
andamulti-setf
′
i
su hthatf
i
→
mulf
′
i
andf
1
+· · ·+f
i−1
+f
′
i
+f
i+1
+· · ·+f
n
= g
. Proof: We know that there isaM
inA
su h thatf
1
(M) + · · · + f
n
(M) = g(M) + 1
∀N ∈ A, f
1
(N) + · · · + f
n
(N) < g(N) ⇒ M → N
Aneasy lexi ographi indu tion ontwonatural numbers
p
andq
shows that ifp + q > 0
thenp > 0
orq > 0
. By indu tion on the natural numbern
, we extend this result: ifp
1
+· · ·+p
n
> 0
then∃i, p
i
> 0
. Weapplythisresultonf
1
(M)+· · ·+f
n
(M)
andgetsomef
i
(M) > 0
. Obviouslythereisauniquef
′
i
su hthatf
1
+· · ·+f
i−1
+f
′
i
+f
i+1
+· · ·+f
n
= g
, and wealso getf
i
→
mul
f
′
i
.2
Denition 12 Given two sets
N
andN
′
of multi-sets, we deneN + N
′
as{f + g| f ∈ N , g ∈ N
′
}
.We dene for every
M
inA
its relative multi-sets as all the multi-setsf
onA
su h that ifN ∈ f
thenM →
∗
N
. We denotethe set of relativemulti-sets as
M
M
.Remark 20 Noti e that for any
M ∈ A
,M
M
is stable under→
mul . Lemma 21 For allM
1
, . . . , M
n
inA
, ifM
M
1
∪ . . . ∪ M
M
n
⊆
SN→
mul thenM
M
1
+ · · · + M
M
n
⊆
SN→
mul .Proof: Let
W
betherelationbetweenM
M
1
+ · · ·+ M
M
n
andM
M
1
×· · ·×M
M
n
dened as:f
1
+ · · · + f
n
W(f
1
, . . . , f
n
)
for allf
1
, . . . , f
n
inM
M
We onsiderasaredu tionrelationon
M
M
1
×· · ·×M
M
n
thelexi ographi omposition of→
mul
. We denote this redu tion relation as
→
mullex. By Corollary 16, we know that
M
M
1
× · · · × M
M
n
⊆
SN→
mullex . Hen e,W
−1
(
SN→
mullex) = M
M
1
+ · · · + M
M
n
. Now we prove thatM
M
1
+ · · · + M
M
n
is stable by→
mul and that→
mullex strongly simulates→
mul throughW
. Supposef
1
+· · ·+f
n
→
mulg
. ByLemma19wegetamulti-set
f
′
i
su h thatf
1
+ · · · + f
i−1
+ f
′
i
+ f
i+1
+ · · · + f
n
= g
andf
i
→
mulf
′
i
. Hen e,f
′
i
∈ M
M
i
, so that(f
1
, . . . , f
i−1
, f
′
i
, f
i+1
, · · · , f
n
) ∈ M
M
1
× · · · × M
M
n
and even(f
1
, · · · , f
n
) →
mullex(f
1
, . . . , f
i−1
, f
′
i
, f
i+1
, · · · , f
n
)
.By Theorem 14 we then get
W
−1
(
SN
→
mullex) ⊆
SN→
mul, whi h on ludes the proof
be ause
W
−1
(
SN→
mullex) = M
M
1
+ · · · + M
M
n
.2
Lemma 22∀M ∈
SN→
, M
M
⊆
SN→
mulProof: By transitive indu tion in SN
→
. Assume that
M ∈
SN→
and assume the
indu tionhypothesis
∀N ∈ →
+
(M), M
N
⊆
SN→
mul .Let us split the redu tion relation
→
mul : iff →
mulg
, letf →
mul1
g
iff (M) = g(M)
and letf →
mul2
g
iff (M) > g(M)
. Clearly, iff →
mulg
then eitherf →
mul1
g
orf →
mul1
g
. This is anintuitionisti impli ationsin e the equality of two naturalnumbers
an be de ided.
Now we prove that
→
mul1
isterminating on
M
M
.Let
W
′
be the following relation (a tually, a fun tion) between
M
M
to itself: for allf
andg
inM
M
,f Wg
ifg(M) = 0
and forallN 6= M
,f (N) = g(N)
.For a given
f ∈ M
M
, letN
1
, . . . , N
n
be the elementsofA
that are not mapped to0
byf
andthataredierentfromM
. Sin ef ∈ M
M
,forall1 ≤ i ≤ n
weknowM →
+
N
i
, and we also know thatW
′
(f ) ∈ M
N
1
+ · · · + M
N
n
. Hen e, we apply the indu tion hypothesis and Lemma 21to getM
N
1
+ · · · + M
N
n
⊆
SN→
mul . Hen e,W
′
(f ) ∈
SN→
mul .Now noti e that
→
mul strongly simulates
→
mul1
throughW
′
, so by Theorem 14,f ∈
SN→
mul1
.Now that we know that
→
′
mul
is terminating on
M
M
, we noti e that the de reasing order onnatural numbers strongly simulates→
mul
2
and weakly simulates
→
mul1
through
the fun tion that mapsevery
f ∈ M
M
tothe natural numberf (M)
. Hen e, we an apply Corollary 18to getM
M
⊆
SN→
mul.
2
Corollary 23 (Multi-Set termination) Let
f
be a multi-set onA
. If for anyM ∈ f
,M ∈
SN→
, then
f ∈
SN→
mul .Proof: Let
M
1
, . . . , M
n
be the elements ofA
that are not mapped to0
byf
. Clearly,f ∈ M
M
1
+ · · · + M
M
n
. By Lemma 22,M
M
1
∪ . . . M
M
n
⊆
SN→
mul , and by Lemma 21,M
M
1
+ · · · + M
M
n
⊆
SN→
mul , sof ∈
SN→
mul .2
1.5 Higher-order syntaxes and rewrite systems
Wenowdeal withhigher-ordersyntaxes, where theset
A
isre ursively dened by aterm syntax possibly involving variable binding and the redu tion relation→
is dened as a rewritesystem. Thereare several ways toexpress those systems ina generi way, amongwhi h the Expression Redu tion Systems (ERS) [Kha90℄, the Combinatory Redu tion
Systems(CRS)[Klo80℄,and the Higher-OrderSystems (HRS)[Nip91℄. Inthe rest ofthis
losureoftherewriterules,aswellasthenotionofimpli itsubstitutionsu has
M{x = N}
(that denotes the termM
inwhi h every o urren e of the variablex
has been repla ed by the termN
). All these denitions an befound in[Ter03 ℄.Denition 13 (Conventions)
The symbol
⊑
denotes the sub-term relation and⊏
denotes the stri t sub-term relation (we alsouse⊒
and⊐
for the inverse relations).Bydenition of terms,
A =
SN⊐
.
For a rewritesystem R,
−→
Rdenotes as usual the ontextual losure of the relation
that ontains every instan e of the rewrite rules of R.
We identify a rewrite rule h with the rewrite system
{
h}
and for two rewrite systems R and R′
we write R,
R′
for R∪
R′
.A ongruen e on
A
isan equivalen erelation that is ontext- losed.Lemma 24 SN
−→
R∪⊐
=
SN−→
R .Proof: This is a typi al theorem that is usually proved lassi ally (using for
in-stan e the postponing te hnique [Ter03℄). We prove it onstru tively here. The
left-to-right in lusion is trivial, by Remark 8. Now for the other dire tion, rst noti e that
SN
⊐
= A
. Be auseofthedenitionofa ontextual losure,−→
Rstronglysimulates
−→
Rthrough
⊑
. Also,itweaklysimulates⊐
through⊑
,sowemayapply Corollary18andget∀N ∈
SN→
R, ∀M ∈ A, M ⊑ N ⇒ M ∈
SN→
R∪⊐
. Inparti ular,∀N ∈
SN→
R, M ∈
SN→
R∪⊐
.2
Noti e that this result enables us to use a stronger indu tion prin iple: in order to
prove
∀M ∈
SN−→
R, P (M)
, itnow su es toprove∀M ∈
SN−→
R, (∀N ∈ A, (M−→
+
RN ∨ N ⊏ M) ⇒ P (N)) ⇒ P (M)
This indu tion prin iple is alled the transitive indu tion in SN R
with sub-terms and is
usedin the followingse tions.
We briey re all the variousindu tion prin iples:
In orderto prove
∀M ∈
SN−→
R, P (M)
, it su es to prove• ∀M ∈ A, (∀N ∈ A, (M −→
RN) ⇒ P (N)) ⇒ P (M)
(raw indu tion inSN R ), orjust• ∀M ∈
SN−→
R, (∀N ∈ A, (M −→
RN) ⇒ P (N)) ⇒ P (M)
(indu tion in SN R ),or just• ∀M ∈
SN−→
R, (∀N ∈ A, (M−→
+
RN) ⇒ P (N)) ⇒ P (M)
(transitiveindu tion in SN R ),or even• ∀M ∈
SN−→
R, (∀N ∈ A, (M−→
+
RN ∨ N ⊏ M) ⇒ P (N)) ⇒ P (M)
(transitiveindu tion in SN R with sub-terms) Denition 14 SN R hen eforth denotes SN−→
R∪⊐
=
SN−→
R .2 Of the di ulty of relating the terminations of
λ
- al uliInthe rest ofthis report we develop te hniquesthat were originallydesigned for deriving
strongnormalisation resultsfrom the strong normalisationof typed
λ
- al ulus [Bar84℄. Therstoneturnsouttobemoregeneraland anbeappliedtoanyrewritesystem. Itisauseful renement ofthe simulationte hnique, butthe maintheorem of the te hnique
onlyholds in lassi al logi .
The se ond te hnique holds in intuitionisti logi , apart maybe from one external
result, of whi h the provability in intuitioniti logi remains to be he ked. The
te h-nique was originally designed to prove the strong normalisation of al uli with expli it
substitutions,su h as
λ
x [BR95℄.We all al ulus with expli it substitutions a al ulus that uses a set of variables,
denoted
x, y, . . .
, and one of its onstru tors isthe followingone:If
M
andN
are terms,thenhM/xiN
isa term,wherex
is bound inN
. The onstru t is alledan expli it substitution andM
is alled itsbody.Of ourse, the te hnique islikely tobe adapted toother frameworks, whi h oulduse
De Bruijn indi es [Bar84℄ or expli it substitutions with additional parameters, but the
aboveframework isplainlysu ient for the examples treatedhereafter.
Among the al uli with expli it substitutions to whi h the te hniques an be applied
are the intuitionisti sequent al uli [Gen35℄.
Thenotionof omputationinsequent al uliisCut-elimination: theproofofasequent
maybesimpliedbyeliminatingthe appli ationsofthe Cut-rule,sothat asequentwhi h
isprovable with the Cut-ruleis provable without.
Itturnsout thatthe mostnaturaltyping ruleforanexpli itsubstitutionasexpressed
above is pre isely a Cut-rule. From that remark, many te hniques aimed at proving
normalisation results about al uli of expli it substitutions a tually apply to systems
with Cut-rules su h as sequent al uli. In other words, termination of ut-elimination
pro esses an oftenbe derived from terminationof expli it substitution al uli.
Of ourse, inthe ase of sequent al uli,termination of Cut-eliminationrelies onlyon
the strongnormalisation of typed terms.
Another notion ta kles the strong normalisation of terms with expli it substitutions
that are not ne essarilytyped: the property alled Preservation of Strong Normalisation
(PSN)[BBLRD96℄. It on ernssynta ti extensionsof
λ
- al uluswiththeirownredu tion relationsand statesthat ifaλ
-termisstronglynormalisingfor theβ
-redu tion, thenitis stillstronglynormalising when onsidered asa term ofthe extended al ulusundergoingtheredu tions of the latter. Inother words, the redu tionrelationshould not betoobig,
althoughit is oftenrequiredto bebig enoughtosimulate
β
-redu tion. It is typi allythe ase ofλ
x [BR95℄,whi hwe shall investigate shortly.The denition of the PSNproperty an be slightly generalised for al uli inwhi h
λ
- al ulus an beembedded (by a one-to-one translation, say A) rather than just in luded.Inthat ase PSNstates that ifa
λ
-termis stronglynormalising, then itsen oding isalso stronglynormalising. Thisisthe asefortheexpli itsubstitution al ulusλ
lxrintrodu ed in [KL05℄ whi h requires terms to be linear and hen e is not a synta ti extension ofλ
- al ulus. Figure2 shows the two situations, withthe exampleofλ
x andλ
lxr .λ
xλ
λ
lxrλ
A+3
Figure2: Standard and generalised situationsfor statingPSN
is to use Corollary 18, that is, simulating
M
's redu tions byβ
-redu tions of a strongly normalisingλ
-term H(M)
.ForPSN, if
M =
A(t)
wheret
is theλ
-term known tobe SNβ
by hypothesis, then we
would take H
(M) = t
.For sequent al ulus, it would be a typed (and hen e strongly normalising)
λ
-term thatdenotes aproofinnaturaldedu tionofthesamesequent(usingCurry-Howardorre-sponden e). TheideaofsimulatingCut-eliminationby
β
-redu tionshasbeeninvestigated in[Zu 74℄.Thereis one problemindoingso: anen oding into
λ
- al ulusthat allows the simula-tion needs to interpret expli it substitutions by impli itsubstitutions su h ast{x = u}
. Butshouldx
not be freeint
, allredu tion steps taking pla ewithin theterm of whi hu
isthe en oding would not indu e anyβ
-redu tion int{x = u}
.Therefore, the sub-system that is onlyweakly simulated, i.e. the one onsisting of all
the redu tions that are not ne essarily simulated by at least one
β
-redu tion, is too big tobe proved terminating (andvery oftenit isnot).The two te hniques developed hereafter are designed to over ome this problem, in a
somewhat generalsetting. The two aforementioned al uli with expli it substitutions
λ
x andλ
lxr respe tively illustrate how ea h an be applied and an provide in parti ular a proof of the PSN property.In order to ompare the examples with
λ
- al ulus, we briey re all the latter. The syntax isdened asfollows:M, N ::= x| λx.M| M N
β
-redu tion isdened asthe following rule:(λx.M) N −→
β
M{x = N}
Therstthreeinferen erulesofFigure3denethederivablejudgementsofthe
simply-typed
λ
- al ulus, whi h we note asΓ ⊢
NJ
M : A
. When the two bottom inferen e rules
are added, we obtain a typing system hara terising SN
β
, and we note those derivable
judgementsas
Γ ⊢
NJ
∩
M : A
.The followingtheorem has been proved in [CD78℄:
Theorem 25 (Strong Normalisation of
λ
- al ulus)Γ ⊢
NJ∩
M : A
if and only if
M ∈
SNβ
.
Aproofof theweaker statementthatsimply-typed
λ
- al ulusisstronglynormalising an befound, for example, in[Bar84℄.Γ, x : A ⊢ x : A
Γ, (x : A) ⊢ M : B
Γ ⊢ λx.M : A → B
Γ ⊢ M : A → B
Γ ⊢ N : A
Γ ⊢ M N : B
Γ ⊢ M : A
Γ ⊢ M : B
Γ ⊢ M : A ∩ B
Γ ⊢ M : A
1
∩ A
2
i ∈ {1, 2}
Γ ⊢ M : A
i
Figure 3: Typing rules for
λ
- al ulus3 The safeness and minimality te hnique
Given a rewrite system R on a set of terms
A
, the safeness and minimality te hnique presents two subsystems minR and safeR satisfying−→
safeR
⊆−→
minR⊆−→
R and SN minR=
SN R .The intuitive idea is that a redu tion step is minimal if all the (stri t) sub-terms of
the redex are inSN R
. Theorem 27says that inorder to prove that
−→
Ris terminating,
we an restri t our attention tominimal redu tionsonly,without lossof generality.
Similarly, a redu tion step is safe if the redex itself is in SN R
, whi h is a stronger
requirement than minimality. Theorem 28says that, whatever R, safe redu tions always
terminate.
Those ideas are made pre isein the followingdenition:
Denition 15 (Safe and Minimal redu tions) Given two rewrite systems h and R
satisfying
−→
h
⊂−→
R ,•
the (R-)minimal h-system is given by the followings heme of rules:minh
: M −→ N
for everyM −→
h
N
su h that for all
P ⊏ M
,P ∈
SN R•
the (R-)safe h-system is given by the following s heme of rules:safe h
: M −→ N
for everyM −→
h
N
su h that
M ∈
SN RInboth rules we ouldrequire
M −→
h
N
tobearootredu tionso that
M
is theredex, but although the rules above seem stronger than that, they have the same ontextuallosure,sowe onsider the denition above whi h is the simplest.
Noti e that being safe is stronger than being minimal aswe have:
−→
safeh⊆−→
minh⊆−→
h⊆−→
R .We alsosay that aredu tion step
M −→
h
N
issafe (resp. minimal) if
M −→
safeh
N
(resp.
M −→
minh
N
) and that it is unsafe if not.
Obviouslyif
−→
his nitely bran hing, thenso are
−→
safehand
−→
minh .
Remark 26 We shall onstantly use the following fa ts:
1.
−→
2.
−→
safe(
h,
h′
)
=−→
safeh,
safeh′
3.−→
min(
h,
h′
)
=−→
minh,
minh′
Theorem 27 SN minR=
SN RIn other words, in order to prove that a term is strongly normalising, it su es to prove
that it is strongly normalising for minimal redu tions only. This theorem holds in
intu-itionisti logi .
Proof: The right-to-left in lusion is trivial. We now prove that SN minR
⊆
SN R , by transitive indu tion inSN minR with sub-terms. LetM ∈
SN minR, we have the indu tion hypothesis that
∀N, (M−→
+
minR
N ∨ N ⊏ M) ⇒ N ∈
SNR .
We want to prove that
M ∈
SN R, so it su es to he k that if
M −→
R
N
, then
N ∈
SN R.
We rst show that in that ase
M −→
minR
N
. Let
Q
be the R-redex inM
, and letP ⊏ Q
. We haveP ⊏ M
. By the indu tion hypothesis we getP ∈
SNR
, so
Q
is a minR-redex. By ontextual losureof minimalredu tion,M −→
minR
N
.Againby the indu tion hypothesis, we get
N ∈
SN Rasrequired.
2
Theorem 28 SN
safeR
= A
In other words, safe redu tions always terminate. This theorem holds in intuitionisti
logi .
Proof: Consider the multi-sets of
(
R)
-strongly normalising terms, and onsider the multi-set redu tions indu ed by the redu tions(−→
R
∪ ⊐)
+
on strongly normalising
terms. By Corollary23, these multi-setredu tions are terminating.
Consideringthe mapping
φ
ofeverytermtothemulti-setof itsR-stronglynormalising sub-terms,we an he kthatthemulti-setredu tionsstronglysimulatethesaferedu tionsthrough
φ
. Hen e, fromTheorem 14, we get that safe redu tions are terminating.2
Now theaimof the safeness and minimalityte hnique is toprove the strongnormali-sationof a system R.
We obtain this by the following theorem, whi h onlyholds in lassi al logi . Indeed,
itrelies onthe fa tthatforthe rewritesystemR,forallterm
M
wehaveeitherM ∈
SN Ror
M 6∈
SN R. This instan e of the Law of Ex luded Middle isin generalnot de idable.
Theorem 29 Given a system R, if we nd a subsystem R
′
satisfying
−→
safeR
⊆−→
R′
⊆−→
minR, su h that we have:
•
thestrongsimulationof−→
minR
\ −→
R
′
inastronglynormalising al ulus,througha total relation
Q
•
the weak simulation of−→
R′
through
Q
•
the strong normalisation of−→
R′
thenR is strongly normalising.
B
(λx.M) N −→ hN/xiM
x:
Abs
hN/xiλy.M
−→ λy.hN/xiM
App
hN/xiM
1
M
2
−→ hN/xiM
1
hN/xiM
2
VarKhN/xiy
−→ y
VarI
hN/xix
−→ N
Figure4: Redu tion rules for
λ
xNow noti e the parti ular ase of the te hnique when we take R
′
=
safeR. By
Theo-rem 28 we would dire tly have its strong normalisation. Unfortunately, this denition is
oftentoo oarse, that is tosay, the relation
−→
R′
is to small, so that−→
minR\ −→
R′′
isoftentoobig tobe strongly simulated.
Hen e, in order to dene R
′
, we use the safeness riterion, but the pre ise denition
depends on the al ulus that is being treated. We give the examples of
λ
x andλ
. The proofs in these examplesuse lassi allogi .3.1 Example:
λ
xλ
x [BR95℄ is the synta ti extension ofλ
- al ulus with the aforementioned expli it sub-stitutionoperator:M, N ::= x| λx.M| M N| hN/xiM
Its redu tion system redu es
β
-redexes into expli it substitutions whi h are then e evaluated,asshown inFigure 4.The rst four inferen e rules of Figure 5 dene the derivable judgements of
simply-typed
λ
x, whi h we note asΓ ⊢
NJCut
M : A
. When the three bottom inferen e rules
are added, we obtain a typing system hara terising SN
B,
x [LLD+
04℄, and we note those
derivable judgements as
Γ ⊢
NJCut
∩
M : A
. The following theorem isproved in [LLD