We are left only with showing (C). Backing through the lemma
Thm* n:, a,z:, m:{a...z-1}, s1:({a...m}{1...n}Peg),
Thm* s2:({m+1...z}{1...n}Peg).
Thm* (k:{1...n}. Moving disk k of n takes s1(m) to s2(m+1))
Thm*
Thm* s1 is a Hanoi(n disk) seq on a..m
Thm*
Thm* s2 is a Hanoi(n disk) seq on m+1..z
Thm*
Thm* (s1 @(m) s2) is a Hanoi(n disk) seq on a..z
our problem reduces to showing the three premises of that lemma, two of which are immediately solved by
Thm* a,z:, n:, s:({a...z}{1...n}Peg), n':.
Thm* nn'
Thm*
Thm* (h:({n+1...n'}Peg).
Thm* (s is a Hanoi(n disk) seq on a..z
Thm* (
Thm* ((s(?) {to n} h {to n'}) is a Hanoi(n' disk) seq on a..z)
leaving us to show only that
k:{1...n}.
Moving disk k of n
takes (s1(?) {to n-1} f {to n})(m) to (s2(?) {to n-1} g {to n})(m+1)
Obviously we should move the largest disk
(D) (s1(?) {to n-1} f {to n})(m,i) = (s2(?) {to n-1} g {to n})(m+1,i)
(D)
(D) i n
(E) (s1(?) {to n-1} f {to n})(m,i) (s1(?) {to n-1} f {to n})(m,n)
(E) & (s2(?) {to n-1} g {to n})(m+1,i) (s2(?) {to n-1} g {to n})(m+1,n)
To show (D) we case split on whether
(s1(?) {to n-1} f {to n})(m,i) = (s2(?) {to n-1} g {to n})(m+1,i)
simplifies to
f(n) = g(n) n n
which follows from our assumption that
(s1(?) {to n-1} f {to n})(m,i) = (s2(?) {to n-1} g {to n})(m+1,i)
simplifies to
Turning to (E),
(s1(?) {to n-1} f {to n})(m,i) simplifies tos1(m,i)
(s2(?) {to n-1} g {to n})(m+1,i) simplifies tos2(m+1,i)
(s1(?) {to n-1} f {to n})(m,n) simplifies tof(n)
(s2(?) {to n-1} g {to n})(m+1,n) simplifies tog(n)
reducing (E) to
i:{1...n-1}. s1(m,i) f(n) & s2(m+1,i) g(n) .
QED
About: