let P be Instruction-Sequence of SCMPDS; for s being 0 -started State of SCMPDS
for I being halt-free shiftable Program of SCMPDS
for a, f0, f1 being Int_position
for n, i being Element of NAT st s . a = 0 & s . f0 = 0 & s . f1 = 1 & s . (intpos i) = n & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS
for k being Element of NAT st n = (t . (intpos i)) + k & t . f0 = Fib k & t . f1 = Fib (k + 1) & t . a = 0 & t . (intpos i) > 0 holds
( (IExec (I,Q,t)) . a = 0 & I is_closed_on t,Q & I is_halting_on t,Q & (IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1 & (IExec (I,Q,t)) . f0 = Fib (k + 1) & (IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) ) ) holds
( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) & while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
let s be 0 -started State of SCMPDS; for I being halt-free shiftable Program of SCMPDS
for a, f0, f1 being Int_position
for n, i being Element of NAT st s . a = 0 & s . f0 = 0 & s . f1 = 1 & s . (intpos i) = n & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS
for k being Element of NAT st n = (t . (intpos i)) + k & t . f0 = Fib k & t . f1 = Fib (k + 1) & t . a = 0 & t . (intpos i) > 0 holds
( (IExec (I,Q,t)) . a = 0 & I is_closed_on t,Q & I is_halting_on t,Q & (IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1 & (IExec (I,Q,t)) . f0 = Fib (k + 1) & (IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) ) ) holds
( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) & while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
let I be halt-free shiftable Program of SCMPDS; for a, f0, f1 being Int_position
for n, i being Element of NAT st s . a = 0 & s . f0 = 0 & s . f1 = 1 & s . (intpos i) = n & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS
for k being Element of NAT st n = (t . (intpos i)) + k & t . f0 = Fib k & t . f1 = Fib (k + 1) & t . a = 0 & t . (intpos i) > 0 holds
( (IExec (I,Q,t)) . a = 0 & I is_closed_on t,Q & I is_halting_on t,Q & (IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1 & (IExec (I,Q,t)) . f0 = Fib (k + 1) & (IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) ) ) holds
( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) & while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
let a, f0, f1 be Int_position ; for n, i being Element of NAT st s . a = 0 & s . f0 = 0 & s . f1 = 1 & s . (intpos i) = n & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS
for k being Element of NAT st n = (t . (intpos i)) + k & t . f0 = Fib k & t . f1 = Fib (k + 1) & t . a = 0 & t . (intpos i) > 0 holds
( (IExec (I,Q,t)) . a = 0 & I is_closed_on t,Q & I is_halting_on t,Q & (IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1 & (IExec (I,Q,t)) . f0 = Fib (k + 1) & (IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) ) ) holds
( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) & while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
let n, i be Element of NAT ; ( s . a = 0 & s . f0 = 0 & s . f1 = 1 & s . (intpos i) = n & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS
for k being Element of NAT st n = (t . (intpos i)) + k & t . f0 = Fib k & t . f1 = Fib (k + 1) & t . a = 0 & t . (intpos i) > 0 holds
( (IExec (I,Q,t)) . a = 0 & I is_closed_on t,Q & I is_halting_on t,Q & (IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1 & (IExec (I,Q,t)) . f0 = Fib (k + 1) & (IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) ) ) implies ( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) & while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) )
set Iw = IExec ((while>0 (a,i,I)),P,s);
set Dw = Initialize (IExec ((while>0 (a,i,I)),P,s));
set da = DataLoc ((s . a),i);
defpred S1[ State of SCMPDS] means ( $1 . (intpos i) >= 0 & ex k being Element of NAT st
( n = ($1 . (intpos i)) + k & $1 . f0 = Fib k & $1 . f1 = Fib (k + 1) ) );
assume that
A2:
s . a = 0
and
A3:
s . f0 = 0
and
A4:
s . f1 = 1
and
A5:
s . (intpos i) = n
; ( ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS ex k being Element of NAT st
( n = (t . (intpos i)) + k & t . f0 = Fib k & t . f1 = Fib (k + 1) & t . a = 0 & t . (intpos i) > 0 & not ( (IExec (I,Q,t)) . a = 0 & I is_closed_on t,Q & I is_halting_on t,Q & (IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1 & (IExec (I,Q,t)) . f0 = Fib (k + 1) & (IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) ) ) or ( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) & while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P ) )
consider ff being Function of (product the Object-Kind of SCMPDS),NAT such that
B6:
for t being State of SCMPDS holds
( ( t . (DataLoc ((s . a),i)) <= 0 implies ff . t = 0 ) & ( t . (DataLoc ((s . a),i)) > 0 implies ff . t = t . (DataLoc ((s . a),i)) ) )
by SCMPDS_8:5;
A6:
for t being 0 -started State of SCMPDS holds
( ( t . (DataLoc ((s . a),i)) <= 0 implies ff . t = 0 ) & ( t . (DataLoc ((s . a),i)) > 0 implies ff . t = t . (DataLoc ((s . a),i)) ) )
by B6;
deffunc H1( State of SCMPDS) -> Element of NAT = ff . $1;
A7:
for t being 0 -started State of SCMPDS st S1[t] holds
( ( not H1(t) = 0 or not t . (DataLoc ((s . a),i)) > 0 ) & ( t . (DataLoc ((s . a),i)) <= 0 implies H1(t) = 0 ) )
by A6;
assume A9:
for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS
for k being Element of NAT st n = (t . (intpos i)) + k & t . f0 = Fib k & t . f1 = Fib (k + 1) & t . a = 0 & t . (intpos i) > 0 holds
( (IExec (I,Q,t)) . a = 0 & I is_closed_on t,Q & I is_halting_on t,Q & (IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1 & (IExec (I,Q,t)) . f0 = Fib (k + 1) & (IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) )
; ( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) & while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
A10:
now let t be
0 -started State of
SCMPDS;
for Q being Instruction-Sequence of SCMPDS st S1[t] & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 holds
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & H1( Initialize (IExec (I,Q,t))) < H1(t) & S1[ Initialize (IExec (I,Q,t))] )let Q be
Instruction-Sequence of
SCMPDS;
( S1[t] & t . a = s . a & t . (DataLoc ((s . a),i)) > 0 implies ( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & H1( Initialize (IExec (I,Q,t))) < H1(t) & S1[ Initialize (IExec (I,Q,t))] ) )assume that A11:
S1[
t]
and A12:
t . a = s . a
and A13:
t . (DataLoc ((s . a),i)) > 0
;
( (IExec (I,Q,t)) . a = t . a & I is_closed_on t,Q & I is_halting_on t,Q & H1( Initialize (IExec (I,Q,t))) < H1(t) & S1[ Initialize (IExec (I,Q,t))] )set It =
IExec (
I,
Q,
t);
set Dit =
Initialize (IExec (I,Q,t));
consider k being
Element of
NAT such that A14:
n = (t . (intpos i)) + k
and A15:
t . f0 = Fib k
and A16:
t . f1 = Fib (k + 1)
by A11;
A17:
t . f1 = Fib (k + 1)
by A16;
A18:
intpos (0 + i) = DataLoc (
(s . a),
i)
by A2, SCMP_GCD:1;
A19:
(
n = (t . (intpos i)) + k &
t . f0 = Fib k )
by A14, A15;
hence
(IExec (I,Q,t)) . a = t . a
by A2, A9, A12, A13, A17, A18;
( I is_closed_on t,Q & I is_halting_on t,Q & H1( Initialize (IExec (I,Q,t))) < H1(t) & S1[ Initialize (IExec (I,Q,t))] )thus
(
I is_closed_on t,
Q &
I is_halting_on t,
Q )
by A2, A9, A12, A13, A19, A17, A18;
( H1( Initialize (IExec (I,Q,t))) < H1(t) & S1[ Initialize (IExec (I,Q,t))] )A20:
(IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) - 1
by A2, A9, A12, A13, A19, A17, A18;
hereby S1[ Initialize (IExec (I,Q,t))]
per cases
( (IExec (I,Q,t)) . (intpos i) <= 0 or (IExec (I,Q,t)) . (intpos i) > 0 )
;
suppose
(IExec (I,Q,t)) . (intpos i) <= 0
;
H1( Initialize (IExec (I,Q,t))) < H1(t)then
(Initialize (IExec (I,Q,t))) . (DataLoc ((s . a),i)) <= 0
by A18, SCMPDS_5:15;
then A21:
H1(
Initialize (IExec (I,Q,t)))
= 0
by A6;
H1(
t)
<> 0
by A7, A11, A13;
hence
H1(
Initialize (IExec (I,Q,t)))
< H1(
t)
by A21, NAT_1:3;
verum end; suppose A22:
(IExec (I,Q,t)) . (intpos i) > 0
;
H1( Initialize (IExec (I,Q,t))) < H1(t)
t . (DataLoc ((s . a),i)) > 0
by A13;
then A23:
H1(
t) =
t . (DataLoc ((s . a),i))
by A6
.=
t . (intpos i)
by A18
;
(Initialize (IExec (I,Q,t))) . (DataLoc ((s . a),i)) > 0
by A18, A22, SCMPDS_5:15;
then H1(
Initialize (IExec (I,Q,t))) =
(Initialize (IExec (I,Q,t))) . (DataLoc ((s . a),i))
by A6
.=
(t . (intpos i)) - 1
by A18, A20, SCMPDS_5:15
;
hence
H1(
Initialize (IExec (I,Q,t)))
< H1(
t)
by A23, XREAL_1:146;
verum end; end;
end; thus
S1[
Initialize (IExec (I,Q,t))]
verumproof
t . (intpos i) >= 1
+ 0
by A13, A18, INT_1:7;
then
(t . (intpos i)) - 1
>= 0
by XREAL_1:48;
hence
(Initialize (IExec (I,Q,t))) . (intpos i) >= 0
by A20, SCMPDS_5:15;
ex k being Element of NAT st
( n = ((Initialize (IExec (I,Q,t))) . (intpos i)) + k & (Initialize (IExec (I,Q,t))) . f0 = Fib k & (Initialize (IExec (I,Q,t))) . f1 = Fib (k + 1) )
take m =
k + 1;
( n = ((Initialize (IExec (I,Q,t))) . (intpos i)) + m & (Initialize (IExec (I,Q,t))) . f0 = Fib m & (Initialize (IExec (I,Q,t))) . f1 = Fib (m + 1) )
thus n =
(((t . (intpos i)) - 1) + 1) + k
by A14
.=
(((Initialize (IExec (I,Q,t))) . (intpos i)) + 1) + k
by A20, SCMPDS_5:15
.=
((Initialize (IExec (I,Q,t))) . (intpos i)) + m
;
( (Initialize (IExec (I,Q,t))) . f0 = Fib m & (Initialize (IExec (I,Q,t))) . f1 = Fib (m + 1) )
(
(IExec (I,Q,t)) . f0 = Fib m &
(IExec (I,Q,t)) . f1 = Fib ((k + 1) + 1) )
by A2, A9, A12, A13, A19, A17, A18;
hence
(
(Initialize (IExec (I,Q,t))) . f0 = Fib m &
(Initialize (IExec (I,Q,t))) . f1 = Fib (m + 1) )
by SCMPDS_5:15;
verum
end; end;
A24:
S1[s]
A25:
( H1( Initialize (IExec ((while>0 (a,i,I)),P,s))) = 0 & S1[ Initialize (IExec ((while>0 (a,i,I)),P,s))] )
from SCPINVAR:sch 2(A7, A24, A10);
X1:
(Initialize (IExec ((while>0 (a,i,I)),P,s))) . (DataLoc ((s . a),i)) = (IExec ((while>0 (a,i,I)),P,s)) . (DataLoc ((s . a),i))
by SCMPDS_5:15;
(Initialize (IExec ((while>0 (a,i,I)),P,s))) . (intpos i) =
(IExec ((while>0 (a,i,I)),P,s)) . (intpos (0 + i))
by SCMPDS_5:15
.=
(IExec ((while>0 (a,i,I)),P,s)) . (DataLoc ((s . a),i))
by A2, SCMP_GCD:1
;
then
(Initialize (IExec ((while>0 (a,i,I)),P,s))) . (intpos i) <= 0
by A7, A25, X1;
then
(Initialize (IExec ((while>0 (a,i,I)),P,s))) . (intpos i) = 0
by A25, XXREAL_0:1;
hence
( (IExec ((while>0 (a,i,I)),P,s)) . f0 = Fib n & (IExec ((while>0 (a,i,I)),P,s)) . f1 = Fib (n + 1) )
by A25, SCMPDS_5:15; ( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
A26:
for t being 0 -started State of SCMPDS st S1[t] & H1(t) = 0 holds
t . (DataLoc ((s . a),i)) <= 0
by A7;
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
from SCMPDS_8:sch 3(A26, A24, A10);
hence
( while>0 (a,i,I) is_closed_on s,P & while>0 (a,i,I) is_halting_on s,P )
; verum