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 Th19:
  for f being FinSeq-Location holds UsedI*Loc (insert-sort f) = {f}
proof
  set m0=SubFrom(a2,a2), m1=Macro m0, m2=AddTo(a4,a0), m3=SubFrom(a2,a0), IF=
  if>0(a5, m1, m2 ";" m3), UIF = UsedI*Loc IF;
  set k2= a2:= a0, k3= a3:= a0, k4= a4:= a0, k5= a5:= a0;
  let f be FinSeq-Location;
  set i1= a2:=a3, i2= SubFrom(a3,a0), i3= a5:=(f,a2), i4= a6:=(f,a3), i5= (f,
  a2):=a6, i6= (f,a3):=a5, body3= i1 ";" i2 ";" i3 ";" i4 ";" i5 ";" i6, Ub3=
  UsedI*Loc body3;
A1: Ub3 = UsedI*Loc (i1 ";" i2 ";"i3 ";"i4 ";" i5 ) \/ UsedInt*Loc i6 by
SF_MASTR:46
    .= UsedI*Loc (i1 ";" i2 ";"i3 ";"i4 ";" i5 ) \/ {f} by SF_MASTR:33
    .= UsedI*Loc (i1 ";" i2 ";"i3 ";"i4) \/ UsedInt*Loc i5 \/ {f} by
SF_MASTR:46
    .= UsedI*Loc (i1 ";" i2 ";"i3 ";"i4) \/ {f} \/ {f} by SF_MASTR:33
    .= UsedI*Loc (i1 ";" i2 ";"i3) \/ UsedInt*Loc i4 \/ {f} \/ {f} by
SF_MASTR:46
    .= UsedI*Loc (i1 ";" i2 ";"i3) \/ {f} \/ {f} \/ {f} by SF_MASTR:33
    .= UsedI*Loc (i1 ";" i2) \/ UsedInt*Loc i3 \/ {f} \/ {f} \/ {f} by
SF_MASTR:46
    .= UsedI*Loc (i1 ";" i2) \/ {f} \/ {f} \/ {f} \/ {f} by SF_MASTR:33
    .= UsedInt*Loc i1 \/ UsedInt*Loc i2 \/ {f} \/ {f} \/ {f} \/ {f} by
SF_MASTR:47
    .= {} \/ UsedInt*Loc i2 \/ {f} \/ {f} \/ {f} \/ {f} by SF_MASTR:32
    .= {} \/ {f} \/ {f} \/ {f} \/ {f} by SF_MASTR:32
    .= {f};
  set n1=a5:=(f,a2), n2=SubFrom(a5,a6), body2=n1 ";"n2 ";" IF, Ub2=UsedI*Loc
  body2;
A2: UIF = UsedI*Loc m1 \/ UsedI*Loc (m2 ";" m3) by SCMFSA9A:10
    .= UsedInt*Loc m0 \/ UsedI*Loc (m2 ";" m3) by SF_MASTR:44
    .= {} \/ UsedI*Loc (m2 ";" m3) by SF_MASTR:32
    .= {} \/ (UsedInt*Loc m2 \/ UsedInt*Loc m3) by SF_MASTR:47
    .= {} \/ ({} \/ UsedInt*Loc m3) by SF_MASTR:32
    .= {} by SF_MASTR:32;
  set WM=initializeWorkMem, j1=a1:=len f, j2=SubFrom(a1,a0);
A3: UsedI*Loc initializeWorkMem = UsedI*Loc (k2 ";" k3 ";" k4 ";" k5) \/
  UsedInt*Loc (a6:= a0) by SF_MASTR:46
    .= UsedI*Loc (k2 ";" k3 ";" k4 ";" k5) \/ {} by SF_MASTR:32
    .= UsedI*Loc (k2 ";" k3 ";" k4) \/ UsedInt*Loc k5 by SF_MASTR:46
    .= UsedI*Loc (k2 ";" k3 ";" k4) \/ {} by SF_MASTR:32
    .= UsedI*Loc (k2 ";" k3 ) \/ UsedInt*Loc k4 by SF_MASTR:46
    .= UsedI*Loc (k2 ";" k3 ) \/ {} by SF_MASTR:32
    .= UsedInt*Loc k2 \/ UsedInt*Loc k3 by SF_MASTR:47
    .= UsedInt*Loc k2 \/ {} by SF_MASTR:32
    .= {} by SF_MASTR:32;
  set T3=Times(a4,body3), t1=a2:=len f, t2=SubFrom(a2,a1), t3=a3 := a2, t4=
  AddTo(a3,a0), t5=a6:=(f,a3), t6=SubFrom(a4,a4), Wg=while>0(a2,body2), t16=t1
  ";" t2 ";" t3 ";" t4 ";" t5 ";" t6, body1=t16 ";" Wg ";" T3, Ub1 =UsedI*Loc
  body1, Ut16 =UsedI*Loc t16;
A4: Ut16= UsedI*Loc (t1 ";"t2 ";" t3 ";" t4 ";" t5) \/ UsedInt*Loc t6 by
SF_MASTR:46
    .= UsedI*Loc (t1 ";"t2 ";" t3 ";" t4 ";" t5) \/ {} by SF_MASTR:32
    .= UsedI*Loc (t1 ";"t2 ";" t3 ";" t4) \/ UsedInt*Loc t5 \/ {} by
SF_MASTR:46
    .= UsedI*Loc (t1 ";"t2 ";" t3 ";" t4) \/ {f} \/ {} by SF_MASTR:33
    .= UsedI*Loc (t1 ";"t2 ";" t3) \/ UsedInt*Loc t4 \/ {f} \/ {} by
SF_MASTR:46
    .= UsedI*Loc (t1 ";"t2 ";" t3) \/ {} \/ {f} \/ {} by SF_MASTR:32
    .= UsedI*Loc (t1 ";"t2) \/ UsedInt*Loc t3 \/ {} \/ {f} \/ {} by SF_MASTR:46
    .= UsedI*Loc (t1 ";"t2) \/ {} \/ {} \/ {f} \/ {} by SF_MASTR:32
    .= UsedInt*Loc t1 \/ UsedInt*Loc t2 \/ {} \/ {} \/ {f} \/ {} by SF_MASTR:47
    .= {f} \/ UsedInt*Loc t2 \/ {} \/ {} \/ {f} \/ {} by SF_MASTR:34
    .= {f} \/ {f} \/ {} by SF_MASTR:32
    .= {f};
A5: Ub2 = UsedI*Loc (n1 ";"n2) \/ UIF by SF_MASTR:43
    .= UsedInt*Loc n1 \/ UsedInt*Loc n2 \/ UIF by SF_MASTR:47
    .= {f} \/ UsedInt*Loc n2 \/ UIF by SF_MASTR:33
    .= {f} \/ {} by A2,SF_MASTR:32
    .= {f};
A6: UsedI*Loc body1 = UsedI*Loc (t16 ";" Wg ) \/ UsedI*Loc T3 by SF_MASTR:43
    .= UsedI*Loc (t16 ";" Wg) \/ {f} by A1,SCMFSA9A:45
    .= UsedI*Loc t16 \/ UsedI*Loc Wg \/ {f} by SF_MASTR:43
    .= {f} \/ {f} by A5,A4,SCMFSA9A:25
    .= {f};
  thus UsedI*Loc (insert-sort f) = UsedI*Loc (WM ";" j1 ";" j2) \/
  UsedI*Loc Times(a1,body1) by SF_MASTR:43
    .= UsedI*Loc (WM ";" j1 ";" j2) \/ {f} by A6,SCMFSA9A:45
    .= UsedI*Loc (WM ";" j1) \/ UsedInt*Loc j2 \/ {f} by SF_MASTR:46
    .= UsedI*Loc (WM ";" j1) \/ {} \/ {f} by SF_MASTR:32
    .= UsedI*Loc WM \/ UsedInt*Loc j1 \/ {} \/ {f} by SF_MASTR:46
    .= {f} \/ {f} by A3,SF_MASTR:34
    .= {f};
end;
