let s be State of SCM+FSA; for t being FinSequence of INT
for P being the Instructions of SCM+FSA -valued ManySortedSet of NAT st (Initialized Insert-Sort-Algorithm) +* ((fsloc 0) .--> t) c= s & Insert-Sort-Algorithm c= P holds
ex u being FinSequence of REAL st
( t,u are_fiberwise_equipotent & u is non-increasing & u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
let t be FinSequence of INT ; for P being the Instructions of SCM+FSA -valued ManySortedSet of NAT st (Initialized Insert-Sort-Algorithm) +* ((fsloc 0) .--> t) c= s & Insert-Sort-Algorithm c= P holds
ex u being FinSequence of REAL st
( t,u are_fiberwise_equipotent & u is non-increasing & u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
let P be the Instructions of SCM+FSA -valued ManySortedSet of NAT ; ( (Initialized Insert-Sort-Algorithm) +* ((fsloc 0) .--> t) c= s & Insert-Sort-Algorithm c= P implies ex u being FinSequence of REAL st
( t,u are_fiberwise_equipotent & u is non-increasing & u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u ) )
set Ia = Insert-Sort-Algorithm ;
set p = Initialized Insert-Sort-Algorithm;
set x = (fsloc 0) .--> t;
set z = (IExec ((insert-sort (fsloc 0)),P,s)) . (fsloc 0);
assume that
A1:
(Initialized Insert-Sort-Algorithm) +* ((fsloc 0) .--> t) c= s
and
A2:
Insert-Sort-Algorithm c= P
; ex u being FinSequence of REAL st
( t,u are_fiberwise_equipotent & u is non-increasing & u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
A3:
P +* Insert-Sort-Algorithm = P
by A2, FUNCT_4:104;
reconsider u = (IExec ((insert-sort (fsloc 0)),P,s)) . (fsloc 0) as FinSequence of REAL by FINSEQ_3:126;
take
u
; ( t,u are_fiberwise_equipotent & u is non-increasing & u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
dom ((fsloc 0) .--> t) = {(fsloc 0)}
by FUNCOP_1:19;
then A4:
fsloc 0 in dom ((fsloc 0) .--> t)
by TARSKI:def 1;
then
fsloc 0 in dom ((Initialized Insert-Sort-Algorithm) +* ((fsloc 0) .--> t))
by FUNCT_4:13;
then s . (fsloc 0) =
((Initialized Insert-Sort-Algorithm) +* ((fsloc 0) .--> t)) . (fsloc 0)
by A1, GRFUNC_1:8
.=
((fsloc 0) .--> t) . (fsloc 0)
by A4, FUNCT_4:14
.=
t
by FUNCOP_1:87
;
hence
t,u are_fiberwise_equipotent
by Th45; ( u is non-increasing & u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
s . (fsloc 0),(IExec ((insert-sort (fsloc 0)),P,s)) . (fsloc 0) are_fiberwise_equipotent
by Th45;
then A5:
dom (s . (fsloc 0)) = dom u
by RFINSEQ:16;
now let i,
j be
Element of
NAT ;
( i in dom u & j in dom u & i < j implies u . i >= u . j )assume that A6:
i in dom u
and A7:
j in dom u
and A8:
i < j
;
u . i >= u . jA9:
i >= 1
by A6, FINSEQ_3:27;
j <= len (s . (fsloc 0))
by A5, A7, FINSEQ_3:27;
hence
u . i >= u . j
by A8, A9, Th45;
verumreconsider y2 =
((IExec ((insert-sort (fsloc 0)),P,s)) . (fsloc 0)) . j as
Integer ;
reconsider y1 =
((IExec ((insert-sort (fsloc 0)),P,s)) . (fsloc 0)) . i as
Integer ;
end;
hence
u is non-increasing
by RFINSEQ:32; ( u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
thus
u is FinSequence of INT
; (Result (P,s)) . (fsloc 0) = u
dom (Initialized Insert-Sort-Algorithm) misses dom ((fsloc 0) .--> t)
by SCMBSORT:46;
then
Initialized Insert-Sort-Algorithm c= (Initialized Insert-Sort-Algorithm) +* ((fsloc 0) .--> t)
by FUNCT_4:33;
then XX:
Initialized Insert-Sort-Algorithm c= s
by A1, XBOOLE_1:1;
Initialized Insert-Sort-Algorithm = Insert-Sort-Algorithm +* (Initialize ((intloc 0) .--> 1))
by SCMFSA6A:def 4;
then
Initialize ((intloc 0) .--> 1) c= Initialized Insert-Sort-Algorithm
by FUNCT_4:26;
then
Initialize ((intloc 0) .--> 1) c= s
by XX, XBOOLE_1:1;
then E1:
s = s +* (Initialize ((intloc 0) .--> 1))
by FUNCT_4:104;
(Result ((P +* Insert-Sort-Algorithm),(s +* (Initialize ((intloc 0) .--> 1))))) . (fsloc 0) = (IExec (Insert-Sort-Algorithm,P,s)) . (fsloc 0)
by SCMBSORT:57;
hence
(Result (P,s)) . (fsloc 0) = u
by A3, E1; verum