reserve S for 1-sorted,
  i for Element of NAT,
  p for FinSequence,
  X for set;

theorem
  for X,Y,x being set holds X@x = Y@x iff (x in X iff x in Y)
proof
  let X,Y,x be set;
  thus X@x = Y@x implies (x in X iff x in Y)
  proof
    assume
A1: X@x = Y@x;
    thus x in X implies x in Y
    proof
      assume x in X;
      then X@x = 1.Z_2 by Def3;
      hence thesis by A1,Def3;
    end;
    assume x in Y;
    then Y@x = 1.Z_2 by Def3;
    hence thesis by A1,Def3;
  end;
  thus (x in X iff x in Y) implies X@x = Y@x
  proof
    assume
A2: x in X iff x in Y;
    per cases by Th5,Th6,CARD_1:50,TARSKI:def 2;
    suppose
      X@x = 0.Z_2;
      hence thesis by A2,Def3;
    end;
    suppose
      X@x = 1.Z_2;
      hence thesis by A2,Def3;
    end;
  end;
end;
