reserve a,b,c,d,x,y,z for object, X,Y,Z for set;
reserve R,S,T for Relation;
reserve F,G for Function;

theorem Th22:
  Z c= Y implies (R |_2 Y) |_2 Z = R |_2 Z
proof
  assume
A1: Z c= Y;
  let a,b be object;
  thus [a,b] in (R |_2 Y) |_2 Z implies [a,b] in R |_2 Z
  proof
    assume
A2: [a,b] in (R |_2 Y) |_2 Z;
    then [a,b] in R |_2 Y by XBOOLE_0:def 4;
    then
A3: [a,b] in R by XBOOLE_0:def 4;
    [a,b] in [:Z,Z:] by A2,XBOOLE_0:def 4;
    hence thesis by A3,XBOOLE_0:def 4;
  end;
  assume
A4: [a,b] in R |_2 Z;
  then
A5: [a,b] in R by XBOOLE_0:def 4;
A6: [a,b] in [:Z,Z:] by A4,XBOOLE_0:def 4;
  then a in Z & b in Z by ZFMISC_1:87;
  then [a,b] in [:Y,Y:] by A1,ZFMISC_1:87;
  then [a,b] in R |_2 Y by A5,XBOOLE_0:def 4;
  hence thesis by A6,XBOOLE_0:def 4;
end;
