reserve i,j,e,u for object;
reserve I for set; 
reserve x,X,Y,Z,V for ManySortedSet of I;
reserve I for non empty set,
  x,X,Y for ManySortedSet of I;
reserve I for set,
  x,X,Y,Z for ManySortedSet of I;
reserve X for non-empty ManySortedSet of I;

theorem Th135:
  (for x holds x in X iff x in Y) implies X = Y
proof
  deffunc F(object) = X.$1;
A1: for i being object st i in I holds F(i) <> {} by Def13;
  consider f being ManySortedSet of I such that
A2: for i being object st i in I holds f.i in F(i)
    from KuratowskiFunction(A1);
  assume
A3: for x holds x in X iff x in Y;
  now
    let i be object such that
A4: i in I;
    now
      let e be object;
      deffunc G(object) = IFEQ(i,$1,e,f.$1);
      consider g being Function such that
A5:   dom g = I and
A6:   for u being object st u in I holds g.u = G(u) from FUNCT_1:sch 3;
      reconsider g as ManySortedSet of I by A5,PARTFUN1:def 2,RELAT_1:def 18;
A7:   g.i = IFEQ(i,i,e,f.i) by A4,A6
        .= e by FUNCOP_1:def 8;
      hereby
        assume
A8:     e in X.i;
        g in X
        proof
          let u be object such that
A9:       u in I;
          per cases;
          suppose
            u = i;
            hence thesis by A7,A8;
          end;
          suppose
A10:        u <> i;
            g.u = IFEQ(i,u,e,f.u) by A6,A9
              .= f.u by A10,FUNCOP_1:def 8;
            hence thesis by A2,A9;
          end;
        end;
        then g in Y by A3;
        hence e in Y.i by A4,A7;
      end;
      assume
A11:  e in Y.i;
      g in Y
      proof
        let u be object such that
A12:    u in I;
        per cases;
        suppose
          u = i;
          hence thesis by A7,A11;
        end;
        suppose
A13:      u <> i;
          f in X by A2;
          then
A14:      f in Y by A3;
          g.u = IFEQ(i,u,e,f.u) by A6,A12
            .= f.u by A13,FUNCOP_1:def 8;
          hence thesis by A12,A14;
        end;
      end;
      then g in X by A3;
      hence e in X.i by A4,A7;
    end;
    hence X.i = Y.i by TARSKI:2;
  end;
  hence thesis;
end;
