
theorem Th21:
 for I being MacroInstruction of SCM+FSA,
     i being No-StopCode Instruction of SCM+FSA,
     n being Nat st n + 1 < card I
  holds I +* (n,i) is MacroInstruction of SCM+FSA
proof let I be MacroInstruction of SCM+FSA,
    i be No-StopCode Instruction of SCM+FSA,
    n be Nat such that
A1:  n + 1 < card I;
  set F = I +*(n,i);
A2: dom F = dom I by FUNCT_7:30;
   then
A3:  LastLoc F = LastLoc I;
A4: n + 1 < card F by A1,A2;

A5: card F >= 0+1 by NAT_1:13;
   LastLoc F = card F -' 1 by AFINSQ_1:70
         .= card F - 1 by A5,XREAL_1:233;
   then n + 1 - 1 < LastLoc F by A4,XREAL_1:14;
   then n < LastLoc I by A3;
   then F.LastLoc F = I.LastLoc I by A3,FUNCT_7:32
     .= halt SCM+FSA by COMPOS_1:def 14;
   then
A6:  F is halt-ending;
  F is unique-halt
    proof let f be Nat such that
A7:   F.f = halt SCM+FSA and
A8:   f in dom F;
     now assume
A9:      I.f <> halt SCM+FSA;
       per cases;
       suppose f = n;
        then F.f = i by FUNCT_7:31,A8,A2;
       hence contradiction by A7,COMPOS_0:def 12;
       end;
       suppose f <> n;
        then F.f = I.f
        by FUNCT_7:32;
       hence contradiction by A9,A7;
       end;
      end;
     hence f = LastLoc F by A2,A8,A3,COMPOS_1:def 15;
    end;
 hence thesis by A6;
end;
