reserve x,y,X,Y for set;
reserve C,D,E for non empty set;
reserve SC for Subset of C;
reserve SD for Subset of D;
reserve SE for Subset of E;
reserve c,c1,c2 for Element of C;
reserve d,d1,d2 for Element of D;
reserve e for Element of E;
reserve f,f1,g for PartFunc of C,D;
reserve t for PartFunc of D,C;
reserve s for PartFunc of D,E;
reserve h for PartFunc of C,E;
reserve F for PartFunc of D,D;

theorem Th3:
  h = s*f iff (for c holds c in dom h iff c in dom f & f/.c in dom
  s) & for c st c in dom h holds h/.c = s/.(f/.c)
proof
  thus h = s*f implies (for c holds c in dom h iff c in dom f & f/.c in dom s)
  & for c st c in dom h holds h/.c = s/.(f/.c)
  proof
    assume
A1: h = s*f;
A2: now
      let c;
      thus c in dom h implies c in dom f & f/.c in dom s
      proof
        assume c in dom h;
        then c in dom f & (f qua Function).c in dom s by A1,FUNCT_1:11;
        hence thesis by PARTFUN1:def 6;
      end;
      assume that
A3:   c in dom f and
A4:   f/.c in dom s;
      (f qua Function).c in dom s by A3,A4,PARTFUN1:def 6;
      hence c in dom h by A1,A3,FUNCT_1:11;
    end;
    hence for c holds c in dom h iff c in dom f & f/.c in dom s;
    let c;
    assume
A5: c in dom h;
    then (h qua Function).c = (s qua Function).((f qua Function).c) by A1,
FUNCT_1:12;
    then
A6: h/.c = (s qua Function).((f qua Function).c) by A5,PARTFUN1:def 6;
    c in dom f by A2,A5;
    then
A7: h/.c = (s qua Function).(f/.c) by A6,PARTFUN1:def 6;
    f/.c in dom s by A2,A5;
    hence thesis by A7,PARTFUN1:def 6;
  end;
  assume that
A8: for c holds c in dom h iff c in dom f & f/.c in dom s and
A9: for c st c in dom h holds h/.c = s/.(f/.c);
A10: now
    let x be object;
    thus x in dom h implies x in dom f & (f qua Function).x in dom s
    proof
      assume
A11:  x in dom h;
      then reconsider y=x as Element of C;
      y in dom f & f/.y in dom s by A8,A11;
      hence thesis by PARTFUN1:def 6;
    end;
    thus x in dom f & (f qua Function).x in dom s implies x in dom h
    proof
      assume that
A12:  x in dom f and
A13:  (f qua Function).x in dom s;
      reconsider y=x as Element of C by A12;
      f/.y in dom s by A12,A13,PARTFUN1:def 6;
      hence thesis by A8,A12;
    end;
  end;
  now
    let x be object;
    assume
A14: x in dom h;
    then reconsider y=x as Element of C;
    h/.y = s/.(f/.y) by A9,A14;
    then
A15: (h qua Function).y = s/.(f/.y) by A14,PARTFUN1:def 6;
    f/.y in dom s by A8,A14;
    then
A16: (h qua Function).x = (s qua Function).(f/.y) by A15,PARTFUN1:def 6;
    y in dom f by A8,A14;
    hence (h qua Function).x = (s qua Function).((f qua Function).x) by A16,
PARTFUN1:def 6;
  end;
  hence thesis by A10,FUNCT_1:10;
end;
