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 i, d being Integer st card I > 0 & s . a = d & s . b > 0 & s . c > 0 & s . (DataLoc (d,i)) = (s . b) - (s . c) & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c holds
( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) ) ) holds
( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) )
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 i, d being Integer st card I > 0 & s . a = d & s . b > 0 & s . c > 0 & s . (DataLoc (d,i)) = (s . b) - (s . c) & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c holds
( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) ) ) holds
( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) )
let I be halt-free shiftable Program of SCMPDS; for a, b, c being Int_position
for i, d being Integer st card I > 0 & s . a = d & s . b > 0 & s . c > 0 & s . (DataLoc (d,i)) = (s . b) - (s . c) & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c holds
( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) ) ) holds
( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) )
let a, b, c be Int_position; for i, d being Integer st card I > 0 & s . a = d & s . b > 0 & s . c > 0 & s . (DataLoc (d,i)) = (s . b) - (s . c) & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c holds
( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) ) ) holds
( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) )
let i, d be Integer; ( card I > 0 & s . a = d & s . b > 0 & s . c > 0 & s . (DataLoc (d,i)) = (s . b) - (s . c) & ( for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c holds
( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) ) ) implies ( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) ) )
set ci = DataLoc ((s . a),i);
assume
card I > 0
; ( not s . a = d or not s . b > 0 or not s . c > 0 or not s . (DataLoc (d,i)) = (s . b) - (s . c) or ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st
( t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c & not ( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) ) ) or ( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) ) )
consider f being Function of (product (the_Values_of SCMPDS)),NAT such that
A1:
for s being State of SCMPDS holds
( ( s . b = s . c implies f . s = 0 ) & ( s . b <> s . c implies f . s = max (|.(s . b).|,|.(s . c).|) ) )
by Th2;
deffunc H1( State of SCMPDS) -> Element of NAT = f . $1;
defpred S1[ set ] means ex t being State of SCMPDS st
( t = $1 & t . b > 0 & t . c > 0 & t . (DataLoc (d,i)) = (t . b) - (t . c) );
assume that
A2:
s . a = d
and
A3:
s . b > 0
and
A4:
s . c > 0
and
A5:
s . (DataLoc (d,i)) = (s . b) - (s . c)
; ( ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st
( t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c & not ( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) ) ) or ( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) ) )
assume A6:
for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st t . b > 0 & t . c > 0 & t . a = d & t . (DataLoc (d,i)) = (t . b) - (t . c) & t . b <> t . c holds
( (IExec (I,Q,t)) . a = d & I is_closed_on t,Q & I is_halting_on t,Q & ( t . b > t . c implies ( (IExec (I,Q,t)) . b = (t . b) - (t . c) & (IExec (I,Q,t)) . c = t . c ) ) & ( t . b <= t . c implies ( (IExec (I,Q,t)) . c = (t . c) - (t . b) & (IExec (I,Q,t)) . b = t . b ) ) & (IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c) )
; ( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P & ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) ) )
A7:
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 A8:
S1[
t]
and A9:
t . a = s . a
and A10:
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 t2 =
Initialize (IExec (I,Q,t));
set t1 =
t;
set x =
(IExec (I,Q,t)) . b;
set y =
(IExec (I,Q,t)) . c;
consider v being
State of
SCMPDS such that A11:
v = t
and A12:
v . b > 0
and A13:
v . c > 0
and A14:
v . (DataLoc (d,i)) = (v . b) - (v . c)
by A8;
A15:
t . b > 0
by A11, A12;
A16:
t . c > 0
by A11, A13;
A17:
t . (DataLoc (d,i)) =
(v . b) - (v . c)
by A11, A14
.=
(t . b) - (v . c)
by A11
.=
(t . b) - (t . c)
by A11
;
then A18:
t . b <> t . c
by A2, A10;
hence
(IExec (I,Q,t)) . a = t . a
by A2, A6, A9, A15, A16, A17;
( 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, A6, A9, A15, A16, A17, A18;
( H1( Initialize (IExec (I,Q,t))) < H1(t) & S1[ Initialize (IExec (I,Q,t))] )A19:
now ( (IExec (I,Q,t)) . b > 0 & (IExec (I,Q,t)) . c > 0 & max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c)) )per cases
( t . b > t . c or t . b <= t . c )
;
suppose A20:
t . b > t . c
;
( (IExec (I,Q,t)) . b > 0 & (IExec (I,Q,t)) . c > 0 & max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c)) )then
(t . b) - (t . c) > 0
by XREAL_1:50;
hence
(IExec (I,Q,t)) . b > 0
by A2, A6, A9, A16, A17, A20;
( (IExec (I,Q,t)) . c > 0 & max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c)) )thus
(IExec (I,Q,t)) . c > 0
by A2, A6, A9, A16, A17, A20;
max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c))A21:
(IExec (I,Q,t)) . b = (t . b) - (t . c)
by A2, A6, A9, A16, A17, A20;
hereby verum
A22:
max (
(t . b),
(t . c))
= t . b
by A20, XXREAL_0:def 10;
per cases
( max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) = (IExec (I,Q,t)) . b or max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) = (IExec (I,Q,t)) . c )
by XXREAL_0:16;
suppose
max (
((IExec (I,Q,t)) . b),
((IExec (I,Q,t)) . c))
= (IExec (I,Q,t)) . b
;
max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c))end; suppose
max (
((IExec (I,Q,t)) . b),
((IExec (I,Q,t)) . c))
= (IExec (I,Q,t)) . c
;
max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c))hence
max (
((IExec (I,Q,t)) . b),
((IExec (I,Q,t)) . c))
< max (
(t . b),
(t . c))
by A2, A6, A9, A16, A17, A20, A22;
verum end; end;
end; end; suppose A23:
t . b <= t . c
;
( (IExec (I,Q,t)) . b > 0 & (IExec (I,Q,t)) . c > 0 & max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c)) )hence
(IExec (I,Q,t)) . b > 0
by A2, A6, A9, A15, A17, A18;
( (IExec (I,Q,t)) . c > 0 & max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c)) )
t . b < t . c
by A18, A23, XXREAL_0:1;
then
(t . c) - (t . b) > 0
by XREAL_1:50;
hence
(IExec (I,Q,t)) . c > 0
by A2, A6, A9, A15, A17, A18, A23;
max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c))A24:
(IExec (I,Q,t)) . c = (t . c) - (t . b)
by A2, A6, A9, A15, A17, A18, A23;
A25:
(IExec (I,Q,t)) . b = t . b
by A2, A6, A9, A15, A17, A18, A23;
hereby verum
A26:
max (
(t . b),
(t . c))
= t . c
by A23, XXREAL_0:def 10;
per cases
( max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) = (IExec (I,Q,t)) . c or max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) = (IExec (I,Q,t)) . b )
by XXREAL_0:16;
suppose
max (
((IExec (I,Q,t)) . b),
((IExec (I,Q,t)) . c))
= (IExec (I,Q,t)) . c
;
max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c))end; suppose
max (
((IExec (I,Q,t)) . b),
((IExec (I,Q,t)) . c))
= (IExec (I,Q,t)) . b
;
max (((IExec (I,Q,t)) . b),((IExec (I,Q,t)) . c)) < max ((t . b),(t . c))hence
max (
((IExec (I,Q,t)) . b),
((IExec (I,Q,t)) . c))
< max (
(t . b),
(t . c))
by A18, A23, A25, A26, XXREAL_0:1;
verum end; end;
end; end; end; end; thus
H1(
Initialize (IExec (I,Q,t)))
< H1(
t)
S1[ Initialize (IExec (I,Q,t))]proof
t . b <> t . c
by A18;
then
t . b <> t . c
;
then A27:
H1(
t) =
max (
|.(t . b).|,
|.(t . c).|)
by A1
.=
max (
|.(t . b).|,
|.(t . c).|)
.=
max (
|.(t . b).|,
|.(t . c).|)
.=
max (
(t . b),
|.(t . c).|)
by A15, ABSVALUE:def 1
.=
max (
(t . b),
(t . c))
by A16, ABSVALUE:def 1
;
then
H1(
t)
>= t . b
by XXREAL_0:25;
then A28:
H1(
t)
> 0
by A15;
per cases
( (Initialize (IExec (I,Q,t))) . b = (Initialize (IExec (I,Q,t))) . c or (Initialize (IExec (I,Q,t))) . b <> (Initialize (IExec (I,Q,t))) . c )
;
suppose
(Initialize (IExec (I,Q,t))) . b <> (Initialize (IExec (I,Q,t))) . c
;
H1( Initialize (IExec (I,Q,t))) < H1(t)then H1(
Initialize (IExec (I,Q,t))) =
max (
|.((Initialize (IExec (I,Q,t))) . b).|,
|.((Initialize (IExec (I,Q,t))) . c).|)
by A1
.=
max (
|.((IExec (I,Q,t)) . b).|,
|.((Initialize (IExec (I,Q,t))) . c).|)
by SCMPDS_5:15
.=
max (
|.((IExec (I,Q,t)) . b).|,
|.((IExec (I,Q,t)) . c).|)
by SCMPDS_5:15
.=
max (
((IExec (I,Q,t)) . b),
|.((IExec (I,Q,t)) . c).|)
by A19, ABSVALUE:def 1
.=
max (
((IExec (I,Q,t)) . b),
((IExec (I,Q,t)) . c))
by A19, ABSVALUE:def 1
;
hence
H1(
Initialize (IExec (I,Q,t)))
< H1(
t)
by A19, A27;
verum end; end;
end; A29:
(IExec (I,Q,t)) . (DataLoc (d,i)) = ((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c)
by A2, A6, A9, A15, A16, A17, A18;
thus
S1[
Initialize (IExec (I,Q,t))]
verumproof
take v =
Initialize (IExec (I,Q,t));
( v = Initialize (IExec (I,Q,t)) & v . b > 0 & v . c > 0 & v . (DataLoc (d,i)) = (v . b) - (v . c) )
thus
v = Initialize (IExec (I,Q,t))
;
( v . b > 0 & v . c > 0 & v . (DataLoc (d,i)) = (v . b) - (v . c) )
thus
(
v . b > 0 &
v . c > 0 )
by A19, SCMPDS_5:15;
v . (DataLoc (d,i)) = (v . b) - (v . c)
thus v . (DataLoc (d,i)) =
((IExec (I,Q,t)) . b) - ((IExec (I,Q,t)) . c)
by A29, SCMPDS_5:15
.=
(v . b) - ((IExec (I,Q,t)) . c)
by SCMPDS_5:15
.=
(v . b) - (v . c)
by SCMPDS_5:15
;
verum
end; end;
A30:
for t being 0 -started State of SCMPDS st S1[t] & H1(t) = 0 holds
t . (DataLoc ((s . a),i)) = 0
A38:
S1[s]
by A3, A4, A5;
( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P )
from SCPINVAR:sch 3(A30, A38, A7);
hence
( while<>0 (a,i,I) is_closed_on s,P & while<>0 (a,i,I) is_halting_on s,P )
; ( s . (DataLoc ((s . a),i)) <> 0 implies IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s)))) )
assume A39:
s . (DataLoc ((s . a),i)) <> 0
; IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s))))
IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s))))
from SCPINVAR:sch 4(A39, A30, A38, A7);
hence
IExec ((while<>0 (a,i,I)),P,s) = IExec ((while<>0 (a,i,I)),P,(Initialize (IExec (I,P,s))))
; verum