reserve x,N for set,
        k for Nat;
reserve N for with_zero set;
reserve S for IC-Ins-separated non empty with_non-empty_values
     Mem-Struct over N;
reserve s for State of S;
reserve p for PartState of S;

theorem Th19:
  for S being IC-Ins-separated non empty with_non-empty_values
         Mem-Struct over N
  for p being PartState of S st IC S in
  dom p holds p = Start-At(IC p,S) +* DataPart p
proof
  let S be IC-Ins-separated non empty with_non-empty_values Mem-Struct over N;
  let p be PartState of S;
  assume IC S in dom p;
  then
A1: {IC S} is Subset of dom p by SUBSET_1:41;
A2: {IC S} \/ ((the carrier of S) \ {IC S})
     = (the carrier of S) \/ {IC S} by XBOOLE_1:39
    .= the carrier of S by XBOOLE_1:12;
A3: dom p c= the carrier of S by RELAT_1:def 18;
A4: now
    let x be object;
    assume
A5: x in dom p;
    per cases by A5,A3,A2,XBOOLE_0:def 3;
    suppose
A6:   x in {IC S};
      IC S in dom Start-At(IC p,S) by TARSKI:def 1;
      then
A7:  IC S in dom (Start-At(IC p,S)) \/ dom DataPart p by XBOOLE_0:def 3;
A8:  x = IC S by A6,TARSKI:def 1;
      not IC S in dom (DataPart p) by Th3;
      then
      (Start-At(IC p,S) +* DataPart p).x
         = (Start-At(IC p,S)).x by A8,A7,FUNCT_4:def 1
        .= IC p by A8,FUNCOP_1:72;
      hence p.x = (Start-At(IC p,S) +* DataPart p).x by A6,TARSKI:def 1;
    end;
    suppose
      x in (the carrier of S) \ {IC S};
      then x in dom p /\ ((the carrier of S) \ {IC S}) by A5,XBOOLE_0:def 4;
      then
A9:  x in dom (p | ((the carrier of S) \ {IC S})) by RELAT_1:61;
      (Start-At(IC p,S) +* DataPart p).x
       = (DataPart p).x by A9,FUNCT_4:13
        .= p.x by A9,FUNCT_1:47;
      hence p.x = (Start-At(IC p,S) +* DataPart p).x;
    end;
  end;
A10: dom p c= the carrier of S by RELAT_1:def 18;
  dom(Start-At(IC p,S) +* DataPart p)
     = dom (Start-At(IC p,S) ) \/ dom (DataPart p) by FUNCT_4:def 1
    .= {IC S} \/ dom(DataPart p)
    .= dom p /\ {IC S} \/ dom(p|((the carrier of S) \ {IC S}))
         by A1,XBOOLE_1:28
    .= dom p /\ {IC S} \/ dom p /\ ((the carrier of S) \ {IC S}) by RELAT_1:61
    .= dom p /\ the carrier of S by A2,XBOOLE_1:23
    .= dom p by A10,XBOOLE_1:28;
  hence thesis by A4;
end;
