reserve A, B for non empty set,
  A1, A2, A3 for non empty Subset of A;

theorem
  for f1 being Function of A1,B, f2 being Function of A2,B st
  f1|(A1 /\ A2) = f2|(A1 /\ A2) holds
  (A1 is Subset of A2 iff f1 union f2 = f2) &
  (A2 is Subset of A1 iff f1 union f2 = f1)
proof
  let f1 be Function of A1,B, f2 be Function of A2,B such that
A1: f1|(A1 /\ A2) = f2|(A1 /\ A2);
A2: now
    assume A1 is Subset of A2;
    then A2 = A1 \/ A2 by XBOOLE_1:12;
    then (f1 union f2)|(A1 \/ A2) = f2 by A1,Def1;
    then (f1 union f2)*(id (A1 \/ A2)) = f2 by RELAT_1:65;
    hence f1 union f2 = f2 by FUNCT_2:17;
  end;
  now
A3: dom (f1 union f2) = A1 \/ A2 & dom f2 = A2 by FUNCT_2:def 1;
    assume f1 union f2 = f2;
    hence A1 is Subset of A2 by A3,XBOOLE_1:7;
  end;
  hence A1 is Subset of A2 iff f1 union f2 = f2 by A2;
A4: now
    assume A2 is Subset of A1;
    then A1 = A1 \/ A2 by XBOOLE_1:12;
    then (f1 union f2)|(A1 \/ A2) = f1 by A1,Def1;
    then (f1 union f2)*(id (A1 \/ A2)) = f1 by RELAT_1:65;
    hence f1 union f2 = f1 by FUNCT_2:17;
  end;
  now
A5: dom (f1 union f2) = A1 \/ A2 & dom f1 = A1 by FUNCT_2:def 1;
    assume f1 union f2 = f1;
    hence A2 is Subset of A1 by A5,XBOOLE_1:7;
  end;
  hence A2 is Subset of A1 iff f1 union f2 = f1 by A4;
end;
