reserve B,C,D,C9,D9 for Category;
reserve E for Subcategory of C;

theorem Th16:
  for O being non empty Subset of the carrier of C, M being non
empty set st M = union{Hom(a,b) where a is Object of C,b is Object of C: a in O
& b in O} holds (the Source of C)|M is Function of M,O & (the Target of C)|M is
Function of M,O & (the Comp of C)||M is PartFunc of [:M,M:],M
proof
  let O be non empty Subset of the carrier of C;
  set H = {Hom(a,b) where a is Object of C, b is Object of C: a in O & b in O};
A1: dom the Source of C = the carrier' of C by FUNCT_2:def 1;
  let M be non empty set such that
A2: M = union H;
A3: now
    let f be Morphism of C;
    assume f in M;
    then consider X being set such that
A4: f in X and
A5: X in H by A2,TARSKI:def 4;
    ex a,b being Object of C st X = Hom(a,b) & a in O & b in O by A5;
    hence dom f in O & cod f in O by A4,CAT_1:1;
  end;
  set d = (the Source of C)|M, c = (the Target of C)|M, p = (the Comp of C)||M;
A6: dom the Target of C = the carrier' of C by FUNCT_2:def 1;
A7: dom d = (dom the Source of C) /\ M by RELAT_1:61;
A8: rng d c= O
  proof
    let y be object;
    assume y in rng d;
    then consider x being object such that
A9: x in dom d and
A10: y = d.x by FUNCT_1:def 3;
    reconsider f = x as Morphism of C by A1,A7,A9,XBOOLE_0:def 4;
    d.f = dom f & f in M by A7,A9,FUNCT_1:47,XBOOLE_0:def 4;
    hence thesis by A3,A10;
  end;
A11: M is non empty Subset of the carrier' of C by A2,Th15;
  then
A12: dom c = M by A6,RELAT_1:62;
A13: dom c = (dom the Target of C) /\ M by RELAT_1:61;
A14: rng c c= O
  proof
    let y be object;
    assume y in rng c;
    then consider x being object such that
A15: x in dom c and
A16: y = c.x by FUNCT_1:def 3;
    reconsider f = x as Morphism of C by A6,A13,A15,XBOOLE_0:def 4;
    c.f = cod f & f in M by A13,A15,FUNCT_1:47,XBOOLE_0:def 4;
    hence thesis by A3,A16;
  end;
  dom d = M by A1,A11,RELAT_1:62;
  hence d is Function of M,O & c is Function of M,O by A8,A14,A12,FUNCT_2:def 1
,RELSET_1:4;
A17: dom p = (dom the Comp of C) /\ [:M,M:] by RELAT_1:61;
A18: dom the Comp of C c= [:the carrier' of C,the carrier' of C:] by
RELAT_1:def 18;
  rng p c= M
  proof
    let y be object;
    assume y in rng p;
    then consider x being object such that
A19: x in dom p and
A20: y = p.x by FUNCT_1:def 3;
A21: x in dom the Comp of C by A17,A19,XBOOLE_0:def 4;
    then consider g,f being Morphism of C such that
A22: x = [g,f] by A18,DOMAIN_1:1;
A23: [g,f] in [:M,M:] by A17,A19,A22,XBOOLE_0:def 4;
    then g in M by ZFMISC_1:87;
    then
A24: cod g in O by A3;
    dom g = cod f by A21,A22,CAT_1:15;
    then
A25: dom(g(*)f) = dom f & cod(g(*)f) = cod g by CAT_1:17;
    f in M by A23,ZFMISC_1:87;
    then dom f in O by A3;
    then
A26: Hom(dom(g(*)f),cod(g(*)f)) in H by A24,A25;
A27: g(*)f in Hom(dom(g(*)f),cod(g(*)f ));
    p.x = (the Comp of C).(g,f) by A19,A22,FUNCT_1:47
      .= g(*)f by A21,A22,CAT_1:def 1;
    hence thesis by A2,A20,A26,A27,TARSKI:def 4;
  end;
  hence p is PartFunc of [:M,M:],M by A17,RELSET_1:4,XBOOLE_1:17;
  thus thesis;
end;
