reserve A,B,O for Ordinal,
        o for object,
        x,y,z for Surreal,
        n,m for Nat;
reserve d,d1,d2 for Dyadic;
reserve i,j for Integer,
        n,m,p for Nat;

theorem Th23:
  d is Integer or ex p,i st d = (2*i+1) / 2|^(p+1)
proof
  assume
A1:not d is Integer;
  then
A2:not d in INT;
  consider i be Integer, n be Nat such that
A3: d = i / (2|^n) by Th18;
  defpred M[Nat] means d in DYADIC($1+1);
  n <>0 by A2,Th21,A3,Def4;
  then reconsider n1=n-1 as Nat by NAT_1:20;
  d in DYADIC(n1+1) by A3,Def4;
  then
A4:ex n st M[n];
  consider m be Nat such that
A5:  M[m] & for n be Nat st M[n] holds m <= n from NAT_1:sch 5(A4);
  not d in DYADIC(m)
  proof
    assume
A6: d in DYADIC(m);
    then m<>0 by A1,Th21;
    then reconsider m1=m-1 as Nat by NAT_1:20;
    m1+1 <= m1 by A6,A5;
    hence thesis by NAT_1:13;
  end;
  then d in DYADIC(m+1)\DYADIC(m) by A5,XBOOLE_0:def 5;
  then ex i be Integer st d = (2*i+1) / 2|^(m+1) by Th20;
  hence thesis;
end;
