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

theorem     :: Tarski:3
  X = { y } iff for x holds x in X iff x = y
proof
  thus X = { y } implies for x holds x in X iff x = y
  proof
    assume
A1: X = {y};
    let x;
    thus x in X implies x = y
    proof
      assume
A2:   x in X;
      now
        let i be object;
        assume
A3:     i in I;
        then
A4:     x.i in X.i by A2;
        X.i = {y.i} by A1,A3,Def1;
        hence x.i = y.i by A4,TARSKI:def 1;
      end;
      hence thesis;
    end;
    assume
A5: x = y;
    let i be object;
    assume i in I;
    then X.i = {y.i} by A1,Def1;
    hence thesis by A5,TARSKI:def 1;
  end;
  assume
A6: for x holds x in X iff x = y;
  then
A7: y in X;
  now
    let i be object such that
A8: i in I;
    now
      let a be object;
      thus a in X.i iff a = y.i
      proof
        thus a in X.i implies a = y.i
        proof
          assume
A9:       a in X.i;
A10:      dom (i .--> a) = {i};
          dom (y +* (i .--> a)) = I by A8,Th1;
          then reconsider x1 = y +* (i .--> a) as ManySortedSet of I
          by PARTFUN1:def 2,RELAT_1:def 18;
          i in {i} by TARSKI:def 1;
          then
A11:      x1.i = (i .--> a).i by A10,FUNCT_4:13
            .= a by FUNCOP_1:72;
          x1 in X
          proof
            let q be object such that
A12:        q in I;
            per cases;
            suppose i = q;
              hence thesis by A9,A11;
            end;
            suppose i <> q;
              then not q in dom (i .--> a) by TARSKI:def 1;
              then x1.q = y.q by FUNCT_4:11;
              hence thesis by A7,A12;
            end;
          end;
          hence thesis by A6,A11;
        end;
        assume a = y.i;
        hence thesis by A7,A8;
      end;
    end;
    then X.i = {y.i} by TARSKI:def 1;
    hence X.i = {y}.i by A8,Def1;
  end;
  hence thesis;
end;
