reserve i for object, I for set,
  f for Function,
  x, x1, x2, y, A, B, X, Y, Z for ManySortedSet of I;

theorem     :: ZFMISC_1:117
  Z is non-empty & ([|X,Z|] c= [|Y,Z|] or [|Z,X|] c= [|Z,Y|]) implies X c= Y
proof
  assume that
A1: Z is non-empty and
A2: [|X,Z|] c= [|Y,Z|] or [|Z,X|] c= [|Z,Y|];
  per cases by A2;
  suppose
A3: [|X,Z|] c= [|Y,Z|];
    let i;
    assume
A4: i in I;
    then
A5: Z.i is non empty by A1;
    [|X,Z|].i c= [|Y,Z|].i by A3,A4;
    then [:X.i,Z.i:] c= [|Y,Z|].i by A4,PBOOLE:def 16;
    then [:X.i,Z.i:] c= [:Y.i,Z.i:] by A4,PBOOLE:def 16;
    hence thesis by A5,ZFMISC_1:94;
  end;
  suppose
A6: [|Z,X|] c= [|Z,Y|];
    let i;
    assume
A7: i in I;
    then
A8: Z.i is non empty by A1;
    [|Z,X|].i c= [|Z,Y|].i by A6,A7;
    then [:Z.i,X.i:] c= [|Z,Y|].i by A7,PBOOLE:def 16;
    then [:Z.i,X.i:] c= [:Z.i,Y.i:] by A7,PBOOLE:def 16;
    hence thesis by A8,ZFMISC_1:94;
  end;
end;
