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