let p be Instruction-Sequence of SCM+FSA; for s being State of SCM+FSA
for a being read-write Int-Location
for Ig being good really-closed MacroInstruction of SCM+FSA st s . (intloc 0) = 1 & ProperBodyWhile>0 a,Ig,s,p & WithVariantWhile>0 a,Ig,s,p holds
ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
( f is on_data_only & ( for k being Nat holds
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 ) ) )
let s be State of SCM+FSA; for a being read-write Int-Location
for Ig being good really-closed MacroInstruction of SCM+FSA st s . (intloc 0) = 1 & ProperBodyWhile>0 a,Ig,s,p & WithVariantWhile>0 a,Ig,s,p holds
ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
( f is on_data_only & ( for k being Nat holds
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 ) ) )
let a be read-write Int-Location; for Ig being good really-closed MacroInstruction of SCM+FSA st s . (intloc 0) = 1 & ProperBodyWhile>0 a,Ig,s,p & WithVariantWhile>0 a,Ig,s,p holds
ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
( f is on_data_only & ( for k being Nat holds
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 ) ) )
let Ig be good really-closed MacroInstruction of SCM+FSA ; ( s . (intloc 0) = 1 & ProperBodyWhile>0 a,Ig,s,p & WithVariantWhile>0 a,Ig,s,p implies ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
( f is on_data_only & ( for k being Nat holds
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 ) ) ) )
set I = Ig;
assume that
A1:
s . (intloc 0) = 1
and
A2:
ProperBodyWhile>0 a,Ig,s,p
and
A3:
WithVariantWhile>0 a,Ig,s,p
; ex f being Function of (product (the_Values_of SCM+FSA)),NAT st
( f is on_data_only & ( for k being Nat holds
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 ) ) )
set SW = StepWhile>0 (a,Ig,p,s);
set PW = p +* (while>0 (a,Ig));
consider K being Nat such that
A4:
ExitsAtWhile>0 (a,Ig,p,s) = K
and
A5:
((StepWhile>0 (a,Ig,p,s)) . K) . a <= 0
and
for i being Nat st ((StepWhile>0 (a,Ig,p,s)) . i) . a <= 0 holds
K <= i
and
DataPart (Comput ((p +* (while>0 (a,Ig))),(Initialize s),(LifeSpan ((p +* (while>0 (a,Ig))),(Initialize s))))) = DataPart ((StepWhile>0 (a,Ig,p,s)) . K)
by A2, A3, Def6;
consider g being Function of (product (the_Values_of SCM+FSA)),NAT such that
A6:
for k being Nat holds
( g . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < g . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 )
by A3;
defpred S1[ State of SCM+FSA, set ] means ( ex k being Nat st
( k <= K & DataPart $1 = DataPart ((StepWhile>0 (a,Ig,p,s)) . k) & $2 = g . ((StepWhile>0 (a,Ig,p,s)) . k) ) or ( ( for k being Nat holds
( not k <= K or not DataPart $1 = DataPart ((StepWhile>0 (a,Ig,p,s)) . k) ) ) & $2 = 0 ) );
A7:
for x being Element of product (the_Values_of SCM+FSA) ex y being Element of NAT st S1[x,y]
proof
let x be
Element of
product (the_Values_of SCM+FSA);
ex y being Element of NAT st S1[x,y]
per cases
( ex k being Nat st
( k <= K & DataPart x = DataPart ((StepWhile>0 (a,Ig,p,s)) . k) ) or for k being Nat holds
( not k <= K or not DataPart x = DataPart ((StepWhile>0 (a,Ig,p,s)) . k) ) )
;
suppose
ex
k being
Nat st
(
k <= K &
DataPart x = DataPart ((StepWhile>0 (a,Ig,p,s)) . k) )
;
ex y being Element of NAT st S1[x,y]then consider k being
Nat such that A8:
(
k <= K &
DataPart x = DataPart ((StepWhile>0 (a,Ig,p,s)) . k) )
;
take
g . ((StepWhile>0 (a,Ig,p,s)) . k)
;
S1[x,g . ((StepWhile>0 (a,Ig,p,s)) . k)]thus
S1[
x,
g . ((StepWhile>0 (a,Ig,p,s)) . k)]
by A8;
verum end; end;
end;
consider f being Function of (product (the_Values_of SCM+FSA)),NAT such that
A10:
for x being Element of product (the_Values_of SCM+FSA) holds S1[x,f . x]
from FUNCT_2:sch 3(A7);
take
f
; ( f is on_data_only & ( for k being Nat holds
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 ) ) )
let k be Nat; ( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 )
per cases
( k < K or K <= k )
;
suppose A12:
k < K
;
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 )then A13:
k + 1
<= K
by NAT_1:13;
then consider kk1 being
Nat such that A14:
(
kk1 <= K &
DataPart ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) = DataPart ((StepWhile>0 (a,Ig,p,s)) . kk1) )
and A15:
f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) = g . ((StepWhile>0 (a,Ig,p,s)) . kk1)
by A10;
A16:
k + 1
= kk1
by A1, A2, A3, A4, A13, A14, Th39;
consider kk being
Nat such that A17:
(
kk <= K &
DataPart ((StepWhile>0 (a,Ig,p,s)) . k) = DataPart ((StepWhile>0 (a,Ig,p,s)) . kk) )
and A18:
f . ((StepWhile>0 (a,Ig,p,s)) . k) = g . ((StepWhile>0 (a,Ig,p,s)) . kk)
by A10, A12;
k = kk
by A1, A2, A3, A4, A12, A17, Th39;
hence
(
f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or
((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 )
by A6, A18, A15, A16;
verum end; suppose
K <= k
;
( f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or ((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 )then
DataPart ((StepWhile>0 (a,Ig,p,s)) . K) = DataPart ((StepWhile>0 (a,Ig,p,s)) . k)
by A5, Th37;
hence
(
f . ((StepWhile>0 (a,Ig,p,s)) . (k + 1)) < f . ((StepWhile>0 (a,Ig,p,s)) . k) or
((StepWhile>0 (a,Ig,p,s)) . k) . a <= 0 )
by A5, SCMFSA_M:2;
verum end; end;