reserve P,Q,X,Y,Z for set, p,x,x9,x1,x2,y,z for object;
reserve D for non empty set;
reserve A,B for non empty set;
reserve Y for non empty set,
  f for Function of X,Y,
  p for PartFunc of Y,Z,
  x for Element of X;
reserve g for Function of X,X;
reserve X,Y for non empty set,
  Z,S,T for set,
  f for Function of X,Y,
  g for PartFunc of Y,Z,
  x for Element of X;

theorem
  for A1,A2, B1,B2 being set for f being Function of A1,A2, g being
Function of B1,B2 st f tolerates g holds f /\ g is Function of A1 /\ B1, A2 /\
  B2
proof
  let A1,A2, B1,B2 be set;
  let f be Function of A1,A2, g be Function of B1,B2 such that
A1: f tolerates g;
A2: dom (f/\g) c= dom f /\ dom g & dom f /\ dom g c= A1/\B1 by XBOOLE_1:27
,XTUPLE_0:24;
A3: now
    set a = the Element of A1 /\ B1;
    assume that
A4: dom f = A1 and
    A1 <> {} and
A5: dom g = B1 and
    B1 <> {};
    hereby
      assume
A6:   A1 /\ B1 <> {};
      then a in A1 by XBOOLE_0:def 4;
      then
A7:   f.a in rng f by A4,FUNCT_1:def 3;
      f.a = g.a & a in B1 by A1,A4,A5,A6,XBOOLE_0:def 4;
      then f.a in rng g by A5,FUNCT_1:def 3;
      hence A2 /\ B2 <> {} by A7,XBOOLE_0:def 4;
    end;
    thus dom (f /\ g) = A1 /\ B1
    proof
      thus dom (f /\ g) c= A1 /\ B1 by A2;
      let a be object;
      assume
A8:   a in A1 /\ B1;
      then a in A1 by XBOOLE_0:def 4;
      then
A9:   [a,f.a] in f by A4,FUNCT_1:def 2;
      f.a = g.a & a in B1 by A1,A4,A5,A8,XBOOLE_0:def 4;
      then [a,f.a] in g by A5,FUNCT_1:def 2;
      then [a,f.a] in f /\ g by A9,XBOOLE_0:def 4;
      hence thesis by XTUPLE_0:def 12;
    end;
  end;
  rng (f/\g) c= rng f /\ rng g & rng f /\ rng g c= A2/\B2 by RELAT_1:13
,XBOOLE_1:27;
  then
A10: rng (f/\g) c= A2/\B2;
A11: A2 = {} or A2 <> {};
A12: B2 = {} or B2 <> {};
A13: now
    per cases;
    case A2 /\ B2 <> {};
      hence dom (f /\ g) = A1 /\ B1 by A12,A3,Def1,A11;
    end;
    case A1 /\ B1 = {};
      hence dom (f /\ g) = A1 /\ B1 by A2;
    end;
    case A2 /\ B2 = {} & A1 /\ B1 <> {};
      hence f /\ g = {} by A12,A3,Def1,A11;
    end;
  end;
  thus thesis by A10,A13,Def1,RELSET_1:4;
end;
