reserve s for State of SCM+FSA,
  a, c for read-write Int-Location,
  aa, bb, cc,
  dd, x for Int-Location,
  f for FinSeq-Location,
  I, J for MacroInstruction of SCM+FSA,
  Ig for good MacroInstruction of SCM+FSA,
  i, k for Nat,
  p for Instruction-Sequence of SCM+FSA;
reserve I for MacroInstruction of SCM+FSA;

theorem Th29:
  1 <= s.aa & s.aa <= s.bb & s.bb <= len (s.f) & aa <> c & bb <> c
& s.intloc 0 = 1 implies IExec(FinSeqMin(f, aa, bb, c),p,s).c
 = min_at(s.f, |.s.aa.|, |.s.bb.|)
proof
  set a = aa, b = bb;
  assume that
A1: 1 <= s.a and
A2: s.a <= s.b and
A3: s.b <= len (s.f) and
A4: a <> c and
A5: b <> c and
A6: s.intloc 0 = 1;
A7: b = intloc 0 or b is read-write by SCMFSA_M:def 2;
  set i0 = c := a;
  set s1 = Exec(i0, Initialized s),
      p1 = p;
A8: a = intloc 0 or a is read-write by SCMFSA_M:def 2;
  reconsider sa = |.s.a.| as Element of NAT;
A9: s.a = sa by A1,ABSVALUE:def 1;
  s.a-s.a <= s.b-s.a by A2,XREAL_1:9;
  then reconsider sba = s.b-s.a as Element of NAT by INT_1:3;
A10: s1.f = (Initialized s).f by SCMFSA_2:63
    .= s.f by SCMFSA_M:37;
  set k = sba+1;
  set cv = 3-rdRWNotIn {a, b, c};
  set aux2 = 2-ndRWNotIn {a, b, c};
  set aux1 = 1-stRWNotIn {a, b, c};
A11: aux1 <> aux2 by SCMFSA_M:26;
  set I12 = if>0(aux2, aux1, Macro (c := cv), Stop SCM+FSA);
  set i10 = aux1 := (f, cv);
A12: aux2 <> cv by SCMFSA_M:26;
  set i11 = aux2 := (f, c);
A13: aux1 <> cv by SCMFSA_M:26;
A14: c in {a, b, c} by ENUMSET1:def 1;
  then
A15: cv <> c by SCMFSA_M:25;
  set I1B = i10 ";" i11 ";" I12;
  set I1 = for-up ( cv, a, b, I1B);
  set SF = StepForUp(cv, a, b, I1B, p1, s1);
  defpred P[Nat] means 0 < $1 & $1 <= k implies SF.$1.intloc 0 = 1
& SF.$1.cv = $1+s1.a & SF.$1.f = s1.f & ex sa1 being Element of NAT st sa1 = $1
  +sa-1 & SF.$1.c = min_at(s.f, sa, sa1);
  cv in {cv, a, b} by ENUMSET1:def 1;
  then
A16: cv in {cv, a, b} \/ (UsedILoc I1B) by XBOOLE_0:def 3;
A17: ProperForUpBody cv, a, b, I1B, s1, p1 by Th15;
A18: aux1 <> c by A14,SCMFSA_M:25;
A19: aux2 <> c by A14,SCMFSA_M:25;
A20: s1.c = (Initialized s).a by SCMFSA_2:63
    .= s.a by A6,A8,SCMFSA_M:9,37;
A21: s1.a = (Initialized s).a by A4,SCMFSA_2:63
    .= s.a by A6,A8,SCMFSA_M:9,37;
A22: s.a <= len (s.f) by A2,A3,XXREAL_0:2;
  then
A23: sa in dom (s.f) by A1,A9,FINSEQ_3:25;
A24: s1.b = (Initialized s).b by A5,SCMFSA_2:63
    .= s.b by A6,A7,SCMFSA_M:9,37;
A25: s1.intloc 0 = (Initialized s). intloc 0 by SCMFSA_2:63
    .= 1 by SCMFSA_M:9;
  then
A26: DataPart IExec(I1,p1,s1) = DataPart SF.k by A21,A24,Th23;
  c in {c, cv} by TARSKI:def 2;
  then c in UsedIntLoc (c := cv) by SF_MASTR:14;
  then c in UsedILoc Macro (c := cv) by SF_MASTR:28;
  then c in {aux2, aux1} \/ (UsedILoc Macro (c := cv)) by XBOOLE_0:def 3;
  then c in {aux2, aux1} \/ (UsedILoc Macro (c := cv)) \/ UsedILoc Stop
  SCM+FSA by XBOOLE_0:def 3;
  then c in UsedILoc I12 by Th6;
  then c in (UsedILoc (i10 ";" i11)) \/ UsedILoc I12 by XBOOLE_0:def 3;
  then
A27: c in UsedILoc I1B by SF_MASTR:27;
  then
A28: c in {cv, a, b} \/ (UsedILoc I1B) by XBOOLE_0:def 3;
A29: for n being Nat st P[n] holds P[n+1]
  proof
    let n be Nat such that
A30: P[n] and
    0 < n+1 and
A31: n+1 <= k;
A32: SF.n.intloc 0 = 1 & SF.n.cv = n+s1.a & SF.n.cv <= s1.b
    proof
      per cases;
      suppose
A33:    0 = n;
        hence SF.n.intloc 0 = 1 by A25,Th8;
        thus SF.n.cv = n+s1.a by A33,Th9;
        thus thesis by A2,A21,A24,A33,Th9;
      end;
      suppose
A34:    0 < n;
        hence SF.n.intloc 0 = 1 by A30,A31,NAT_1:13;
        thus SF.n.cv = n+s1.a by A30,A31,A34,NAT_1:13;
        n+1-1 <= s.b-s.a+1-1 by A31,XREAL_1:9;
        hence thesis by A21,A24,A30,A34,NAT_1:13,XREAL_1:19;
      end;
    end;
    set S0 = Initialized (SF.n);
    set S1 = Exec(i10, S0);
    set S2 = Exec(i11, Exec(i10, S0));
A35: IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n).f
       = S2.f by SCMFSA6C:9
      .= S1.f by SCMFSA_2:72
      .= S0.f by SCMFSA_2:72;
    IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).intloc 0 = S2.intloc 0 by SCMFSA6C:8
      .= S1.intloc 0 by SCMFSA_2:72
      .= S0.intloc 0 by SCMFSA_2:72
      .= 1 by SCMFSA_M:9;
    then
A36: DataPart IExec(Stop SCM+FSA,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n))
       = DataPart
    IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)
       by Th1;
    n < n+1 by XREAL_1:29;
    then n < k by A31,XXREAL_0:2;
    then
A37: SF.(n+1) | ({cv, a, b} \/ (UsedILoc I1B) \/ FinSeq-Locations) =
IExec(I1B ";" AddTo(cv, intloc 0),
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n) |
       ({cv, a, b} \/ (UsedILoc I1B) \/
    FinSeq-Locations) by A25,A21,A24,A17,Th19;
    then
A38: SF.(n+1).f = IExec(I1B ";" AddTo(cv, intloc 0),
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n).f
       by SCMFSA_M:28
      .= Exec(AddTo(cv, intloc 0), IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).f
       by SFMASTR1:12
      .= IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n).f
       by SCMFSA_2:64
      .= IExec(I12,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).f
       by SFMASTR1:8;
A39: SF.(n+1).c = IExec(I1B ";" AddTo(cv, intloc 0),
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n).c
       by A28,A37,SCMFSA_M:28
      .= Exec(AddTo(cv, intloc 0), IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).c
       by SFMASTR1:11
      .= IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n).c
       by A15,SCMFSA_2:64
      .= IExec(I12,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).c
       by SFMASTR1:7;
A40: SF.(n+1).cv = IExec(I1B ";" AddTo(cv, intloc 0),
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).cv by A16,A37,SCMFSA_M:28
      .= Exec(AddTo(cv, intloc 0), IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n)).cv by SFMASTR1:11
      .= IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).cv+IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).intloc 0 by SCMFSA_2:64
      .= IExec(I1B,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).cv+1 by SCMFSA6B:11
      .= IExec(I12,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n)).cv+1 by SFMASTR1:7;
A41: Macro (c := cv) does not refer aux2 & Stop SCM+FSA does not refer
    aux2 by A12,Th2,Th3,SCMFSA8C:51;
A42: IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).c = S2.c by SCMFSA6C:8
      .= S1.c by A19,SCMFSA_2:72
      .= S0.c by A18,SCMFSA_2:72
      .= SF.n.c by SCMFSA_M:37;
A43: IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n).cv
       = S2.cv by SCMFSA6C:8
      .= S1.cv by A12,SCMFSA_2:72
      .= S0.cv by A13,SCMFSA_2:72;
    per cases;
    suppose
A44:  0 = n;
      thus thesis
      proof
        reconsider sa1 = (n+1)+sa-1 as Element of NAT by A44;
A45:    SF.0.c = s1.c by A15,A27,Th12;
A46:    S1.c = S0.c by A18,SCMFSA_2:72
          .= s.a by A20,A44,A45,SCMFSA_M:37;
        thus SF.(n+1).intloc 0 = 1 by A25,A21,A24,A17,A31,Th17;
A47:    S0.f = SF.0.f by A44,SCMFSA_M:37
          .= s.f by A10,Th13;
        then
A48:    S1.f = s.f by SCMFSA_2:72;
A49:    S0.cv = SF.0.cv by A44,SCMFSA_M:37
          .= s.a by A21,Th9;
        then reconsider S0cv = S0.cv as Element of NAT by A1,INT_1:3;
A50:    IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).aux1 = S2.aux1 by SCMFSA6C:8
          .= S1.aux1 by A11,SCMFSA_2:72
          .= (S0.f)/.|.S0.cv.| by Th4
          .= s.f.S0cv by A9,A23,A47,A49,PARTFUN1:def 6;
A51:    IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).aux2 = S2.aux2 by SCMFSA6C:8
          .= (S1.f)/.|.S1.c.| by Th4
          .= s.f.S0cv by A9,A23,A49,A48,A46,PARTFUN1:def 6;
        hence SF.(n+1).cv = IExec(Stop SCM+FSA,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n)).cv+1
        by A12,A41,A40,A50,SCMFSA8B:40
          .= (n+1)+s1.a by A21,A36,A43,A44,A49,SCMFSA_M:2;
        thus SF.(n+1).f = IExec(Stop SCM+FSA,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).f
       by A41,A38,A50,A51,SCMFSA8B:40
          .= s1.f by A10,A36,A35,A47,SCMFSA_M:2;
        take sa1;
        thus sa1 = (n+1)+sa-1;
        SF.(n+1).c = IExec(Stop SCM+FSA,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).c
       by A19,A41,A39,A50,A51,SCMFSA8B:40
          .= s.a by A20,A36,A42,A44,A45,SCMFSA_M:2;
        hence thesis by A1,A22,A9,A44,FINSEQ_6:162;
      end;
    end;
    suppose
A52:  0 < n;
      thus thesis
      proof
A53:    S0.cv = SF.n.cv by SCMFSA_M:37;
        then reconsider S0cv = S0.cv as Element of NAT by A1,A21,A32,INT_1:3;
        1 <= S0cv & S0cv <= len (s.f) by A1,A3,A9,A21,A24,A32,A53,NAT_1:12
,XXREAL_0:2;
        then
A54:    S0cv in dom (s.f) by FINSEQ_3:25;
A55:    S0.f = s.f by A10,A30,A31,A52,NAT_1:13,SCMFSA_M:37;
        then
A56:    S1.f = s.f by SCMFSA_2:72;
A57:    IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).aux1 = S2.aux1 by SCMFSA6C:8
          .= S1.aux1 by A11,SCMFSA_2:72
          .= (S0.f)/.|.S0.cv.| by Th4
          .= (S0.f)/.S0cv by ABSVALUE:def 1
          .= s.f.S0cv by A55,A54,PARTFUN1:def 6;
        n+s.a <= len (s.f) by A3,A21,A24,A32,XXREAL_0:2;
        then n+s.a-1 <= len (s.f)-1 by XREAL_1:9;
        then
A58:    n+s.a-1+0 <= len (s.f)-1+1 by XREAL_1:7;
        thus SF.(n+1).intloc 0 = 1 by A25,A21,A24,A17,A31,Th17;
        consider sa1 being Nat such that
A59:    sa1 = n+sa-1 and
A60:    SF.n.c = min_at(s.f, sa, sa1) by A30,A31,A52,NAT_1:13;
        reconsider SFnc = SF.n.c as Element of NAT
             by A60,ORDINAL1:def 12;
        0+1 <= n by A52,NAT_1:13;
        then 1-1 <= n-1 by XREAL_1:9;
        then
A61:    0+s.a <= n-1+s.a by XREAL_1:6;
        then
A62:    sa <= SFnc by A1,A9,A59,A60,A58,FINSEQ_6:161;
        then
A63:    1 <= SFnc by A1,A9,XXREAL_0:2;
A64:    SFnc <= sa1 by A1,A9,A59,A60,A61,A58,FINSEQ_6:161;
        then SFnc <= len (s.f) by A9,A59,A58,XXREAL_0:2;
        then
A65:    SFnc in dom (s.f) by A63,FINSEQ_3:25;
A66:    IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).aux2
       = S2.aux2 by SCMFSA6C:8
          .= (S1.f)/.|.S1.c.| by Th4
          .= (S1.f)/.|.S0.c.| by A18,SCMFSA_2:72
          .= (S1.f)/.|.SF.n.c.| by SCMFSA_M:37
          .= (S1.f)/.SFnc by ABSVALUE:def 1
          .= s.f.SFnc by A56,A65,PARTFUN1:def 6;
A67:    for i st sa <= i & i < SF.n.c holds s.f.i > s.f.(SFnc) by A1,A9,A59,A60
,A61,A58,FINSEQ_6:161;
        thus thesis
        proof
A68:      (n+1)+s.a-1 <= len (s.f) by A3,A21,A24,A32,XXREAL_0:2;
A69:      (n+1)+s.a-1 = n+s.a+1-1
            .= n+sa by A1,ABSVALUE:def 1;
          then
A70:      s.a <= (n+1)+s.a-1 by NAT_1:12;
          per cases;
          suppose
A71:        s.f.S0cv < s.f.SFnc;
A72: IExec(Macro (c := cv),
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)
            ).cv
    = ( Exec(c := cv, Initialized IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n))).cv by SCMFSA6C:5
              .= (Initialized IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n)).cv by A15,SCMFSA_2:63;
    thus SF.(n+1).cv
         = (Initialized IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n)).cv+1 by A72,A12,A41,A40,A57,A66,A71,SCMFSA8B:40
              .= IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).cv+1 by SCMFSA_M:37
              .= (n+1)+s1.a by A32,A43,A53;
            thus SF.(n+1).f
            = IExec(Macro (c := cv),
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n))
            .f by A41,A38,A57,A66,A71,SCMFSA8B:40
      .= ( Exec(c := cv, Initialized IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n))).f by SCMFSA6C:5
              .= (Initialized IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n)).f by SCMFSA_2:63
              .= s1.f by A10,A35,A55,SCMFSA_M:37;
            reconsider sa11 = (n+1)+sa-1 as Element of NAT by A69;
            take sa11;
            thus sa11 = (n+1)+sa-1;
A73:        for i st s.a <= i & i <= (n+1)+s.a-1 holds s.f.S0cv <= s.f.i
            proof
              let i such that
A74:          s.a <= i and
A75:          i <= (n+1)+s.a-1;
              per cases by A75,XXREAL_0:1;
              suppose
                i < (n+1)+s.a-1;
                then i+1 <= n+s.a by A69,NAT_1:13;
                then i+1-1 <= n+s.a-1 by XREAL_1:9;
                then s.f.(SFnc) <= s.f.i by A1,A9,A59,A60,A61,A58,A74,
FINSEQ_6:161;
                hence thesis by A71,XXREAL_0:2;
              end;
              suppose
                i = (n+1)+s.a-1;
                hence thesis by A21,A32,SCMFSA_M:37;
              end;
            end;
A76:        for i st s.a <= i & i < S0cv holds s.f.i > s.f.S0cv
            proof
              let i;
              assume that
A77:          s.a <= i and
A78:          i < S0cv;
              i+1 <= S0cv by A78,NAT_1:13;
              then i+1-1 <= S0cv-1 by XREAL_1:9;
              then s.f.SFnc <= s.f.i by A1,A9,A21,A32,A53,A59,A60,A61,A58,A77,
FINSEQ_6:161;
              hence thesis by A71,XXREAL_0:2;
            end;
            SF.(n+1).c
            = IExec(Macro (c := cv),
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n))
            .c by A19,A41,A39,A57,A66,A71,SCMFSA8B:40
     .= ( Exec(c := cv, Initialized IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)
      )).c
       by SCMFSA6C:5
              .= (Initialized IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).cv
       by SCMFSA_2:63
              .= S0cv by A43,SCMFSA_M:37;
            hence thesis by A1,A9,A21,A32,A53,A70,A68,A73,A76,FINSEQ_6:161;
          end;
          suppose
A79:        s.f.SFnc <= s.f.S0cv;
            thus thesis
            proof
A80:          for i st s.a <= i & i <= (n+1)+s.a-1 holds s.f.(SFnc) <= s
              .f.i
              proof
                let i such that
A81:            s.a <= i and
A82:            i <= (n+1)+s.a-1;
                per cases by A82,XXREAL_0:1;
                suppose
                  i < (n+1)+s.a-1;
                  then i+1 <= n+s.a by A69,NAT_1:13;
                  then i+1-1 <= n+s.a-1 by XREAL_1:9;
                  hence thesis by A1,A9,A59,A60,A61,A58,A81,FINSEQ_6:161;
                end;
                suppose
                  i = (n+1)+s.a-1;
                  hence thesis by A21,A32,A79,SCMFSA_M:37;
                end;
              end;
              thus SF.(n+1).cv = IExec(Stop SCM+FSA,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n))
              .cv+1 by A12,A41,A40,A57,A66,A79,SCMFSA8B:40
                .= IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      SF.n).cv+1 by A36,SCMFSA_M:2
                .= (n+1)+s1.a by A32,A43,A53;
              thus SF.(n+1).f = IExec(Stop SCM+FSA,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n)).
              f by A41,A38,A57,A66,A79,SCMFSA8B:40
                .= s1.f by A10,A36,A35,A55,SCMFSA_M:2;
              reconsider sa11 = (n+1)+sa-1 as Element of NAT by A69;
              take sa11;
              thus sa11 = (n+1)+sa-1;
              n+s.a-1 <= n+s.a-1+1 by XREAL_1:29;
              then
A83:          SFnc <= (n+1)+s.a-1 by A9,A59,A64,XXREAL_0:2;
              SF.(n+1).c = IExec(Stop SCM+FSA,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)),
      IExec(i10 ";" i11,
   p1 +* while>0(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B),
     I1B ";" AddTo(cv, intloc 0) ";"
      SubFrom(1-stRWNotIn ({cv, a, b} \/ UsedILoc I1B), intloc 0)), SF.n))
              .c by A19,A41,A39,A57,A66,A79,SCMFSA8B:40
                .= SF.n.c by A36,A42,SCMFSA_M:2;
              hence thesis by A1,A9,A62,A67,A70,A68,A83,A80,FINSEQ_6:161;
            end;
          end;
        end;
      end;
    end;
  end;
  reconsider sb = |.s.b.| as Element of NAT;
A84: P[0];
  for n being Nat holds P[n] from NAT_1:sch 2(A84, A29);
  then consider sab being Element of NAT such that
A85: sab = k+sa-1 and
A86: SF.k.c = min_at(s.f, sa, sab);
A87: sab = sb by A9,A85,ABSVALUE:def 1;
  I1 is_halting_on s1,p1 by A25,Th24;
  hence IExec(FinSeqMin(f, a, b, c),p, s).c = IExec(I1,p1,s1).c by SFMASTR1:14
    .= min_at(s.f, |.s.a.|, |.s.b.|) by A26,A86,A87,SCMFSA_M:2;
end;
