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, b, c being Int_position
for n, i, p0 being Element of NAT
for f being FinSequence of INT st f is_FinSequence_on s,p0 & len f = n & s . b = 0 & s . a = 0 & s . (intpos i) = - n & s . c = p0 + 1 & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) ) ) holds
( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & 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, b, c being Int_position
for n, i, p0 being Element of NAT
for f being FinSequence of INT st f is_FinSequence_on s,p0 & len f = n & s . b = 0 & s . a = 0 & s . (intpos i) = - n & s . c = p0 + 1 & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) ) ) holds
( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & 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, b, c being Int_position
for n, i, p0 being Element of NAT
for f being FinSequence of INT st f is_FinSequence_on s,p0 & len f = n & s . b = 0 & s . a = 0 & s . (intpos i) = - n & s . c = p0 + 1 & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) ) ) holds
( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & while<0 (a,i,I) is_closed_on s,P & while<0 (a,i,I) is_halting_on s,P )
let a, b, c be Int_position; for n, i, p0 being Element of NAT
for f being FinSequence of INT st f is_FinSequence_on s,p0 & len f = n & s . b = 0 & s . a = 0 & s . (intpos i) = - n & s . c = p0 + 1 & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) ) ) holds
( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & while<0 (a,i,I) is_closed_on s,P & while<0 (a,i,I) is_halting_on s,P )
let n, i, p0 be Element of NAT ; for f being FinSequence of INT st f is_FinSequence_on s,p0 & len f = n & s . b = 0 & s . a = 0 & s . (intpos i) = - n & s . c = p0 + 1 & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) ) ) holds
( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & while<0 (a,i,I) is_closed_on s,P & while<0 (a,i,I) is_halting_on s,P )
let f be FinSequence of INT ; ( f is_FinSequence_on s,p0 & len f = n & s . b = 0 & s . a = 0 & s . (intpos i) = - n & s . c = p0 + 1 & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) ) ) implies ( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & 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 ( ( for i being Element of NAT st i > p0 holds
$1 . (intpos i) = s . (intpos i) ) & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ($1 . (intpos i)) + n & $1 . b = Sum g & $1 . (intpos i) <= 0 & $1 . c = (p0 + 1) + (len g) ) );
assume that
A1:
f is_FinSequence_on s,p0
and
A2:
len f = n
and
A3:
s . b = 0
and
A4:
s . a = 0
and
A5:
s . (intpos i) = - n
and
A6:
s . c = p0 + 1
; ( ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st
( ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) & 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) ) ) or ( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & 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_Values_of SCMPDS)),NAT such that
A7:
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 Th3;
deffunc H1( State of SCMPDS) -> Element of NAT = ff . $1;
assume A8:
for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = (t . (intpos i)) + n & t . b = Sum g & t . c = (p0 + 1) + (len g) ) & t . a = 0 & t . (intpos i) < 0 & ( for i being Element of NAT st i > p0 holds
t . (intpos i) = s . (intpos i) ) 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 & ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((t . (intpos i)) + n) + 1 & (IExec (I,Q,t)) . c = (p0 + 1) + (len g) & (IExec (I,Q,t)) . b = Sum g ) & ( for i being Element of NAT st i > p0 holds
(IExec (I,Q,t)) . (intpos i) = s . (intpos i) ) )
; ( (IExec ((while<0 (a,i,I)),P,s)) . b = Sum f & while<0 (a,i,I) is_closed_on s,P & while<0 (a,i,I) is_halting_on s,P )
A9:
for t being 0 -started State of SCMPDS st S1[t] holds
( ( H1(t) = 0 implies not t . (DataLoc ((s . a),i)) < 0 ) & ( t . (DataLoc ((s . a),i)) >= 0 implies H1(t) = 0 ) )
A12:
now for t being 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 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 A13:
S1[
t]
and A14:
t . a = s . a
and A15:
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))] )consider h being
FinSequence of
INT such that A16:
h is_FinSequence_on s,
p0
and A17:
(
len h = (t . (intpos i)) + n &
t . b = Sum h )
and A18:
t . c = (p0 + 1) + (len h)
by A13;
A19:
t . c = (p0 + 1) + (len h)
by A18;
set It =
IExec (
I,
Q,
t);
set Dit =
Initialize (IExec (I,Q,t));
A20:
for
i being
Element of
NAT st
i > p0 holds
t . (intpos i) = s . (intpos i)
by A13;
A21:
intpos (0 + i) = DataLoc (
(s . a),
i)
by A4, SCMP_GCD:1;
A22:
(
len h = (t . (intpos i)) + n &
t . b = Sum h )
by A17;
hence
(IExec (I,Q,t)) . a = t . a
by A4, A8, A14, A15, A20, A16, A19, A21;
( 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))] )consider g being
FinSequence of
INT such that A23:
g is_FinSequence_on s,
p0
and A24:
len g = ((t . (intpos i)) + n) + 1
and A25:
(IExec (I,Q,t)) . c = (p0 + 1) + (len g)
and A26:
(IExec (I,Q,t)) . b = Sum g
by A4, A8, A14, A15, A20, A16, A22, A19, A21;
thus
(
I is_closed_on t,
Q &
I is_halting_on t,
Q )
by A4, A8, A14, A15, A20, A16, A22, A19, A21;
( H1( Initialize (IExec (I,Q,t))) < H1(t) & S1[ Initialize (IExec (I,Q,t))] )A27:
(IExec (I,Q,t)) . (intpos i) = (t . (intpos i)) + 1
by A4, A8, A14, A15, A20, A16, A22, A19, A21;
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 A21, SCMPDS_5:15;
then A28:
H1(
Initialize (IExec (I,Q,t)))
= 0
by A7;
H1(
t)
<> 0
by A9, A13, A15;
hence
H1(
Initialize (IExec (I,Q,t)))
< H1(
t)
by A28;
verum end; suppose A29:
(IExec (I,Q,t)) . (intpos i) < 0
;
H1( Initialize (IExec (I,Q,t))) < H1(t)
t . (DataLoc ((s . a),i)) < 0
by A15;
then A30:
H1(
t) =
- (t . (DataLoc ((s . a),i)))
by A7
.=
- (t . (intpos i))
by A21
;
(Initialize (IExec (I,Q,t))) . (DataLoc ((s . a),i)) < 0
by A21, A29, SCMPDS_5:15;
then H1(
Initialize (IExec (I,Q,t))) =
- ((Initialize (IExec (I,Q,t))) . (DataLoc ((s . a),i)))
by A7
.=
- ((t . (intpos i)) + 1)
by A21, A27, SCMPDS_5:15
.=
(- (t . (intpos i))) - 1
;
hence
H1(
Initialize (IExec (I,Q,t)))
< H1(
t)
by A30, XREAL_1:146;
verum end; end;
end; thus
S1[
Initialize (IExec (I,Q,t))]
verumproof
hereby ex g being FinSequence of INT st
( g is_FinSequence_on s,p0 & len g = ((Initialize (IExec (I,Q,t))) . (intpos i)) + n & (Initialize (IExec (I,Q,t))) . b = Sum g & (Initialize (IExec (I,Q,t))) . (intpos i) <= 0 & (Initialize (IExec (I,Q,t))) . c = (p0 + 1) + (len g) )
let i be
Element of
NAT ;
( i > p0 implies (Initialize (IExec (I,Q,t))) . (intpos i) = s . (intpos i) )assume A31:
i > p0
;
(Initialize (IExec (I,Q,t))) . (intpos i) = s . (intpos i)thus (Initialize (IExec (I,Q,t))) . (intpos i) =
(IExec (I,Q,t)) . (intpos i)
by SCMPDS_5:15
.=
s . (intpos i)
by A4, A8, A14, A15, A20, A16, A22, A19, A21, A31
;
verum
end;
take
g
;
( g is_FinSequence_on s,p0 & len g = ((Initialize (IExec (I,Q,t))) . (intpos i)) + n & (Initialize (IExec (I,Q,t))) . b = Sum g & (Initialize (IExec (I,Q,t))) . (intpos i) <= 0 & (Initialize (IExec (I,Q,t))) . c = (p0 + 1) + (len g) )
thus
g is_FinSequence_on s,
p0
by A23;
( len g = ((Initialize (IExec (I,Q,t))) . (intpos i)) + n & (Initialize (IExec (I,Q,t))) . b = Sum g & (Initialize (IExec (I,Q,t))) . (intpos i) <= 0 & (Initialize (IExec (I,Q,t))) . c = (p0 + 1) + (len g) )
thus len g =
((IExec (I,Q,t)) . (intpos i)) + n
by A27, A24
.=
((Initialize (IExec (I,Q,t))) . (intpos i)) + n
by SCMPDS_5:15
;
( (Initialize (IExec (I,Q,t))) . b = Sum g & (Initialize (IExec (I,Q,t))) . (intpos i) <= 0 & (Initialize (IExec (I,Q,t))) . c = (p0 + 1) + (len g) )
thus
(Initialize (IExec (I,Q,t))) . b = Sum g
by A26, SCMPDS_5:15;
( (Initialize (IExec (I,Q,t))) . (intpos i) <= 0 & (Initialize (IExec (I,Q,t))) . c = (p0 + 1) + (len g) )
(Initialize (IExec (I,Q,t))) . (intpos i) = (t . (intpos i)) + 1
by A27, SCMPDS_5:15;
hence
(Initialize (IExec (I,Q,t))) . (intpos i) <= 0
by A15, A21, INT_1:7;
(Initialize (IExec (I,Q,t))) . c = (p0 + 1) + (len g)
thus
(Initialize (IExec (I,Q,t))) . c = (p0 + 1) + (len g)
by A25, SCMPDS_5:15;
verum
end; end;
A32:
S1[s]
A35:
( H1( Initialize (IExec ((while<0 (a,i,I)),P,s))) = 0 & S1[ Initialize (IExec ((while<0 (a,i,I)),P,s))] )
from SCPINVAR:sch 1(A9, A32, A12);
then consider g being FinSequence of INT such that
A36:
g is_FinSequence_on s,p0
and
A37:
len g = ((Initialize (IExec ((while<0 (a,i,I)),P,s))) . (intpos i)) + n
and
A38:
(Initialize (IExec ((while<0 (a,i,I)),P,s))) . b = Sum g
and
A39:
(Initialize (IExec ((while<0 (a,i,I)),P,s))) . (intpos i) <= 0
;
A40: (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 A4, SCMP_GCD:1
;
(IExec ((while<0 (a,i,I)),P,s)) . (DataLoc ((s . a),i)) = (Initialize (IExec ((while<0 (a,i,I)),P,s))) . (DataLoc ((s . a),i))
by SCMPDS_5:15;
then
(Initialize (IExec ((while<0 (a,i,I)),P,s))) . (intpos i) >= 0
by A9, A35, A40;
then A41:
(Initialize (IExec ((while<0 (a,i,I)),P,s))) . (intpos i) = 0
by A39;
then
f = g
by A2, A37, A41, FINSEQ_2:9;
hence
(IExec ((while<0 (a,i,I)),P,s)) . b = Sum f
by A38, SCMPDS_5:15; ( while<0 (a,i,I) is_closed_on s,P & while<0 (a,i,I) is_halting_on s,P )
A43:
for t being 0 -started State of SCMPDS st S1[t] & H1(t) = 0 holds
t . (DataLoc ((s . a),i)) >= 0
by A9;
( while<0 (a,i,I) is_closed_on s,P & while<0 (a,i,I) is_halting_on s,P )
from SCMPDS_8:sch 1(A43, A32, A12);
hence
( while<0 (a,i,I) is_closed_on s,P & while<0 (a,i,I) is_halting_on s,P )
; verum