let s be State of ; :: thesis: ( s . (intloc 0 ) = 1 implies for c0 being Element of NAT st IC s = insloc c0 holds
for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . (insloc ((c0 + c) -' 1)) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k ) )

assume A1: s . (intloc 0 ) = 1 ; :: thesis: for c0 being Element of NAT st IC s = insloc c0 holds
for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . (insloc ((c0 + c) -' 1)) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k )

let c0 be Element of NAT ; :: thesis: ( IC s = insloc c0 implies for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . (insloc ((c0 + c) -' 1)) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k ) )

assume A2: IC s = insloc c0 ; :: thesis: for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . (insloc ((c0 + c) -' 1)) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k )

let a be Int-Location ; :: thesis: for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . (insloc ((c0 + c) -' 1)) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k )

let k be Integer; :: thesis: ( a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . (insloc ((c0 + c) -' 1)) ) implies ( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k ) )

assume that
A3: a <> intloc 0 and
A4: for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . (insloc ((c0 + c) -' 1)) ; :: thesis: ( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k )

per cases ( k > 0 or k <= 0 ) ;
suppose A5: k > 0 ; :: thesis: ( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k )

then reconsider k' = k as Element of NAT by INT_1:16;
consider k1 being Element of NAT such that
A6: k1 + 1 = k' and
A7: aSeq a,k' = <*(a := (intloc 0 ))*> ^ (k1 |-> (AddTo a,(intloc 0 ))) by A5, Def3;
defpred S1[ Element of NAT ] means ( $1 <= k' implies ( IC (Computation s,$1) = insloc (c0 + $1) & ( 1 <= $1 implies (Computation s,$1) . a = $1 ) & ( for b being Int-Location st b <> a holds
(Computation s,$1) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,$1) . f = s . f ) ) );
A8: len (aSeq a,k') = (len <*(a := (intloc 0 ))*>) + (len (k1 |-> (AddTo a,(intloc 0 )))) by A7, FINSEQ_1:35
.= 1 + (len (k1 |-> (AddTo a,(intloc 0 )))) by FINSEQ_1:56
.= k' by A6, FINSEQ_1:def 18 ;
A9: for i being Element of NAT st i <= len (aSeq a,k') holds
( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = i ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) )
proof
A10: now
let i be Element of NAT ; :: thesis: ( i < k' implies i + 1 in dom (aSeq a,k') )
assume i < k' ; :: thesis: i + 1 in dom (aSeq a,k')
then insloc i in dom (Load (aSeq a,k')) by A8, Th29;
hence i + 1 in dom (aSeq a,k') by Th26; :: thesis: verum
end;
A11: now
let i be Element of NAT ; :: thesis: ( i < k' implies s . (insloc (c0 + i)) = (aSeq a,k') . (i + 1) )
assume A12: i < k' ; :: thesis: s . (insloc (c0 + i)) = (aSeq a,k') . (i + 1)
thus s . (insloc (c0 + i)) = s . (insloc (((c0 + i) + 1) -' 1)) by NAT_D:34
.= s . (insloc ((c0 + (i + 1)) -' 1))
.= (aSeq a,k') . (i + 1) by A4, A10, A12 ; :: thesis: verum
end;
then A13: s . (insloc (c0 + 0 )) = (aSeq a,k') . (0 + 1) by A5
.= a := (intloc 0 ) by A7, FINSEQ_1:58 ;
A14: now
let n be Element of NAT ; :: thesis: ( n = 0 implies ( Computation s,n = s & CurInstr (Computation s,n) = a := (intloc 0 ) & Computation s,(n + 1) = Exec (a := (intloc 0 )),s ) )
assume n = 0 ; :: thesis: ( Computation s,n = s & CurInstr (Computation s,n) = a := (intloc 0 ) & Computation s,(n + 1) = Exec (a := (intloc 0 )),s )
hence A15: Computation s,n = s by AMI_1:13; :: thesis: ( CurInstr (Computation s,n) = a := (intloc 0 ) & Computation s,(n + 1) = Exec (a := (intloc 0 )),s )
hence CurInstr (Computation s,n) = a := (intloc 0 ) by A2, A13; :: thesis: Computation s,(n + 1) = Exec (a := (intloc 0 )),s
thus Computation s,(n + 1) = Following (Computation s,n) by AMI_1:14
.= Exec (a := (intloc 0 )),s by A2, A13, A15 ; :: thesis: verum
end;
A16: now
let i be Element of NAT ; :: thesis: ( 1 < i & i <= k' implies (aSeq a,k') . i = AddTo a,(intloc 0 ) )
assume that
A17: 1 < i and
A18: i <= k' ; :: thesis: (aSeq a,k') . i = AddTo a,(intloc 0 )
A19: 1 <= i - 1 by A17, INT_1:79;
then reconsider i1 = i - 1 as Element of NAT by INT_1:16;
i - 1 <= k' - 1 by A18, XREAL_1:11;
then A20: i1 in Seg k1 by A6, A19;
len <*(a := (intloc 0 ))*> = 1 by FINSEQ_1:56;
hence (aSeq a,k') . i = (k1 |-> (AddTo a,(intloc 0 ))) . (i - 1) by A7, A8, A17, A18, FINSEQ_1:37
.= AddTo a,(intloc 0 ) by A20, FUNCOP_1:13 ;
:: thesis: verum
end;
A21: now
let i be Element of NAT ; :: thesis: ( 0 < i & i < k' implies s . (insloc (c0 + i)) = AddTo a,(intloc 0 ) )
assume that
A22: 0 < i and
A23: i < k' ; :: thesis: s . (insloc (c0 + i)) = AddTo a,(intloc 0 )
A24: ( 0 + 1 < i + 1 & i + 1 <= k' ) by A22, A23, NAT_1:13, XREAL_1:8;
thus s . (insloc (c0 + i)) = (aSeq a,k') . (i + 1) by A11, A23
.= AddTo a,(intloc 0 ) by A16, A24 ; :: thesis: verum
end;
A25: for n being Element of NAT st S1[n] holds
S1[n + 1]
proof
let n be Element of NAT ; :: thesis: ( S1[n] implies S1[n + 1] )
assume A26: S1[n] ; :: thesis: S1[n + 1]
assume A27: n + 1 <= k' ; :: thesis: ( IC (Computation s,(n + 1)) = insloc (c0 + (n + 1)) & ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

per cases ( n = 0 or n > 0 ) ;
suppose A28: n = 0 ; :: thesis: ( IC (Computation s,(n + 1)) = insloc (c0 + (n + 1)) & ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

hence IC (Computation s,(n + 1)) = (Exec (a := (intloc 0 )),s) . (IC SCM+FSA ) by A14
.= Next (insloc (c0 + n)) by A2, A28, SCMFSA_2:89
.= insloc ((c0 + n) + 1) by NAT_1:39
.= insloc (c0 + (n + 1)) ;
:: thesis: ( ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

hereby :: thesis: ( ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )
assume 1 <= n + 1 ; :: thesis: (Computation s,(n + 1)) . a = n + 1
thus (Computation s,(n + 1)) . a = (Exec (a := (intloc 0 )),s) . a by A14, A28
.= n + 1 by A1, A28, SCMFSA_2:89 ; :: thesis: verum
end;
hereby :: thesis: for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f
let b be Int-Location ; :: thesis: ( b <> a implies (Computation s,(n + 1)) . b = s . b )
assume A29: b <> a ; :: thesis: (Computation s,(n + 1)) . b = s . b
thus (Computation s,(n + 1)) . b = (Exec (a := (intloc 0 )),s) . b by A14, A28
.= s . b by A29, SCMFSA_2:89 ; :: thesis: verum
end;
let f be FinSeq-Location ; :: thesis: (Computation s,(n + 1)) . f = s . f
thus (Computation s,(n + 1)) . f = (Exec (a := (intloc 0 )),s) . f by A14, A28
.= s . f by SCMFSA_2:89 ; :: thesis: verum
end;
suppose A30: n > 0 ; :: thesis: ( IC (Computation s,(n + 1)) = insloc (c0 + (n + 1)) & ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

A31: n < k' by A27, NAT_1:13;
A32: n + 0 <= n + 1 by XREAL_1:9;
then A33: CurInstr (Computation s,n) = s . (insloc (c0 + n)) by A26, A27, AMI_1:54, XXREAL_0:2
.= AddTo a,(intloc 0 ) by A21, A30, A31 ;
A34: Computation s,(n + 1) = Following (Computation s,n) by AMI_1:14
.= Exec (AddTo a,(intloc 0 )),(Computation s,n) by A33 ;
hence IC (Computation s,(n + 1)) = Next (IC (Computation s,n)) by SCMFSA_2:90
.= insloc ((c0 + n) + 1) by A26, A27, A32, NAT_1:39, XXREAL_0:2
.= insloc (c0 + (n + 1)) ;
:: thesis: ( ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

A35: 0 + 1 <= n by A30, INT_1:20;
hereby :: thesis: ( ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )
assume 1 <= n + 1 ; :: thesis: (Computation s,(n + 1)) . a = n + 1
thus (Computation s,(n + 1)) . a = n + ((Computation s,n) . (intloc 0 )) by A26, A27, A35, A32, A34, SCMFSA_2:90, XXREAL_0:2
.= n + 1 by A1, A3, A26, A27, A32, XXREAL_0:2 ; :: thesis: verum
end;
hereby :: thesis: for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f
let b be Int-Location ; :: thesis: ( b <> a implies (Computation s,(n + 1)) . b = s . b )
assume A36: b <> a ; :: thesis: (Computation s,(n + 1)) . b = s . b
hence (Computation s,(n + 1)) . b = (Computation s,n) . b by A34, SCMFSA_2:90
.= s . b by A26, A27, A32, A36, XXREAL_0:2 ;
:: thesis: verum
end;
let f be FinSeq-Location ; :: thesis: (Computation s,(n + 1)) . f = s . f
thus (Computation s,(n + 1)) . f = (Computation s,n) . f by A34, SCMFSA_2:90
.= s . f by A26, A27, A32, XXREAL_0:2 ; :: thesis: verum
end;
end;
end;
A37: S1[ 0 ] by A2, AMI_1:13;
A38: for i being Element of NAT holds S1[i] from NAT_1:sch 1(A37, A25);
let i be Element of NAT ; :: thesis: ( i <= len (aSeq a,k') implies ( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = i ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) )

assume i <= len (aSeq a,k') ; :: thesis: ( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = i ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) )

hence ( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = i ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) by A8, A38; :: thesis: verum
end;
hence for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ; :: thesis: (Computation s,(len (aSeq a,k))) . a = k
1 <= len (aSeq a,k) by A6, A8, NAT_1:11;
hence (Computation s,(len (aSeq a,k))) . a = k by A8, A9; :: thesis: verum
end;
suppose A39: k <= 0 ; :: thesis: ( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ) & (Computation s,(len (aSeq a,k))) . a = k )

then reconsider mk = - k as Element of NAT by INT_1:16;
defpred S1[ Element of NAT ] means ( $1 <= (mk + 1) + 1 implies ( IC (Computation s,$1) = insloc (c0 + $1) & ( 1 <= $1 implies (Computation s,$1) . a = ((- $1) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,$1) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,$1) . f = s . f ) ) );
consider k1 being Element of NAT such that
A40: k1 + k = 1 and
A41: aSeq a,k = <*(a := (intloc 0 ))*> ^ (k1 |-> (SubFrom a,(intloc 0 ))) by A39, Def3;
A42: len (aSeq a,k) = (len <*(a := (intloc 0 ))*>) + (len (k1 |-> (SubFrom a,(intloc 0 )))) by A41, FINSEQ_1:35
.= 1 + (len (k1 |-> (SubFrom a,(intloc 0 )))) by FINSEQ_1:56
.= (mk + 1) + 1 by A40, FINSEQ_1:def 18 ;
A43: for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = ((- i) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) )
proof
A44: now
let i be Element of NAT ; :: thesis: ( i < (mk + 1) + 1 implies i + 1 in dom (aSeq a,k) )
assume i < (mk + 1) + 1 ; :: thesis: i + 1 in dom (aSeq a,k)
then insloc i in dom (Load (aSeq a,k)) by A42, Th29;
hence i + 1 in dom (aSeq a,k) by Th26; :: thesis: verum
end;
A45: now
let i be Element of NAT ; :: thesis: ( i < (mk + 1) + 1 implies s . (insloc (c0 + i)) = (aSeq a,k) . (i + 1) )
assume A46: i < (mk + 1) + 1 ; :: thesis: s . (insloc (c0 + i)) = (aSeq a,k) . (i + 1)
thus s . (insloc (c0 + i)) = s . (insloc (((c0 + i) + 1) -' 1)) by NAT_D:34
.= s . (insloc ((c0 + (i + 1)) -' 1))
.= (aSeq a,k) . (i + 1) by A4, A44, A46 ; :: thesis: verum
end;
then A47: s . (insloc (c0 + 0 )) = (aSeq a,k) . (0 + 1)
.= a := (intloc 0 ) by A41, FINSEQ_1:58 ;
A48: for n being Element of NAT st n = 0 holds
( Computation s,n = s & CurInstr (Computation s,n) = a := (intloc 0 ) & Computation s,(n + 1) = Exec (a := (intloc 0 )),s )
proof
let n be Element of NAT ; :: thesis: ( n = 0 implies ( Computation s,n = s & CurInstr (Computation s,n) = a := (intloc 0 ) & Computation s,(n + 1) = Exec (a := (intloc 0 )),s ) )
assume n = 0 ; :: thesis: ( Computation s,n = s & CurInstr (Computation s,n) = a := (intloc 0 ) & Computation s,(n + 1) = Exec (a := (intloc 0 )),s )
hence A49: Computation s,n = s by AMI_1:13; :: thesis: ( CurInstr (Computation s,n) = a := (intloc 0 ) & Computation s,(n + 1) = Exec (a := (intloc 0 )),s )
hence CurInstr (Computation s,n) = a := (intloc 0 ) by A2, A47; :: thesis: Computation s,(n + 1) = Exec (a := (intloc 0 )),s
thus Computation s,(n + 1) = Following (Computation s,n) by AMI_1:14
.= Exec (a := (intloc 0 )),s by A2, A47, A49 ; :: thesis: verum
end;
A50: now
let i be Element of NAT ; :: thesis: ( 1 < i & i <= (mk + 1) + 1 implies (aSeq a,k) . i = SubFrom a,(intloc 0 ) )
assume that
A51: 1 < i and
A52: i <= (mk + 1) + 1 ; :: thesis: (aSeq a,k) . i = SubFrom a,(intloc 0 )
A53: i - 1 <= ((mk + 1) + 1) - 1 by A52, XREAL_1:11;
A54: 1 - 1 < i - 1 by A51, XREAL_1:11;
then reconsider i1 = i - 1 as Element of NAT by INT_1:16;
(1 - 1) + 1 <= i - 1 by A54, INT_1:20;
then A55: i1 in Seg k1 by A40, A53;
len <*(a := (intloc 0 ))*> = 1 by FINSEQ_1:56;
hence (aSeq a,k) . i = (k1 |-> (SubFrom a,(intloc 0 ))) . (i - 1) by A41, A42, A51, A52, FINSEQ_1:37
.= SubFrom a,(intloc 0 ) by A55, FUNCOP_1:13 ;
:: thesis: verum
end;
A56: now
let i be Element of NAT ; :: thesis: ( 0 < i & i < (mk + 1) + 1 implies s . (insloc (c0 + i)) = SubFrom a,(intloc 0 ) )
assume that
A57: 0 < i and
A58: i < (mk + 1) + 1 ; :: thesis: s . (insloc (c0 + i)) = SubFrom a,(intloc 0 )
A59: ( 0 + 1 < i + 1 & i + 1 <= (mk + 1) + 1 ) by A57, A58, NAT_1:13, XREAL_1:8;
thus s . (insloc (c0 + i)) = (aSeq a,k) . (i + 1) by A45, A58
.= SubFrom a,(intloc 0 ) by A50, A59 ; :: thesis: verum
end;
A60: for n being Element of NAT st S1[n] holds
S1[n + 1]
proof
let n be Element of NAT ; :: thesis: ( S1[n] implies S1[n + 1] )
assume A61: S1[n] ; :: thesis: S1[n + 1]
assume A62: n + 1 <= (mk + 1) + 1 ; :: thesis: ( IC (Computation s,(n + 1)) = insloc (c0 + (n + 1)) & ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

per cases ( n = 0 or n > 0 ) ;
suppose A63: n = 0 ; :: thesis: ( IC (Computation s,(n + 1)) = insloc (c0 + (n + 1)) & ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

hence IC (Computation s,(n + 1)) = (Exec (a := (intloc 0 )),s) . (IC SCM+FSA ) by A48
.= Next (insloc (c0 + n)) by A2, A63, SCMFSA_2:89
.= insloc ((c0 + n) + 1) by NAT_1:39
.= insloc (c0 + (n + 1)) ;
:: thesis: ( ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

hereby :: thesis: ( ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )
assume 1 <= n + 1 ; :: thesis: (Computation s,(n + 1)) . a = ((- (n + 1)) + 1) + 1
thus (Computation s,(n + 1)) . a = (Exec (a := (intloc 0 )),s) . a by A48, A63
.= ((- (n + 1)) + 1) + 1 by A1, A63, SCMFSA_2:89 ; :: thesis: verum
end;
hereby :: thesis: for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f
let b be Int-Location ; :: thesis: ( b <> a implies (Computation s,(n + 1)) . b = s . b )
assume A64: b <> a ; :: thesis: (Computation s,(n + 1)) . b = s . b
thus (Computation s,(n + 1)) . b = (Exec (a := (intloc 0 )),s) . b by A48, A63
.= s . b by A64, SCMFSA_2:89 ; :: thesis: verum
end;
let f be FinSeq-Location ; :: thesis: (Computation s,(n + 1)) . f = s . f
thus (Computation s,(n + 1)) . f = (Exec (a := (intloc 0 )),s) . f by A48, A63
.= s . f by SCMFSA_2:89 ; :: thesis: verum
end;
suppose A65: n > 0 ; :: thesis: ( IC (Computation s,(n + 1)) = insloc (c0 + (n + 1)) & ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

A66: n < (mk + 1) + 1 by A62, NAT_1:13;
A67: n + 0 <= n + 1 by XREAL_1:9;
then A68: CurInstr (Computation s,n) = s . (insloc (c0 + n)) by A61, A62, AMI_1:54, XXREAL_0:2
.= SubFrom a,(intloc 0 ) by A56, A65, A66 ;
A69: Computation s,(n + 1) = Following (Computation s,n) by AMI_1:14
.= Exec (SubFrom a,(intloc 0 )),(Computation s,n) by A68 ;
hence IC (Computation s,(n + 1)) = Next (IC (Computation s,n)) by SCMFSA_2:91
.= insloc ((c0 + n) + 1) by A61, A62, A67, NAT_1:39, XXREAL_0:2
.= insloc (c0 + (n + 1)) ;
:: thesis: ( ( 1 <= n + 1 implies (Computation s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )

A70: 0 + 1 < n + 1 by A65, XREAL_1:8;
hereby :: thesis: ( ( for b being Int-Location st b <> a holds
(Computation s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f ) )
assume 1 <= n + 1 ; :: thesis: (Computation s,(n + 1)) . a = ((- (n + 1)) + 1) + 1
thus (Computation s,(n + 1)) . a = (((- n) + 1) + 1) - ((Computation s,n) . (intloc 0 )) by A61, A62, A70, A69, NAT_1:13, SCMFSA_2:91
.= (((- n) + 1) + 1) - (s . (intloc 0 )) by A3, A61, A62, A67, XXREAL_0:2
.= ((- (n + 1)) + 1) + 1 by A1 ; :: thesis: verum
end;
hereby :: thesis: for f being FinSeq-Location holds (Computation s,(n + 1)) . f = s . f
let b be Int-Location ; :: thesis: ( b <> a implies (Computation s,(n + 1)) . b = s . b )
assume A71: b <> a ; :: thesis: (Computation s,(n + 1)) . b = s . b
hence (Computation s,(n + 1)) . b = (Computation s,n) . b by A69, SCMFSA_2:91
.= s . b by A61, A62, A67, A71, XXREAL_0:2 ;
:: thesis: verum
end;
let f be FinSeq-Location ; :: thesis: (Computation s,(n + 1)) . f = s . f
thus (Computation s,(n + 1)) . f = (Computation s,n) . f by A69, SCMFSA_2:91
.= s . f by A61, A62, A67, XXREAL_0:2 ; :: thesis: verum
end;
end;
end;
A72: S1[ 0 ] by A2, AMI_1:13;
A73: for i being Element of NAT holds S1[i] from NAT_1:sch 1(A72, A60);
let i be Element of NAT ; :: thesis: ( i <= len (aSeq a,k) implies ( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = ((- i) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) )

assume i <= len (aSeq a,k) ; :: thesis: ( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = ((- i) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) )

hence ( IC (Computation s,i) = insloc (c0 + i) & ( 1 <= i implies (Computation s,i) . a = ((- i) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) by A42, A73; :: thesis: verum
end;
hence for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Computation s,i) = insloc (c0 + i) & ( for b being Int-Location st b <> a holds
(Computation s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Computation s,i) . f = s . f ) ) ; :: thesis: (Computation s,(len (aSeq a,k))) . a = k
1 <= len (aSeq a,k) by A42, NAT_1:11;
hence (Computation s,(len (aSeq a,k))) . a = ((- ((- k) + (1 + 1))) + 1) + 1 by A42, A43
.= k ;
:: thesis: verum
end;
end;