Built with Alectryon, running Coq+SerAPI v8.13.0+0.13.0. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.
Notation "[ rel _ _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ : _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ & _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ & _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ | _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ rel _ _ in _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "_ + _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ - _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ >= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ > _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ * _" was already used in scope nat_scope. [notation-overridden,parsing]
From hanoi Require Import gdist ghanoi. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Section sHanoi. (*****************************************************************************) (* The pegs are the elements of 'I_n.+3 *) (*****************************************************************************) Variable m : nat. Implicit Type p : peg m.+3. Local Notation "c1 `--> c2" := (smove c1 c2) (format "c1 `--> c2", at level 60). Local Notation "c1 `-->* c2" := (connect smove c1 c2) (format "c1 `-->* c2", at level 60). Let p0 : peg m.+3 := ord0. Definition so1 p : (peg m.+3) := if (p == inord 1) then inord 2 else inord 1.
m:nat
p0:=ord0:peg m.+3
p:peg m.+3

so1 p != p0 /\ so1 p != p
2
4
inord 2 != p0
4
inord 2 != inord 1
567
pD1:p != inord 1
inord 1 != p0
12
inord 1 != p
b
4
10
1115
19
12
14
15
1e
12
16
by rewrite eq_sym. Qed. Definition so2 p1 p2 : (peg m.+3) := if (p1 == inord 1) then if (p2 == inord 2) then inord 3 else inord 2 else if (p2 == inord 1) then if (p1 == inord 2) then inord 3 else inord 2 else inord 1.
56
p1, p2:peg m.+3

0 < m -> [/\ so2 p1 p2 != p0, so2 p1 p2 != p1 & so2 p1 p2 != p2]
26
5629
m_gt0:0 < m

[/\ so2 p1 p2 != p0, so2 p1 p2 != p1 & so2 p1 p2 != p2]
2f
[/\ inord 3 != p0, inord 3 != inord 1 & inord 3 != inord 2]
562930
p2D:p2 != inord 2
[/\ inord 2 != p0, inord 2 != inord 1 & inord 2 != p2]
562930
p1D1:p1 != inord 1
[/\ (if p1 == inord 2 then inord 3 else inord 2) != p0, (if p1 == inord 2 then inord 3 else inord 2) != p1 & (if p1 == inord 2 then inord 3 else inord 2) != inord 1]
5629303d
p2D:p2 != inord 1
[/\ inord 1 != p0, inord 1 != p1 & inord 1 != p2]
33
38
3a
3b3f
45
3c
3e
3f
4a
3c
[/\ inord 3 != p0, inord 3 != inord 2 & inord 3 != inord 1]
5629303d
p1D2:p1 != inord 2
[/\ inord 2 != p0, inord 2 != p1 & inord 2 != inord 1]
3f
54
56
4c
40
42
by split; try (by rewrite eq_sym); apply/eqP/val_eqP; rewrite /= !inordK. Qed.
56
n:nat
c:configuration m.+3 n
7

c `-->* `c[p]
5e
5661627
sirr:irreflexive (srel (n:=m.+3))

63
566961
IH:forall (c : configuration m.+3 n) p, c `-->* `c[p]
c:configuration m.+3 n.+1
7

63
5669616e6f7
p1:=c ldisk:(fun=> peg m.+3) ldisk

63
73
↑[↓[c]]_p1 `-->* ↑[`c[p]]_p
5669616e6f774
pDp1:p != p1

78
5669616e6f7747d
p1Ep0:p1 = p0

78
5669616e6f7747d
p1Dp0:p1 != p0
78
81
↑[↓[c]]_p0 `-->* ↑[`c[p]]_p
83
5669616e6f7747d82
sDp0:so1 p != p0
sDp:so1 p != p

8a
83
8e
↑[`c[so1 p]]_p `-->* ↑[`c[p]]_p
8e
↑[↓[c]]_p0 `-->* ↑[`c[so1 p]]_p
84
8e
97
83
8e
↑[↓[c]]_p0 `-->* ↑[`c[so1 p]]_p0
8e
↑[`c[so1 p]]_p0 `-->* ↑[`c[so1 p]]_p
84
8e
a1
83
8e
srel p0 p
83
85
78
5669616e6f7747d86
pEp0:p = p0

78
5669616e6f7747d86
pDp0:p != p0
78
5669616e6f7747d86b0
sDp0:so1 p1 != p0
sDp1:so1 p1 != p1

78
b1
b8
↑[↓[c]]_p1 `-->* ↑[`c[so1 p1]]_p1
b8
↑[`c[so1 p1]]_p1 `-->* ↑[`c[p]]_p
b2
b8
c1
b1
b8
↑[`c[so1 p1]]_p1 `-->* ↑[`c[so1 p1]]_p
b8
↑[`c[so1 p1]]_p `-->* ↑[`c[p]]_p
b2
b8
srel p1 p
b8
p != so1 p1
cab2
b8
d2
c9
b8
cb
b1
b3
78
b3
↑[↓[c]]_p1 `-->* ↑[`c[p]]_p1
b3
↑[`c[p]]_p1 `-->* ↑[`c[p]]_p
b3
e2
b3
↑[`c[p]]_p1 `-->* ↑[`c[p]]_p0
b3
↑[`c[p]]_p0 `-->* ↑[`c[p]]_p
b3
srel p1 p0
ea
b3
ec
b3
↑[`c[p]]_p0 `-->* ↑[`c[p1]]_p0
b3
↑[`c[p1]]_p0 `-->* ↑[`c[p]]_p
b3
fa
b3
↑[`c[p1]]_p0 `-->* ↑[`c[p1]]_p
b3
↑[`c[p1]]_p `-->* ↑[`c[p]]_p
b3
a8
102
b3
104
by apply/connect_liftr/IH. Qed.
5661
c1, c2:configuration m.+3 n

c1 `-->* c2
10c
10e
`c[p0] `-->* c2
10e
connect (move (srel (n:=m.+3))) c2 `c[p0]
apply: shanoi_connect_perfect. Qed. End sHanoi.