reserve x,A for set, i,j,k,m,n, l, l1, l2 for Nat;
reserve D for non empty set, z for Nat;
reserve S for COM-Struct;
reserve ins for Element of the InstructionsF of S;
reserve k, m for Nat,
  x, x1, x2, x3, y, y1, y2, y3, X,Y,Z for set;

theorem Th13:
  for S being COM-Struct, F, G being Program of S
  holds CutLastLoc F c= CutLastLoc (F ';' G)
proof
  let S be COM-Struct, F, G be Program of S;
  set k = card F -' 1;
  set P = F ';' G;
A1: dom P = dom CutLastLoc F \/ dom Reloc(G,k) by FUNCT_4:def 1;
A2: dom CutLastLoc F =
  { m where m is Element of NAT: m < card CutLastLoc F } by AFINSQ_1:68;
A3: card CutLastLoc P = card P - 1 by VALUED_1:38
    .= card F + card G - 1 - 1 by Th11
    .= card F - 1 + (card G - 1);
A4: for m being Element of NAT
  st m < card CutLastLoc F holds m < card CutLastLoc P
  proof
    let m be Element of NAT such that
A5: m < card CutLastLoc F;
A6: card CutLastLoc F = card F - 1 by VALUED_1:38;
    1 <= card G by NAT_1:14;
    then 1 - 1 <= card G - 1 by XREAL_1:9;
    then card F - 1 + (0 qua Nat) <= card F - 1 + (card G - 1) by XREAL_1:6;
    hence thesis by A3,A5,A6,XXREAL_0:2;
  end;
A7: dom CutLastLoc F c= dom CutLastLoc P
  proof
    let x be object;
    assume x in dom CutLastLoc F;
    then consider m being Element of NAT such that
A8: x = m and
A9: m < card CutLastLoc F by A2;
    m < card CutLastLoc P by A4,A9;
    hence thesis by A8,AFINSQ_1:66;
  end;
  for x being object st x in dom CutLastLoc F holds
  (CutLastLoc F).x = (CutLastLoc P).x
  proof
    let x be object;
    assume
A10: x in dom CutLastLoc F;
    then consider m being Element of NAT such that
A11: x = m and
A12: m < card CutLastLoc F by A2;
A13: dom Reloc(G,k) = { w+k where w is Nat:
    w in dom IncAddr(G,k) } by VALUED_1:def 12;
A14: now
      assume x in dom Reloc(G,k);
      then consider w being Nat such that
A15:  x = w+k and w in dom IncAddr(G,k) by A13;
      m < card F - 1 by A12,VALUED_1:38;
      then
      m < k by PRE_CIRC:20;
      hence contradiction by A11,A15,NAT_1:11;
    end;
A16: x in dom P by A1,A10,XBOOLE_0:def 3;
    now
      assume x = LastLoc P;
      then
A17:  m = card P -' 1 by A11,AFINSQ_1:70
        .= card P - 1 by PRE_CIRC:20;
      card CutLastLoc P = card P - 1 by VALUED_1:38;
      hence contradiction by A4,A12,A17;
    end;
    then not x in {LastLoc P} by TARSKI:def 1;
    then not x in dom ( LastLoc P .--> P.LastLoc P );
    then x in dom P \ dom ( LastLoc P .--> P.LastLoc P ) by A16,XBOOLE_0:def 5;
    hence (CutLastLoc P).x = (CutLastLoc F +* Reloc(G,k)).x
    by GRFUNC_1:32
      .= (CutLastLoc F).x by A14,FUNCT_4:11;
  end;
  hence thesis by A7,GRFUNC_1:2;
end;
