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

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