reserve s for State of SCM+FSA,
  I for MacroInstruction of SCM+FSA,
  a for read-write Int-Location;
reserve i,j,k,n for Nat;
reserve P,P1,P2,Q for Instruction-Sequence of SCM+FSA;

theorem Th28:
  for w being FinSequence of INT holds Initialized
   ((fsloc 0) .--> w) is Insert-Sort-Algorithm-autonomic
proof
  set DD={intloc 0,IC SCM+FSA,fsloc 0};
  let w be FinSequence of INT;
  set p=Initialized ((fsloc 0) .--> w), q=Insert-Sort-Algorithm;
  set UD={fsloc 0,a0,a1,a2,a3,a4,a5,a6}, Us=UsedI*Loc q \/ UsedILoc q;
A1: UsedILoc q ={a0,a1,a2,a3,a4,a5,a6} by Th18;
A2: UsedI*Loc q ={fsloc 0} by Th19;
  then
A3: Us = UD by A1,ENUMSET1:22;
A4: for i being Nat,s1,s2 being State of SCM+FSA,P1,P2
 st 11 <= i &  p c= s1 &  p c= s2 & q c= P1 & q c= P2
  holds Comput(P1, s1,i) | Us = Comput(P2, s2,i) | Us &
  Comput(P1, s1,i).IC SCM+FSA = Comput(P2, s2,i).IC
SCM+FSA
  proof
    let i be Nat,s1,s2 be State of SCM+FSA,P1,P2 such that
A5: 11 <= i and
A6:  p c= s1 and
A7:  p c= s2 and
A8: q c= P1 and
A9: q c= P2;
A10: s1.intloc 0 =1 by A6,SCMFSA_M:33
      .= s2.intloc 0 by A7,SCMFSA_M:33;
A11: s2 is 0-started by A7,MEMSTR_0:17;
    set Cs11= Comput(P1, s1,11), Cs21= Comput(P2,
s2,11);
A12: s1 is 0-started by A6,MEMSTR_0:17;
A13: s1.fsloc 0 =w by A6,SCMFSA_M:33
      .=s2.fsloc 0 by A7,SCMFSA_M:33;
A14: now
      let x be set;
      assume x in Us;
      then
A15:  x in UD by A2,A1,ENUMSET1:22;
      per cases by A15,ENUMSET1:def 6;
      suppose
A16:    x = fsloc 0;
        hence Cs11.x =s1.fsloc 0 by A12,Lm2,A8
          .=Cs21.x by A11,A13,A16,Lm2,A9;
      end;
      suppose
A17:    x = a0;
        hence Cs11.x =s1.a0 by A12,Lm2,A8
          .=Cs21.x by A11,A10,A17,Lm2,A9;
      end;
      suppose
A18:    x = a1;
        hence Cs11.x=len(s1.fsloc 0) by A12,Lm2,A8
          .=Cs21.x by A11,A13,A18,Lm2,A9;
      end;
      suppose
A19:    x = a2;
        hence Cs11.x=s1.a0 by A12,Lm2,A8
          .=Cs21.x by A11,A10,A19,Lm2,A9;
      end;
      suppose
A20:    x = a3;
        hence Cs11.x=s1.a0 by A12,Lm2,A8
          .=Cs21.x by A11,A10,A20,Lm2,A9;
      end;
      suppose
A21:    x = a4;
        hence Cs11.x=s1.a0 by A12,Lm2,A8
          .=Cs21.x by A11,A10,A21,Lm2,A9;
      end;
      suppose
A22:    x = a5;
        hence Cs11.x=s1.a0 by A12,Lm2,A8
          .=Cs21.x by A11,A10,A22,Lm2,A9;
      end;
      suppose
A23:    x = a6;
        hence Cs11.x=s1.a0 by A12,Lm2,A8
          .=Cs21.x by A11,A10,A23,Lm2,A9;
      end;
    end;
A24: for i holds IC Comput(P2, s2,i) in dom q by A7,Th26,A9;
A25: for i holds IC Comput(P1, s1,i) in dom q by A6,Th26,A8;
A26: Us c= dom(Cs21) by SCMBSORT:32;
    Us c= dom(Cs11) by SCMBSORT:32;
    then
A27: Cs11 | Us = Cs21 | Us by A26,A14,FUNCT_1:95;
    Cs11.IC SCM+FSA =  11 by A12,Lm2,A8
      .=Cs21.IC SCM+FSA by A11,Lm2,A9;
    hence thesis by A5,A27,A25,A24,A8,A9,SCMBSORT:15;
  end;
A28: for s1,s2 being State of SCM+FSA,P1,P2,i
 st  p c= s1 &  p c= s2 & q c= P1 & q c= P2 & i <= 10 holds
Comput(P1, s1,i).intloc 0 = Comput(P2, s2,i).intloc
0 & Comput(P1, s1,i).
  IC SCM+FSA = Comput(P2, s2,i).IC SCM+FSA &
   Comput(P1, s1,i).fsloc 0 = Comput(P2, s2,i).fsloc 0
  proof
    let s1,s2 be State of SCM+FSA,P1,P2,i;
    assume that
A29:  p c= s1 and
A30:  p c= s2 and
A31: q c= P1 and
A32: q c= P2 and
A33: i <= 10;
A34: s2 is 0-started by A30,MEMSTR_0:17;
A35: s1.fsloc 0 =w by A29,SCMFSA_M:33
      .=s2.fsloc 0 by A30,SCMFSA_M:33;
A36: s1.intloc 0 =1 by A29,SCMFSA_M:33
      .= s2.intloc 0 by A30,SCMFSA_M:33;
A37: s1 is 0-started by A29,MEMSTR_0:17;
    then
A38: IC s1 =  0
      .= IC s2 by A34;
    i = 0 or ... or i = 10 by A33;
    then per cases;
    suppose
A39:  i = 0;
      hence
      Comput(P1,s1,i).intloc 0 = Comput(P2,s2,i).intloc 0 by A36;
      thus (Comput(P1,s1,i)).IC SCM+FSA = (Comput(P2,s2,i)).IC SCM+FSA
           by A38,A39;
      thus thesis by A35,A39;
    end;
    suppose
A40:  i = 1;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A40,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  1 by A37,A40,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A40,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A40,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A40,Lm2,A32;
    end;
    suppose
A41:  i = 2;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A41,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  2 by A37,A41,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A41,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A41,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A41,Lm2,A32;
    end;
    suppose
A42:  i = 3;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A42,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  3 by A37,A42,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A42,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A42,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A42,Lm2,A32;
    end;
    suppose
A43:  i = 4;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A43,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  4 by A37,A43,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A43,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A43,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A43,Lm2,A32;
    end;
    suppose
A44:  i = 5;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A44,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  5 by A37,A44,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A44,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A44,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A44,Lm2,A32;
    end;
    suppose
A45:  i = 6;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A45,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  6 by A37,A45,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A45,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A45,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A45,Lm2,A32;
    end;
    suppose
A46:  i = 7;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A46,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  7 by A37,A46,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A46,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A46,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A46,Lm2,A32;
    end;
    suppose
A47:  i = 8;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A47,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  8 by A37,A47,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A47,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A47,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A47,Lm2,A32;
    end;
    suppose
A48:  i = 9;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A48,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  9 by A37,A48,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A48,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A48,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A48,Lm2,A32;
    end;
    suppose
A49:  i = 10;
      hence Comput(P1,s1,i).intloc 0 = s1.intloc 0 by A37,Lm2,A31
        .= Comput(P2,s2,i).intloc 0 by A34,A36,A49,Lm2,A32;
      thus (Comput(P1,s1,i)).IC SCM+FSA =  10 by A37,A49,Lm2,A31
        .= (Comput(P2,s2,i)).IC SCM+FSA by A34,A49,Lm2,A32;
      thus Comput(P1,s1,i).fsloc 0 = s1.fsloc 0 by A37,A49,Lm2,A31
        .= Comput(P2,s2,i).fsloc 0 by A34,A35,A49,Lm2,A32;
    end;
  end;
A50: dom p = DD by SCMFSA_M:31;
    reconsider ini = (intloc 0) .--> 1 as data-only FinPartState of SCM+FSA;
  for P,Q being Instruction-Sequence of SCM+FSA
    st q c= P & q c= Q
   for s1,s2 being State of SCM+FSA st  p c= s1 &  p c= s2
   for i being Nat holds Comput(P,s1,i)|dom  p = Comput(Q,s2,i)|dom  p
  proof
    let P1,P2 be Instruction-Sequence of SCM+FSA
    such that
A51: q c= P1 and
A52: q c= P2;
    let s1,s2 be State of SCM+FSA;
    assume that
A53:  p c= s1 and
A54:  p c=s2;
    let i be Nat;
     reconsider i as Nat;
    set Cs1i= Comput(P1, s1,i), Cs2i= Comput(P2, s2,i);
A55: Us c= dom(Cs1i) by SCMBSORT:32;
A56: fsloc 0 in Us by A3,ENUMSET1:def 6;
A57: Us c= dom(Cs2i) by SCMBSORT:32;
A58: i>10 implies 10+1 < i+1 by XREAL_1:6;
A59: intloc 0 in Us by A3,ENUMSET1:def 6;
A60: now
      let x be set;
      assume
A61:  x in DD;
      per cases by A61,ENUMSET1:def 1;
      suppose
A62:    x=intloc 0;
          per cases;
          suppose
            i<=10;
            hence Cs1i.x=Cs2i.x by A28,A53,A54,A62,A51,A52;
          end;
          suppose
            i>10;
            then 11 <= i by A58,NAT_1:13;
            then Cs1i | Us = Cs2i | Us by A4,A53,A54,A51,A52;
            hence Cs1i.x=Cs2i.x by A59,A55,A57,A62,FUNCT_1:95;
          end;
      end;
      suppose
A63:    x=IC SCM+FSA;
          per cases;
          suppose
            i<=10;
            hence Cs1i.x=Cs2i.x by A28,A53,A54,A63,A51,A52;
          end;
          suppose
            i>10;
            then 11 <= i by A58,NAT_1:13;
            hence Cs1i.x=Cs2i.x by A4,A53,A54,A63,A51,A52;
          end;
      end;
      suppose
A64:    x=fsloc 0;
          per cases;
          suppose
            i<=10;
            hence Cs1i.x=Cs2i.x by A28,A53,A54,A64,A51,A52;
          end;
          suppose
            i>10;
            then 11 <= i by A58,NAT_1:13;
            then Cs1i | Us = Cs2i | Us by A4,A53,A54,A51,A52;
            hence Cs1i.x=Cs2i.x by A56,A55,A57,A64,FUNCT_1:95;
          end;
      end;
    end;
A65: DD c= dom Cs2i by SCMFSA_M:34;
    DD c= dom Cs1i by SCMFSA_M:34;
    then Cs1i | DD = Cs2i| DD by A65,A60,FUNCT_1:95;
    hence thesis by A50;
  end;
  hence thesis;
end;
