let P be Instruction-Sequence of SCM+FSA; for I being Program of SCM+FSA
for a being read-write Int-Location
for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
for k being Element of NAT holds
( ( f . ((StepWhile>0 (a,P,s,I)) . k) <> 0 implies ( f . ((StepWhile>0 (a,P,s,I)) . (k + 1)) < f . ((StepWhile>0 (a,P,s,I)) . k) & I is_closed_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) ) ) & ((StepWhile>0 (a,P,s,I)) . (k + 1)) . (intloc 0) = 1 & ( f . ((StepWhile>0 (a,P,s,I)) . k) = 0 implies ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 implies f . ((StepWhile>0 (a,P,s,I)) . k) = 0 ) ) holds
( while>0 (a,I) is_halting_onInit s,P & while>0 (a,I) is_closed_onInit s,P )
let I be Program of SCM+FSA; for a being read-write Int-Location
for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
for k being Element of NAT holds
( ( f . ((StepWhile>0 (a,P,s,I)) . k) <> 0 implies ( f . ((StepWhile>0 (a,P,s,I)) . (k + 1)) < f . ((StepWhile>0 (a,P,s,I)) . k) & I is_closed_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) ) ) & ((StepWhile>0 (a,P,s,I)) . (k + 1)) . (intloc 0) = 1 & ( f . ((StepWhile>0 (a,P,s,I)) . k) = 0 implies ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 implies f . ((StepWhile>0 (a,P,s,I)) . k) = 0 ) ) holds
( while>0 (a,I) is_halting_onInit s,P & while>0 (a,I) is_closed_onInit s,P )
let a be read-write Int-Location; for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
for k being Element of NAT holds
( ( f . ((StepWhile>0 (a,P,s,I)) . k) <> 0 implies ( f . ((StepWhile>0 (a,P,s,I)) . (k + 1)) < f . ((StepWhile>0 (a,P,s,I)) . k) & I is_closed_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) ) ) & ((StepWhile>0 (a,P,s,I)) . (k + 1)) . (intloc 0) = 1 & ( f . ((StepWhile>0 (a,P,s,I)) . k) = 0 implies ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 implies f . ((StepWhile>0 (a,P,s,I)) . k) = 0 ) ) holds
( while>0 (a,I) is_halting_onInit s,P & while>0 (a,I) is_closed_onInit s,P )
let s be State of SCM+FSA; ( ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
for k being Element of NAT holds
( ( f . ((StepWhile>0 (a,P,s,I)) . k) <> 0 implies ( f . ((StepWhile>0 (a,P,s,I)) . (k + 1)) < f . ((StepWhile>0 (a,P,s,I)) . k) & I is_closed_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) ) ) & ((StepWhile>0 (a,P,s,I)) . (k + 1)) . (intloc 0) = 1 & ( f . ((StepWhile>0 (a,P,s,I)) . k) = 0 implies ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 implies f . ((StepWhile>0 (a,P,s,I)) . k) = 0 ) ) implies ( while>0 (a,I) is_halting_onInit s,P & while>0 (a,I) is_closed_onInit s,P ) )
set D = Data-Locations ;
given f being Function of (product (the_Values_of SCM+FSA)),NAT such that A1:
for k being Element of NAT holds
( ( f . ((StepWhile>0 (a,P,s,I)) . k) <> 0 implies ( f . ((StepWhile>0 (a,P,s,I)) . (k + 1)) < f . ((StepWhile>0 (a,P,s,I)) . k) & I is_closed_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . k,P +* (while>0 (a,I)) ) ) & ((StepWhile>0 (a,P,s,I)) . (k + 1)) . (intloc 0) = 1 & ( f . ((StepWhile>0 (a,P,s,I)) . k) = 0 implies ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,P,s,I)) . k) . a <= 0 implies f . ((StepWhile>0 (a,P,s,I)) . k) = 0 ) )
; ( while>0 (a,I) is_halting_onInit s,P & while>0 (a,I) is_closed_onInit s,P )
set s1 = Initialized s;
set P1 = P +* (while>0 (a,I));
A2:
(P +* (while>0 (a,I))) +* (while>0 (a,I)) = P +* (while>0 (a,I))
;
deffunc H1( Nat) -> Element of NAT = f . ((StepWhile>0 (a,P,s,I)) . $1);
A3:
for k being Nat holds
( H1(k + 1) < H1(k) or H1(k) = 0 )
consider m being Nat such that
A4:
H1(m) = 0
and
A5:
for n being Nat st H1(n) = 0 holds
m <= n
from NAT_1:sch 17(A3);
reconsider m = m as Element of NAT by ORDINAL1:def 12;
defpred S1[ Element of NAT ] means ( $1 + 1 <= m implies ex k being Element of NAT st (StepWhile>0 (a,P,s,I)) . ($1 + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),k) );
A6:
S1[ 0 ]
proof
assume
0 + 1
<= m
;
ex k being Element of NAT st (StepWhile>0 (a,P,s,I)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),k)
take n =
(LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized s))) + 3;
(StepWhile>0 (a,P,s,I)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),n)
thus
(StepWhile>0 (a,P,s,I)) . (0 + 1) = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
n)
by Th16;
verum
end;
A7:
now for i being Element of NAT st i < m holds
( I is_closed_onInit (StepWhile>0 (a,P,s,I)) . i,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . i,P +* (while>0 (a,I)) )let i be
Element of
NAT ;
( i < m implies ( I is_closed_onInit (StepWhile>0 (a,P,s,I)) . i,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . i,P +* (while>0 (a,I)) ) )assume
i < m
;
( I is_closed_onInit (StepWhile>0 (a,P,s,I)) . i,P +* (while>0 (a,I)) & I is_halting_onInit (StepWhile>0 (a,P,s,I)) . i,P +* (while>0 (a,I)) )then
H1(
i)
<> 0
by A5;
hence
(
I is_closed_onInit (StepWhile>0 (a,P,s,I)) . i,
P +* (while>0 (a,I)) &
I is_halting_onInit (StepWhile>0 (a,P,s,I)) . i,
P +* (while>0 (a,I)) )
by A1;
verum end;
A8:
now for k being Element of NAT st S1[k] holds
S1[k + 1]let k be
Element of
NAT ;
( S1[k] implies S1[k + 1] )assume A9:
S1[
k]
;
S1[k + 1]now ( (k + 1) + 1 <= m implies ex m being Element of NAT st (StepWhile>0 (a,P,s,I)) . ((k + 1) + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),m) )set sk =
(StepWhile>0 (a,P,s,I)) . k;
set sk1 =
(StepWhile>0 (a,P,s,I)) . (k + 1);
assume A10:
(k + 1) + 1
<= m
;
ex m being Element of NAT st (StepWhile>0 (a,P,s,I)) . ((k + 1) + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),m)
(k + 1) + 0 < (k + 1) + 1
by XREAL_1:6;
then consider n being
Element of
NAT such that A11:
(StepWhile>0 (a,P,s,I)) . (k + 1) = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
n)
by A9, A10, XXREAL_0:2;
A12:
((StepWhile>0 (a,P,s,I)) . (k + 1)) . (intloc 0) = 1
by A1;
k + 0 < k + (1 + 1)
by XREAL_1:6;
then A13:
k < m
by A10, XXREAL_0:2;
then A14:
I is_halting_onInit (StepWhile>0 (a,P,s,I)) . k,
P +* (while>0 (a,I))
by A7;
H1(
k)
<> 0
by A5, A13;
then A15:
((StepWhile>0 (a,P,s,I)) . k) . a > 0
by A1;
take m =
n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . (k + 1))))) + 3);
(StepWhile>0 (a,P,s,I)) . ((k + 1) + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),m)A16:
(P +* (while>0 (a,I))) +* (while>0 (a,I)) = P +* (while>0 (a,I))
;
A17:
(StepWhile>0 (a,P,s,I)) . (k + 1) = Comput (
(P +* (while>0 (a,I))),
(Initialized ((StepWhile>0 (a,P,s,I)) . k)),
((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . k)))) + 3))
by Def1;
I is_closed_onInit (StepWhile>0 (a,P,s,I)) . k,
P +* (while>0 (a,I))
by A7, A13;
then
IC ((StepWhile>0 (a,P,s,I)) . (k + 1)) = 0
by A17, A14, A15, Th11, A16;
then
(StepWhile>0 (a,P,s,I)) . ((k + 1) + 1) = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . (k + 1))))) + 3)))
by A11, A12, Th17;
hence
(StepWhile>0 (a,P,s,I)) . ((k + 1) + 1) = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
m)
;
verum end; hence
S1[
k + 1]
;
verum end;
A18:
for k being Element of NAT holds S1[k]
from NAT_1:sch 1(A6, A8);
per cases
( m = 0 or m <> 0 )
;
suppose A19:
m <> 0
;
( while>0 (a,I) is_halting_onInit s,P & while>0 (a,I) is_closed_onInit s,P )then consider i being
Nat such that A20:
m = i + 1
by NAT_1:6;
reconsider i =
i as
Element of
NAT by ORDINAL1:def 12;
set si =
(StepWhile>0 (a,P,s,I)) . i;
set sm =
(StepWhile>0 (a,P,s,I)) . m;
set sm1 =
Initialized ((StepWhile>0 (a,P,s,I)) . m);
set sm2 =
Initialize ((StepWhile>0 (a,P,s,I)) . m);
A21:
i < m
by A20, XREAL_1:29;
then A22:
I is_closed_onInit (StepWhile>0 (a,P,s,I)) . i,
P +* (while>0 (a,I))
by A7;
i < m
by A20, NAT_1:13;
then
H1(
i)
<> 0
by A5;
then A23:
((StepWhile>0 (a,P,s,I)) . i) . a > 0
by A1;
A24:
I is_halting_onInit (StepWhile>0 (a,P,s,I)) . i,
P +* (while>0 (a,I))
by A7, A21;
(StepWhile>0 (a,P,s,I)) . m = Comput (
(P +* (while>0 (a,I))),
(Initialized ((StepWhile>0 (a,P,s,I)) . i)),
((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . i)))) + 3))
by A20, Def1;
then
IC ((StepWhile>0 (a,P,s,I)) . m) = 0
by A22, A24, A23, Th11, A2;
then A25:
Start-At (
0,
SCM+FSA)
c= (StepWhile>0 (a,P,s,I)) . m
by MEMSTR_0:30;
((StepWhile>0 (a,P,s,I)) . (i + 1)) . (intloc 0) = 1
by A1;
then A26:
Initialized ((StepWhile>0 (a,P,s,I)) . m) = Initialize ((StepWhile>0 (a,P,s,I)) . m)
by A20, SCMFSA_M:18;
set p =
(LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized s))) + 3;
m = i + 1
by A20;
then consider n being
Element of
NAT such that A27:
(StepWhile>0 (a,P,s,I)) . m = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
n)
by A18;
A28:
Initialized ((StepWhile>0 (a,P,s,I)) . m) = (StepWhile>0 (a,P,s,I)) . m
by A26, A25, FUNCT_4:98;
A29:
((StepWhile>0 (a,P,s,I)) . m) . a <= 0
by A1, A4;
then
while>0 (
a,
I)
is_halting_onInit (StepWhile>0 (a,P,s,I)) . m,
P +* (while>0 (a,I))
by Th8;
then
P +* (while>0 (a,I)) halts_on Initialized ((StepWhile>0 (a,P,s,I)) . m)
by A2, SCM_HALT:def 5;
then consider j being
Element of
NAT such that A30:
CurInstr (
(P +* (while>0 (a,I))),
(Comput ((P +* (while>0 (a,I))),((StepWhile>0 (a,P,s,I)) . m),j)))
= halt SCM+FSA
by A28, EXTPRO_1:29;
A31:
Comput (
(P +* (while>0 (a,I))),
(Initialized s),
(j + n))
= Comput (
(P +* (while>0 (a,I))),
(Comput ((P +* (while>0 (a,I))),(Initialized s),n)),
j)
by EXTPRO_1:4;
P +* (while>0 (a,I)) halts_on Initialized s
by A27, A30, A31, EXTPRO_1:29;
hence
while>0 (
a,
I)
is_halting_onInit s,
P
by SCM_HALT:def 5;
while>0 (a,I) is_closed_onInit s,Pnow for q being Element of NAT holds IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))let q be
Element of
NAT ;
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),b1)) in dom (while>0 (a,I))per cases
( q <= (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized s))) + 3 or q > (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized s))) + 3 )
;
suppose A32:
q <= (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized s))) + 3
;
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),b1)) in dom (while>0 (a,I))A33:
(StepWhile>0 (a,P,s,I)) . 0 = s
by Def1;
then A34:
I is_halting_onInit s,
P +* (while>0 (a,I))
by A7, A19;
H1(
0 )
<> 0
by A5, A19;
then A35:
s . a > 0
by A1, A33;
I is_closed_onInit s,
P +* (while>0 (a,I))
by A7, A19, A33;
hence
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))
by A32, A35, A34, Th11, A2;
verum end; suppose A36:
q > (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized s))) + 3
;
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),b1)) in dom (while>0 (a,I))A37:
now ex k being Element of NAT st
( (StepWhile>0 (a,P,s,I)) . 1 = Comput ((P +* (while>0 (a,I))),(Initialized s),k) & k <= q )take k =
(LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized s))) + 3;
( (StepWhile>0 (a,P,s,I)) . 1 = Comput ((P +* (while>0 (a,I))),(Initialized s),k) & k <= q )thus
(
(StepWhile>0 (a,P,s,I)) . 1
= Comput (
(P +* (while>0 (a,I))),
(Initialized s),
k) &
k <= q )
by A36, Th16;
verum end; defpred S2[
Nat]
means ( $1
<= m & $1
<> 0 & ex
k being
Element of
NAT st
(
(StepWhile>0 (a,P,s,I)) . $1
= Comput (
(P +* (while>0 (a,I))),
(Initialized s),
k) &
k <= q ) );
A38:
for
i being
Nat st
S2[
i] holds
i <= m
;
0 + 1
< m + 1
by A19, XREAL_1:6;
then
1
<= m
by NAT_1:13;
then A39:
ex
t being
Nat st
S2[
t]
by A37;
consider t being
Nat such that A40:
(
S2[
t] & ( for
i being
Nat st
S2[
i] holds
i <= t ) )
from NAT_1:sch 6(A38, A39);
reconsider t =
t as
Element of
NAT by ORDINAL1:def 12;
now IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))per cases
( t = m or t <> m )
;
suppose
t = m
;
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))then consider r being
Element of
NAT such that A41:
(StepWhile>0 (a,P,s,I)) . m = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
r)
and A42:
r <= q
by A40;
consider x being
Nat such that A43:
q = r + x
by A42, NAT_1:10;
A44:
while>0 (
a,
I)
is_closed_onInit (StepWhile>0 (a,P,s,I)) . m,
P +* (while>0 (a,I))
by A29, Th8;
reconsider x =
x as
Element of
NAT by ORDINAL1:def 12;
Comput (
(P +* (while>0 (a,I))),
(Initialized s),
q)
= Comput (
(P +* (while>0 (a,I))),
(Initialized ((StepWhile>0 (a,P,s,I)) . m)),
x)
by A28, A41, A43, EXTPRO_1:4;
hence
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))
by A44, A2, SCM_HALT:def 4;
verum end; suppose A45:
t <> m
;
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))set Dt =
(StepWhile>0 (a,P,s,I)) . t;
A46:
t < m
by A40, A45, XXREAL_0:1;
then A47:
I is_closed_onInit (StepWhile>0 (a,P,s,I)) . t,
P +* (while>0 (a,I))
by A7;
A48:
I is_halting_onInit (StepWhile>0 (a,P,s,I)) . t,
P +* (while>0 (a,I))
by A7, A46;
consider y being
Nat such that A49:
t = y + 1
by A40, NAT_1:6;
reconsider y =
y as
Element of
NAT by ORDINAL1:def 12;
t = y + 1
by A49;
then A50:
((StepWhile>0 (a,P,s,I)) . t) . (intloc 0) = 1
by A1;
H1(
t)
<> 0
by A5, A46;
then A51:
((StepWhile>0 (a,P,s,I)) . t) . a > 0
by A1;
consider z being
Element of
NAT such that A52:
(StepWhile>0 (a,P,s,I)) . t = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
z)
and A53:
z <= q
by A40;
set z2 =
z + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . t)))) + 3);
consider w being
Nat such that A54:
q = z + w
by A53, NAT_1:10;
set Dy =
(StepWhile>0 (a,P,s,I)) . y;
y + 0 < t
by A49, XREAL_1:6;
then A55:
y < m
by A40, XXREAL_0:2;
then A56:
I is_closed_onInit (StepWhile>0 (a,P,s,I)) . y,
P +* (while>0 (a,I))
by A7;
H1(
y)
<> 0
by A5, A55;
then A57:
((StepWhile>0 (a,P,s,I)) . y) . a > 0
by A1;
A58:
I is_halting_onInit (StepWhile>0 (a,P,s,I)) . y,
P +* (while>0 (a,I))
by A7, A55;
reconsider w =
w as
Element of
NAT by ORDINAL1:def 12;
(StepWhile>0 (a,P,s,I)) . t = Comput (
(P +* (while>0 (a,I))),
(Initialized ((StepWhile>0 (a,P,s,I)) . y)),
((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . y)))) + 3))
by A49, Def1;
then A59:
IC ((StepWhile>0 (a,P,s,I)) . t) = 0
by A56, A58, A57, Th11, A2;
A60:
(StepWhile>0 (a,P,s,I)) . t = Initialized ((StepWhile>0 (a,P,s,I)) . t)
by A50, A52, A59, Th17;
now not z + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . t)))) + 3) <= qassume A61:
z + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . t)))) + 3) <= q
;
contradictionA62:
now ex k being Element of NAT st
( (StepWhile>0 (a,P,s,I)) . (t + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),k) & k <= q )take k =
z + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . t)))) + 3);
( (StepWhile>0 (a,P,s,I)) . (t + 1) = Comput ((P +* (while>0 (a,I))),(Initialized s),k) & k <= q )thus
(StepWhile>0 (a,P,s,I)) . (t + 1) = Comput (
(P +* (while>0 (a,I))),
(Initialized s),
k)
by A50, A52, A59, Th17;
k <= qthus
k <= q
by A61;
verum end;
t + 1
<= m
by A46, NAT_1:13;
hence
contradiction
by A40, A62, XREAL_1:29;
verum end; then A63:
w < (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialized ((StepWhile>0 (a,P,s,I)) . t)))) + 3
by A54, XREAL_1:6;
Comput (
(P +* (while>0 (a,I))),
(Initialized s),
q)
= Comput (
(P +* (while>0 (a,I))),
(Initialized ((StepWhile>0 (a,P,s,I)) . t)),
w)
by A60, A52, A54, EXTPRO_1:4;
hence
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))
by A63, A47, A48, A51, Th11, A2;
verum end; end; end; hence
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),q)) in dom (while>0 (a,I))
;
verum end; end; end; hence
while>0 (
a,
I)
is_closed_onInit s,
P
by SCM_HALT:def 4;
verum end; end;