let P be Instruction-Sequence of SCMPDS; :: thesis: for s being 0 -started State of SCMPDS
for n being Nat st s . GBP = 0 & s . (intpos 2) = n & s . (intpos 3) = 0 holds
(IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n

set i = AddTo (GBP,3,1);
set I = Load (AddTo (GBP,3,1));
set FD = for-down (GBP,2,1,(Load (AddTo (GBP,3,1))));
set a = intpos 3;
let s be 0 -started State of SCMPDS; :: thesis: for n being Nat st s . GBP = 0 & s . (intpos 2) = n & s . (intpos 3) = 0 holds
(IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n

let n be Nat; :: thesis: ( s . GBP = 0 & s . (intpos 2) = n & s . (intpos 3) = 0 implies (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n )
assume that
A1: s . GBP = 0 and
A2: s . (intpos 2) = n and
A3: s . (intpos 3) = 0 ; :: thesis: (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n
defpred S1[ Nat] means for s being 0 -started State of SCMPDS st s . (intpos 2) = $1 & s . GBP = 0 holds
(IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = $1 + (s . (intpos 3));
A4: now :: thesis: for k being Nat st S1[k] holds
S1[k + 1]
let k be Nat; :: thesis: ( S1[k] implies S1[k + 1] )
assume A5: S1[k] ; :: thesis: S1[k + 1]
now :: thesis: for s being 0 -started State of SCMPDS st s . (intpos 2) = k + 1 & s . GBP = 0 holds
(IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = (k + 1) + (s . (intpos 3))
let s be 0 -started State of SCMPDS; :: thesis: ( s . (intpos 2) = k + 1 & s . GBP = 0 implies (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = (k + 1) + (s . (intpos 3)) )
assume that
A6: s . (intpos 2) = k + 1 and
A7: s . GBP = 0 ; :: thesis: (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = (k + 1) + (s . (intpos 3))
GBP <> DataLoc ((s . GBP),2) by A6, A7, SCMP_GCD:1;
then A8: not DataLoc ((s . GBP),2) in {GBP} by TARSKI:def 1;
A9: now :: thesis: for t being 0 -started State of SCMPDS
for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in {GBP} holds
t . x = s . x ) & t . GBP = s . GBP holds
( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds
(IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) )
set cv = DataLoc ((s . GBP),2);
let t be 0 -started State of SCMPDS; :: thesis: for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in {GBP} holds
t . x = s . x ) & t . GBP = s . GBP holds
( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds
(IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) )

let Q be Instruction-Sequence of SCMPDS; :: thesis: ( ( for x being Int_position st x in {GBP} holds
t . x = s . x ) & t . GBP = s . GBP implies ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds
(IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) )

A10: Initialize t = t by MEMSTR_0:44;
assume that
for x being Int_position st x in {GBP} holds
t . x = s . x and
A11: t . GBP = s . GBP ; :: thesis: ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds
(IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) )

set t0 = Initialize t;
(Initialize t) . GBP = 0 by A7, A11, SCMPDS_5:15;
then A12: DataLoc (((Initialize t) . GBP),3) = intpos (0 + 3) by SCMP_GCD:1;
then A13: DataLoc ((s . GBP),2) <> DataLoc (((Initialize t) . GBP),3) by A6, A7, AMI_3:10, SCMP_GCD:1;
thus A14: (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = (Exec ((AddTo (GBP,3,1)),(Initialize t))) . GBP by A10, SCMPDS_5:40
.= (Initialize t) . GBP by A12, AMI_3:10, SCMPDS_2:48
.= t . GBP by SCMPDS_5:15 ; :: thesis: ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds
(IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) )

thus (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = (Exec ((AddTo (GBP,3,1)),(Initialize t))) . (DataLoc ((s . GBP),2)) by A10, SCMPDS_5:40
.= (Initialize t) . (DataLoc ((s . GBP),2)) by A13, SCMPDS_2:48
.= t . (DataLoc ((s . GBP),2)) by SCMPDS_5:15 ; :: thesis: ( Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds
(IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) )

thus ( Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q ) by SCMPDS_6:20, SCMPDS_6:21; :: thesis: for y being Int_position st y in {GBP} holds
(IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y

let y be Int_position; :: thesis: ( y in {GBP} implies (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y )
assume y in {GBP} ; :: thesis: (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y
then y = GBP by TARSKI:def 1;
hence (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y by A14; :: thesis: verum
end;
set j = AddTo (GBP,2,(- 1));
set s0 = s;
set s1 = IExec ((Load (AddTo (GBP,3,1))),P,s);
set s2 = IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s);
set l2 = intpos 2;
set P2 = P;
A15: DataLoc ((s . GBP),3) = intpos (0 + 3) by A7, SCMP_GCD:1;
A16: (IExec ((Load (AddTo (GBP,3,1))),P,s)) . GBP = (Exec ((AddTo (GBP,3,1)),s)) . GBP by SCMPDS_5:40
.= 0 by A7, A15, AMI_3:10, SCMPDS_2:48 ;
then A17: DataLoc (((IExec ((Load (AddTo (GBP,3,1))),P,s)) . GBP),2) = intpos (0 + 2) by SCMP_GCD:1;
A18: (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 2) = (Exec ((AddTo (GBP,2,(- 1))),(IExec ((Load (AddTo (GBP,3,1))),P,s)))) . (intpos 2) by SCMPDS_5:41
.= ((IExec ((Load (AddTo (GBP,3,1))),P,s)) . (intpos 2)) + (- 1) by A17, SCMPDS_2:48
.= ((Exec ((AddTo (GBP,3,1)),s)) . (intpos 2)) + (- 1) by SCMPDS_5:40
.= (s . (intpos 2)) + (- 1) by A15, AMI_3:10, SCMPDS_2:48
.= k by A6 ;
A19: (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 3) = (Exec ((AddTo (GBP,2,(- 1))),(IExec ((Load (AddTo (GBP,3,1))),P,s)))) . (intpos 3) by SCMPDS_5:41
.= (IExec ((Load (AddTo (GBP,3,1))),P,s)) . (intpos 3) by A17, AMI_3:10, SCMPDS_2:48
.= (Exec ((AddTo (GBP,3,1)),s)) . (intpos 3) by SCMPDS_5:40
.= (s . (intpos 3)) + 1 by A15, SCMPDS_2:48 ;
A20: (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . GBP = (Exec ((AddTo (GBP,2,(- 1))),(IExec ((Load (AddTo (GBP,3,1))),P,s)))) . GBP by SCMPDS_5:41
.= 0 by A16, A17, AMI_3:10, SCMPDS_2:48 ;
A21: (Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))) . (intpos 2) = (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 2) by SCMPDS_5:15;
A22: (Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))) . (intpos 3) = (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 3) by SCMPDS_5:15;
A23: (Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))) . GBP = (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . GBP by SCMPDS_5:15;
DataLoc ((s . GBP),2) = intpos (0 + 2) by A7, SCMP_GCD:1;
hence (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,(Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))))) . (intpos 3) by A6, A7, A8, A9, Th47
.= k + ((IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 3)) by A5, A18, A20, A21, A22, A23
.= (k + 1) + (s . (intpos 3)) by A19 ;
:: thesis: verum
end;
hence S1[k + 1] ; :: thesis: verum
end;
A24: S1[ 0 ]
proof
let s be 0 -started State of SCMPDS; :: thesis: ( s . (intpos 2) = 0 & s . GBP = 0 implies (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = 0 + (s . (intpos 3)) )
assume that
A25: s . (intpos 2) = 0 and
A26: s . GBP = 0 ; :: thesis: (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = 0 + (s . (intpos 3))
A27: Initialize s = s by MEMSTR_0:44;
DataLoc ((s . GBP),2) = intpos (0 + 2) by A26, SCMP_GCD:1;
hence (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = 0 + (s . (intpos 3)) by A25, Th45, A27; :: thesis: verum
end;
for k being Nat holds S1[k] from NAT_1:sch 2(A24, A4);
hence (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n + 0 by A1, A2, A3
.= n ;
:: thesis: verum