Definitions HanoiTowers Sections NuprlLIB Doc
IF YOU CAN SEE THIS go to /sfa/Nuprl/Shared/Xindentation_hack_doc.html

A Non-standard Recursive Solution

Our Standard Solution involved an inductive proof invoking the inductive hypothesis twice to move an extra disk, implicitly defining a recursive procedure that invokes itself twice. Here we consider exploiting other features of Hanoi sequences to get a procedure that only calls itself once for each disk. Here we make two observations. First, that shifting the indices of a Hanoi sequence leaves it a Hanoi sequence, the obviousness of which was assumed as part of our formulation of Hanoi sequences in the first place; after all the indices are only used to provide a notion of sequence length and consecutiveness.

Thm*  n:a,z,d:s:({a...z}{1...n}Peg).
Thm*  s is a Hanoi(n disk) seq on a..z
Thm*  
Thm*  (x.s(x-d)) is a Hanoi(n disk) seq on a+d..z+d

Consequently, one could always "normalize" Hanoi sequences to start at, say, 1. Second, if one permutes the three pegs throughout a Hanoi sequence the result is still a Hanoi sequence. By a permutation we just mean a one-one correspondence between the class of pegs and itself, i.e., a function f  PegPeg which is an injection:

Def  Inj(ABf) == a1,a2:Af(a1) = f(a2 B  a1 = a2

Thm*  n:a,z:s:({a...z}{1...n}Peg).
Thm*  s is a Hanoi(n disk) seq on a..z
Thm*  
Thm*  (f:(PegPeg). 
Thm*  (Inj(Peg; Peg; f (x,if(s(x,i))) is a Hanoi(n disk) seq on a..z)

Gloss

The procedure for producing the Hanoi sequence implicit in this theorem therefore makes only one recursive call per disk

Thm*  n:p,q:Peg.
Thm*  p  q
Thm*  
Thm*  (z:{1...}, s:({1...z}{1...n}Peg).
Thm*  (s is a Hanoi(n disk) seq on 1..z & s(1) = (i.p) & s(z) = (i.q))

Gloss

About:
intnatural_numberaddsubtractlambdaapplyfunctionequal
memberimpliesandallexists!abstraction
IF YOU CAN SEE THIS go to /sfa/Nuprl/Shared/Xindentation_hack_doc.html

Definitions HanoiTowers Sections NuprlLIB Doc