let s be State of SCM+FSA; for t being FinSequence of INT
for P being Instruction-Sequence of SCM+FSA st (Initialize ((intloc 0) .--> 1)) +* ((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 Instruction-Sequence of SCM+FSA st (Initialize ((intloc 0) .--> 1)) +* ((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 Instruction-Sequence of SCM+FSA; ( (Initialize ((intloc 0) .--> 1)) +* ((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 = Initialize ((intloc 0) .--> 1);
set x = (fsloc 0) .--> t;
set z = (IExec ((insert-sort (fsloc 0)),P,s)) . (fsloc 0);
assume that
A1:
(Initialize ((intloc 0) .--> 1)) +* ((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:98;
reconsider u = (IExec ((insert-sort (fsloc 0)),P,s)) . (fsloc 0) as FinSequence of REAL by FINSEQ_3:117;
take
u
; ( t,u are_fiberwise_equipotent & u is non-increasing & u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
A5:
fsloc 0 in dom ((fsloc 0) .--> t)
by TARSKI:def 1;
then
fsloc 0 in dom ((Initialize ((intloc 0) .--> 1)) +* ((fsloc 0) .--> t))
by FUNCT_4:12;
then s . (fsloc 0) =
((Initialize ((intloc 0) .--> 1)) +* ((fsloc 0) .--> t)) . (fsloc 0)
by A1, GRFUNC_1:2
.=
((fsloc 0) .--> t) . (fsloc 0)
by A5, FUNCT_4:13
.=
t
by FUNCOP_1:72
;
hence
t,u are_fiberwise_equipotent
by Th25; ( 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 Th25;
then A6:
dom (s . (fsloc 0)) = dom u
by RFINSEQ:3;
now for i, j being Nat st i in dom u & j in dom u & i < j holds
u . i >= u . jlet i,
j be
Nat;
( i in dom u & j in dom u & i < j implies u . i >= u . j )assume that A7:
i in dom u
and A8:
j in dom u
and A9:
i < j
;
u . i >= u . jA10:
i >= 1
by A7, FINSEQ_3:25;
j <= len (s . (fsloc 0))
by A6, A8, FINSEQ_3:25;
hence
u . i >= u . j
by A9, A10, Th25;
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:19; ( u is FinSequence of INT & (Result (P,s)) . (fsloc 0) = u )
thus
u is FinSequence of INT
; (Result (P,s)) . (fsloc 0) = u
A11:
dom (Initialize ((intloc 0) .--> 1)) = {(intloc 0),(IC )}
by SCMFSA_M:11;
( fsloc 0 <> intloc 0 & fsloc 0 <> IC )
by SCMFSA_2:57, SCMFSA_2:58;
then
not fsloc 0 in dom (Initialize ((intloc 0) .--> 1))
by A11, TARSKI:def 2;
then
dom (Initialize ((intloc 0) .--> 1)) misses dom ((fsloc 0) .--> t)
by ZFMISC_1:50;
then
Initialize ((intloc 0) .--> 1) c= (Initialize ((intloc 0) .--> 1)) +* ((fsloc 0) .--> t)
by FUNCT_4:32;
then A12:
Initialize ((intloc 0) .--> 1) c= s
by A1, XBOOLE_1:1;
Initialize ((intloc 0) .--> 1) c= s
by A12;
then
s = s +* (Initialize ((intloc 0) .--> 1))
by FUNCT_4:98;
then A13:
s = Initialized s
;
(Result ((P +* Insert-Sort-Algorithm),(Initialized s))) . (fsloc 0) = (IExec (Insert-Sort-Algorithm,P,s)) . (fsloc 0)
by SCMBSORT:33;
hence
(Result (P,s)) . (fsloc 0) = u
by A3, A13; verum