SURREALN

index · ← SURREALS · SURREALC →
:: Surreal Dyadic and Real Numbers: A Formal Construction
::  by Karol P\kak
::
:: Received April 10, 2025
:: Copyright (c) 2025-2026 Association of Mizar Users
::           (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: This code can be distributed under the GNU General Public Licence
:: version 3.0 or later, or the Creative Commons Attribution-ShareAlike
:: License version 4.0 or later, subject to the binding interpretation
:: detailed in file COPYING.interpretation.
:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
:: licenses, or see http://www.gnu.org/licenses/gpl.html and
:: http://creativecommons.org/licenses/by-sa/4.0/.

environ

 vocabularies RELAT_1, TARSKI, XBOOLE_0, SUBSET_1, XXREAL_0, ARYTM_3, FUNCT_1,
      CARD_1, ORDINAL1, PBOOLE, MEMBERED, MEMBER_1, ZFREFLE1, VECTSP_1,
      FUNCT_2, NUMBERS, FINSET_1, NAT_1, ARYTM_1, FUNCOP_1, MATHMORP, GLIB_000,
      WAYBEL_3, INT_1, URYSOHN1, REAL_1, ABIAN, NEWTON, RAT_1, SURREAL0,
      SURREALO, SURREALN;
 notations RAT_1, MEMBERED, TARSKI, XBOOLE_0, SUBSET_1, RELAT_1, FUNCT_1,
      RELSET_1, PBOOLE, ORDINAL1, FUNCT_2, FINSET_1, CARD_1, NUMBERS, XCMPLX_0,
      XXREAL_0, XREAL_0, INT_1, NAT_D, NEWTON, ORDINAL7, ABIAN, SURREAL0,
      SURREALO, SURREALR, SURREALI;
 constructors RELSET_1, NEWTON, ORDERS_5, NAT_D, ABIAN, ORDINAL7, SURREALO,
      SURREALR, SURREALI;
 registrations XBOOLE_0, RELAT_1, SUBSET_1, XTUPLE_0, ORDINAL1, FUNCT_1, NAT_1,
      XREAL_0, CARD_1, FINSET_1, FUNCOP_1, ORDINAL7, FOMODEL0, INT_1, XXREAL_0,
      NEWTON, NUMBERS, XCMPLX_0, ABIAN, NAT_3, RAT_1, MEMBERED, SURREAL0,
      SURREALO, SURREALR, SURREALI;
 requirements BOOLE, SUBSET, NUMERALS, ARITHM, REAL;
 definitions TARSKI, XBOOLE_0, FUNCOP_1, SURREAL0, SURREALO;
 equalities ORDINAL1, SURREAL0, SURREALO, SURREALR;
 expansions SURREAL0, SURREALO, SURREALI;
 theorems RELAT_1, TARSKI, ZFMISC_1, FUNCT_1, FUNCT_2, XBOOLE_0, XBOOLE_1,
      XXREAL_0, ENUMSET1, NAT_1, CARD_2, ORDINAL1, ORDINAL2, INT_1, MEMBERED,
      CARD_1, XREAL_1, PARTFUN1, ORDINAL7, RAT_1, PEPIN, INT_2, NEWTON,
      XCMPLX_1, ABIAN, NEWTON02, XREAL_0, PREPOWER, XTUPLE_0, SEQ_4, SURREAL0,
      SURREALO, SURREALR, SURREALI;
 schemes XXREAL_1, NAT_1, ORDINAL1, ORDINAL2, CLASSES1, XBOOLE_0, PBOOLE,
      FUNCT_1;

begin :: Mappings between Integers and Surreal Integers

reserve A,B,O for Ordinal,
        o for object,
        x,y,z for Surreal,
        n,m for Nat;

definition
  func uInt -> ManySortedSet of INT means :Def1:
    it.0 = 0_No & it.(n+1) = [{it.n},{}] & it.-(n+1) = [{},{it.-n}];
  existence
  proof
    deffunc F1(object,object) = [{$2},{}];
    consider f1 be Function such that
A1: dom f1 = NAT & f1.0 = 0_No and
A2: for n being Nat holds f1.(n+1) = F1(n,f1.n) from NAT_1:sch 11;
    deffunc F2(object,object) = [{},{$2}];
    consider f2 be Function such that
A3: dom f2 = NAT & f2.0 = 0_No and
A4: for n being Nat holds f2.(n+1) = F2(n,f2.n) from NAT_1:sch 11;
    defpred P[object,object] means
    for i be Integer st i=$1 holds
    (i>=0 implies $2=f1.i) & (i<0 implies $2=f2.-i);
A5: for i being object st i in INT ex j being object st P[i,j]
    proof
      let i be object;
      assume i in INT;
      then reconsider x=i as Integer;
      per cases;
      suppose
A6:     x >=0;
        take f1.x;
        thus thesis by A6;
      end;
      suppose
A7:     x < 0;
        take f2.(-x);
        thus thesis by A7;
      end;
    end;
    consider f be ManySortedSet of INT such that
A8: for i being object st i in INT holds P[i,f.i] from PBOOLE:sch 3(A5);
    take f;
    let n;
    0 in INT by INT_1:def 2;
    hence f.0 = 0_No by A1,A8;
A9: n+1 in INT & n in INT by INT_1:def 2;
    then f.(n+1) = f1.(n+1) = F1(n,f1.n) by A2,A8;
    hence f.(n+1) = [{f.n},{}] by A9,A8;
A10:-(n+1) in INT & -n in INT by INT_1:def 2;
    then
A11: f.-(n+1) = f2.- -(n+1) = F2(n,f2.n) by A4,A8;
    f.-n = f2.- -(n)
    proof
      per cases;
      suppose n >0;
        hence thesis by A10,A8;
      end;
      suppose n=0;
        hence thesis by A10,A1,A3,A8;
      end;
    end;
    hence f.-(n+1) = [{},{f.-n}] by A11;
  end;
  uniqueness
  proof
    let it1,it2 be ManySortedSet of INT such that
A12:it1.0 = 0_No & it1.(n+1) = [{it1.n},{}] & it1.-(n+1) = [{},{it1.-n}]
    and
A13:it2.0 = 0_No & it2.(n+1) = [{it2.n},{}] & it2.-(n+1) = [{},{it2.-n}];
    defpred P[Nat] means it1.$1 = it2.$1 & it1.-$1 = it2.-$1;
A14:P[0] by A12,A13;
A15:P[n] implies P[n+1]
    proof
      assume
A16:  P[n];
      thus it1.(n+1) = [{it1.n},{}] by A12
      .= it2.(n+1) by A16,A13;
      thus it1.-(n+1) = [{},{it1.-n}] by A12
      .= it2.-(n+1) by A16,A13;
    end;
A17:P[n] from NAT_1:sch 2(A14,A15);
A18:dom it1 = INT = dom it2 by PARTFUN1:def 2;
    o in INT implies it1.o=it2.o
    proof
      assume o in INT;
      then ex n st o =n or o =-n by INT_1:2;
      hence thesis by A17;
    end;
    hence thesis by A18,FUNCT_1:2;
  end;
end;

theorem Th1:
  uInt.n in Day n & uInt.-n in Day n
proof
  defpred P[Nat] means uInt.$1 in Day $1 & uInt.-$1 in Day $1;
A1:uInt.0 =0_No by Def1;
  born 0_No = {} by SURREAL0:37;
  then
A2: P[0] by A1,SURREAL0:def 18;
A3: for n st P[n] holds P[n+1]
  proof
    let n such that
A4: P[n];
A5: {uInt.n}<<{};
A6: n in succ Segm n = Segm (n+1) by ORDINAL1:6,NAT_1:38;
A7: {} << {uInt.-n};
A8:o in {uInt.-n}\/{} implies
    ex O st O in n+1 & o in Day O
    proof
      assume o in {uInt.-n}\/{};
      then o = uInt.-n by TARSKI:def 1;
      hence thesis by A6,A4;
    end;
    o in {uInt.n}\/{} implies ex O st O in n+1 & o in Day O
    proof
      assume o in {uInt.n}\/{};
      then o = uInt.n by TARSKI:def 1;
      hence thesis by A6,A4;
    end;
    then [{uInt.n},{}] in Day (n+1) &
    [{},{uInt.-n}] in Day (n+1) by A8,A5,A7,SURREAL0:46;
    hence thesis by Def1;
  end;
  for n holds P[n] from NAT_1:sch 2(A2,A3);
  hence thesis;
end;

registration
  let i be Integer;
  cluster uInt.i -> surreal;
  coherence
  proof
    i in INT by INT_1:def 2;
    then consider k be Nat such that
A1: i = k or i = - k by INT_1:def 1;
    uInt.i in Day k by A1,Th1;
    hence thesis;
  end;
end;

Lm1: uInt.n < uInt.(n+1)
proof
A1: uInt.(n+1) = [{uInt.n},{}] by Def1;
  assume uInt.(n+1) <= uInt.n;
  then L_(uInt.(n+1)) << {uInt.n} by SURREAL0:43;
  then uInt.n in {uInt.n} << {uInt.n} by A1,TARSKI:def 1;
  hence thesis by SURREALO:3;
end;

Lm2:  uInt.-(n+1) < uInt.-n
proof
A1: uInt.-(n+1) = [{},{uInt.-n}] by Def1;
  assume uInt.-n <= uInt.-(n+1);
  then {uInt.-n} << R_(uInt.-(n+1)) by SURREAL0:43;
  then uInt.-n in {uInt.-n} << {uInt.-n} by A1,TARSKI:def 1;
  hence thesis by SURREALO:3;
end;

theorem Th2:
  x in Day n implies uInt.-n <= x <= uInt.n
proof
  defpred P[Nat] means for x st x in Day $1 holds
  uInt.-$1 <= x <= uInt.$1;
A1: P[0]
  proof
A2: uInt.0=0_No by Def1;
    let x;
    assume x in Day 0;
    then born x c= 0 by SURREAL0:def 18;
    then born x = 0;
    hence thesis by A2,SURREAL0:37;
  end;
A3: for n holds P[n] implies P[n+1]
  proof
    let n;
A4: succ Segm n = Segm (n+1) by NAT_1:38;
    assume
A5: P[n];
    let x such that
A6: x in Day (n+1);
    uInt.(n+1) = [{uInt.n},{}] by Def1;
    then
A7: R_(uInt.(n+1)) = {};
A8: L_x << {uInt.(n+1)}
    proof
      let l,r be Surreal such that
A9:   l in L_x & r in {uInt.(n+1)};
      l in L_x \/ R_x by A9,XBOOLE_0:def 3;
      then born l in born x c= n+1 by A6,SURREALO:1,SURREAL0:def 18;
      then l in Day born l c= Day n by A4,SURREAL0:35,def 18,ORDINAL1:22;
      then l <= uInt.n < uInt.(n+1) by A5,Lm1;
      then l < uInt.(n+1) by SURREALO:4;
      hence thesis by A9,TARSKI:def 1;
    end;
A10: {x} << {};
    uInt.-(n+1) = [{},{uInt.-n}] by Def1;
    then
A11: L_(uInt.-(n+1)) ={};
A12: {} << {x};
    {uInt.-(n+1)} << R_x
    proof
      let r,l be Surreal such that
A13:  r in {uInt.-(n+1)} & l in R_x;
      l in L_x \/ R_x by A13,XBOOLE_0:def 3;
      then born l in born x c= n+1 by A6,SURREALO:1,SURREAL0:def 18;
      then l in Day born l c= Day n by A4,ORDINAL1:22,SURREAL0:35,def 18;
      then uInt.-(n+1) < uInt.-n <= l by A5,Lm2;
      then uInt.-(n+1) < l by SURREALO:4;
      hence thesis by A13,TARSKI:def 1;
    end;
    hence thesis by A7,A8,SURREAL0:43,A10,A11,A12;
  end;
  for n holds P[n] from NAT_1:sch 2(A1,A3);
  hence thesis;
end;

theorem Th3:
  for i,j be Integer st i < j holds uInt.i < uInt.j
proof
A1:for k be Nat st k>=1 holds uInt.n < uInt.(n+k)
  proof
    defpred P[Nat] means uInt.n < uInt.(n+$1);
A2: P[1] by Lm1;
A3: for j being Nat st 1 <= j holds P[j] implies P[j+1]
    proof
      let j be Nat such that
A4:   1 <= j & P[j];
      uInt.(n+j) <= uInt.(n+j+1) by Lm1;
      hence thesis by A4,SURREALO:4;
    end;
    for j being Nat st 1 <= j holds P[j] from NAT_1:sch 8(A2,A3);
    hence thesis;
  end;
A5:for k be Nat st k>=1 holds uInt.-(n+k) < uInt.-n
  proof
    defpred P[Nat] means uInt.-(n+$1) < uInt.-n;
A6: P[1] by Lm2;
A7: for j being Nat st 1 <= j holds P[j] implies P[j+1]
    proof
      let j be Nat such that
A8:   1 <= j & P[j];
      uInt.-(n+j+1) <= uInt.-(n+j) by Lm2;
      hence thesis by A8,SURREALO:4;
    end;
    for j being Nat st 1 <= j holds P[j] from NAT_1:sch 8(A6,A7);
    hence thesis;
  end;
  let i,j be Integer such that
A9:i < j;
  i in INT by INT_1:def 2;
  then consider I be Nat such that
A10: i=I or i = -I by INT_1:def 1;
  j in INT by INT_1:def 2;
  then consider J be Nat such that
A11:j=J or j = -J by INT_1:def 1;
  per cases by A10,A11;
  suppose
A12:i=I & j=J;
    then reconsider JI=J-I as Nat by A9,NAT_1:21;
    JI <>0 by A12,A9;
    then uInt.I < uInt.(I+JI) by A1,NAT_1:14;
    hence thesis by A12;
  end;
  suppose i=I & j=-J;
    hence thesis by A9;
  end;
  suppose
A13:i=-I & j=J;
    per cases;
    suppose
A14:  i=0;
      then uInt.0 < uInt.(0+j) by A9,A1,NAT_1:14;
      hence thesis by A14;
    end;
    suppose
A15:  j=0;
      then uInt.-(0+I) < uInt.-0 by A9,A13,A5,NAT_1:14;
      hence thesis by A15,A13;
    end;
    suppose i<>0 & j <>0;
      then uInt.-(0+I) < uInt.-0 <= uInt.(0+J) by A13,NAT_1:14,A1,A5;
      hence thesis by A13,SURREALO:4;
    end;
  end;
  suppose
A16: i=-I & j=-J;
    then reconsider IJ=I-J as Nat by A9,XREAL_1:24,NAT_1:21;
    IJ<>0 by A16,A9;
    then uInt.-(J+IJ) < uInt.-J by A5,NAT_1:14;
    hence thesis by A16;
  end;
end;

registration
  let n be positive Nat;
  cluster uInt.n -> positive;
  coherence
  proof
    0_No = uInt.0 < uInt.n by Def1,Th3;
    hence thesis;
  end;
end;

theorem Th4:
  n = born uInt.n & n = born uInt.-n
proof
A1: uInt.n in Day n by Th1;
  for O st uInt.n in Day O holds n c= O
  proof
    let O such that
A2: uInt.n in Day O and
A3: not n c= O;
A4: O in Segm n by A3,ORDINAL1:16;
    reconsider O as Nat by A3;
    uInt.n <= uInt.O < uInt.n by A2,Th2,A4,NAT_1:44,Th3;
    hence thesis;
  end;
  hence n = born (uInt.n) by A1,SURREAL0:def 18;
A5: uInt.-n in Day n by Th1;
  for O st uInt.-n in Day O holds n c= O
  proof
    let O such that
A6: uInt.-n in Day O and
A7: not n c= O;
A8: O in Segm n by A7,ORDINAL1:16;
    reconsider O as Nat by A7;
A9: -n < - O by XREAL_1:24,A8,NAT_1:44;
    uInt.-n <= uInt.-O < uInt.-n by A6,Th2,A9,Th3;
    hence thesis;
  end;
  hence thesis by A5,SURREAL0:def 18;
end;

theorem Th5:
  born_eq uInt.n = n & born_eq uInt.-n = n
proof
A1: born uInt.n = n by Th4;
  for y be Surreal st y == uInt.n holds born uInt.n c= born y
  proof
    let y be Surreal such that
A2: y == uInt.n;
    assume not born uInt.n c= born y;
    then
A3: not n c= born y by Th4;
    then reconsider O=born y as Nat;
    y in Day O c= Day n by SURREAL0:35,SURREAL0:def 18,A3;
    then y <= uInt.O by Th2;
    then
A4: uInt.n <= uInt.O by A2,SURREALO:4;
    O in Segm n by A3,ORDINAL1:16;
    hence thesis by A4,Th3,NAT_1:44;
  end;
  hence born_eq uInt.n = n by A1,SURREALO:def 5;
A5: born uInt.-n = n by Th4;
  for y be Surreal st y == uInt.-n holds born uInt.-n c= born y
  proof
    let y be Surreal such that
A6: y == uInt.-n;
    assume not born uInt.-n c= born y;
    then
A7: not n c= born y by Th4;
    then reconsider O=born y as Nat;
    y in Day O c= Day n by SURREAL0:35,SURREAL0:def 18,A7;
    then
A8: uInt.-O <= y by Th2;
    O in Segm n by A7,ORDINAL1:16;
    then -n < -O by NAT_1:44,XREAL_1:24;
    hence thesis by A8, A6,SURREALO:4,Th3;
  end;
  hence thesis by A5,SURREALO:def 5;
end;

theorem
  0_No <= uInt.n
proof
  0 = n or 0 < n;
  then uInt.0 = uInt.n or uInt.0 < uInt.n by Th3;
  hence thesis by Def1;
end;

theorem Th7:
  L_(uInt.-n) = {} = R_(uInt.n)
proof
A1: uInt.0 = 0_No by Def1;
  thus L_(uInt.-n) = {}
  proof
    assume
A2: L_(uInt.-n) <> {};
    then n <>0 by A1;
    then reconsider N=n-1 as Nat by NAT_1:20;
    uInt.-(N+1) = [{},{uInt.-N}] by Def1;
    hence thesis by A2;
  end;
  assume
A3:R_(uInt.n) <> {};
  then n <> 0 by A1;
  then reconsider N=n-1 as Nat by NAT_1:20;
  uInt.(N+1) = [{uInt.N},{}] by Def1;
  hence thesis by A3;
end;

registration
  let i be Integer;
  cluster uInt.i -> uniq-surreal;
  coherence
proof
  i in INT by INT_1:def 2;
  then consider o be Nat such that
A1:i=o or i=-o by INT_1:def 1;
  per cases by A1;
  suppose
A2: i=o;
    defpred P[Nat] means uInt.$1 is uniq-surreal;
A3: P[0] by Def1;
A4: P[n] implies P[n+1]
    proof
      assume P[n];
      then reconsider sn= uInt.n as uSurreal;
      set n1=n+1;
      set x= uInt.(n+1);
A5:   x in Day born x by SURREAL0:def 18;
A6:   born_eq x = n1 & n1 = born x by Th5,Th4;
      then
A7:   x in born_eq_set x by A5,SURREALO:def 6;
A8:   x = [{sn},{}] by Def1;
      then
A9:   L_x\/R_x is uniq-surreal-membered;
      for z st z in born_eq_set x & L_z\/R_z is uniq-surreal-membered & x<>z
      holds card (L_x) (+) card (R_x) in card (L_z) (+) card (R_z)
      proof
        let z such that
A10:    z in born_eq_set x &
        L_z\/R_z is uniq-surreal-membered and
A11:    x<>z and
A12:    not card (L_x) (+) card (R_x) in card (L_z) (+) card (R_z);
A13:    z==x by A10,SURREALO:def 6;
A14:    card (L_x) (+) card (R_x) = 1 by A8,SURREALO:47;
        then card (L_z) (+) card (R_z) c= 1 by A12,ORDINAL1:16;
        then reconsider cz = card (L_z) (+) card (R_z) as Nat;
        cz<>0
        proof
          assume cz=0;
          then
A15:      z=0_No by SURREALO:46;
          uInt.0 < x by Th3;
          hence thesis by A13,A15,Def1;
        end;
        then
A16:    1 <= cz by NAT_1:14;
        Segm cz c= Segm 1 by A14,A12,ORDINAL1:16;
        then cz <=1 by NAT_1:39;
        then consider r be Surreal such that
A17:    z= [{},{r}] or z = [{r},{}] by SURREALO:47,A16,XXREAL_0:1;
A18:    r in L_z\/R_z by A17,TARSKI:def 1;
        then reconsider r as uSurreal by A10;
A19:    born z = born_eq z = born_eq x by A10,SURREALO:35;
A20:    born r in n1 by A19,A6,SURREALO:1,A18;
        then
A21:    r in Day born r c= Day n1 by SURREAL0:35,def 18,ORDINAL1:def 2;
        per cases by A17;
        suppose
A22:      z= [{},{r}];
A23:      L_x << {z} & {x} << R_z & L_z << {x} by A13,SURREAL0:43;
          x in {x} & r in {r} by TARSKI:def 1;
          hence thesis by A21,Th2,A23,A22;
        end;
        suppose
A24:      z = [{r},{}];
          then
A25:      not r == sn by A11,A8,SURREALO:50;
          n1=Segm n1;
          then born r in succ Segm n by A20,NAT_1:38;
          then
A26:      r in Day born r c= Day n
          by ORDINAL1:22,SURREAL0:35,def 18;
          L_z << {sn} & {z} << R_sn by Th7,A24,SURREALO:21,A26,Th2,A25;
          then not L_x << {z} by SURREAL0:43,A8,SURREALO:21;
          hence thesis by A13,SURREAL0:43;
        end;
      end;
      hence thesis by A7,A9,SURREALO:49;
    end;
    P[n] from NAT_1:sch 2(A3,A4);
    hence thesis by A2;
  end;
  suppose
A27: i=-o;
    defpred P[Nat] means uInt.-$1 is uniq-surreal;
A28: P[0] by Def1;
A29: P[n] implies P[n+1]
    proof
      assume P[n];
      then reconsider sn= uInt.-n as uSurreal;
      set n1=n+1;
      set x= uInt.-(n+1);
A30:  x in Day born x by SURREAL0:def 18;
A31:  born_eq x = n1 & n1 = born x by Th5,Th4;
      then
A32:  x in born_eq_set x by A30,SURREALO:def 6;
A33:  x = [{},{sn}] by Def1;
      then
A34:  L_x\/R_x is uniq-surreal-membered;
      for z st z in born_eq_set x & L_z\/R_z is uniq-surreal-membered & x<>z
      holds card (L_x) (+) card (R_x) in card (L_z) (+) card (R_z)
      proof
        let z such that
A35:    z in born_eq_set x & L_z\/R_z is uniq-surreal-membered and
A36:    x<>z and
A37:    not card (L_x) (+) card (R_x) in card (L_z) (+) card (R_z);
A38:    z==x by A35,SURREALO:def 6;
A39:    card (L_x) (+) card (R_x) = 1 by A33,SURREALO:47;
        then card (L_z) (+) card (R_z) c= 1 by A37,ORDINAL1:16;
        then reconsider cz = card (L_z) (+) card (R_z) as Nat;
        cz<>0
        proof
          assume cz=0;
          then
A40:      z=0_No by SURREALO:46;
          x < uInt.0 by Th3;
          hence thesis by A38,A40,Def1;
        end;
        then
A41:    1 <= cz by NAT_1:14;
        Segm cz c= Segm 1 by A39,A37,ORDINAL1:16;
        then cz <=1 by NAT_1:39;
        then consider r be Surreal such that
A42:    z= [{},{r}] or z = [{r},{}] by SURREALO:47,A41,XXREAL_0:1;
A43:    r in L_z\/R_z by A42,TARSKI:def 1;
        then reconsider r as uSurreal by A35;
A44:    born z = born_eq z = born_eq x by A35,SURREALO:35;
A45:    born r in n1 by A44,A31,SURREALO:1,A43;
        then
A46:    r in Day born r c= Day n1 by SURREAL0:35,def 18,ORDINAL1:def 2;
        per cases by A42;
        suppose
A47:      z= [{r},{}];
A48:      L_x << {z} & {x} << R_z & L_z << {x} by A38, SURREAL0:43;
          x in {x} & r in {r} by TARSKI:def 1;
          hence thesis by A46,A47,A48,Th2;
        end;
        suppose
A49:      z = [{},{r}];
          then
A50:      not r == sn by A36,A33,SURREALO:50;
          n1=Segm n1;
          then born r in succ Segm n by A45,NAT_1:38;
          then
A51:      r in Day born r c= Day n by ORDINAL1:22,SURREAL0:35,def 18;
          R_z >> {sn} & {z} >> L_sn by Th7,A49,A51,Th2,A50,SURREALO:21;
          then not R_x >> {z} by SURREAL0:43,A33,SURREALO:21;
          hence thesis by A38,SURREAL0:43;
        end;
      end;
      hence thesis by A32,A34,SURREALO:49;
    end;
    P[n] from NAT_1:sch 2(A28,A29);
    hence thesis by A27;
  end;
end;
end;

Lm3: for i be Integer st -n < i < n holds
   uInt.-n < uInt.i < uInt.n
proof
  let i be Integer such that
A1:-n < i < n;
  i in INT by INT_1:def 2;
  then consider k be Nat such that
A2:i=k or i=-k by INT_1:def 1;
  Segm k c= Segm n by A2,A1,XREAL_1:24,NAT_1:39;
  then
A3: Day k c= Day n by SURREAL0:35;
A4: born_eq uInt.n = n = born_eq uInt.-n by Th5;
  born_eq uInt.i = k by A2,Th5;
  then
A5: not uInt.n == uInt.i & not uInt.i==uInt.-n by A4,SURREALO:50,A2,A1;
  born  uInt.i = k by A2,Th4;
  then (uInt.i) in Day k by SURREAL0:def 18;
  hence thesis by Th2,A5,A3;
end;

Lm4:
  for i,j be Integer st i < j holds uInt.i < uInt.j
proof
  let i,j be Integer;
  assume
A1: i < j;
  i in INT by INT_1:def 2;
  then consider k be Nat such that
A2:i=k or i=-k by INT_1:def 1;
  j in INT by INT_1:def 2;
  then consider n be Nat such that
A3:j=n or j=-n by INT_1:def 1;
  per cases by XXREAL_0:1;
  suppose k < n;
    then -n < k & -n < -k & -k < n by XREAL_1:24;
    hence thesis by A2,A3,A1,Lm3;
  end;
  suppose k > n;
    hence thesis by Lm3,A2,A3,A1;
  end;
  suppose k = n;
    then i=-n & j=n & -n < 0 < n by A2,A3,A1;
    then uInt.i < uInt.0 <= uInt.j by Lm3;
    hence thesis by SURREALO:4;
  end;
end;

theorem
  for i,j be Integer st uInt.i = uInt.j holds i=j
proof
  let i,j be Integer;
  assume uInt.i = uInt.j;
  then i <= j <=i by Lm4,SURREALO:3;
  hence thesis by XXREAL_0:1;
end;

theorem Th9:
  for i,j be Integer holds i < j iff uInt.i < uInt.j
proof
  let i,j be Integer;
  thus i < j implies uInt.i < uInt.j by Lm4;
  assume
A1:uInt.i < uInt.j & j <=i;
  then j <> i by SURREALO:3;
  then j < i by A1,XXREAL_0:1;
  then uInt.j <= uInt.i by Lm4;
  hence thesis by A1;
end;

theorem Th10:
  for i be Integer, x holds
     [{uInt.(i-1)},{uInt.(i+1)}] is Surreal &
     (x = [{uInt.(i-1)},{uInt.(i+1)}] implies x == uInt.i)
proof
  let i be Integer,x;
  set S=uInt.i;
  i+-1 < i+1 by XREAL_1:6;
  hence [{uInt.(i-1)},{uInt.(i+1)}] is Surreal by Th9,SURREALO:22;
  assume
A1:x = [{uInt.(i-1)},{uInt.(i+1)}];
  uInt.(i-1) < S by XREAL_1:44,Th9;
  then
A2: L_x << {S} by A1,SURREALO:21;
A3: L_S << {x} << R_S
  proof
    per cases;
    suppose i =0;
      then S = 0_No by Def1;
      hence thesis;
    end;
    suppose
A4:   i >0;
      then reconsider I=i as Element of NAT by INT_1:3;
      reconsider i1=I-1 as Nat by NAT_1:20,A4;
      i = i1+1;
      then
A5:   S = [{uInt.i1},{}] by Def1;
      uInt.i1 <= uInt.(i-1);
      then not L_x << {uInt.i1} by A1,SURREALO:21;
      then uInt.i1 < x by SURREAL0:43;
      hence thesis by SURREALO:21,A5;
    end;
    suppose
A6:   0 >i;
      then reconsider I=-i as Element of NAT by INT_1:3;
      reconsider i1=I-1 as Nat by NAT_1:20,A6;
      i = -(i1+1);
      then
A7:   S = [{},{uInt.-i1}] by Def1;
      not (L_(uInt.-i1) << {x} & {uInt.-i1} << R_x) by SURREALO:3,21,A1;
      then not uInt.-i1 <= x by SURREAL0:43;
      hence thesis by SURREALO:21,A7;
    end;
  end;
  S < uInt.(i+1) by Th9,XREAL_1:29;
  then {S} << R_x by A1,SURREALO:21;
  hence thesis by A2,A3,SURREAL0:43;
end;

theorem Th11:
  uInt.1 = 1_No
proof
  uInt.(1+0) = [{uInt.0},{}] by Def1
  .= [{0_No},{}] by Def1;
  hence thesis;
end;

theorem Th12:
  for i be Integer holds - uInt.i = uInt.-i
proof
  defpred P[Nat] means - uInt.$1 = uInt.-$1;
  uInt.0=0_No by Def1;
  then
A1: P[0];
A2: P[n] implies P[n+1]
  proof
    assume
A3: P[n];
    uInt.(n+1) = [{uInt.n},{}] by Def1;
    then L_(uInt.(n+1)) = {uInt.n} & R_(uInt.(n+1)) = {};
    then - uInt.(n+1) = [{},-- {uInt.n}] by SURREALR:22,7
    .= [{},{uInt.-n}] by A3,SURREALR:21
    .= uInt.-(n+1) by Def1;
    hence thesis;
  end;
A4: P[n] from NAT_1:sch 2(A1,A2);
  let i be Integer;
  i in INT by INT_1:def 2;
  then consider o be Nat such that
A5:i=o or i=-o by INT_1:def 1;
  P[o] by A4;
  hence thesis by A5;
end;

theorem Th13:
  (uInt.n) + (uInt.m) = uInt.(n+m)
proof
  defpred P[Nat] means (uInt.$1) + 1_No = uInt.($1+1);
A1: uInt.0=0_No & uInt.1=1_No by Def1,Th11;
  then
A2: P[0];
A3: for n st P[n] holds P[n+1]
  proof
    let n;
    set s = uInt.(n+1);
    assume
A4: P[n];
A5: {s} ++ L_1_No = {s+0_No} by SURREALR:36;
    R_s = {} by Th7;
    then
A6: R_s ++ {1_No} = {} by SURREALR:27;
    s = [{uInt.n},{}] by Def1;
    then
A7: L_s ++ {1_No} = {s} by A4,SURREALR:36;
    thus s + 1_No
    = [(L_s ++ {1_No})\/({s} ++ L_1_No), (R_s ++ {1_No}) \/({s} ++ R_1_No)]
    by SURREALR:28
    .= [{s}\/{s}, {} \/{}] by A5,SURREALR:27,A6,A7
    .= uInt.((n+1)+1) by Def1;
  end;
A8: for n holds P[n] from NAT_1:sch 2(A2,A3);
  defpred Q[Nat] means (uInt.n) + (uInt.$1) = uInt.(n+$1);
A9:Q[0] by A1;
A10: for m st Q[m] holds Q[m+1]
  proof
    let m such that
A11: Q[m];
    (uInt.n) + (uInt.(m+1)) = (uInt.n) + ((uInt.m) + (uInt.1)) by Th11,A8
    .= (uInt.(n + m)) + 1_No by Th11,A11,SURREALR:37
    .= uInt.((n + m) + 1) by A8;
    hence thesis;
  end;
  for m holds Q[m] from NAT_1:sch 2(A9,A10);
  hence thesis;
end;

theorem Th14:
  for i,j be Integer holds (uInt.i) + (uInt.j) == uInt.(i+j)
  proof
A1: uInt.0=0_No by Def1;
    defpred P[Nat] means for n,m st n+m=$1
      holds (uInt.n) + (uInt.-m) == uInt.(n-m);
A2: P[0]
    proof
      let n,m;
      assume n+m=0;
      then n=0 & m=0;
      hence thesis by A1;
    end;
A3: for k be Nat st P[k] holds P[k+1]
    proof
      let k be Nat such that
A4:   P[k];
      let n,m such that
A5:   n+m=k+1;
      per cases;
      suppose n=0 or m=0;
        hence thesis by A1;
      end;
      suppose n<>0 & m<>0;
        then reconsider n1=n-1,m1=m-1 as Nat by NAT_1:20;
A6:     uInt.(n1+1) = [{uInt.n1},{}] & uInt.-(m1+1) = [{},{uInt.-m1}]
        by Def1;
        then
A7:     {(uInt.n)} ++ L_(uInt.-m)={} = R_(uInt.n) ++ {(uInt.-m)}
        by SURREALR:27;
        n1+m =k by A5;
        then
A8:     (uInt.n1) + (uInt.-m) == uInt.(n1-m) by A4;
        L_(uInt.n) ++ {(uInt.-m)}
        = {(uInt.n1) + (uInt.-m)} by SURREALR:36,A6;
        then
A9:     L_(uInt.n) ++ {(uInt.-m)} <==> {uInt.(n-m-1)} by A8,SURREALO:32;
        n+m1 = k by A5;
        then
A10:    (uInt.n) + (uInt.-m1) == uInt.(n-m1) by A4;
        {(uInt.n)} ++ R_(uInt.-m)
        = {(uInt.n) + (uInt.-m1)} by A6,SURREALR:36;
        then
A11:    {(uInt.n)} ++ R_(uInt.-m) <==> {uInt.(n-m+1)}
        by A10,SURREALO:32;
        reconsider ss = [{uInt.(n-m-1)},{uInt.(n-m+1)}] as Surreal by Th10;
A12:    ss == uInt.(n-m) by Th10;
        (uInt.n) + (uInt.-m) = [(L_(uInt.n) ++ {(uInt.-m)})\/{},
        {} \/({(uInt.n)} ++ R_(uInt.-m))] by A7,SURREALR:28
        .= [L_(uInt.n) ++ {(uInt.-m)},{(uInt.n)} ++ R_(uInt.-m)];
        then (uInt.n) + (uInt.-m) == ss by A9,A11,SURREALO:29;
        hence thesis by A12,SURREALO:4;
      end;
    end;
A13:for k be Nat holds P[k] from NAT_1:sch 2(A2,A3);
    let i,j be Integer;
    i in INT by INT_1:def 2;
    then consider k be Nat such that
A14:i=k or i=-k by INT_1:def 1;
    j in INT by INT_1:def 2;
    then consider n be Nat such that
A15:j=n or j=-n by INT_1:def 1;
    per cases by A14,A15;
    suppose i=k & j=n;
      hence thesis by Th13;
    end;
    suppose
A16:  i=-k & j=n;
      P[n+k] by A13;
      then (uInt.n) + (uInt.-k) == uInt.(n-k);
      hence thesis by A16;
    end;
    suppose
A17:  i=k & j=-n;
      P[k+n] by A13;
      then (uInt.k) + (uInt.-n) == uInt.(k-n);
      hence thesis by A17;
    end;
    suppose
A18: i=-k & j=-n;
      then (uInt.i) + (uInt.j) = (-uInt.k) + (uInt.-n) by Th12
      .=(-uInt.k) + (-uInt.n) by Th12
      .= -(uInt.k + uInt.n) by SURREALR:40
      .= -(uInt.(k +n)) by Th13
      .= uInt.-(k +n) by Th12;
      hence thesis by A18;
    end;
end;

theorem Th15:
  for i,j be Integer holds (uInt.i) * (uInt.j) == uInt.(i*j)
proof
A1: uInt.0=0_No by Def1;
  defpred P[Nat] means for n,m st n+m=$1
    holds (uInt.n) * (uInt.m) == uInt.(n*m);
A2: for k be Nat st for n st n < k holds P[n] holds P[k]
  proof
    let k be Nat such that
A3: for n st n < k holds P[n];
    let n,m such that
A4: n+m=k;
    per cases;
    suppose n=0 or m=0;
      hence thesis by A1;
    end;
    suppose n<>0 & m<>0;
      then reconsider n1=n-1,m1=m-1,nm1=n*m-1 as Nat by NAT_1:20;
A5:   uInt.(n1+1) = [{uInt.n1},{}] & uInt.(m1+1) = [{uInt.m1},{}]
      by Def1;
A6:   uInt.(nm1+1) = [{uInt.nm1},{}] by Def1;
      set x=uInt.n,y = uInt.m;
      reconsider nm1=n*m-1 as Nat by A6;
      comp(R_x,x,y,L_y) = comp(L_y,y,x,R_x) by SURREALR:53;
      then
A7:   comp(R_x,x,y,L_y) = {} by A5,SURREALR:49;
A8:   comp(L_x,x,y,R_y) = {} = comp(R_x,x,y,R_y) by A5,SURREALR:49;
A9:   n1 < n1+1 & m1< m1+1 by NAT_1:13;
      then
A10:  n1+m < n+m & n1+m1 < n+m1 & n+m1 < n+m by XREAL_1:8;
      n1+m1 < n+m by A9,XREAL_1:8;
      then (uInt.n1)*y == uInt.(n1*m) & (uInt.n1)*(uInt.m1) == uInt.(n1*m1) &
      x*(uInt.m1) == uInt.(n*m1) by A4,A3,A10;
      then (uInt.n1)*y + x*(uInt.m1) == (uInt.(n1*m)) + uInt.(n*m1) =
      uInt.(n1*m + n*m1) &
      - (uInt.n1)*(uInt.m1) == - uInt.(n1*m1) = uInt.-(n1*m1)
      by Th13,SURREALR:10,43,Th12;
      then (uInt.n1)*y + x*(uInt.m1) + - (uInt.n1)*(uInt.m1)
      == uInt.(n1*m + n*m1) + uInt.-(n1*m1) == uInt.((n1*m + n*m1)+ -(n1*m1))
      by Th14,SURREALR:43;
      then (uInt.n1)*y + x*(uInt.m1) + - (uInt.n1)*(uInt.m1) == uInt.(nm1)
      by SURREALO:4;
      then { (uInt.n1)*y + x*(uInt.m1) - (uInt.n1)*(uInt.m1)}
      <==> {uInt.(nm1)} by SURREALO:32;
      then
A11:  comp(L_x,x,y,L_y) <==> {uInt.(nm1)} by A5,SURREALR:52;
      x * y = [comp(L_x,x,y,L_y)\/ {},{}\/{}] by A7,A8,SURREALR:50
      .= [comp(L_x,x,y,L_y),{}];
      hence thesis by A6,A11,SURREALO:29;
    end;
  end;
A12: for k be Nat holds P[k] from NAT_1:sch 4(A2);
  let i,j be Integer;
  i in INT by INT_1:def 2;
  then consider k be Nat such that
A13:i=k or i=-k by INT_1:def 1;
  j in INT by INT_1:def 2;
  then consider n be Nat such that
A14:j=n or j=-n by INT_1:def 1;
A15: P[n+k] by A12;
  then
A16:(uInt.n) * (uInt.k) == uInt.(n*k);
  per cases by A13,A14;
  suppose i=k & j=n;
    hence thesis by A15;
  end;
  suppose
A17:i=-k & j=n;
    (uInt.n) * (uInt.-k) = (uInt.n) *( -uInt.k) by Th12
    .= - (uInt.n) * (uInt.k) by SURREALR:58;
    then (uInt.n) * (uInt.-k) == - uInt.(n*k) by A16,SURREALR:10;
    then (uInt.n) * (uInt.-k) == uInt.-(n*k) by Th12;
    hence thesis by A17;
  end;
  suppose
A18: i=k & j=-n;
    (uInt.-n) * (uInt.k) = (-uInt.n) *( uInt.k) by Th12
    .= - (uInt.n) * (uInt.k) by SURREALR:58;
    then (uInt.-n) * (uInt.k) == - uInt.(n*k) by A16,SURREALR:10;
    then (uInt.-n) * (uInt.k) == uInt.-(n*k) by Th12;
    hence thesis by A18;
  end;
  suppose
A19: i=-k & j=-n;
    (uInt.-n) * (uInt.-k) = (-uInt.n) *( uInt.-k) by Th12
    .= (-uInt.n) *(-uInt.k) by Th12
    .= - - (uInt.n) * (uInt.k) by SURREALR:58
    .= (uInt.n) * (uInt.k);
    hence thesis by A19,A16;
  end;
end;

theorem Th16:
  x = [{y},{}] & y < 0_No implies x == 0_No
proof
  assume x=[{y},{}] & y < 0_No;
  then
A1: L_x<<{0_No}<< R_x by SURREALO:21;
  born 0_No ={} by SURREAL0:37;
  then for z st L_x << {z} << R_x holds born 0_No c= born z;
  hence thesis by SURREALO:16,A1;
end;

theorem Th17:
  x = [{y},{}] & born x is finite & 0_No <= y implies
    ex n be Nat st x == uInt.(n+1) & uInt.n <= y < uInt.(n+1) & n in born x
proof
  assume
A1: x=[{y},{}] & born x is finite & 0_No <= y;
  reconsider a = born x as Nat by A1;
  defpred O[Nat] means L_x << {uInt.$1};
A2: x in Day a by SURREAL0:def 18;
  L_x << {x} by SURREALO:11;
  then O[a] by A2,Th2,SURREALO:17;
  then
A3: ex k being Nat st O[k];
  consider k be Nat such that
A4: O[k] & for n being Nat st O[n] holds k <= n from NAT_1:sch 5(A3);
  k<>0
  proof
    assume k=0;
    then {y} << {0_No} by Def1,A1,A4;
    hence thesis by A1,SURREALO:21;
  end;
  then reconsider k1=k-1 as Nat by NAT_1:20;
  take k1;
A5: L_x << {uInt.k} << R_x by A4,A1;
  for z st L_x << {z} << R_x holds born uInt.k c= born z
  proof
    let z such that
A6: L_x << {z} << R_x and
A7: not born uInt.k c= born z;
A8: born z in born uInt.k =k=Segm k by Th4,A7,ORDINAL1:16;
    then reconsider bz = born z as Nat;
    bz < k = k1+1 by A8,NAT_1:44;
    then bz <= k1 by NAT_1:13;
    then Segm bz c= Segm k1 by NAT_1:39;
    then z in Day bz c= Day k1 by SURREAL0:35,SURREAL0:def 18;
    then L_x << {uInt.k1} by Th2,A6,SURREALO:17;
    then k1+1 <= k1 by A4;
    hence thesis by NAT_1:13;
  end;
  hence x == uInt.(k1+1) by A5,SURREALO:16;
A9: uInt.k1 <= y
  proof
    assume y < uInt.k1;
    then L_x << {uInt.k1} by SURREALO:21,A1;
    then k1+1 <= k1 by A4;
    hence thesis by NAT_1:13;
  end;
  hence uInt.k1 <= y < uInt.(k1+1) by SURREALO:21,A4,A1;
A10: k1 c= born y
  proof
    assume
A11:not k1 c= born y;
    then k1<>0;
    then reconsider k2=k1-1 as Nat by NAT_1:20;
    k1 = k2+1;
    then Segm k1 = succ Segm k2 by NAT_1:38;
    then born y c= k2 by A11,ORDINAL1:16,22;
    then y in Day born y c= Day k2 by SURREAL0:35,SURREAL0:def 18;
    then y <= uInt.k2 < uInt.(k2+1) by Th2,Lm1;
    hence thesis by A9,SURREALO:4;
  end;
  y in L_x \/ R_x by A1,TARSKI:def 1;
  hence thesis by SURREALO:1,A10,ORDINAL1:12;
end;

begin :: Dyadic Numbers

definition
  let r be Rational;
  attr r is dyadic-like means
    ex n be Nat st denominator(r) = 2 |^ n;
end;

theorem Th18:
  for r be Rational holds
    r is dyadic-like iff ex i be Integer, n be Nat st r = i / (2|^n)
proof
  let r be Rational;
  thus r is dyadic-like implies ex i be Integer, n be Nat st r = i / (2|^n)
  proof
    assume r is dyadic-like;
    then consider n be Nat such that
A1: denominator(r) = 2 |^ n;
    take numerator(r), n;
    thus thesis by A1;
  end;
  given i be Integer, n be Nat such that
A2: r = i / (2|^n);
  consider w be Nat such that
A3:  i=numerator(r)*w & 2|^n=denominator(r)*w by A2,RAT_1:27;
  consider t be Element of NAT such that
A4:w = 2 |^ t & t <= n by INT_2:28,A3,INT_1:def 3,PEPIN:34;
  reconsider nt=n-t as Nat by A4,NAT_1:21;
  n = t+nt;
  then denominator(r)* (2 |^ t) = 2|^nt * 2|^t by A4,A3,NEWTON:8;
  hence thesis by XCMPLX_1:5;
end;

registration
  let i be Integer, n be Nat;
  cluster i / (2|^n) -> dyadic-like;
  coherence by Th18;
end;

registration
  cluster -> dyadic-like for Integer;
  coherence
  proof
    let i be Integer;
    2|^0 =1 by NEWTON:4;
    then i = i / (2|^0);
    hence thesis;
  end;
end;

registration
  let x be dyadic-like Rational;
  cluster - x -> dyadic-like;
  coherence
  proof
    consider ix be Integer, nx be Nat such that
A1: x = ix / (2|^nx) by Th18;
    -x = (-ix) / (2|^nx) by A1,XCMPLX_1:187;
    hence thesis;
  end;
  let y be dyadic-like Rational;
  cluster x+y -> dyadic-like;
  coherence
  proof
    consider ix be Integer, nx be Nat such that
A2: x = ix / (2|^nx) by Th18;
    consider iy be Integer, ny be Nat such that
A3: y = iy / (2|^ny) by Th18;
    x+y = (ix*(2|^ny) + iy*(2|^nx)) / ((2|^nx)*(2|^ny)) &
    (2|^nx)*(2|^ny) = 2|^(nx+ny) by A2,A3,XCMPLX_1:116,NEWTON:8;
    hence thesis;
  end;
  cluster x+y -> dyadic-like;
  coherence;
  cluster x * y -> dyadic-like;
  coherence
  proof
    consider ix be Integer, nx be Nat such that
A4: x = ix / (2|^nx) by Th18;
    consider iy be Integer, ny be Nat such that
A5: y = iy / (2|^ny) by Th18;
    x*y = (ix *iy)/ ((2|^nx)*(2|^ny)) & (2|^nx)*(2|^ny) = 2|^(nx+ny)
    by A4,A5,XCMPLX_1:76,NEWTON:8;
    hence thesis;
  end;
end;

definition
  func DYADIC -> set means :Def3:
    o in it iff o is dyadic-like Rational;
  existence
  proof
    defpred P[object] means $1 is dyadic-like Rational;
    consider X be set such that
A1: o in X iff o in RAT & P[o] from XBOOLE_0:sch 1;
    take X;
    let o;
    thus thesis by A1,RAT_1:def 2;
  end;
  uniqueness
  proof
    let D1,D2 be set such that
A2: o in D1 iff o is dyadic-like Rational and
A3: o in D2 iff o is dyadic-like Rational;
    now let o;
      o in D1 iff o is dyadic-like Rational by A2;
      hence o in D1 iff o in D2 by A3;
    end;
    hence thesis by TARSKI:2;
  end;
end;

registration
  cluster DYADIC -> rational-membered non empty;
  coherence
  proof
    o in DYADIC implies o is rational by Def3;
    hence thesis by Def3,MEMBERED:def 4;
  end;
end;

registration
  cluster -> dyadic-like for Element of DYADIC;
  coherence by Def3;
end;

definition
  mode Dyadic is dyadic-like Rational;
end;

reserve d,d1,d2 for Dyadic;

definition
  let n be Nat;
  func DYADIC(n) -> Subset of DYADIC means :Def4:
    d in it iff ex i be Integer st d = i / (2|^n);
  existence
  proof
    defpred P[object] means ex i be Integer st $1 = i / (2|^n);
    consider IT be set such that
A1: o in IT iff o in DYADIC & P[o] from XBOOLE_0:sch 1;
    IT c= DYADIC
    proof
      let o;
      assume o in IT;
      hence thesis by A1;
    end;
    then reconsider IT as Subset of DYADIC;
    take IT;
    let d;
    thus d in IT implies ex i be Integer st d = i / (2|^n) by A1;
    given i be Integer such that
A2: d = i / (2|^n);
    d in DYADIC by Def3;
    hence thesis by A2,A1;
  end;
  uniqueness
  proof
    let D1,D2 be Subset of DYADIC such that
A3: d in D1 iff ex i be Integer st d = i / (2|^n) and
A4: d in D2 iff ex i be Integer st d = i / (2|^n);
    thus D1 c= D2
    proof
      let o;
      assume o in D1;
      then ex i be Integer st o = i / (2|^n) by A3;
      hence thesis by A4;
    end;
    let o;
    assume o in D2;
    then ex i be Integer st o = i / (2|^n) by A4;
    hence thesis by A3;
  end;
end;

reserve i,j for Integer,
        n,m,p for Nat;

theorem Th19:
  n <= m implies DYADIC(n) c= DYADIC(m)
proof
  assume n <= m;
  then reconsider mn = m-n as Nat by NAT_1:21;
  let o;
  assume
A1:o in DYADIC(n);
  then reconsider o as Dyadic;
  consider i be Integer such that
A2:o = i / (2|^n) by A1,Def4;
A3: (2|^n) * (2|^mn) = 2 |^ (n+mn) by NEWTON:8;
  o = (i * 2|^mn) / ((2|^n) * (2|^mn)) by A2,XCMPLX_1:91;
  hence thesis by A3,Def4;
end;

theorem Th20:
  d in DYADIC(n+1)\DYADIC(n) iff ex i be Integer st d = (2*i+1) / 2|^(n+1)
proof
  thus d in DYADIC(n+1)\DYADIC(n) implies
    ex i be Integer st d = (2*i+1) / 2|^(n+1)
  proof
    assume
A1: d in DYADIC(n+1)\DYADIC(n);
    then d in DYADIC(n+1) by XBOOLE_0:def 5;
    then consider i be Integer such that
A2: d = i / (2|^(n+1)) by Def4;
    i is odd
    proof
      assume i is even;
      then consider j be Integer such that
A3:   i= 2*j by ABIAN:11;
      d = (j*2) /(2*2|^n) by A3,A2,NEWTON:6;
      then d = j / (2|^n) by XCMPLX_1:91;
      then d in DYADIC(n) by Def4;
      hence thesis by A1,XBOOLE_0:def 5;
    end;
    then consider j be Integer such that
A4: i= 2*j+1 by ABIAN:1;
    take j;
    thus thesis by A2,A4;
  end;
  given i be Integer such that
A5:d = (2*i+1) / 2|^(n+1);
A6:d in DYADIC(n+1) by Def4,A5;
  not d in DYADIC(n)
  proof
    assume d in DYADIC(n);
    then consider j be Integer such that
A7: d = j / (2|^n) by Def4;
A8: 2|^(n+1) = 2 * 2|^n by NEWTON:6;
    j* (2|^(n+1)) = (2*i+1) * (2|^n) by A7,A5,XCMPLX_1:95;
    then j * 2 * 2|^n = (2*i+1) * (2|^n) by A8;
    hence thesis by XCMPLX_1:5;
  end;
  hence thesis by A6,XBOOLE_0:def 5;
end;

theorem Th21:
  INT = DYADIC(0)
proof
A1: 2|^0 = 1 by NEWTON:4;
  thus INT c= DYADIC(0)
  proof
    let o;
    assume o in INT;
    then reconsider o as Integer;
    o = o/(2|^0) by A1;
    hence thesis by Def4;
  end;
  let o;
  assume o in DYADIC(0);
  then ex i st o = i / (2|^0) by Def4;
  hence thesis by A1,INT_1:def 2;
end;

theorem Th22:
  rng uInt c= Day NAT
proof
  let y be object;
  assume y in rng uInt;
  then consider x be object such that
A1: x in dom uInt & uInt.x = y by FUNCT_1:def 3;
  reconsider x as Integer by A1;
  consider k be Nat such that
A2: x = k or x = - k by A1,INT_1:def 1;
  k c= NAT;
  then
A3: Day k c= Day NAT by SURREAL0:35;
  y in Day k by A1,A2,Th1;
  hence thesis by A3;
end;

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;

begin :: Mappings between Dyadic Numbers and Surreal Dyadic Numbers

definition
  func uDyadic -> ManySortedSet of DYADIC means :Def5:
    it.i = uInt.i &
    it.((2*j+1)/(2|^(p+1))) = [{it.(j/(2|^p))},{it.((j+1)/(2|^p))}];
  existence
  proof
    defpred P[object,object] means
    for n be Nat st $1 = n holds
      $2 is Function of Funcs(DYADIC(n),Games (NAT(+)n)),
        Funcs(DYADIC(n+1),Games (NAT(+)(n+1))) &
         for T be Function of Funcs(DYADIC(n),Games (NAT(+)n)),
         Funcs(DYADIC(n+1),Games (NAT(+)(n+1))) st T = $2
         for f be Function of DYADIC(n),Games (NAT(+)n) holds
          (for d st d in DYADIC(n) holds T.f.d = f.d)
             & for i holds
            T.f.((2*i+1) /(2|^(n+1))) =
               [{f.(i/(2|^n))},{f.((i+1)/(2|^n))}];
A1: for e being object st e in NAT ex u being object st P[e,u]
    proof
      let e be object such that
A2:   e in NAT;
      reconsider n=e as Nat by A2;
      set n1=n+1;
      defpred T[object,object] means
      $2 is Function of DYADIC(n1),Games (NAT(+)n1) &
      for f be Function of DYADIC(n),Games (NAT(+)n) st f=$1
      for g be Function of DYADIC(n1),Games (NAT(+)n1) st g=$2
      holds
        (for d st d in DYADIC(n) holds g.d = f.d)
         & for i holds
            g.((2*i+1) /(2|^(n+1))) =
               [{f.(i/(2|^n))},{f.((i+1)/(2|^n))}];
A3:   for c be object st c in Funcs(DYADIC(n),Games (NAT(+)n))
        ex u being object st T[c,u]
      proof
        let c be object such that
A4:     c in Funcs(DYADIC(n),Games (NAT(+)n));
        reconsider C=c as Function of DYADIC(n),Games (NAT(+)n)
        by A4,FUNCT_2:66;
        defpred D[object,object] means ($1 in DYADIC(n) implies $2 = C.$1) &
        (not $1 in DYADIC(n) implies
          for i st $1 = ((2*i+1) /(2|^(n+1))) holds
            $2 = [{C.(i/(2|^n))},{C.((i+1)/(2|^n))}]);
A5:     for e be object st e in DYADIC(n1) ex u being object st D[e,u]
        proof
          let e be object such that A6:e in DYADIC(n1);
          reconsider d=e as Dyadic by A6;
          per cases;
          suppose
A7:         e in DYADIC(n);
            take C.e;
            thus thesis by A7;
          end;
          suppose
A8:         not e in DYADIC(n);
            then d in DYADIC(n1)\DYADIC(n) by A6,XBOOLE_0:def 5;
            then consider i be Integer such that
A9:         d = (2*i+1) / 2|^(n+1) by Th20;
            take X=[{C.(i/(2|^n))},{C.((i+1)/(2|^n))}];
            thus e in DYADIC(n) implies X = C.e by A8;
            assume not e in DYADIC(n);
            let j such that
A10:        e = (2*j+1) /(2|^(n+1));
            (2*i+1) * 2|^(n+1) = (2*j+1) *(2|^(n+1)) by A10,A9,XCMPLX_1:95;
            then 2*i+1 = 2*j+1 by XCMPLX_1:5;
            hence thesis;
          end;
        end;
        consider d be Function such that
A11:    dom d = DYADIC(n1) and
A12:    for e being object st e in DYADIC(n1) holds D[e,d.e]
        from CLASSES1:sch 1(A5);
        take d;
A13:    dom C = DYADIC(n) by FUNCT_2:def 1;
        rng d c= Games (NAT(+)n1)
        proof
          let y be object;
          assume y in rng d;
          then consider x be object such that
A14:      x in dom d & d.x=y by FUNCT_1:def 3;
          reconsider x as Dyadic by A14,A11;
          per cases;
          suppose
A15:        x in DYADIC(n);
            then C.x in rng C by A13,FUNCT_1:def 3;
            then
A16:        C.x in Games (NAT(+)n);
A17:        d.x = C.x by A11,A12,A14,A15;
            n < n+1 by NAT_1:13;
            then Segm n c= Segm (n+1) by NAT_1:39;
            then Games (NAT(+)n) c= Games (NAT(+)n1)
            by SURREAL0:1,ORDINAL7:95;
            hence thesis by A17,A14, A16;
          end;
          suppose
A18:        not x in DYADIC(n);
            then x in DYADIC(n+1)\DYADIC(n) by A14,A11,XBOOLE_0:def 5;
            then consider j be Integer such that
A19:        x = (2*j+1) / 2|^n1 by Th20;
            set O=[{C.(j/(2|^n))},{C.((j+1)/(2|^n))}];
A20:        d.x = O by A19,A18,A14,A11,A12;
            j/(2|^n) in DYADIC(n) & (j+1)/(2|^n) in DYADIC(n) by Def4;
            then C.(j/(2|^n)) in rng C & C.((j+1)/(2|^n)) in rng C
            by A13,FUNCT_1:def 3;
            then
A21:        C.(j/(2|^n)) in Games (NAT(+)n) & C.((j+1)/(2|^n))
            in Games (NAT(+)n);
            for a be object st a in L_O \/ R_O
            ex A st A in (NAT(+)n1) & a in Games A
            proof
              let a be object;
              assume a in L_O \/ R_O;
              then
A22:          a in L_O or a in R_O by XBOOLE_0:def 3;
              take A=NAT(+)n;
              n < n1 by NAT_1:13;
              then n in Segm n1 by NAT_1:44;
              hence thesis by A22,A21,TARSKI:def 1,ORDINAL7:94;
            end;
            hence thesis by A20,A14,SURREAL0:4;
          end;
        end;
        hence d is Function of DYADIC(n1),Games (NAT(+)n1)
        by A11,FUNCT_2:2;
        let f be Function of DYADIC(n),Games (NAT(+)n) such that
A23:    f=c;
        let g be Function of DYADIC(n1),Games (NAT(+)n1) such that
A24:    g=d;
        DYADIC(n) c= DYADIC(n1) by Th19,NAT_1:11;
        hence for z be Dyadic st z in DYADIC(n) holds g.z = f.z by A12,A23,A24;
        let i;
        set I = (2*i+1) /(2|^(n+1));
        I in DYADIC(n1)\DYADIC(n) by Th20;
        then I in DYADIC(n1) & not I in DYADIC(n) by XBOOLE_0:def 5;
        hence thesis by A12,A23,A24;
      end;
      consider H be Function such that
A25:  dom H = Funcs(DYADIC(n),Games (NAT(+)n)) and
A26:  for e being object st e in Funcs(DYADIC(n),Games (NAT(+)n))
         holds T[e,H.e] from CLASSES1:sch 1(A3);
      take H;
      let k be Nat such that
A27:  e = k;
      rng H c= Funcs(DYADIC(n1),Games (NAT(+)n1))
      proof
        let y be object;
        assume y in rng H;
        then consider x be object such that
A28:    x in dom H & H.x=y by FUNCT_1:def 3;
        reconsider hx=H.x as Function of DYADIC(n1),Games (NAT(+)n1)
        by A28,A25,A26;
        hx in Funcs(DYADIC(n1),Games (NAT(+)n1)) by FUNCT_2:8;
        hence thesis by A28;
      end;
      then reconsider h=H as Function of Funcs(DYADIC(n),Games (NAT(+)n)),
      Funcs(DYADIC(n+1),Games (NAT(+)(n1)))
      by A25,FUNCT_2:2;
      h=H;
      hence H is Function of Funcs(DYADIC(k),Games (NAT(+)k)),
      Funcs(DYADIC(k+1),Games (NAT(+)(k+1))) by A27;
      let G be Function of Funcs(DYADIC(k),Games (NAT(+)k)),
      Funcs(DYADIC(k+1),Games (NAT(+)(k+1))) such that
A29:  G = H;
      let f be Function of DYADIC(k),Games (NAT(+)k);
      f in dom H by A27,A25,FUNCT_2:8;
      then T[f,H.f] by A25,A26;
      hence thesis by A27,A29;
    end;
    consider P be Function such that
A30:  dom P = NAT and
A31:  for e being object st e in NAT holds P[e,P.e] from CLASSES1:sch 1(A1);
    P is Function-yielding
    proof
      let o;
      thus thesis by A30,A31;
    end;
    then reconsider P as Function-yielding Function;
A32: dom uInt = INT by PARTFUN1:def 2;
A33: rng uInt c= Games NAT & NAT = NAT (+) 0
    by Th22,XBOOLE_1:1,ORDINAL7:69;
    deffunc F1(object,object) = (P.$1).$2;
    consider f1 be Function such that
A34: dom f1 = NAT & f1.0 = uInt and
A35: for n being Nat holds f1.(n+1) = F1(n,f1.n) from NAT_1:sch 11;
    defpred D[Nat] means
    f1.$1 is Function of DYADIC($1),Games (NAT(+)$1);
A36: D[0] by A33,A32,FUNCT_2:2,Th21,A34;
A37: for k be Nat st D[k] holds D[k+1]
    proof
      let k be Nat such that
A38:  D[k];
      reconsider f1k=f1.k as Function of DYADIC(k),Games (NAT(+)k) by A38;
      set k1=k+1;
      k in NAT by ORDINAL1:def 12;
      then reconsider Pk=P.k as Function of
      Funcs(DYADIC(k),Games (NAT(+)k)),
      Funcs(DYADIC(k1),Games (NAT(+)k1)) by A31;
      dom Pk = Funcs(DYADIC(k),Games (NAT(+)k)) by FUNCT_2:def 1;
      then
A39:  f1k in dom Pk by FUNCT_2:8;
      f1.k1 = Pk.f1k by A35;
      then f1.k1 in rng Pk c= Funcs(DYADIC(k1),Games (NAT(+)k1))
      by A39,FUNCT_1:def 3;
      hence thesis by FUNCT_2:66;
    end;
A40:for k be Nat holds D[k] from NAT_1:sch 2(A36,A37);
    f1 is Function-yielding
    proof
      let o;
      assume o in dom f1;
      then reconsider n=o as Nat by A34;
      D[n] by A40;
      hence thesis;
    end;
    then reconsider f1 as Function-yielding Function;
    defpred K[object,object] means
    for n be Nat st $1 in DYADIC(n) holds $2 = (f1.n).$1;
A41:for d be Dyadic,n be Nat st d in DYADIC(n)
    for m be Nat holds
    (f1.n).d = f1.(n+m).d
    proof
      let d be Dyadic,n be Nat such that
A42:  d in DYADIC(n);
      defpred P[Nat] means (f1.n).d = f1.(n+$1).d;
A43:  P[0];
A44:  for m be Nat st P[m] holds P[m+1]
      proof
        let m be Nat such that
A45:    P[m];
        set nm=n+m;
A46:    nm in NAT by ORDINAL1:def 12;
        then reconsider Pnm=P.nm as Function of
        Funcs(DYADIC(nm),Games (NAT(+)nm)),
        Funcs(DYADIC(nm+1),Games (NAT(+)(nm+1))) by A31;
        reconsider f1nm=f1.nm as Function of DYADIC(nm),Games (NAT(+)nm)
        by A40;
        DYADIC(n) c= DYADIC(nm) by NAT_1:11,Th19;
        then Pnm.f1nm.d = f1nm.d by A46,A31,A42;
        hence thesis by A45,A35;
      end;
      for m be Nat holds P[m] from NAT_1:sch 2(A43,A44);
      hence thesis;
    end;
A47:for e being object st e in DYADIC ex u being object st K[e,u]
    proof
      let e be object such that
A48:  e in DYADIC;
      reconsider d=e as Dyadic by A48;
      per cases by Th23;
      suppose
A49:    d is Integer;
        take sd = uInt.d;
        let m be Nat such that e in DYADIC(m);
        f1.0.d = f1.(0+m).d by A49,A41,INT_1:def 2,Th21;
        hence thesis by A34;
      end;
      suppose ex p,i st d = (2*i+1) / 2|^(p+1);
        then consider p,i such that
A50:    d = (2*i+1) / 2|^(p+1);
A51:    d in DYADIC(p+1)\DYADIC(p) by A50,Th20;
        then
A52:    d in DYADIC(p+1) & not d in DYADIC(p) by XBOOLE_0:def 5;
        take sd = f1.(p+1).d;
        let m be Nat such that
A53:    e in DYADIC(m);
        p+1 <= m
        proof
          assume m < p+1;
          then m <= p by NAT_1:13;
          then DYADIC(m) c= DYADIC(p) by Th19;
          hence thesis by A53,A51,XBOOLE_0:def 5;
        end;
        then reconsider r = m - (p+1) as Nat by NAT_1:21;
        (p+1) +r =m;
        hence thesis by A41,A52;
      end;
    end;
    consider K be Function such that
A54:dom K = DYADIC and
A55:for e being object st e in DYADIC holds K[e,K.e] from CLASSES1:sch 1(A47);
    reconsider K as ManySortedSet of DYADIC
    by PARTFUN1:def 2,A54,RELAT_1:def 18;
    take K;
    let i,j,p;
    set p1=p+1;
    i in INT = DYADIC(0) by INT_1:def 2,Th21;
    hence K.i = uInt.i by A34,A55;
    set D=(2*j+1)/(2|^(p+1));
    D in DYADIC(p+1)\DYADIC(p) by Th20;
    then D in DYADIC(p+1) & not D in DYADIC(p) by XBOOLE_0:def 5;
    then
A56: K.D = f1.(p+1).D by A55;
A57: p in NAT by ORDINAL1:def 12;
    then reconsider Pp=P.p as Function of
    Funcs(DYADIC(p),Games (NAT(+)p)),
    Funcs(DYADIC(p1),Games (NAT(+)p1)) by A31;
    reconsider f1p=f1.p as Function of DYADIC(p),Games (NAT(+)p) by A40;
A58:Pp.f1p.((2*j+1) /(2|^(p+1)))
    = [{f1p.(j/(2|^p))},{f1p.((j+1)/(2|^p))}] by A57,A31;
    j/(2|^p) in DYADIC(p) & (j+1)/(2|^p) in DYADIC(p) by Def4;
    then K.(j/(2|^p)) = f1p.(j/(2|^p)) & K.((j+1)/(2|^p))
    = f1p.((j+1)/(2|^p)) by A55;
    hence K.D = [{K.(j/(2|^p))},{K.((j+1)/(2|^p))}] by A56,A58,A35;
  end;
  uniqueness
  proof
    let M1,M2 be ManySortedSet of DYADIC such that
A59:  M1.i = uInt.i &
    M1.((2*j+1)/(2|^(p+1))) = [{M1.(j/(2|^p))},{M1.((j+1)/(2|^p))}] and
A60: M2.i = uInt.i &
    M2.((2*j+1)/(2|^(p+1))) = [{M2.(j/(2|^p))},{M2.((j+1)/(2|^p))}];
    defpred P[Nat] means
    for d st d in DYADIC($1) holds M1.d = M2.d;
A61:P[0]
    proof
      let d;
      assume d in DYADIC(0);
      then M1.d = uInt.d = M2.d by Th21,A59,A60;
      hence thesis;
    end;
A62:P[n] implies P[n+1]
    proof
      assume
A63:  P[n];
      let d such that
A64:  d in DYADIC(n+1);
      per cases;
      suppose d in DYADIC(n);
        hence thesis by A63;
      end;
      suppose not d in DYADIC(n);
        then d in DYADIC(n+1)\DYADIC(n) by A64,XBOOLE_0:def 5;
        then consider i be Integer such that
A65:    d = (2*i+1) / 2|^(n+1) by Th20;
        i/(2|^n) in DYADIC(n) & (i+1)/(2|^n) in DYADIC(n) by Def4;
        then M1.(i/(2|^n)) = M2.(i/(2|^n)) &
        M1.((i+1)/(2|^n)) = M2.((i+1)/(2|^n)) by A63;
        then M1.d = [{M2.(i/(2|^n))},{M2.((i+1)/(2|^n))}] by A65,A59;
        hence thesis by A65,A60;
      end;
    end;
A66:P[n] from NAT_1:sch 2(A61,A62);
A67:dom M1 = DYADIC = dom M2 by PARTFUN1:def 2;
    o in DYADIC implies M1.o = M2.o
    proof
      assume o in DYADIC;
      then consider i be Integer, n be Nat such that
A68:  o = i / (2|^n) by Th18;
      o in DYADIC(n) by A68,Def4;
      hence thesis by A66;
    end;
    hence thesis by A67,FUNCT_1:2;
  end;
end;

Lm5:
(for d holds uDyadic.d is Surreal) &
       for i,j be Integer, si,sj be Surreal st
           si = uDyadic.(i/(2|^p)) & sj = uDyadic.(j/(2|^p)) holds
    i < j iff si < sj
proof
  defpred P[Nat] means
    (for d st d in DYADIC($1) holds uDyadic.d is Surreal) &
    for i,j be Integer, si,sj be Surreal st
      si = uDyadic.(i/(2|^$1)) & sj = uDyadic.(j/(2|^$1)) holds
      i < j iff si < sj;
A1: P[0]
  proof
A2: 2|^0 =1 by NEWTON:4;
    thus for d st d in DYADIC(0) holds uDyadic.d is Surreal
    proof
      let d;
      assume d in DYADIC(0);
      then reconsider i=d as Integer by Th21;
      uDyadic.d = uInt.i by Def5;
      hence thesis;
    end;
    let i,j be Integer, si,sj be Surreal such that
A3: si = uDyadic.(i/(2|^0)) & sj = uDyadic.(j/(2|^0));
    si = uInt.i & sj = uInt.j by A2,A3,Def5;
    hence thesis by Th9;
  end;
A4: P[n] implies P[n+1]
  proof
    assume
A5: P[n];
    set n1=n+1;
    thus for d st d in DYADIC(n1) holds uDyadic.d is Surreal
    proof
      let d such that
A6:   d in DYADIC(n1);
      per cases;
      suppose d in DYADIC(n);
        hence thesis by A5;
      end;
      suppose not d in DYADIC(n);
        then d in DYADIC(n1)\ DYADIC(n) by A6,XBOOLE_0:def 5;
        then consider i be Integer such that
A7:     d = (2*i+1) / 2|^(n+1) by Th20;
        i/(2|^n) in DYADIC(n) & (i+1)/(2|^n) in DYADIC(n) by Def4;
        then reconsider si = uDyadic.(i/(2|^n)),si1 = uDyadic.((i+1)/(2|^n))
        as Surreal by A5;
        i+0 < i+1 by XREAL_1:6;
        then
A8:     si < si1 by A5;
        uDyadic.d = [{si},{si1}] by Def5,A7;
        hence thesis by A8,SURREALO:22;
      end;
    end;
    let i,j be Integer, si,sj be Surreal such that
A9: si = uDyadic.(i/(2|^n1)) & sj = uDyadic.(j/(2|^n1));
A10:2|^n1 = 2*2|^n by NEWTON:6;
    per cases;
    suppose i is even;
      then consider i1 be Integer such that
A11:  i= 2*i1 by ABIAN:11;
A12:  i/(2|^n1) = i1/ 2|^n by A11,A10,XCMPLX_1:91;
      per cases;
      suppose j is even;
        then consider j1 be Integer such that
A13:    j= 2*j1 by ABIAN:11;
A14:    j/(2|^n1) = j1/ 2|^n by A13,A10,XCMPLX_1:91;
        i1 < j1 iff si < sj by A12,A14,A9,A5;
        hence thesis by A11,A13,XREAL_1:64,XREAL_1:68;
      end;
      suppose j is odd;
        then consider j1 be Integer such that
A15:    j = 2*j1+1 by ABIAN:1;
        j1/(2|^n) in DYADIC(n) & (j1+1)/(2|^n) in DYADIC(n) by Def4;
        then reconsider Dn = uDyadic.(j1/(2|^n)),D1n = uDyadic.((j1+1)/(2|^n))
        as Surreal by A5;
A16:    sj = [{ Dn},{ D1n}] by A15,A9,Def5;
A17:    L_sj << {sj} << R_sj by SURREALO:11;
        thus i < j implies si < sj
        proof
          assume i < j;
          then i1 <= j1 by XREAL_1:68,A11,A15,INT_1:7;
          then not Dn < si by A5,A12,A9;
          hence thesis by A16,SURREALO:4,21,A17;
        end;
        assume
A18:    si < sj & j <=i;
        then 2*j1+1 < 2*i1 by A11,A15,XXREAL_0:1;
        then 2*(j1+1)=2*j1+1+1 <=2*i1 by INT_1:7;
        then not i1 < j1+1 by XREAL_1:68;
        then D1n <= si by A5,A12,A9;
        then D1n <= sj by A18,SURREALO:4;
        hence thesis by A16,SURREALO:21,A17;
      end;
    end;
    suppose i is odd;
      then consider i1 be Integer such that
A19:  i = 2*i1+1 by ABIAN:1;
      i1/(2|^n) in DYADIC(n) & (i1+1)/(2|^n) in DYADIC(n) by Def4;
      then reconsider Sn = uDyadic.(i1/(2|^n)),S1n = uDyadic.((i1+1)/(2|^n))
      as Surreal by A5;
A20:  si = [{ Sn},{ S1n}] by A19,A9,Def5;
A21:  L_si << {si} << R_si by SURREALO:11;
      per cases;
      suppose j is even;
        then consider j1 be Integer such that
A22:    j= 2*j1 by ABIAN:11;
A23:    j/(2|^n1) = j1/ 2|^n by A22,A10,XCMPLX_1:91;
        thus i < j implies si < sj
        proof
          assume i < j;
          then 2*(i1+1) = 2*i1+1+1 <= 2*j1 by A19,A22,INT_1:7;
          then not j1 < i1+1 by XREAL_1:68;
          then not sj < S1n by A5,A9,A23;
          hence thesis by A21,A20,SURREALO:4,21;
        end;
        assume
A24:    si < sj & j <=i;
        then 2*j1 < 2*i1+1 by A19,A22,XXREAL_0:1;
        then j1 <= i1 by XREAL_1:68,INT_1:7;
        then sj <= Sn by A5,A9,A23;
        then sj <= si by A21,A20,SURREALO:21,SURREALO:4;
        hence thesis by A24;
      end;
      suppose j is odd;
        then consider j1 be Integer such that
A25:    j = 2*j1+1 by ABIAN:1;
        j1/(2|^n) in DYADIC(n) & (j1+1)/(2|^n) in DYADIC(n) by Def4;
        then reconsider Dn = uDyadic.(j1/(2|^n)),D1n = uDyadic.((j1+1)/(2|^n))
        as Surreal by A5;
A26:    sj = [{ Dn},{ D1n}] by A25,A9,Def5;
A27:    L_sj << {sj} << R_sj by SURREALO:11;
        thus i < j implies si < sj
        proof
          assume i < j;
          then 2*(i1+1) = 2*i1+1+1 <= 2*j1+1 by A19,A25,INT_1:7;
          then 2*(i1+1) < 2*j1+1 by XXREAL_0:1;
          then i1+1 <= j1 by XREAL_1:68,INT_1:7;
          then S1n <= Dn by A5;
          then S1n <= sj by A26,SURREALO:4,21,A27;
          hence thesis by A21,A20,SURREALO:4,21;
        end;
        assume
A28:    si < sj & j <=i;
        then 2*j1 <= 2*i1 by A19,A25,XREAL_1:6;
        then
A29:    j1 <= i1 by XREAL_1:68;
        j <> i by A9,A28,SURREALO:3;
        then j1 < i1 by A25,A19,A29,XXREAL_0:1;
        then j1+1 <= i1 by INT_1:7;
        then D1n <= Sn by A5;
        then D1n <= si by A21,A20,SURREALO:4,21;
        then sj <= si by A27,A26,SURREALO:21,SURREALO:4;
        hence thesis by A28;
      end;
    end;
  end;
A30:P[n] from NAT_1:sch 2(A1,A4);
  thus for d holds uDyadic.d is Surreal
  proof
    let d;
    consider i be Integer, n be Nat such that
A31:d = i / (2|^n) by Th18;
    d in DYADIC(n) by A31,Def4;
    hence thesis by A30;
  end;
  thus thesis by A30;
end;

registration
  let d;
  cluster uDyadic.d -> surreal;
  coherence by Lm5;
end;

theorem Th24:
  d1 < d2 iff uDyadic.d1 < uDyadic.d2
proof
  consider i1 be Integer, n1 be Nat such that
A1:d1 = i1 / (2|^n1) by Th18;
  consider i2 be Integer, n2 be Nat such that
A2:d2 = i2 / (2|^n2) by Th18;
  (2|^n1)*(2|^n2) = 2|^(n1+n2) by NEWTON:8;
  then
A3: d1 = (i1*(2|^n2)) / 2|^(n1+n2) &
  d2 = (i2*(2|^n1)) / 2|^(n1+n2) by A1,A2,XCMPLX_1:91;
  thus d1 < d2 implies uDyadic.d1 < uDyadic.d2
  proof
    assume d1 < d2;
    then i1*(2|^n2) < i2*(2|^n1) by A3,XREAL_1:72;
    hence thesis by A3,Lm5;
  end;
  assume uDyadic.d1 < uDyadic.d2;
  then i1*(2|^n2) < i2*(2|^n1) by A3,Lm5;
  hence thesis by A3,XREAL_1:74;
end;

theorem Th25:
  (0_No <= z & z in Day n & not z == uDyadic.n implies
     ex x,y,p be Nat st
        z == uDyadic.(x + y / (2|^p)) & y < 2|^p & x+p < n) &
  for x,y,p be Nat st y < 2|^p & x+p < n holds
      0_No <= uDyadic.(x + y / (2|^p)) in Day n
proof
  defpred P[Nat] means
   (for s be Surreal st s in Day $1 & 0_No <= s holds
          s == uDyadic.$1 or ex d be Dyadic,x,y,p be Nat st
                  s == uDyadic.d & y < 2|^p &
                  d = x + y / (2|^p) & x+p < $1) &
     (for x,y,p be Nat st y < 2|^p &
                   x+p < $1 holds 0_No <= uDyadic.(x + y / (2|^p)) in Day $1);
A1:P[0]
  proof
A2: 0_No = uInt.0 = uDyadic.0 by Def1,Def5;
    thus for s be Surreal st s in Day 0 & 0_No <= s holds s == uDyadic.0 or
    ex d be Dyadic,x,y,p be Nat st s == uDyadic.d & y < 2|^p &
    d = x + y / (2|^p) & x+p < 0 by A2,SURREAL0:2,TARSKI:def 1;
    let x,y,p be Nat such that
A3: y < 2|^p & x+p < 0;
    thus 0_No <= uDyadic.(x + y / (2|^p)) in Day 0 by A3;
  end;
A4:for n holds P[n] implies P[n+1]
  proof
    let n;
    assume
A5: P[n];
    set n1=n+1;
A6: 0_No = uInt.0 = uDyadic.0 by Def1,Def5;
    n < n+1 by NAT_1:13;
    then
A7: Segm n c= Segm (n+1) & n in Segm (n+1) by NAT_1:39,44;
    then
A8: Day n c= Day (n+1) by SURREAL0:35;
    thus for s be Surreal st s in Day n1 & 0_No <= s holds
    s == uDyadic.n1 or ex d be Dyadic,x,y,p be Nat st
    s == uDyadic.d & y < 2|^p &
    d = x + y / (2|^p) & x+p < n1
    proof
      let s be Surreal such that
A9:   s in Day n1 & 0_No <= s;
      set c = Unique_No s;
A10:  c == s by SURREALO:def 10;
      then
A11:  0_No <= c by A9,SURREALO:4;
      per cases;
      suppose c in Day n;
        then per cases by A10,A9,SURREALO:4,A5;
        suppose
A12:      c == uDyadic.n;
          ex d be Dyadic,x,y,p be Nat st
          s == uDyadic.d & y < 2|^p & d = x + y / (2|^p) & x+p < n1
          proof
            take d = n, x= n,y=0,p=0;
            thus thesis by A12,A10,SURREALO:4,NAT_1:13;
          end;
          hence thesis;
        end;
        suppose ex d be Dyadic,x,y,p be Nat st
          c == uDyadic.d & y < 2|^p &
          d = x + y / (2|^p) & x+p < n;
          then consider d be Dyadic,x,y,p be Nat such that
A13:      c == uDyadic.d & y < 2|^p & d = x + y / (2|^p) & x+p < n;
          x+p < n1 & s == uDyadic.d by SURREALO:4,A10,A13,NAT_1:13;
          hence thesis by A13;
        end;
      end;
      suppose
A14:    not c in Day n;
A15:    born_eq c = born c by SURREALO:48;
A16:    born_eq c = born_eq s c= born s c= n1
          by A9,SURREAL0:def 18,SURREALO:def 5,33,SURREALO:def 10;
        then
A17:    born_eq c c= n1 by XBOOLE_1:1;
A18:    c in Day born c by SURREAL0:def 18;
A19:    n1 c= born_eq c
        proof
          assume not n1 c= born_eq c;
          then born_eq c in Segm n1 = succ (Segm n) by ORDINAL1:16,NAT_1:38;
          then Day born c c= Day n by SURREAL0:35,A15,ORDINAL1:22;
          hence thesis by A14,A18;
        end;
        then
A20:    n1 = born c by A15,A17,XBOOLE_0:def 10;
        assume
A21:    not s == uDyadic.n1;
        per cases;
        suppose
A22:      c = 0_No;
          take d=0,x=0,y=0,p=0;
          thus thesis by A22,SURREALO:def 10,A6;
        end;
        suppose
A23:      c <> 0_No;
          R_c <>{}
          proof
            assume
A24:        R_ c ={};
            then L_ c <>{} by A23;
            then card (L_c) = 1 by SURREALO:8,44,A15,A16;
            then consider y be object such that
A25:        L_c = {y} by CARD_2:42;
            y in L_c by A25,TARSKI:def 1;
            then reconsider y as Surreal by SURREAL0:def 16;
A26:        not c == 0_No by A23,SURREALO:50;
            c = [{y},{}] by A24,A25;
            then consider k be Nat such that
A27:        c == uInt.(k+1) & uInt.k <= y < uInt.(k+1) & k in born c
            by A26,Th16,A15,A16,Th17;
            c = uInt.(k+1) by A27,SURREALO:50;
            then c = uInt.n1 = uDyadic.n1 by A20,Th4,Def5;
            hence contradiction by SURREALO:def 10,A21;
          end;
          then card (R_c) = 1 by A15,A16,SURREALO:8,45;
          then consider c2 be object such that
A28:      R_c = {c2} by CARD_2:42;
          c2 in R_c by A28,TARSKI:def 1;
          then reconsider c2 as Surreal by SURREAL0:def 16;
          L_ c <>{}
          proof
            assume
A29:        L_c ={};
            -c = [--R_c, --L_c] by SURREALR:7;
            then
A30:        -c = [{-c2},{}] by A29,A28,SURREALR:21,22;
            not c == 0_No by A23,SURREALO:50;
            then not -c == 0_No by SURREALR:23,10;
            then c2 <= 0_No by A30,Th16,SURREALR:23,10;
            then not (L_0_No << {c} & {0_No} << R_c) by A28,SURREALO:21;
            hence thesis by A11,SURREAL0:43;
          end;
          then card (L_c) = 1 by A15,A16,SURREALO:8,44;
          then consider c1 be object such that
A31:      L_c = {c1} by CARD_2:42;
          c1 in L_c by A31,TARSKI:def 1;
          then reconsider c1 as Surreal by SURREAL0:def 16;
A32:      c = [{c1},{c2}] by A28,A31;
          not c == 0_No by A23,SURREALO:50;
          then
A33:      not (L_c << {0_No} & {c} << R_0_No)
          by A10,A9,SURREAL0:43,SURREALO:4;
          then 0_No <= c1 by A31,SURREALO:21;
          then
A34:      0_No <= c2 by A32,SURREALO:4,22;
          c1 in L_c & c2 in R_c by A28,A31,TARSKI:def 1;
          then c1 in L_c \/ R_c & c2 in L_c \/ R_c by XBOOLE_0:def 3;
          then
A35:      born c1 in n1 & born c2 in n1 & n1= Segm n1
          by A20,SURREALO:1;
          then reconsider b1=born c1, b2=born c2 as Nat;
          b1 < n1 & b2 < n1 by A35,NAT_1:44;
          then b1 <= n & b2 <= n & n = Segm n by NAT_1:13;
          then Segm b1 c= n & Segm b2 c= n by NAT_1:39;
          then
A36:      c1 in Day b1 c= Day n & c2 in Day b2 c= Day n
          by SURREAL0:35,SURREAL0:def 18;
A37:      uDyadic.n = uInt.n by Def5;
          not c1 == uDyadic.n
          proof
            assume c1 == uDyadic.n;
            then uInt.n < c2 by A37,A32,SURREALO:4,22;
            hence thesis by Th2,A36;
          end;
          then consider d1 be Dyadic,x1,y1,p1 be Nat such that
A38:      c1 == uDyadic.d1 & y1 < 2|^p1 &
          d1 = x1 + y1 / (2|^p1) & x1+p1 < n by A36,A33,A31,SURREALO:21,A5;
          y1 / (2|^p1) < 1 by A38,XREAL_1:189;
          then
A39:      d1 < x1+1 by A38,XREAL_1:6;
A40:      born c = born_eq c by SURREALO:48;
          per cases by A5,A34,A36;
          suppose
A41:        c2 == uDyadic.n;
A42:        x1+1 = n
            proof
              assume
A43:          x1+1 <>n;
              x1 <= x1+p1 by NAT_1:11;
              then x1 < n by A38,XXREAL_0:2;
              then x1+1 <= n by NAT_1:13;
              then x1+1 < n by A43,XXREAL_0:1;
              then
A44:          2 <= x1+2=x1+1+1 <= n by NAT_1:11,13;
              then reconsider N2=n-2 as Nat by NAT_1:21,XXREAL_0:2;
              x1+2 <= N2+2 by A44;
              then x1 <= N2 by XREAL_1:6;
              then x1+1 <= N2+1 by XREAL_1:6;
              then d1 < N2+1 by A39,XXREAL_0:2;
              then c1 < uDyadic.(N2+1) by A38,SURREALO:4,Th24;
              then
A45:          {c1} << {uDyadic.(N2+1)} by SURREALO:21;
              N2+1 < N2+1+1 by NAT_1:13;
              then uDyadic.(N2+1) < c2 by A41,SURREALO:4,Th24;
              then {uDyadic.(N2+1)} << {c2} by SURREALO:21;
              then
A46:          born c c= born uDyadic.(N2+1)
              by A45, A28,A31,A40,SURREALO:51;
              uDyadic.(N2+1) = uInt.(N2+1) by Def5;
              then Segm n1 c= Segm (N2+1) by A46,A20,Th4;
              then n1 <= N2+1 by NAT_1:39;
              then n1 <= N2+1+1 by NAT_1:13;
              hence thesis by NAT_1:13;
            end;
            x1+p1+1 <= n by A38,NAT_1:13;
            then n+p1 <= n+0 by A42;
            then
A47:        p1=0 & 2|^0=1 by XREAL_1:6,NEWTON:4;
            then c1 == uDyadic.x1 by A38,NAT_1:14;
            then
A48:        {c1} <==> {uDyadic.x1} by SURREALO:32;
A49:        {c2} <==> {uDyadic.(x1+1)} by A41,A42,SURREALO:32;
            uDyadic.x1 = uDyadic.(x1/(2|^0)) &
            uDyadic.(x1+1) = uDyadic.((x1+1)/(2|^0)) by A47;
            then uDyadic.((2*x1+1)/(2|^(0+1)))=[{uDyadic.x1},{uDyadic.(x1+1)}]
            by Def5;
            then
            c == uDyadic.((2*x1+1)/(2|^(0+1))) by SURREALO:29,A48,A49,A32;
            then
A50:        s == uDyadic.((2*x1+1)/(2|^1)) by SURREALO:4,A10;
A51:        (2*x1+1)/(2|^1) = x1+ 1/(2|^1);
            x1 + 1 <n1 by A42,NAT_1:13;
            hence thesis by A50,A51;
          end;
          suppose ex d be Dyadic,x,y,p be Nat st
            c2 == uDyadic.d & y < 2|^p &
            d = x + y / (2|^p) & x+p < n;
            then consider d2 be Dyadic,x2,y2,p2 be Nat such that
A52:        c2 == uDyadic.d2 & y2 < 2|^p2 &
            d2 = x2 + y2 / (2|^p2) & x2+p2 < n;
            c1 < uDyadic.d2 by A32,SURREALO:4,22,A52;
            then
A53:        uDyadic.d1 < uDyadic.d2 by A38,SURREALO:4;
            y2 / (2|^p2) < 1 by A52,XREAL_1:189;
            then
A54:        d2 < x2+1 by A52,XREAL_1:6;
A55:        x1+0 <= d1 by A38,XREAL_1:6;
            per cases;
            suppose
A56:          x1 <> x2;
              x1 < x2
              proof
                assume x2 <= x1;
                then x2 < x1 by A56,XXREAL_0:1;
                then x2 +1 <= x1 by NAT_1:13;
                then d2 < x1 by A54,XXREAL_0:2;
                hence thesis by A53,Th24,A55,XXREAL_0:2;
              end;
              then
A57:          x1 +1 <= x2 by NAT_1:13;
              x2+0 <= d2 by A52,XREAL_1:6;
              then
A58:          x1+1 <= d2 by A57,XXREAL_0:2;
A59:          d2 = x1+1
              proof
                assume d2 <> x1+1;
                then x1+1 < d2 by A58,XXREAL_0:1;
                then c1 < uDyadic.(x1+1) < c2 by A38,SURREALO:4,A52,A39,Th24;
                then {c1} << {uDyadic.(x1+1)} << {c2} by SURREALO:21;
                then born c c= born uDyadic.(x1+1) = born uInt.(x1+1)=x1+1
                by A40,SURREALO:51,A28,A31,Def5,Th4;
                then Segm n1 c= Segm (x1+1) by A19,A15,XBOOLE_1:1;
                then n1 <= x1+1 by NAT_1:39;
                then n1 <= x2 <= x2+p2 by NAT_1:11,A57,XXREAL_0:2;
                then n1 <= x2+p2 by XXREAL_0:2;
                hence thesis by NAT_1:13,A52;
              end;
              y1+1 = 2|^p1
              proof
A60:            y1+1 <= 2|^p1 by A38,NAT_1:13;
                assume y1+1 <> 2|^p1;
                then
A61:            y1 < y1+1 < 2|^p1 by NAT_1:13,A60,XXREAL_0:1;
                then y1/(2|^p1) < (y1+1)/(2|^p1) < (2|^p1)/(2|^p1) =1
                by XREAL_1:74,XCMPLX_1:60;
                then d1 < x1+(y1+1)/(2|^p1) < x1+1 by A38,XREAL_1:6;
                then d1 < x1+(y1+1)/(2|^p1) < d2 by A58,XXREAL_0:2;
                then c1 < uDyadic.(x1+(y1+1)/(2|^p1)) < c2
                by Th24,A52,A38,SURREALO:4;
                then {c1} << {uDyadic.(x1+(y1+1)/(2|^p1))} << {c2}
                by SURREALO:21;
                then
A62:            n1 c= born uDyadic.(x1+(y1+1)/(2|^p1))
                by A40,SURREALO:51,A20,A28,A31;
                uDyadic.(x1+(y1+1)/(2|^p1)) in Day n by A38,A5,A61;
                then born uDyadic.(x1+(y1+1)/(2|^p1)) c= n by SURREAL0:def 18;
                then Segm n1 c= Segm n by XBOOLE_1:1,A62;
                then n1 <=n by NAT_1:39;
                hence thesis by NAT_1:13;
              end;
              then
A63:          ((x1* (2|^p1) + y1+1) / (2|^p1)) = ((x1+1)* (2|^p1)) / (2|^p1)
              .= (x1+1)* ((2|^p1)/(2|^p1)) by XCMPLX_1:74
              .= d2 by A59,XCMPLX_1:88;
A64:          d1 = (x1* (2|^p1) + y1) / (2|^p1) by A38,XCMPLX_1:113;
A65:          {c1} <==> {uDyadic.d1} & {c2} <==> {uDyadic.d2}
              by A52,A38,SURREALO:32;
              uDyadic.(((x1* (2|^p1) + y1)*2+1)/(2|^(p1+1))) =
              [{uDyadic.(d1)},{uDyadic.d2}] by Def5,A64,A63;
              then c == uDyadic.(((x1* (2|^p1) + y1)*2+1)/(2|^(p1+1)))
              by A65,SURREALO:29,A32;
              then
A66:          s == uDyadic.(((x1* (2|^p1) + y1)*2+1)/(2|^(p1+1)))
              by A10,SURREALO:4;
A67:          2|^(p1+1) = 2 * (2|^p1) by NEWTON:6;
              then
A68:          ((x1* (2|^p1) + y1)*2+1)/(2|^(p1+1))
              = ((x1* (2|^(p1+1))) + (y1*2+1))/(2|^(p1+1))
              .= x1 + (y1*2+1)/(2|^(p1+1)) by XCMPLX_1:113;
              y1+1 <= 2|^p1 by A38,NAT_1:13;
              then 2*y1+1+1=2*(y1+1) <= 2*2|^p1 by XREAL_1:64;
              then
A69:          2*y1+1 < 2|^(p1+1) by A67,NAT_1:13;
              x1+p1+1 < n1 by A38,XREAL_1:6;
              then x1+(p1+1) < n1;
              hence thesis by A66,A68,A69;
            end;
            suppose
A70:          x1=x2;
              then
A71:          y1 / (2|^p1) < y2 / (2|^p2) by A38,A52,A53,Th24,XREAL_1:6;
              ex Y1,Y2,p3 be Nat st Y1 < Y2 & Y1 < 2|^p3 & Y2 < 2|^p3 &
              d1 = x1 + Y1 / (2|^p3) & d2 = x2 + Y2 / (2|^p3) & x2+p3 < n
              proof
                per cases;
                suppose p2 < p1;
                  then reconsider p = p1-p2 as Nat by NAT_1:21;
                  take y1,y3=y2*(2|^p),p3=p1;
A72:              2|^(p2+p) = (2|^p2) * (2|^p) by NEWTON:8;
                  y2/(2|^p2) = y3/(2|^p3) by A72,XCMPLX_1:91;
                  hence thesis
                  by A70,A71,XREAL_1:72,A72,A52,XREAL_1:68,A38;
                end;
                suppose p1 <= p2;
                  then reconsider p = p2-p1 as Nat by NAT_1:21;
                  take y3=y1*(2|^p),y2,p3=p2;
A73:              2|^(p1+p) = (2|^p1) * (2|^p) by NEWTON:8;
                  y1/(2|^p1) = y3/(2|^p3) by A73,XCMPLX_1:91;
                  hence thesis by A73,A38,XREAL_1:68,A71,XREAL_1:72,A52;
                end;
              end;
              then consider Y1,Y2,p3 be Nat such that
A74:          Y1 < Y2 & Y1 < 2|^p3 & Y2 < 2|^p3 &
              d1 = x1 + Y1 / (2|^p3) & d2 = x2 + Y2 / (2|^p3) & x2+p3 < n;
              Y2-Y1 >0 by A74,XREAL_1:50;
              then reconsider y = Y2-Y1 as Nat;
A75:          y >= 1+0 by A74,XREAL_1:50,NAT_1:13;
A76:          y = 1
              proof
                assume y <>1;
                then
A77:            y > 1 by A75,XXREAL_0:1;
                Y1 < Y1 +1 < Y1+y=Y2 by A77,NAT_1:13,XREAL_1:6;
                then Y1 / (2|^p3) < (Y1 +1) / (2|^p3) < Y2 / (2|^p3)
                by XREAL_1:74;
                then uDyadic.d1 < uDyadic.(x1+(Y1 +1) / (2|^p3)) < uDyadic.d2
                by Th24,A74,A70,XREAL_1:6;
                then c1 < uDyadic.(x1+(Y1 +1) / (2|^p3)) < c2
                by A52,A38,SURREALO:4;
                then {c1} << {uDyadic.(x1+(Y1 +1) / (2|^p3))} << {c2}
                by SURREALO:21;
                then
A78:            n1 c= born uDyadic.(x1+(Y1 +1) / (2|^p3))
                by A40,SURREALO:51,A20,A28,A31;
                Y1+1 <= Y2 by A74,NAT_1:13;
                then (Y1 +1)<(2|^p3) by A74,XXREAL_0:2;
                then uDyadic.(x1+(Y1 +1) / (2|^p3)) in Day n by A5,A74,A70;
                then born uDyadic.(x1+(Y1 +1) / (2|^p3)) c= n
                by SURREAL0:def 18;
                then Segm n1 c= Segm n by A78,XBOOLE_1:1;
                then n1 <= n by NAT_1:39;
                hence thesis by NAT_1:13;
              end;
A79:          {c1} <==> {uDyadic.d1} & {c2} <==> {uDyadic.d2}
              by A52,A38,SURREALO:32;
A80:          (x1* (2|^p3) + Y1)/(2|^p3) = d1 by A74,XCMPLX_1:113;
A81:          d2 = (x1* (2|^p3) + Y2)/(2|^p3) by A70,A74,XCMPLX_1:113
              .= (x1* (2|^p3) + Y1+1)/(2|^p3) by A76;
              uDyadic.(((x1* (2|^p3) + Y1)*2+1)/(2|^(p3+1))) =
              [{uDyadic.d1},{uDyadic.d2}]
              by Def5,A80,A81;
              then c == uDyadic.(((x1* (2|^p3) + Y1)*2+1)/(2|^(p3+1)))
              by A79,SURREALO:29,A32;
              then
A82:          s == uDyadic.(((x1* (2|^p3) + Y1)*2+1)/(2|^(p3+1)))
              by A10,SURREALO:4;
A83:          2|^(p3+1) = 2 * (2|^p3) by NEWTON:6;
              then
A84:          ((x1* (2|^p3) + Y1)*2+1)/(2|^(p3+1))
              = ((x1* (2|^(p3+1))) + (Y1*2+1))/(2|^(p3+1))
              .= x1 + (Y1*2+1)/(2|^(p3+1)) by XCMPLX_1:113;
              Y1+1 <= 2|^p3 by A74,NAT_1:13;
              then 2*Y1+1+1=2*(Y1+1) <= 2*2|^p3 by XREAL_1:64;
              then
A85:          2*Y1+1 < 2|^(p3+1) by A83,NAT_1:13;
              x1+p3+1 < n1 by A70,A74,XREAL_1:6;
              then x1+(p3+1) < n1;
              hence thesis by A82,A84,A85;
            end;
          end;
        end;
      end;
    end;
    let x,y,p be Nat such that
A86: y < 2|^p & x+p < n1;
    set d = x + y / (2|^p);
A87:x+p <= n by A86,NAT_1:13;
    per cases;
    suppose
A88:  p=0;
      then 2|^p = 1 by NEWTON:4;
      then y = 0 by A86,NAT_1:14;
      then
A89:  uDyadic.d = uInt.x by Def5;
      0 < x or 0 = x;
      then
A90:  uInt.0 < uInt.x or uInt.0 = uInt.x by Lm4;
      Segm x c= Segm n1 by A88,A86,NAT_1:39;
      then uInt.x in Day x c= Day n1 by Th1,SURREAL0:35;
      hence thesis by A90,Def1,A89;
    end;
    suppose
A91:  y is even & p<>0;
      then consider z be Nat such that
A92:  y = 2*z by ABIAN:def 2;
      reconsider p1=p-1 as Nat by NAT_1:20,A91;
      p=p1+1;
      then
A93:  2|^p = 2*2|^p1 by NEWTON:6;
      then
A94:  y / (2|^p) = z /2|^p1 by A92,XCMPLX_1:91;
A95:  z < 2|^p1 by A93,A92,A86,XREAL_1:64;
      x+p1+1 <= n by A86,NAT_1:13;
      then x+p1 < n by NAT_1:13;
      then 0_No <= uDyadic.(x + z / (2|^p1)) in Day n by A5,A95;
      hence thesis by A8,A94;
    end;
    suppose
A96:  y is odd & p<>0;
      then consider z be Nat such that
A97:  y = 2*z+1 by ABIAN:9;
      reconsider p1=p-1 as Nat by NAT_1:20,A96;
      set SD= uDyadic.((x*2|^p1+z)/(2|^p1)),
      SD1 = uDyadic.(((x*2|^p1+z)+1)/(2|^p1));
      p=p1+1;
      then
A98:  2|^p = 2*2|^p1 by NEWTON:6;
      then
A99:  x*(2|^p) + y = 2*(x*2|^p1+z)+1 by A97;
      d = (2*(x*2|^p1+z)+1) / (2|^(p1+1)) by A99,XCMPLX_1:113;
      then
A100: uDyadic.d = [{SD},{SD1}] by Def5;
A101: z < 2|^p1 by XREAL_1:64,A98,A97,A86,NAT_1:13;
      x+p1+1 <= n by A86,NAT_1:13;
      then
A102: x+p1 < n by NAT_1:13;
      (x*2|^p1+z)/(2|^p1) = x + z/(2|^p1) by XCMPLX_1:113;
      then
A103: SD in Day n by A5,A101,A102;
      2*z+1+1 <= 2*2|^p1 by A98,A97,A86,NAT_1:13;
      then 2*(z+1) <= 2*2|^p1;
      then
A104: z+1 <= 2|^p1 by XREAL_1:68;
A105: SD1 in Day n
      proof
        (x*2|^p1+z)+1 = (x*2|^p1)+(z+1);
        then
A106:   ((x*2|^p1+z)+1)/(2|^p1) = x + (z+1)/(2|^p1) by XCMPLX_1:113;
        per cases by A104,XXREAL_0:1;
        suppose z+1 = 2|^p1;
          then ((x*2|^p1+z)+1)/(2|^p1) = x+1 by A106,XCMPLX_1:60;
          then
A107:     SD1 = uInt.(x+1) by Def5;
          x+1 <= x+1+p1 = x+p by NAT_1:11;
          then Segm (x+1) c= Segm n by NAT_1:39,A87,XXREAL_0:2;
          then uInt.(x+1) in Day (x+1) c= Day n by SURREAL0:35,Th1;
          hence thesis by A107;
        end;
        suppose z+1 < 2|^p1;
          hence thesis by A102,A5,A106;
        end;
      end;
A108: {SD} << {SD1} by SURREALO:21,22,A100;
      for o be object st o in {SD} \/ {SD1} ex O st O in n1 & o in Day O
      proof
        let o be object;
        assume o in {SD} \/ {SD1};
        then o in {SD} or o in {SD1} by XBOOLE_0:def 3;
        then o in Day n by A103,A105,TARSKI:def 1;
        hence thesis by A7;
      end;
      hence thesis by A6,Th24,A100,SURREAL0:46,A108;
    end;
  end;
A109:for n holds P[n] from NAT_1:sch 2(A1,A4);
  thus 0_No <= z & z in Day n & not z == uDyadic.n implies
  ex x,y,p be Nat st z == uDyadic.(x + y / (2|^p)) & y < 2|^p & x+p < n
  proof
    assume 0_No <= z & z in Day n & not z == uDyadic.n;
    then ex d be Dyadic,x,y,p be Nat st
    z == uDyadic.d & y < 2|^p & d = x + y / (2|^p) & x+p < n by A109;
    hence thesis;
  end;
  thus thesis by A109;
end;

theorem Th26:
  2*m+1 < 2|^p implies born uDyadic.(n + (2*m+1) / (2|^p)) = n+p+1
proof
  set d = n + (2*m+1) / (2|^p);
  assume
A1:2*m+1 < 2|^p & born uDyadic.d <> n+p+1;
A2: not uDyadic.d == uDyadic.(n+p)
  proof
    assume uDyadic.d == uDyadic.(n+p);
    then d <= n+p <= d by Th24;
    then d = n+p by XXREAL_0:1;
    then p * (2|^p) < 1 * (2|^p) by A1,XCMPLX_1:87;
    then p=0 by NAT_1:14,XREAL_1:64;
    then 2|^p =1+0 by NEWTON:4;
    hence thesis by A1,NAT_1:13;
  end;
  n+p < n+p+1 by NAT_1:13;
  then
A3:0_No <= uDyadic.d in Day (n+p+1) by A1,Th25;
  for O st uDyadic.d in Day O holds (n+p+1) c= O
  proof
    let O such that
A4: uDyadic.d in Day O and
A5: not (n+p+1) c= O;
A6: O in n+p+1 = Segm (n+p+1) by A5,ORDINAL1:16;
    reconsider O as Nat by A5;
    O < n+p+1 by A6,NAT_1:44;
    then Segm O = O <= n+p= Segm (n+p) by NAT_1:13;
    then Day O c= Day (n+p) by NAT_1:39,SURREAL0:35;
    then consider x,y,p1 be Nat such that
A7: uDyadic.d == uDyadic.(x + y / (2|^p1)) &
    y < 2|^p1 & x+p1 < n+p by A4,Th25,A2,A3;
    d <= x + y / (2|^p1) <= d by A7,Th24;
    then
A8: n + (2*m+1) / (2|^p) = x + y / (2|^p1) by XXREAL_0:1;
    0 <= (2*m+1) / (2|^p) < 1 & 0<= y / (2|^p1) < 1 by A1,A7,XREAL_1:191;
    then n+0 <= n+ (2*m+1) / (2|^p) < n+1 & x+0<= x+ y / (2|^p1) < x+1
    by XREAL_1:6;
    then n < x+1 & x < n+1 by A8,XXREAL_0:2;
    then n<= x <= n by NAT_1:13;
    then
A9: x=n by XXREAL_0:1;
    then p1 < p by A7,XREAL_1:6;
    then p1+1<=p by NAT_1:13;
    then reconsider P=p-(p1+1) as Nat by NAT_1:21;
    p = p1+1+P;
    then
A10:2|^p = (2|^(p1+1))*(2|^P) & 2|^(p1+1) = 2*(2|^p1)
    by NEWTON:6,8;
    (2*m+1) *(2|^p1) = y *(2|^p) by A8,A9,XCMPLX_1:95
    .= (y* (2|^P) *2) *(2|^p1) by A10;
    hence thesis by XCMPLX_1:5;
  end;
  hence thesis by A1,SURREAL0:def 18,A3;
end;

theorem Th27:
  uDyadic.-d = - uDyadic.d
proof
  defpred P[Nat] means
    for d st d in DYADIC($1) holds uDyadic.-d = - uDyadic.d;
A1:P[0]
  proof
    let d;
    assume d in DYADIC 0;
    then reconsider i=d as Integer by Th21;
    uDyadic.-d = uInt.(-i) = -uInt.i by Def5,Th12;
    hence thesis by Def5;
  end;
A2: P[n] implies P[n+1]
  proof
    assume
A3: P[n];
    let d such that
A4: d in DYADIC(n+1);
    per cases;
    suppose d in DYADIC(n);
      hence thesis by A3;
    end;
    suppose not d in DYADIC(n);
      then d in DYADIC(n+1)\DYADIC(n) by A4,XBOOLE_0:def 5;
      then consider i be Integer such that
A5:    d = (2*i+1) / 2|^(n+1) by Th20;
      set j = -(i+1);
      2*j+1 = -(2*i+1);
      then
A6:   - d = (2*j+1) / 2|^(n+1) by A5,XCMPLX_1:187;
A7:   -(i/(2|^n)) = (-i) / (2|^n) by XCMPLX_1:187
      .= (j+1)/ (2|^n);
A8:   -((i+1)/(2|^n)) = j / (2|^n) by XCMPLX_1:187;
      i/(2|^n) in DYADIC(n) & (i+1)/(2|^n) in DYADIC(n) by Def4;
      then
A9:   -uDyadic.(i/(2|^n)) = uDyadic.((j+1)/(2|^n)) &
      -uDyadic.((i+1)/(2|^n)) = uDyadic.(j/(2|^n)) by A3,A7,A8;
      uDyadic.d = [{uDyadic.(i/(2|^n))},{uDyadic.((i+1)/(2|^n))}] by A5,Def5;
      then L_(uDyadic.d) ={uDyadic.(i/(2|^n))} &
      R_(uDyadic.d) = {uDyadic.((i+1)/(2|^n))};
      hence - (uDyadic.d) = [--{uDyadic.((i+1)/(2|^n))},--{uDyadic.(i/(2|^n))}]
      by SURREALR:7
      .= [{-uDyadic.((i+1)/(2|^n))},--{uDyadic.(i/(2|^n))}] by SURREALR:21
      .= [{-uDyadic.((i+1)/(2|^n))},{-uDyadic.(i/(2|^n))}] by SURREALR:21
      .= uDyadic.-d by A9,A6,Def5;
    end;
  end;
A10:P[n] from NAT_1:sch 2(A1,A2);
  consider i be Integer, n be Nat such that
A11: d = i / (2|^n) by Th18;
  d in DYADIC(n) by A11,Def4;
  hence thesis by A10;
end;

theorem Th28:
  0 <= d & not d is Integer implies
    ex n,m,p be Nat st d = n + (2*m+1)/(2|^(p+1)) & 2*m+1 < 2|^(p+1)
proof
  assume
A1: 0 <= d & not d is Integer;
  then consider p,i such that
A2:d = (2*i+1) / 2|^(p+1) by Th23;
  i >=0
  proof
    assume i < 0;
    then i+1 <= 0 by INT_1:7;
    then i+1+i < 0+0 by XREAL_1:6;
    hence thesis by A1,A2;
  end;
  then reconsider i as Element of NAT by INT_1:3;
  set DV = (2*i+1) div (2|^(p+1)),MD = (2*i+1) mod (2|^(p+1));
A3: 2|^(p+1) = 2*(2|^p) by NEWTON:6;
A4: 2*i+1 = DV * 2|^(p+1) + MD by INT_1:59;
  then 2*i+1 >= DV * 2|^p * 2 by A3,NAT_1:11;
  then 2*i+1 > DV * 2|^p * 2 by XXREAL_0:1;
  then i >= DV * 2|^p by XREAL_1:68,NAT_1:13;
  then reconsider M=i-(DV*(2|^p)) as Nat by NAT_1:21;
  take DV,M,p;
A5: MD = (2*i+1)- (DV*(2|^(p+1))) by A4
  .= 2*M+1 by A3;
  thus d = (DV * 2|^(p+1) + MD) / 2|^(p+1) by INT_1:59,A2
  .= DV + (2*M+1) / (2|^(p+1)) by A5,XCMPLX_1:113;
  thus thesis by A5,INT_1:58;
end;

theorem Th29:
  0 <= d iff 0_No <= uDyadic.d
proof
  0_No = uInt.0 = uDyadic.0 by Def1,Def5;
  hence thesis by Th24;
end;

theorem Th30:
  uDyadic.d in born_eq_set uDyadic.d
proof
A1: - -d = d;
  per cases;
  suppose d is Integer;
    then reconsider i=d as Integer;
A2: uDyadic.d = uInt.i by Def5;
    born uInt.i = born_eq uInt.i by SURREALO:48;
    then uInt.i in Day born_eq uInt.i by SURREAL0:def 18;
    hence thesis by A2,SURREALO:def 6;
  end;
  suppose
A3:   d < 0 & not d is Integer;
      then 0 < -d  & not -d is Integer;
      then consider n,m,p be Nat such that
A4:   - d = n + (2*m+1)/(2|^(p+1)) & 2*m+1 < 2|^(p+1) by Th28;
      set D = uDyadic.-d;
A5:   0_No <= D by A3,Th29;
A6:   born D = n+(p+1)+1 by A4,Th26;
A7:   D = - uDyadic.d by Th27;
      then
A8:   born D = born uDyadic.d by SURREALR:12;
      for y be Surreal st y == D holds born D c= born y
      proof
        let y be Surreal such that
A9:     y == D & not born D c= born y;
A10:    born y in Segm (n+(p+1)+1) by A6,A9,ORDINAL1:16;
        reconsider By = born y as Nat by A6,A9;
        By < n+(p+1)+1 by A10,NAT_1:44;
        then By <= n+p+1 by NAT_1:13;
        then Segm By c= Segm (n+p+1) by NAT_1:39;
        then
A11:    y in Day By c= Day (n+p+1) by SURREAL0:def 18,35;
        not y == uDyadic.(n+p+1)
        proof
          assume y == uDyadic.(n+p+1);
          then -d <= n+p+1 <= -d by Th24,A9,SURREALO:4;
          then -d = n+(p+1) by XXREAL_0:1;
          hence thesis by NAT_1:14,A4, XREAL_1:189;
        end;
        then consider x1,y1,p1 be Nat such that
A12:    y == uDyadic.(x1 + y1 / (2|^p1)) & y1 < 2|^p1 & x1+p1 < n+p+1
        by A5,A9,SURREALO:4,A11,Th25;
        -d <= x1 + y1 / (2|^p1) <= -d by Th24,A9,A12,SURREALO:4;
        then
A13:    n + (2*m+1) / (2|^(p+1)) = x1 + y1 / (2|^p1) by A4,XXREAL_0:1;
        0 <= (2*m+1) / (2|^(p+1)) < 1 & 0<= y1 / (2|^p1) < 1
        by A4,A12,XREAL_1:191;
        then n+0 <= n+ (2*m+1) / (2|^(p+1)) < n+1 & x1+0<= x1+ y1 / (2|^p1)
        < x1+1 by XREAL_1:6;
        then n < x1+1 & x1 < n+1 by A13,XXREAL_0:2;
        then n<= x1 <= n by NAT_1:13;
        then
A14:    x1=n by XXREAL_0:1;
        x1+p1 < n+(p+1) by A12;
        then p1 < p+1 by A14,XREAL_1:6;
        then p1<=p by NAT_1:13;
        then reconsider P=p-p1 as Nat by NAT_1:21;
        p = p1+P;
        then
A15:    2|^p = (2|^p1)*(2|^P) & 2|^(p+1) = 2*(2|^p) by NEWTON:6,8;
        (2*m+1) *(2|^p1) = y1 *(2|^(p+1)) by A13,A14,XCMPLX_1:95
        .= (y1* (2|^P) *2) *(2|^p1) by A15;
        hence thesis by XCMPLX_1:5;
      end;
      then born_eq uDyadic.d = born_eq D = born D
      by A7,SURREALO:def 5,SURREALR:13;
      then uDyadic.d in Day born_eq uDyadic.d by A8,SURREAL0:def 18;
      hence thesis by SURREALO:def 6;
    end;
    suppose
A16:  0 <= d & not d is Integer;
      then consider n,m,p be Nat such that
A17:  d = n + (2*m+1)/(2|^(p+1)) & 2*m+1 < 2|^(p+1) by Th28;
      set D = uDyadic.d;
A18:  0_No <= D by A16,Th29;
A19:  born D = n+(p+1)+1 by A17,Th26;
      for y be Surreal st y == D holds born D c= born y
      proof
        let y be Surreal such that
A20:    y == D & not born D c= born y;
A21:    born y in Segm (n+(p+1)+1) by A19,A20,ORDINAL1:16;
        reconsider By = born y as Nat by A19,A20;
        By < n+(p+1)+1 by A21,NAT_1:44;
        then By <= n+p+1 by NAT_1:13;
        then Segm By c= Segm (n+p+1) by NAT_1:39;
        then
A22:    y in Day By c= Day (n+p+1) by SURREAL0:def 18,35;
        not y == uDyadic.(n+p+1)
        proof
          assume y == uDyadic.(n+p+1);
          then d <= n+p+1 <= d by Th24,A20,SURREALO:4;
          then d = n+(p+1) by XXREAL_0:1;
          hence thesis by NAT_1:14,A17, XREAL_1:189;
        end;
        then consider x1,y1,p1 be Nat such that
A23:    y == uDyadic.(x1 + y1 / (2|^p1)) & y1 < 2|^p1 & x1+p1 < n+p+1
        by A18,A20,SURREALO:4,A22,Th25;
        d <= x1 + y1 / (2|^p1) <= d by Th24,A20,A23,SURREALO:4;
        then
A24:    n + (2*m+1) / (2|^(p+1)) = x1 + y1 / (2|^p1) by A17,XXREAL_0:1;
        0 <= (2*m+1) / (2|^(p+1)) < 1 & 0<= y1 / (2|^p1) < 1
        by A17,A23,XREAL_1:191;
        then n+0 <= n+ (2*m+1) / (2|^(p+1)) < n+1 & x1+0<= x1+ y1 / (2|^p1)
        < x1+1 by XREAL_1:6;
        then n < x1+1 & x1 < n+1 by A24,XXREAL_0:2;
        then n <= x1 <= n by NAT_1:13;
        then
A25:    x1=n by XXREAL_0:1;
        x1+p1 < n+(p+1) by A23;
        then p1 < p+1 by A25,XREAL_1:6;
        then p1<=p by NAT_1:13;
        then reconsider P=p-p1 as Nat by NAT_1:21;
        p = p1+P;
        then
A26:    2|^p = (2|^p1)*(2|^P) & 2|^(p+1) = 2*(2|^p) by NEWTON:6,8;
        (2*m+1) *(2|^p1) = y1 *(2|^(p+1)) by A24,A25,XCMPLX_1:95
        .= (y1* (2|^P) *2) *(2|^p1) by A26;
        hence thesis by XCMPLX_1:5;
      end;
      then born_eq D = born D by SURREALO:def 5;
      then D in Day born_eq D by SURREAL0:def 18;
      hence thesis by SURREALO:def 6;
    end;
end;

theorem Th31:
  born x is finite & card (L_x) (+) card (R_x) c= 1 implies
    ex i be Integer st x == uInt.i
proof
  assume
A1: born x is finite & card (L_x) (+) card (R_x) c= 1;
A2: born x = born -x by SURREALR:12;
  per cases;
  suppose card (L_x) (+) card (R_x) = 1;
    then consider y be Surreal such that
A3:  x= [{},{y}] or x = [{y},{}] by SURREALO:47;
    per cases by A3;
    suppose x= [{},{y}];
      then -- R_x = --{y} ={-y} & -- L_x = --{} = {} by SURREALR:21,22;
      then
A4:    -x = [{-y},{}] by SURREALR:7;
      per cases;
      suppose -y < 0_No;
        then -x == 0_No by A4,Th16;
        then x = - -x == 0_No = uInt.0 by Def1,SURREALR:23,10;
        hence thesis;
      end;
      suppose 0_No<=-y;
        then consider n be Nat such that
A5:     -x == uInt.(n+1) & uInt.n <= -y < uInt.(n+1) &
        n in born x by A4,A1,A2,Th17;
        x =- -x == -uInt.(n+1) = uInt.-(n+1) by A5,SURREALR:10,Th12;
        hence thesis;
      end;
    end;
    suppose
A6:   x= [{y},{}];
      per cases;
      suppose y < 0_No;
        then x == 0_No = uInt.0 by Def1,A6,Th16;
        hence thesis;
      end;
      suppose 0_No<=y;
        then ex n be Nat st x == uInt.(n+1) & uInt.n <= y < uInt.(n+1) &
        n in born x by A6,A1,Th17;
        hence thesis;
      end;
    end;
  end;
  suppose card (L_x) (+) card (R_x) <> 1;
    then card (L_x) (+) card (R_x) in 1=succ 0
    by A1,XBOOLE_0:def 8,ORDINAL1:11;
    then card (L_x) (+) card (R_x) = 0;
    then x = 0_No by SURREALO:46;
    then x = uInt.0 by Def1;
    hence thesis;
  end;
end;

theorem Th32:
  for x1,x2,y1,y2,p1,p2 be Nat st
    x1 + y1 / (2|^p1) = x2 + y2 / (2|^p2) & y1 < 2|^p1 & y2 < 2|^p2
  holds x1=x2
proof
  let x1,x2,y1,y2,p1,p2 be Nat such that
A1: x1 + y1 / (2|^p1) = x2 + y2 / (2|^p2) & y1 < 2|^p1 & y2 < 2|^p2;
  0<= y1 / (2|^p1) < 1 & 0<= y2 / (2|^p2) < 1 by A1,XREAL_1:189;
  then x1+0<= x1+y1 / (2|^p1) < x1+1 & x2+0<= x2+y2 / (2|^p2) < x2+1
  by XREAL_1:6;
  then x1 <x2+1 & x2 < x1+1 by A1,XXREAL_0:2;
  then x1 <= x2 <= x1 by NAT_1:13;
  hence thesis by XXREAL_0:1;
end;

theorem Th33: :::
  for x1,x2,y1,y2,p1,p2 be Nat st
    x1 + y1 / (2|^p1) < x2 + y2 / (2|^p2) & y1 < 2|^p1 & y2 < 2|^p2
  holds x1 <= x2
proof
  let x1,x2,y1,y2,p1,p2 be Nat such that
A1: x1 + y1 / (2|^p1) < x2 + y2 / (2|^p2) & y1 < 2|^p1 & y2 < 2|^p2
  and
A2: x2 < x1;
A3: x2+1 <= x1 by A2,NAT_1:13;
  0<= y1 / (2|^p1) & y2 / (2|^p2) < 1 by A1,XREAL_1:189;
  then
A4:x1+0<= x1+y1 / (2|^p1) &  x2+y2 / (2|^p2) < x2+1 by XREAL_1:6;
  then x2+y2 / (2|^p2) < x1 by A3,XXREAL_0:2;
  hence thesis by A4,A1,XXREAL_0:2;
end;

theorem Th34: :::
  for x1,x2,p1,p2 be Nat st (2*x1+1) / (2|^p1) = x2 / (2|^p2)
    holds p1 <= p2
proof
  let x1,x2,p1,p2 be Nat such that
A1: (2*x1+1) / (2|^p1) = x2 / (2|^p2);
  assume p2 < p1;
  then p2+1 <= p1 by NAT_1:13;
  then reconsider P = p1-(p2+1)as Nat by NAT_1:21;
  p1 = P+(p2+1);
  then 2|^p1 = (2|^P) * (2|^(p2+1)) & 2|^(p2+1) = 2*2|^p2 by NEWTON:6,8;
  then (2*x1+1) * (2|^p2) = x2 * ((2|^P)*(2*2|^p2)) = x2 * (2|^P)*2*2|^p2
  by A1,XCMPLX_1:95;
  hence thesis by XCMPLX_1:5;
end;

theorem Th35:
  x in Day n implies ex d be Dyadic st x == uDyadic.d & uDyadic.d in Day n
proof
  assume
A1: x in Day n;
  then
A2: born x c= n by SURREAL0:def 18;
  per cases;
  suppose ex i be Integer st x == uDyadic.i;
    then consider i be Integer such that
A3:  x == uDyadic.i;
    take i;
    born_eq_set x = born_eq_set uDyadic.i by A3,SURREALO:34;
    then uDyadic.i in born_eq_set x by Th30;
    then uDyadic.i in Day born_eq x by SURREALO:def 6;
    then born uDyadic.i c= born_eq x c= born x
    by SURREAL0:def 18,SURREALO:def 5;
    then born uDyadic.i c= born x by XBOOLE_1:1;
    then born uDyadic.i c= n by A2,XBOOLE_1:1;
    then uDyadic.i in Day born uDyadic.i c= Day n by SURREAL0:def 18,35;
    hence thesis by A3;
  end;
  suppose
A4: for i be Integer holds not x == uDyadic.i;
    per cases;
    suppose
A5:   0_No <=x;
      not x == uDyadic.n by A4;
      then consider x1,y1,p1 be Nat such that
A6:   x == uDyadic.(x1 + y1 / (2|^p1)) & y1 < 2|^p1 & x1+p1 < n
      by A1,A5,Th25;
      not x1 + y1 / (2|^p1) is Integer by A6,A4;
      then consider n2,m2,p2 be Nat such that
A7:   x1 + y1 / (2|^p1) = n2 + (2*m2+1)/(2|^(p2+1)) &
      2*m2+1 < 2|^(p2+1) by Th28;
      take d = n2 + (2*m2+1)/(2|^(p2+1));
A8:   x1 = n2 by A6,A7,Th32;
      then
A9:   n2+(p2+1) <= n2 + p1 by Th34,A7,XREAL_1:6;
      n2+(p2+1) < n by A6,A8,A9,XXREAL_0:2;
      then n2+(p2+1)+1 <= n by NAT_1:13;
      then Segm(n2+(p2+1)+1) c= Segm n by NAT_1:39;
      then
A10:  Day (n2+(p2+1)+1) c= Day n by SURREAL0:35;
      born uDyadic.d = n2+(p2+1)+1 by Th26,A7;
      then uDyadic.d in Day (n2+(p2+1)+1) by SURREAL0:def 18;
      hence thesis by A10,A6,A7;
    end;
    suppose x < 0_No;
      then
A11:  0_No= -0_No <= -x by SURREALR:10;
      born -x = born x c= n by SURREAL0:def 18,A1,SURREALR:12;
      then
A12:  -x in Day (born x) c= Day n by SURREAL0:def 18,35;
      not -x == uDyadic.n
      proof
        assume -x == uDyadic.n;
        then - -x == - uDyadic.n = uDyadic.-n by SURREALR:10,Th27;
        hence thesis by A4;
      end;
      then consider x1,y1,p1 be Nat such that
A13:  -x == uDyadic.(x1 + y1 / (2|^p1)) & y1 < 2|^p1 & x1+p1 < n
      by A12,A11,Th25;
      - -x == -uDyadic.(x1 + y1 / (2|^p1)) by A13,SURREALR:10;
      then x == uDyadic.-(x1 + y1 / (2|^p1)) by Th27;
      then not - -(x1 + y1 / (2|^p1)) is Integer by A4;
      then consider n2,m2,p2 be Nat such that
A14:  x1 + y1 / (2|^p1) = n2 + (2*m2+1)/(2|^(p2+1)) &
      2*m2+1 < 2|^(p2+1) by Th28;
      set d = n2 + (2*m2+1)/(2|^(p2+1));
A15:  x = - -x == - uDyadic.d = uDyadic.-d by A13,A14,SURREALR:10,Th27;
A16:  x1 = n2 by A13,A14,Th32;
      then
A17:  n2+(p2+1) <= n2 + p1 by A14,Th34,XREAL_1:6;
      n2+(p2+1) < n by A13,A16,A17,XXREAL_0:2;
      then n2+(p2+1)+1 <= n by NAT_1:13;
      then Segm(n2+(p2+1)+1) c= Segm n by NAT_1:39;
      then
A18:  Day (n2+(p2+1)+1) c= Day n by SURREAL0:35;
      born uDyadic.d = born (-uDyadic.d) = born (uDyadic.-d)
      by SURREALR:12,Th27;
      then born uDyadic.-d = n2+(p2+1)+1 by Th26,A14;
      then uDyadic.-d in Day (n2+(p2+1)+1) by SURREAL0:def 18;
      hence thesis by A15,A18;
    end;
  end;
end;

Lm6:
d >=0 implies ex n st uDyadic.d in Day n
proof
  assume
A1:d>=0;
  per cases;
  suppose d is Integer;
    then reconsider n=d as Element of NAT by A1,INT_1:3;
    uDyadic.d = uInt.n in Day n by Def5,Th1;
    hence thesis;
  end;
  suppose not d is Integer;
    then consider n,m,p be Nat such that
A2: d = n + (2*m+1)/(2|^(p+1)) & 2*m+1 < 2|^(p+1) by A1,Th28;
    born uDyadic.d = n+(p+1)+1 by A2,Th26;
    then uDyadic.d in Day (n+(p+1)+1) by SURREAL0:def 18;
    hence thesis;
  end;
end;

theorem Th36:
  ex n st uDyadic.d in Day n
proof
  per cases;
  suppose d >=0;
    hence thesis by Lm6;
  end;
  suppose d < 0;
    then consider n such that
A1: uDyadic.-d in Day n by Lm6;
    take n;
    uDyadic.-d = - uDyadic.d by Th27;
    then - - uDyadic.d in Day n by A1,SURREALR:11;
    hence thesis;
  end;
end;

registration
  let d;
  cluster uDyadic.d -> uniq-surreal;
  coherence
  proof
    defpred P[Nat] means
    (for d st uDyadic.d in Day $1 holds uDyadic.d is uniq-surreal) &
    (for x be Surreal st x in Day $1 & x is uniq-surreal holds
       -x is uniq-surreal);
A1: P[0] by SURREALR:23,SURREAL0:2,TARSKI:def 1;
A2: P[n] implies P[n+1]
    proof
      assume
A3:   P[n];
      set n1=n+1;
      thus
A4:   for d st uDyadic.d in Day n1 holds uDyadic.d is uniq-surreal
      proof
A5:     for d st 0<=d & not d is Integer & uDyadic.d in Day n1 \Day n holds
        (for z st z in born_eq_set uDyadic.d &
        L_z\/R_z is uniq-surreal-membered & uDyadic.d<>z
        holds card (L_(uDyadic.d)) (+) card (R_(uDyadic.d)) in
        card (L_z) (+) card (R_z)) & uDyadic.d in born_eq_set uDyadic.d &
        L_(uDyadic.d)\/R_(uDyadic.d) is uniq-surreal-membered
        proof
          let d;
          set D=uDyadic.d;
          assume that
A6:         0<=d & not d is Integer
          and
A7:         uDyadic.d in Day n1 \Day n;
A8:       D in Day n1 & not D in Day n by A7,XBOOLE_0:def 5;
          not born D c= n
          proof
            assume born D c= n;
            then D in Day born D c= Day n by SURREAL0:def 18,SURREAL0:35;
            hence thesis by A7,XBOOLE_0:def 5;
          end;
          then
A9:       Segm n1 = succ Segm n c= born D c= n1
          by A8,ORDINAL1:16,21,SURREAL0:def 18,NAT_1:38;
          consider k,m,p be Nat such that
A10:      d = k + (2*m+1)/(2|^(p+1)) & 2*m+1 < 2|^(p+1) by A6,Th28;
          set p1=p+1;
A11:      2|^p1 = 2*(2|^p) by NEWTON:6;
          then k*(2|^p1) + (2*m+1) = 2*(k*(2|^p)+m)+1;
          then d = (2*(k*(2|^p)+m)+1)/(2|^p1) by A10,XCMPLX_1:113;
          then
A12:      D = [{uDyadic.( (k*(2|^p)+m)/(2|^p)) },
          {uDyadic.( ((k*(2|^p)+m)+1)/(2|^p))}] by Def5;
          then card (L_D) = 1 & card (R_D) = 1 by CARD_1:30;
          then
A13:      card (L_D) (+) card (R_D) = 1+1 by ORDINAL7:76;
A14:      born D = k+p1+1 by A10,Th26;
A15:      m < 2|^p by XREAL_1:64,NAT_1:13,A11,A10;
A16:      (k*(2|^p)+m)/(2|^p) = k+ m/(2|^p) by XCMPLX_1:113;
A17:      ((k*(2|^p)+m)+1)/(2|^p) = (k*(2|^p)+(m+1))/(2|^p)
          = k+ (m+1)/(2|^p) by XCMPLX_1:113;
          set sD1 = uDyadic.( (k*(2|^p)+m)/(2|^p));
          set sD2 = uDyadic.( ((k*(2|^p)+m)+1)/(2|^p));
A18:      0_No <= D by A6,Th29;
A19:      for y be Surreal st y == D holds born D c= born y
          proof
            let y be Surreal such that
A20:        y == D & not born D c= born y;
A21:        born y in Segm (k+p1+1) by A14,A20,ORDINAL1:16;
            reconsider By=born y as Nat by A14,A20;
            By < k+p1+1 by A21,NAT_1:44;
            then By <= k+p1 by NAT_1:13;
            then Segm By c= Segm (k+p1) by NAT_1:39;
            then
A22:        y in Day By c= Day (k+p1) by SURREAL0:def 18,SURREAL0:35;
A23:        not y == uDyadic.(k+p1)
            proof
              assume y == uDyadic.(k+p1);
              then d <= k+p1 <= d by Th24,A20,SURREALO:4;
              hence thesis by A6,XXREAL_0:1;
            end;
            consider x2,y2,p2 be Nat such that
A24:        y == uDyadic.(x2 + y2 / (2|^p2)) & y2 < 2|^p2 & x2+p2 < k+p1
            by Th25,A22,A20,A18,SURREALO:4,A23;
            d <= x2 + y2 / (2|^p2) <= d by Th24,A20,A24,SURREALO:4;
            then
A25:        k + (2*m+1)/(2|^p1) = x2 + y2 / (2|^p2) by A10,XXREAL_0:1;
            then k = x2 by Th32,A10,A24;
            hence thesis by A25,Th34,A24,XREAL_1:6;
          end;
          then
A26:      born D = born_eq D by SURREALO:def 5;
          then
A27:      D in Day born_eq D by SURREAL0:def 18;
          sD1 in L_D & sD2 in R_D by TARSKI:def 1,A12;
          then sD1 in L_D\/R_D & sD2 in L_D\/R_D by XBOOLE_0:def 3;
          then
A28:      born sD1 in born D & born sD2 in born D by SURREALO:1;
          sD1 in Day born sD1 c= Day n & sD2 in Day born sD2 c= Day n
          by SURREAL0:def 18,SURREAL0:35,A28,A9,ORDINAL1:22;
          then
A29:      sD1 is uniq-surreal & sD2 is uniq-surreal by A3;
          for z st z in born_eq_set D &
          L_z\/R_z is uniq-surreal-membered & D<>z
          holds card (L_D) (+) card (R_D) in card (L_z) (+) card (R_z)
          proof
            let z such that
A30:        z in born_eq_set D &
            L_z\/R_z is uniq-surreal-membered & D<>z and
A31:        not card (L_D) (+) card (R_D) in card (L_z) (+) card (R_z);
A32:        card (L_z) (+) card (R_z) c= card (L_D) (+) card (R_D)
            by A31,ORDINAL1:16;
A33:        z==D by A30,SURREALO:def 6;
            z in Day born_eq D by A30,SURREALO:def 6;
            then
A34:        born z c= born_eq D c= born D
            by SURREAL0:def 18,SURREALO:def 5;
            then
A35:        born z c= Segm (k+p1+1) by A14,XBOOLE_1:1;
            0_No <= D by A6,Th29;
            then
A36:        0_No<= z by A33,SURREALO:4;
            per cases;
            suppose card (L_z) (+) card (R_z)<>2;
              then card (L_z) (+) card (R_z) in succ 1
              by ORDINAL1:11,A32,A13,XBOOLE_0:def 8;
              then consider i such that
A37:          z == uInt.i by A34,A14,Th31,ORDINAL1:22;
              D == uInt.i = uDyadic.i by A33,A37,SURREALO:4,Def5;
              then d <= i <= d by Th24;
              hence thesis by XXREAL_0:1,A6;
            end;
            suppose
A38:          card (L_z) (+) card (R_z)=2;
              L_z is finite & R_z is finite by A34,A14,SURREALO:8;
              then reconsider cz1=card (L_z),cz2=card (R_z) as Nat;
A39:          cz1+cz2 =2 by A38,ORDINAL7:76;
A40:          cz1 = 1
              proof
                assume
A41:            cz1 <> 1;
                per cases;
                suppose
A42:              cz1 <>0;
                  then 0+1 <= cz1 by NAT_1:13;
                  then 1 < cz1 by A41,XXREAL_0:1;
                  then 1+1 <= cz1<= cz1+cz2 by NAT_1:13,11;
                  then
A43:              cz1 = 2 by A39,XXREAL_0:1;
                  L_z is non empty surreal-membered finite by A42;
                  then consider Min,Max be Surreal such that
A44:              Min in L_z & Max in L_z &
                  for x st x in L_z holds Min <= x <= Max by SURREALO:12;
A45:              for x st x in L_z holds  x <= Max by A44;
                  then reconsider zM=[{Max},R_z] as Surreal by A44,SURREALO:23;
A46:              born zM c= born z by A44,A45,SURREALO:23;
A47:              zM == z by A44,SURREALO:23,A45;
                  card (L_zM) (+) card (R_zM) = 1(+)0=1 by A39,A43,CARD_1:30;
                  then consider i such that
A48:              zM == uInt.i by A46,A34,A14,Th31;
                  z==D by A30,SURREALO:def 6;
                  then D == zM by A47,SURREALO:4;
                  then D == uInt.i = uDyadic.i by A48,SURREALO:4,Def5;
                  then d <= i <= d by Th24;
                  hence thesis by A6,XXREAL_0:1;
                end;
                suppose
A49:              card (L_z) =0;
                  then R_z is non empty surreal-membered finite
                  by A38,ORDINAL7:69;
                  then consider Min,Max be Surreal such that
A50:              Min in R_z & Max in R_z &
                  for x st x in R_z holds Min <= x <= Max by SURREALO:12;
A51:              for x st x in R_z holds  Min <= x by A50;
                  then reconsider zM=[L_z,{Min}] as Surreal by A50,SURREALO:24;
A52:              born zM c= born z by A50,A51,SURREALO:24;
A53:              zM == z by A50,SURREALO:24,A51;
                  card (L_zM) (+) card (R_zM) = 0(+)1=1 by CARD_1:30,A49;
                  then consider i such that
A54:              zM == uInt.i by A52,A34,A14,Th31;
                  z==D by A30,SURREALO:def 6;
                  then D == zM by A53,SURREALO:4;
                  then D == uInt.i = uDyadic.i by A54,SURREALO:4,Def5;
                  then d <= i <= d by Th24;
                  hence thesis by A6, XXREAL_0:1;
                end;
              end;
              then consider Z1 be object such that
A55:          L_z = {Z1} by CARD_2:42;
              consider Z2 be object such that
A56:          R_z = {Z2} by A40,A39,CARD_2:42;
A57:          Z1 in L_z & Z2 in R_z by A55,A56, TARSKI:def 1;
              then reconsider Z1,Z2 as Surreal by SURREAL0:def 16;
A58:          Z1 in L_z\/R_z & Z2 in L_z\/R_z by A57,XBOOLE_0:def 3;
              then reconsider Z1,Z2 as uSurreal by A30;
A59:          {Z1} << {D} & {D} << {Z2} by A33,A55,A56,SURREAL0:43;
              born Z1 in born z & born Z2 in born z by A58,SURREALO:1;
              then born Z1 in Segm (k+p1+1) &
              born Z2 in Segm (k+p1+1) = succ Segm (k+p1) by A35,NAT_1:38;
              then
A60:          Z1 in Day born Z1 & Z2 in Day born Z2 &
              Day born Z1 c= Day (k+p1) & Day born Z2 c= Day (k+p1)
              by ORDINAL1:22,SURREAL0:35,SURREAL0:def 18;
A61:          born z = born_eq z = born_eq D by A30,SURREALO:35;
A62:          not Z1 == uDyadic.(k+p1)
              proof
                assume Z1 == uDyadic.(k+p1);
                then uDyadic.(k+p1) < D by A59,SURREALO:21,SURREALO:4;
                then p1 < (2*m+1)/(2|^(p+1)) < 1
                by A10,Th24,XREAL_1:6,XREAL_1:189;
                then p1 < 1 by XXREAL_0:2;
                hence thesis by NAT_1:11;
              end;
A63:          {0_No} << R_z by A36,SURREAL0:43;
              0_No <= Z1
              proof
                assume
A64:            not 0_No <= Z1;
                born 0_No = {} by SURREAL0:37;
                then for x st L_z << {x} << R_z holds born 0_No c= born x;
                then z == 0_No by A63,A64,A55,SURREALO:21,SURREALO:16;
                then D==0_No = uInt.0 = uDyadic.0
                by A33,SURREALO:4,Def1,Def5;
                then 0<= d<=0 by Th24;
                hence thesis by A6;
              end;
              then consider x3,y3,p3 be Nat such that
A65:          Z1 == uDyadic.(x3 + y3 / (2|^p3)) & y3 < 2|^p3 & x3+p3 < k+p1
              by Th25,A60,A62;
A66:          L_D << {D} << R_D by SURREALO:11;
A67:          sD1 == Z1
              proof
                assume not sD1 == Z1;
                then per cases;
                suppose sD1 < Z1;
                  then
A68:              sD1 < uDyadic.(x3 + y3 / (2|^p3)) < D
                  by A59,A65,SURREALO:4,SURREALO:21;
                  then k+m/(2|^p) < x3 + y3 / (2|^p3)
                  < k + (2*m+1)/(2|^(p+1)) by Th24,A10,A16;
                  then k <= x3 <= k by Th33,A65,A15,A10;
                  then
A69:              k=x3 by XXREAL_0:1;
                  then p3 < p+1 by A65,XREAL_1:6;
                  then p3 <= p by NAT_1:13;
                  then reconsider P=p-p3 as Nat by NAT_1:21;
                  p = p3+P;
                  then 2|^p = (2|^p3)*(2|^P) by NEWTON:8;
                  then 2|^p1 = (2|^p3) *(2*2|^P) by A11;
                  then
A70:              y3 / (2|^p3) = (y3*(2*2|^P)) / (2|^p1) by XCMPLX_1:91;
A71:              m/(2|^p) = (2*m)/(2|^p1) by A11,XCMPLX_1:91;
                  (2*m)/(2|^p1) < (y3*(2*2|^P)) / (2|^p1) < (2*m+1)/(2|^p1)
                  by A70,A71,A68,A69,XREAL_1:6,Th24,A10,A16;
                  then 2*m < (y3*(2*2|^P)) < 2*m+1 by XREAL_1:72;
                  hence thesis by NAT_1:13;
                end;
                suppose
A72:              Z1 < sD1;
                  sD1 <= D by A66,SURREALO:21,A12;
                  then sD1 < Z2 by A59,SURREALO:21,4;
                  then L_z << {sD1} << R_z by A72,A55,A56,SURREALO:21;
                  then born z c= born sD1 by SURREALO:51,A61;
                  hence thesis by A26,A61,A28,ORDINAL1:12;
                end;
              end;
A73:          sD2 == Z2
              proof
                assume
A74:            not sD2 == Z2;
A75:            0_No <= Z2 by A63,A56,SURREALO:21;
                not Z2 == uDyadic.(k+p1)
                proof
                  assume
A76:              Z2 == uDyadic.(k+p1);
A77:              k+p < k+p+1 by NAT_1:13;
A78:              p=0
                  proof
                    assume p<>0;
                    then (2*m+1)/(2|^(p+1)) < 1<=p by NAT_1:14,A10,XREAL_1:189;
                    then (2*m+1)/(2|^(p+1)) < p by XXREAL_0:2;
                    then D <= uDyadic.(k+p) by Th24,A10,XREAL_1:6;
                    then Z1 < uDyadic.(k+p) < Z2
                      by A76,A77,SURREALO:4,21,A59,Th24;
                    then {Z1} << {uDyadic.(k+p)} <<{Z2} by SURREALO:21;
                    then
A79:                born z c= born uDyadic.(k+p) =born uInt.(k+p)
                    = k+p by Def5,A61,A55,A56,SURREALO:51,Th4;
                    Segm (k+p1+1) c= Segm(k+p)
                    by A61,A19,A14,A79,SURREALO:def 5;
                    then k+p+2 = k+p1+1 <= k+p+0 by NAT_1:39;
                    hence thesis by XREAL_1:6;
                  end;
                  then 2*m +1 < 1+1 by A10;
                  then
A80:              m=0 by NAT_1:14,XREAL_1:6;
                  2|^p = 1 by A78,NEWTON:4;
                  hence thesis by A80,A76,A78,A74;
                end;
                then consider x4,y4,p4 be Nat such that
A81:            Z2 == uDyadic.(x4 + y4 / (2|^p4)) & y4 < 2|^p4 & x4+p4
                < k+p1 by Th25,A60,A75;
                per cases by A74;
                suppose Z2 < sD2;
                  then D < uDyadic.(x4 + y4 / (2|^p4)) < sD2
                  by A59,SURREALO:21,A81,SURREALO:4;
                  then
A82:              k+(2*m+1)/(2|^(p+1)) <
                  x4 + y4 / (2|^p4) < k+(m+1)/(2|^p) by Th24,A10,A17;
                  then k <= x4 by A10,A81,Th33;
                  then k+p1 <= x4+p1 by XREAL_1:6;
                  then x4+p4 < x4+p1 by A81,XXREAL_0:2;
                  then reconsider P=p1-p4 as Nat by NAT_1:21,XREAL_1:6;
                  p1 = p4+P;
                  then 2|^p1 = (2|^p4)*(2|^P) by NEWTON:8;
                  then
A83:              y4 / (2|^p4) = (y4*(2|^P)) / (2|^p1)
                  by XCMPLX_1:91;
A84:              k+(2*m+1)/(2|^p1) = (k*(2|^p1)+(2*m+1))/(2|^p1) &
                  x4 + (y4*(2|^P)) / (2|^p1) =
                  (x4*(2|^p1) + (y4*(2|^P))) / (2|^p1) &
                  k+(2*(m+1))/(2|^p1) = (k*(2|^p1)+(2*(m+1)))/(2|^p1)
                  by XCMPLX_1:113;
                  (k*(2|^p1)+(2*m+1))/(2|^p1) <
                  (x4*(2|^p1) + (y4*(2|^P))) / (2|^p1) <
                  (k*(2|^p1)+(2*(m+1)))/(2|^p1) by A82,A83,A84,A11,XCMPLX_1:91;
                  then k*(2|^p1)+(2*m+1) < x4*(2|^p1) + (y4*(2|^P))
                  < k*(2|^p1)+(2*(m+1)) by XREAL_1:72;
                  then k*(2|^p1)+(2*m+1)+1 < k*(2|^p1)+(2*(m+1)) by NAT_1:13;
                  hence thesis;
                end;
                suppose
A85:              sD2 < Z2;
                  D <= sD2 by A66,SURREALO:21,A12;
                  then Z1 < sD2 by A59,SURREALO:21,4;
                  then L_z << {sD2} << R_z by A85,A55,A56,SURREALO:21;
                  then born z c= born sD2 by SURREALO:51,A61;
                  hence thesis by A26,A61,A28,ORDINAL1:12;
                end;
              end;
              sD1 = Z1 & sD2 = Z2 by A67,A73,A29,SURREALO:50;
              hence thesis by A30,A12,A55,A56;
            end;
          end;
          hence thesis by A29,A12,A27,SURREALO:def 6;
        end;
        let d;
        set D=uDyadic.d;
        assume
A86:    D in Day n1;
        per cases;
        suppose D in Day n;
          hence thesis by A3;
        end;
        suppose
A87:      not D in Day n;
          not born D c= n
          proof
            assume born D c= n;
            then D in Day born D c= Day n by SURREAL0:def 18,SURREAL0:35;
            hence thesis by A87;
          end;
          then
A88:      Segm n1 = succ Segm n c= born D c= n1
          by A86,ORDINAL1:16,21,SURREAL0:def 18,NAT_1:38;
          then
A89:      born D = n1 by XBOOLE_0:def 10;
          per cases;
          suppose d is Integer;
            then reconsider i=d as Integer;
            D=uInt.i by Def5;
            hence thesis;
          end;
          suppose
A90:        0<=d & not d is Integer;
            D in Day n1 \ Day n by A87,A86,XBOOLE_0:def 5;
            then (for z st z in born_eq_set D &
            L_z\/R_z is uniq-surreal-membered & D <>z
            holds card (L_D) (+) card (R_D) in
            card (L_z) (+) card (R_z)) & D in born_eq_set D &
            L_D\/R_D is uniq-surreal-membered by A90,A5;
            hence thesis by SURREALO:49;
          end;
          suppose
A91:        not 0<=d & not d is Integer;
            - - d =d;
A92:        not -d is Integer by A91;
            set E = uDyadic.(-d);
A93:        E = -D by Th27;
A94:        E in Day n1 by A93,SURREALR:11,A86;
A95:        -E = D by A93;
            then not E in Day n by SURREALR:11,A87;
            then E in Day n1 \ Day n by A94,XBOOLE_0:def 5;
            then
A96:        (for z st z in born_eq_set E &
            L_z\/R_z is uniq-surreal-membered & E <>z
            holds card (L_E) (+) card (R_E) in
            card (L_z) (+) card (R_z)) & E in born_eq_set E &
            L_E\/R_E is uniq-surreal-membered by A91,A5;
A97:        for z st z in born_eq_set D &
            L_z\/R_z is uniq-surreal-membered & D <>z
            holds card (L_D) (+) card (R_D) in card (L_z) (+) card (R_z)
            proof
              let z such that
A98:          z in born_eq_set D &
              L_z\/R_z is uniq-surreal-membered & D <>z;
              set Z=-z;
A99:          L_(-D) = -- (R_D) & R_(-D) = -- (L_D) by SURREALR:8;
A100:         L_Z = -- (R_z) & R_Z = -- (L_z) by SURREALR:8;
A101:         Z <> E by A98,A95;
A102:         L_Z\/R_Z is uniq-surreal-membered
              proof
                let o;
                assume o in L_Z\/R_Z;
                then o in -- (L_z\/R_z) by A100,SURREALR:20;
                then consider x such that
A103:           x in L_z\/R_z & o = -x by SURREALR:def 4;
A104:           x is uSurreal by A98,A103;
A105:           Segm n1 = succ Segm n by NAT_1:38;
                born z = born_eq z = born_eq D c= born D
                by A98,SURREALO:35,def 5;
                then born x in born z c= n1
                by A103,A88,SURREALO:1,XBOOLE_0:def 10;
                then x in Day born x c= Day n
                by SURREAL0:def 18,35,A105,ORDINAL1:22;
                hence thesis by A103,A104,A3;
              end;
A106:         card (L_Z) = card (R_z) & card (R_Z) = card (L_z)
              by A100,SURREALR:17;
              card (L_E) = card (R_D) & card (R_E) = card (L_D)
              by A99,A93,SURREALR:17;
              hence thesis by A102,A106,A96,A101,A98,A93,SURREALR:14;
            end;
            L_D\/R_D is uniq-surreal-membered
            proof
A107:         L_D = -- (R_E) & R_D = -- (L_E) by A95,SURREALR:8;
              let o;
              assume o in L_D\/R_D;
              then o in -- (L_E\/R_E) by A107,SURREALR:20;
              then consider x such that
A108:         x in L_E\/R_E & o = -x by SURREALR:def 4;
A109:         x is uSurreal by A96,A108;
A110:         Segm n1 = succ Segm n by NAT_1:38;
              born E = born D by A93,SURREALR:12;
              then born x c= Segm n by A108,A89,SURREALO:1,A110,ORDINAL1:22;
              then x in Day born x c= Day n by SURREAL0:def 18,SURREAL0:35;
              hence thesis by A108,A109,A3;
            end;
            hence thesis by SURREALO:49,A97,Th30;
          end;
        end;
      end;
      let x be Surreal such that
A111: x in Day n1 & x is uniq-surreal;
      consider d be Dyadic such that
A112: x == uDyadic.d & uDyadic.d in Day n1 by A111,Th35;
A113: uDyadic.-d = -uDyadic.d by Th27;
      then
A114: uDyadic.-d is uniq-surreal by A4,A112,SURREALR:11;
      uDyadic.d is uniq-surreal by A112,A4;
      hence thesis by A113,A114,A112,A111,SURREALO:41;
    end;
A115: P[n] from NAT_1:sch 2(A1,A2);
    ex n st uDyadic.d in Day n by Th36;
    hence thesis by A115;
  end;
end;

theorem Th37:
  x is uSurreal & born x is finite iff ex d be Dyadic st x = uDyadic.d
proof
  hereby
    assume
A1: x is uSurreal & born x is finite;
    then reconsider b = born x as Nat;
    x in Day b by SURREAL0:def 18;
    then ex d be Dyadic st
    x == uDyadic.d & uDyadic.d in Day b by Th35;
    hence ex d be Dyadic st x = uDyadic.d by A1,SURREALO:50;
  end;
  given d be Dyadic such that
A2:x = uDyadic.d;
  consider n such that
A3:uDyadic.d in Day n by Th36;
  born uDyadic.d c= n by A3,SURREAL0:def 18;
  hence thesis by A2;
end;

Lm7:
   for n,p,x st p >0 holds
      [{uDyadic.(n / (2|^p))},{uDyadic.((n+2) / (2|^p))}] is Surreal &
      (x = [{uDyadic.(n / (2|^p))},{uDyadic.((n+2) / (2|^p))}]
       implies x == uDyadic.((n+1) / (2|^p)))
proof
  let n,p,x such that
A1:p >0;
  reconsider P=p-1 as Nat by A1,NAT_1:20;
  set p1=P+1;
  n +0 < n+2 by XREAL_1:6;
  then n/(2|^p) < (n+2)/(2|^p) by XREAL_1:74;
  hence [{uDyadic.(n / (2|^p))},{uDyadic.((n+2)/ (2|^p))}] is Surreal
  by SURREALO:22,Th24;
  assume
A2:x = [{uDyadic.(n / (2|^p))},{uDyadic.((n+2) / (2|^p))}];
A3: 2*2|^P = 2|^p1 by NEWTON:6;
  per cases;
  suppose n is even;
    then consider k be Nat such that
A4: n= 2*k by ABIAN:def 2;
     k/(2|^P) = n/(2|^p1) & (k+1)/(2|^P) = (2*(k+1))/(2|^p1)
    by A4,XCMPLX_1:91,A3;
    hence thesis by A4,A2,Def5;
  end;
  suppose n is odd;
    then consider k be Nat such that
A5: n= 2*k+1 by ABIAN:9;
    set D = uDyadic.((n+1) / (2|^p));
    n+0 < n+1 & n+1+0 < n+1+1 by XREAL_1:6;
    then n / (2|^p) < (n+1) / (2|^p) < (n+1+1) / (2|^p) by XREAL_1:74;
    then
A6: L_x << {D} << R_x by A2,SURREALO:21,Th24;
    per cases;
    suppose (n+1) / (2|^p) is Integer;
      then reconsider N= (n+1) / (2|^p) as Integer;
      N <>0;
      then reconsider N1=N-1 as Nat by NAT_1:20;
A7:   N*(2|^P) *2 = N*(2|^p) = n+1 = 2*(k+1) by A3,XCMPLX_1:87,A5;
      N=N1+1;
      then
A8:   D=uInt.N = [{uInt.N1},{}] by Def1,Def5;
      then
A9:   {x} << R_D;
      N*(2|^p) - 1 *(2|^p) <= N*(2|^p)-1 by XREAL_1:10,NAT_1:14;
      then N1 *(2|^p) <=n = N*(2|^p)-1 by A7;
      then N1 <= (n / (2|^p)) by XREAL_1:77;
      then uInt.N1 = uDyadic.N1 <= uDyadic.(n / (2|^p)) by Def5,Th24;
      then not ( L_x << {uInt.N1} & {x} << R_(uInt.N1)) by A2,SURREALO:21;
      then not x <= uInt.N1 by SURREAL0:43;
      then L_D << {x} by A8,SURREALO:21;
      hence thesis by A9,A6,SURREAL0:43;
    end;
    suppose not (n+1) / (2|^p) is Integer;
      then consider n3,m3,p3 be Nat such that
A10:  (n+1) / (2|^p) = n3 + (2*m3+1)/(2|^(p3+1)) &
      2*m3+1 < 2|^(p3+1) by Th28;
      set i3 = m3+n3*2|^p3;
A11:  2|^(p3+1) = 2*2|^p3 by NEWTON:6;
      then
A12: (n+1) / (2|^p) = ((n3 * (2*2|^p3)) + (2*m3+1))/(2|^(p3+1))
        by A10,XCMPLX_1:113
      .= (2*i3+1) / (2|^(p3+1));
      (2*k+1+1)*(2|^(p3+1)) = (2*i3+1)*(2|^p) by A12,A5,XCMPLX_1:95;
      then ((k+1)*(2|^(p3+1)))*2 = ((2*i3+1)*2|^P)*2 by A3;
      then 2|^(p3+1) divides 2|^P by NEWTON02:67,INT_1:def 3;
      then reconsider pp = P - (p3+1) as Nat by NAT_1:21,PEPIN:31;
      set M = 2|^pp;
      P = pp +(p3+1);
      then
A13:  2|^P = M * (2|^(p3+1)) by NEWTON:8;
      (n+1) / (2|^p) = (2*M*(2*i3+1)) / (2*M* 2|^(p3+1)) by A12,XCMPLX_1:91
      .= (2*M*(2*i3+1))/ (2|^p) by A13,A3;
      then
A14:  n+1 = 2*M*(2*i3+1) by XCMPLX_1:53;
      set D = uDyadic.((n+1) / (2|^p));
A15:  i3/(2|^p3) = (2*2*M*i3) / (2*2*M* (2|^p3)) by XCMPLX_1:91
      .= (2*2*M*i3) / (2|^p) by A13,A3,A11;
      0 <= M+M-1 by XREAL_1:48,NAT_1:14;
      then 2*2*M*i3+0 <= 2*2*M*i3 + (2*M -1) by XREAL_1:6;
      then not uDyadic.(n / (2|^p)) < uDyadic.(i3/(2|^p3))
      by A14,A15,Th24,XREAL_1:72;
      then not (L_x << {uDyadic.(i3/(2|^p3))} &
      {x} << R_(uDyadic.(i3/(2|^p3)))) by A2,SURREALO:21;
      then
A16:  not x <=uDyadic.(i3/(2|^p3)) by SURREAL0:43;
A17:  (i3+1)/(2|^p3) = (2*2*M*(i3+1)) / (2*2*M* (2|^p3)) by XCMPLX_1:91
      .= (2*2*M*(i3+1)) / (2|^p) by A13,A3,A11;
      2*M*2*i3+2*M+1 <= 2*2*M*i3+2*M+2*M by NAT_1:14,XREAL_1:6;
      then not uDyadic.((i3+1)/(2|^p3)) < uDyadic.((n+2) / (2|^p))
      by A14,A17,Th24,XREAL_1:72;
      then not ( L_(uDyadic.((i3+1)/(2|^p3))) << {x} &
      {uDyadic.((i3+1)/(2|^p3))} << R_x) by A2,SURREALO:21;
      then
A18:  x < uDyadic.((i3+1)/(2|^p3)) by SURREAL0:43;
      D = [{uDyadic.(i3/(2|^p3))},{uDyadic.((i3+1)/(2|^p3))}] by A12,Def5;
      then L_D << {x} << R_D by A16,A18,SURREALO:21;
      hence thesis by A6,SURREAL0:43;
    end;
  end;
end;

theorem Th38:
  for i be Integer,p be Nat,x be Surreal holds
     [{uDyadic.(i / (2|^p))},{uDyadic.((i+2) / (2|^p))}] is Surreal &
      (x = [{uDyadic.(i / (2|^p))},{uDyadic.((i+2) / (2|^p))}]
       implies x == uDyadic.((i+1) / (2|^p)))
proof
  let i be Integer,p be Nat,x be Surreal;
  i +0 < i+2 by XREAL_1:6;
  then i / (2|^p) < (i+2) / (2|^p) by XREAL_1:74;
  hence [{uDyadic.(i / (2|^p))},{uDyadic.((i+2)/ (2|^p))}] is Surreal
  by SURREALO:22,Th24;
  assume
A1:x = [{uDyadic.(i / (2|^p))},{uDyadic.((i+2) / (2|^p))}];
  per cases;
  suppose p=0;
    then
A2: 2|^p =1 by NEWTON:4;
    set j=i+1;
A3: j-1 = i & j+1=i+2;
    uDyadic.(i / (2|^p)) = uInt.i & uDyadic.((i+1) / (2|^p)) = uInt.(i+1)&
    uDyadic.((i+2) / (2|^p)) = uInt.(i+2) by A2,Def5;
    hence thesis by A1,Th10,A3;
  end;
  suppose
A4: p >0;
    per cases;
    suppose i+1 >0;
      then i is Element of NAT by INT_1:3,7;
      hence thesis by A1,A4,Lm7;
    end;
    suppose
A5:   i+1=0;
A6:   0_No = uInt.0 = uDyadic.0 by Def1,Def5;
      (-1)/ (2|^p) < 0;
      then
A7:   L_x << {0_No} & {x} << R_0_No by A1,A6,SURREALO:21,A5,Th24;
      L_0_No << {x} & {0_No} << R_x by A5,A1,A6,SURREALO:21,Th24;
      hence thesis by A6,A5,A7,SURREAL0:43;
    end;
    suppose i+1<0;
      then i+1 <= -1 by INT_1:8;
      then i+1+1 <= -1+1 by XREAL_1:6;
      then reconsider n= -(i+2) as Element of NAT by INT_1:3;
      (n+2) / (2|^p) = - (-(n+2)) / (2|^p) by XCMPLX_1:190;
      then uDyadic.((n+2) / (2|^p)) = - uDyadic.(i / (2|^p)) by Th27;
      then
A8:   -- L_x = {uDyadic.((n +2) / (2|^p))} by A1,SURREALR:21;
      n / (2|^p) = -((i+2) / (2|^p)) by XCMPLX_1:187;
      then uDyadic.(n / (2|^p)) = - uDyadic.((i+2) / (2|^p)) by Th27;
      then -- R_x = {uDyadic.(n / (2|^p))} by A1,SURREALR:21;
      then -x = [ {uDyadic.(n / (2|^p))},{uDyadic.((n +2) / (2|^p))}]
      by A8,SURREALR:7;
      then -x == uDyadic.((n+1) / (2|^p)) by A4,Lm7;
      then x = - - x == - uDyadic.((n+1) / (2|^p)) by SURREALR:10;
      then
A9:   x == uDyadic.(- ((n+1) / (2|^p))) by Th27;
      -(n+1) = i+1;
      hence thesis by A9,XCMPLX_1:187;
    end;
  end;
end;

Lm8: uDyadic.i + uDyadic.d == uDyadic.(i+d)
proof
A1:uDyadic.0 = uInt.0 = 0_No by Def1,Def5;
  defpred P[Nat] means for i,j be Nat st i+j<=$1
    for d st d in DYADIC(j) holds
      uDyadic.i + uDyadic.d == uDyadic.(i+d);
A2:P[0]
  proof
    let i,j be Nat;
    assume i+j<=0;
    then i=0;
    hence thesis by A1;
  end;
A4:P[m] implies P[m+1]
  proof
    assume
A5: P[m];
    set m1=m+1;
    let i,j be Nat such that
A6: i+j<=m1;
    let d such that
A7: d in DYADIC(j);
    per cases by A6,XXREAL_0:1;
    suppose i+j < m1;
      then i+j <= m by NAT_1:13;
      hence thesis by A5,A7;
    end;
    suppose i=0;
      hence thesis by A1;
    end;
    suppose j=0;
      then reconsider dd=d as Integer by A7,Th21;
      uDyadic.i = uInt.i by Def5;
      then uDyadic.i + uDyadic.d = uInt.i + uInt.dd by Def5;
      then uDyadic.i + uDyadic.d == uInt.(i+dd) by Th14;
      hence thesis by Def5;
    end;
    suppose
A8:   i+j = m1 & i <>0 & j<>0;
      then reconsider i1=i-1,j1=j-1 as Nat by NAT_1:20;
      per cases;
      suppose
A9:     d in DYADIC(j1);
        m1 = i+j1+1 by A8;
        hence thesis by A9,A5;
      end;
      suppose not d in DYADIC(j1);
        then d in DYADIC(j1+1)\DYADIC(j1) by A7,XBOOLE_0:def 5;
        then consider k be Integer such that
A10:    d = (2*k+1)/(2|^(j1+1)) by Th20;
A11:    uDyadic.d = [{uDyadic.(k/(2|^j1))},{uDyadic.((k+1)/(2|^j1))}]
        by A10,Def5;
        uDyadic.i = uInt.(i1+1) by Def5;
        then
A12:    uDyadic.i = [{uInt.i1},{}] by Def1;
        i1 +j =m by A8;
        then
A13:    uDyadic.i1 + uDyadic.d == uDyadic.(i1+d) by A7,A5;
        L_(uDyadic.i) ++ {uDyadic.d} = {uInt.i1 + uDyadic.d} by A12,SURREALR:36
        .= {uDyadic.i1 + uDyadic.d} by Def5;
        then
A14:    L_(uDyadic.i) ++ {uDyadic.d} <==> {uDyadic.(i1+d)}
        by SURREALO:32,A13;
A15:    k/(2|^j1) in DYADIC(j1) by Def4;
        m = i+j1 by A8;
        then
A16:    uDyadic.i + uDyadic.(k/(2|^j1)) == uDyadic.(i+k/(2|^j1)) by A15,A5;
        {uDyadic.i} ++ L_(uDyadic.d)
        = {uDyadic.i + uDyadic.(k/(2|^j1))} by A11,SURREALR:36;
        then {uDyadic.i} ++ L_(uDyadic.d) <==> {uDyadic.(i+k/(2|^j1))}
        by SURREALO:32,A16;
        then
A17:    (L_(uDyadic.i) ++ {uDyadic.d})\/
        ({uDyadic.i} ++ L_(uDyadic.d)) <==>
        {uDyadic.(i1+d)}\/{uDyadic.(i+k/(2|^j1))} by A14,SURREALO:31;
A18:    R_(uDyadic.i) ++ {uDyadic.d} = {} by SURREALR:27,A12;
A19:    (k+1)/(2|^j1) in DYADIC(j1) by Def4;
        m = i+j1 by A8;
        then
A20:    uDyadic.i + uDyadic.((k+1)/(2|^j1)) ==
        uDyadic.(i+(k+1)/(2|^j1)) by A19,A5;
        {uDyadic.i} ++ R_(uDyadic.d) = {uDyadic.i + uDyadic.((k+1)/(2|^j1))}
        by SURREALR:36,A11;
        then
A21:    (R_(uDyadic.i) ++ {uDyadic.d})\/({uDyadic.i} ++ R_(uDyadic.d))
        <==> {uDyadic.(i+(k+1)/(2|^j1))} by A18,SURREALO:32,A20;
A22:    uDyadic.i + uDyadic.d =
        [(L_(uDyadic.i) ++ {uDyadic.d})\/({uDyadic.i} ++ L_(uDyadic.d)),
        (R_(uDyadic.i) ++ {uDyadic.d}) \/({uDyadic.i} ++ R_(uDyadic.d))]
        by SURREALR:28;
        then [{uDyadic.(i1+d)}\/{uDyadic.(i+k/(2|^j1))},
        {uDyadic.(i+(k+1)/(2|^j1))}] is surreal by A17,A21,SURREALI:37;
        then reconsider DD=[{uDyadic.(i1+d)}\/{uDyadic.(i+k/(2|^j1))},
        {uDyadic.(i+(k+1)/(2|^j1))}] as Surreal;
A23:    {uDyadic.(i1+d)}\/{uDyadic.(i+k/(2|^j1))} =
        {uDyadic.(i1+d),uDyadic.(i+k/(2|^j1))} by ENUMSET1:1;
        i*2|^j1 + (k+1) = i*2|^j1 + k+1;
        then
A24:    (i*2|^j1 + k)/(2|^j1) = i + k/(2|^j1) &
        (i*2|^j1 + k+1)/(2|^j1) = i + (k+1)/(2|^j1) by XCMPLX_1:113;
A25:    2|^(j1+1) = 2*2|^j1 by NEWTON:6;
        i+d = (i*(2*2|^j1)+(2*k+1))/(2|^(j1+1)) by A10,A25,XCMPLX_1:113
        .= (2* (i*2|^j1 + k)+1)/(2|^(j1+1));
        then
A26:    uDyadic.(i+d) = [{uDyadic.(i + k/(2|^j1))},
        {uDyadic.(i+(k+1)/(2|^j1))}] by A24,Def5;
        2*k+1 <= 2*k+(2|^j1)*2 by NAT_1:14,XREAL_1:6;
        then (2*k+1) * (2|^j1) <= (1*(2|^j1)+k) * 2*(2|^j1) by XREAL_1:64;
        then (2*k+1) * (2|^j1) <= (1*(2|^j1)+k) * (2|^(j1+1)) by A25;
        then (2*k+1)/(2|^(j1+1))<= (1*(2|^j1)+k)/(2|^j1) by XREAL_1:102;
        then d <= k/(2|^j1)+1 by A10,XCMPLX_1:113;
        then d+i1 <= k/(2|^j1)+1+i1 by XREAL_1:6;
        then
A27:    DD == uDyadic.(i+d) by A26,SURREALO:25,A23,Th24;
        uDyadic.i + uDyadic.d == DD by A22,A17,A21,SURREALO:29;
        hence thesis by A27,SURREALO:4;
      end;
    end;
  end;
A28:P[m] from NAT_1:sch 2(A2,A4);
  consider n be Nat such that
A29:i =n or i =-n by INT_1:2;
  per cases by A29;
  suppose
A30:i=n;
    consider j be Integer, m be Nat such that
A31: d = j / (2|^m) by Th18;
A32: d in DYADIC(m) by A31,Def4;
    P[n+m] by A28;
    hence thesis by A30,A32;
  end;
  suppose
A33:i=-n;
    consider j be Integer, m be Nat such that
A34:-d = j / (2|^m) by Th18;
A35: -d in DYADIC(m) by A34,Def4;
    P[n+m] by A28;
    then
A36:-(uDyadic.n + uDyadic.-d) == - uDyadic.(n+-d) by A35,SURREALR:65;
A37:- uDyadic.(n+-d) = uDyadic.-(n+-d) by Th27;
    d=- - d;
    then -uDyadic.n = uDyadic.i & - uDyadic.-d = uDyadic.d by A33,Th27;
    hence thesis by A37,A33,A36,SURREALR:40;
  end;
end;

theorem Th39:
  uDyadic.d1 + uDyadic.d2 == uDyadic.(d1+d2)
proof
  defpred P[Nat] means for n1,n2 be Nat st n1+n2 <= $1 & n1 <= n2
    for d1,d2 st d1 in DYADIC(n1) & d2 in DYADIC(n2) holds
      uDyadic.d1 + uDyadic.d2 == uDyadic.(d1+d2);
A1: P[0]
  proof
    let n1,n2 be Nat such that
A2: n1+n2 <= 0 & n1 <= n2;
A3: n1=0 = n2 by A2;
    let d1,d2 such that
A4: d1 in DYADIC(n1) & d2 in DYADIC(n2);
    reconsider i1=d1,i2=d2 as Integer by A4,A3,Th21;
    uDyadic.d1 = uInt.i1 & uDyadic.d2 = uInt.i2 &
    uDyadic.(d1+d2) = uInt.(i1+i2) by Def5;
    hence thesis by Th14;
  end;
A5: P[m] implies P[m+1]
  proof
    assume
A6: P[m];
    set m1=m+1;
    let n1,n2 be Nat such that
A7: n1+n2 <= m1 & n1 <= n2;
    let d1,d2 such that
A8: d1 in DYADIC(n1) & d2 in DYADIC(n2);
    per cases;
    suppose n1=0;
      then reconsider i1=d1 as Integer by A8,Th21;
      uDyadic.i1 + uDyadic.d2 == uDyadic.(i1+d2) by Lm8;
      hence thesis;
    end;
    suppose
A9:   n1 <>0;
      then reconsider N1=n1-1 as Nat by NAT_1:20;
      N1+n2+1 <= m1 by A7;
      then
A10:  N1+n2 <= m by XREAL_1:6;
      n2 <>0 by A7,A9;
      then reconsider N2=n2-1 as Nat by NAT_1:20;
A11:  N1+n2 = n1+N2;
A12:  (N1 <= n2 or n2 <= N1) & (n1 <= N2 or N2 <= n1);
      per cases;
      suppose d1 in DYADIC(N1) or  d2 in DYADIC(N2);
        hence thesis by A11,A10,A8,A6,A12;
      end;
      suppose
A13:    not d1 in DYADIC(N1) & not d2 in DYADIC(N2);
        then d1 in DYADIC(N1+1)\DYADIC(N1) by A8,XBOOLE_0:def 5;
        then consider i1 be Integer such that
A14:    d1 = (2*i1+1) / 2|^(N1+1) by Th20;
        d2 in DYADIC(N2+1)\DYADIC(N2) by A8,A13,XBOOLE_0:def 5;
        then consider i2 be Integer such that
A15:    d2 = (2*i2+1) / 2|^(N2+1) by Th20;
A16:    uDyadic.d1 =
        [{uDyadic.(i1/(2|^N1))},{uDyadic.((i1+1)/(2|^N1))}] by A14,Def5;
A17:    uDyadic.d2 =
        [{uDyadic.(i2/(2|^N2))},{uDyadic.((i2+1)/(2|^N2))}] by A15,Def5;
        i1/(2|^N1) in DYADIC(N1) by Def4;
        then
A18:    uDyadic.(i1/(2|^N1)) + uDyadic.d2 == uDyadic.(i1/(2|^N1)+d2)
        by A10,A8,A6,A12;
        L_(uDyadic.d1) ++ {uDyadic.d2} = {uDyadic.(i1/(2|^N1)) + uDyadic.d2}
        by A16,SURREALR:36;
        then
A19:    L_(uDyadic.d1) ++ {uDyadic.d2} <==> {uDyadic.(i1/(2|^N1)+d2)}
        by A18,SURREALO:32;
        i2/(2|^N2) in DYADIC(N2) by Def4;
        then
A20:    uDyadic.d1 + uDyadic.(i2/(2|^N2))== uDyadic.(d1 +i2/(2|^N2))
        by A11,A10,A8,A6,A12;
        {uDyadic.d1} ++ L_(uDyadic.d2)
        = {uDyadic.d1 + uDyadic.(i2/(2|^N2))} by A17,SURREALR:36;
        then
A21:    {uDyadic.d1} ++ L_(uDyadic.d2) <==>{uDyadic.(d1+i2/(2|^N2))}
        by A20,SURREALO:32;
        (i1+1)/(2|^N1) in DYADIC(N1) by Def4;
        then
A22:    uDyadic.((i1+1)/(2|^N1)) + uDyadic.d2 ==
        uDyadic.((i1+1)/(2|^N1)+d2) by A10,A8,A6,A12;
        R_(uDyadic.d1) ++ {uDyadic.d2}
        = {uDyadic.((i1+1)/(2|^N1)) + uDyadic.d2} by A16,SURREALR:36;
        then
A23:    R_(uDyadic.d1) ++ {uDyadic.d2} <==>
        {uDyadic.((i1+1)/(2|^N1)+d2)} by A22,SURREALO:32;
        (i2+1)/(2|^N2) in DYADIC(N2) by Def4;
        then
A24:    uDyadic.d1 + uDyadic.((i2+1)/(2|^N2)) ==
        uDyadic.(d1 +(i2+1)/(2|^N2)) by A11,A10,A8,A6,A12;
        {uDyadic.d1} ++ R_(uDyadic.d2) =
        {uDyadic.d1 + uDyadic.((i2+1)/(2|^N2))} by A17,SURREALR:36;
        then
A25:    {uDyadic.d1} ++ R_(uDyadic.d2) <==>
        {uDyadic.(d1 +(i2+1)/(2|^N2))} by A24,SURREALO:32;
A26:    (L_(uDyadic.d1) ++ {uDyadic.d2})\/
        ({uDyadic.d1} ++ L_(uDyadic.d2)) <==>
        {uDyadic.(i1/(2|^N1)+d2)}\/{uDyadic.(d1 +i2/(2|^N2))} =
        {uDyadic.(i1/(2|^N1)+d2),uDyadic.(d1 +i2/(2|^N2))}
        by A19,A21,SURREALO:31,ENUMSET1:1;
A27:    (R_(uDyadic.d1) ++ {uDyadic.d2}) \/({uDyadic.d1} ++ R_(uDyadic.d2))
        <==> {uDyadic.((i1+1)/(2|^N1)+d2)} \/ {uDyadic.(d1 +(i2+1)/(2|^N2))}=
        {uDyadic.((i1+1)/(2|^N1)+d2),uDyadic.(d1 +(i2+1)/(2|^N2))}
        by A23,A25,SURREALO:31,ENUMSET1:1;
A28:    uDyadic.d1 + uDyadic.d2 = [(L_(uDyadic.d1) ++ {uDyadic.d2})\/
        ({uDyadic.d1} ++ L_(uDyadic.d2)),
        (R_(uDyadic.d1) ++ {uDyadic.d2}) \/({uDyadic.d1} ++ R_(uDyadic.d2))]
        by SURREALR:28;
        reconsider DD=[{uDyadic.(i1/(2|^N1)+d2),uDyadic.(d1 +i2/(2|^N2))},
        {uDyadic.((i1+1)/(2|^N1)+d2),uDyadic.(d1 +(i2+1)/(2|^N2))}] as Surreal
        by A28,TARSKI:1,A26,A27,SURREALI:37;
        DD=DD;
        then reconsider DD1 = [ {uDyadic.(d1 +i2/(2|^N2))},
        {uDyadic.((i1+1)/(2|^N1)+d2),uDyadic.(d1 +(i2+1)/(2|^N2))}]
        as Surreal by SURREALO:26;
        DD1=DD1;
        then reconsider DD2 = [ {uDyadic.(d1 +i2/(2|^N2))},
        {uDyadic.(d1 +(i2+1)/(2|^N2))}] as Surreal by SURREALO:28;
        N1+1 <= n2 by A7;
        then N1 < n2=N2+1 by NAT_1:13;
        then N1 <= N2 by NAT_1:13;
        then reconsider N=N2-N1 as Nat by NAT_1:21;
        set 2N1 = 2|^N1,2N2=2|^N2,P=2|^N;
A29:    2|^(N1+1) = 2*2N1 & 2|^(N2+1) = 2*2N2 by NEWTON:6;
        N2 = N1+N;
        then
A30:    2N2 = 2N1*P by NEWTON:8;
A31:    i1/(2|^N1)+d2 = (i1*(P*2))/(2N1*(P*2)) + (2*i2+1) / (2*2N2)
        by A15,A29,XCMPLX_1:91
        .= (i1*(P*2)+(2*i2+1))/(2*2N2)by XCMPLX_1:62,A30
        .= (2*(P*i1+i2)+1)/(2*2N2);
A32:    d1 +i2/(2|^N2)
        = ((2*i1+1)*P) / (2N1*2*P) + i2/2N2 by A14,A29,XCMPLX_1:91
        .= ((2*i1+1)*P) / (2N2*2) + (i2*2)/(2N2*2)
        by A30,XCMPLX_1:91
        .=((2*i1+1)*P + (i2*2))/(2N2*2) by XCMPLX_1:62
        .= (2*(P*i1+i2)+P)/(2*2N2);
        2*(P*i1+i2)+1 <= 2*(P*i1+i2)+P by NAT_1:14,XREAL_1:6;
        then i1/(2|^N1)+d2 <= d1 +i2/(2|^N2) by A31,A32,XREAL_1:72;
        then
A33:    DD==DD1 by Th24,SURREALO:25;
A34:    (i1+1)/(2|^N1)+d2
        = ((i1+1)*(P*2))/(2N1*(P*2)) + (2*i2+1) / (2*2N2) by A15,
        A29,XCMPLX_1:91
        .= ((i1+1)*(P*2)+(2*i2+1))/(2*2N2) by XCMPLX_1:62,A30
        .= (2*(P*i1+i2)+(2*P+1))/(2*2N2);
A35:    d1 +(i2+1)/(2|^N2)
        = ((2*i1+1)*P) / (2N1*2*P) + (i2+1)/2N2 by A29,XCMPLX_1:91,A14
        .= ((2*i1+1)*P) / (2N2*2) + ((i2+1)*2)/(2N2*2)
        by A30,XCMPLX_1:91
        .=((2*i1+1)*P + ((i2+1)*2))/(2N2*2) by XCMPLX_1:62
        .= (2*(P*i1+i2)+(P+2))/(2*2N2);
        1+(P+1) <= P +(P+1) by NAT_1:14,XREAL_1:6;
        then 2*(P*i1+i2)+(P+2) <= 2*(P*i1+i2)+(2*P+1) by XREAL_1:6;
        then d1 +(i2+1)/(2|^N2) <= (i1+1)/(2|^N1)+d2 by A34,A35,XREAL_1:72;
        then
A36:    DD1==DD2 by Th24,SURREALO:27;
        uDyadic.d1 + uDyadic.d2 == DD by A28,A26,A27,SURREALO:29;
        then uDyadic.d1 + uDyadic.d2 == DD1 by A33,SURREALO:4;
        then
A37:    uDyadic.d1 + uDyadic.d2 == DD2 by A36,SURREALO:4;
        d1 = ((2*i1+1)*P) / ((2*2N1)*P) by A29,XCMPLX_1:91,A14;
        then
A38:    d1+d2 = ((2*i1+1)*P+(2*i2+1)) / (2*2N2)
        by XCMPLX_1:62,A29,A30,A15
        .= (2*(i1*P+i2)+(P+1)) / (2*2N2);
        per cases;
        suppose N1 <> N2;
          then N<>0;
          then reconsider nn=N-1 as Nat by NAT_1:14,21;
          set 2n = 2|^nn;
          N=nn+1;
          then
A39:      P =2*2n by NEWTON:6;
A40:      d1 +i2/(2|^N2)
          = (2*(P*i1+i2+2n))/(2*2N2) by A39,A32
          .=(P*i1+i2+2n)/2N2 by XCMPLX_1:91;
A41:      d1 +(i2+1)/(2|^N2)
          = (2*(P*i1+i2+2n+1)) /(2*2N2) by A35,A39
          .=(P*i1+i2+2n+1)/2N2 by XCMPLX_1:91;
          d1+d2 = (2*(i1*P+i2+2n)+1) / (2|^(N2+1)) by NEWTON:6,A39,A38;
          hence thesis by A37,A40,A41,Def5;
        end;
        suppose N1=N2;
          then
A42:      P=1 by NEWTON:4;
          then
A43:      d1+d2 = (2*(i1+i2)+1+1)/(2|^(N2+1)) by NEWTON:6,A38;
A44:      d1 +i2/(2|^N2) = (2*(i1+i2)+1)/(2|^(N2+1)) by A42,A32,NEWTON:6;
          d1 +(i2+1)/(2|^N2)
          = (2*(i1+i2)+1+2)/(2|^(N2+1)) by NEWTON:6,A42,A35;
          then DD2 == uDyadic.(d1+d2) by A43,A44,Th38;
          hence thesis by A37,SURREALO:4;
        end;
      end;
    end;
  end;
A45: P[m] from NAT_1:sch 2(A1,A5);
  consider i1 be Integer, n1 be Nat such that
A46: d1 = i1 / (2|^n1) by Th18;
  consider i2 be Integer, n2 be Nat such that
A47: d2 = i2 / (2|^n2) by Th18;
A48: d2 in DYADIC(n2) c= DYADIC(n1+n2) by A47,Def4,Th19,NAT_1:11;
A49: d1 in DYADIC(n1) by A46,Def4;
A50: n1 <= n1+n2 by NAT_1:11;
  P[n1+(n1+n2)] by A45;
  hence thesis by A48,A49,A50;
end;

Lm9: uDyadic.i * uDyadic.d == uDyadic.(i*d)
proof
A1: uDyadic.0 = uInt.0 = 0_No by Def1,Def5;
  defpred P[Nat] means for i,j be Nat st i+j<=$1
    for d st d in DYADIC(j) holds
      uDyadic.i * uDyadic.d == uDyadic.(i*d);
A2: P[0]
  proof
    let i,j be Nat such that
A3: i+j <= 0;
    let d such that d in DYADIC(j);
    i=0 by A3;
    hence thesis by A1;
  end;
A4:P[m] implies P[m+1]
  proof
    assume
A5: P[m];
    set m1=m+1;
    let i,j be Nat such that
A6: i+j<=m1;
    let d such that
A7: d in DYADIC(j);
    per cases by A6,XXREAL_0:1;
    suppose i+j < m1;
      then i+j <= m by NAT_1:13;
      hence thesis by A5,A7;
    end;
    suppose i=0;
      hence thesis by A1;
    end;
    suppose j=0;
      then reconsider dd=d as Integer by A7,Th21;
      uDyadic.i = uInt.i by Def5;
      then uDyadic.i * uDyadic.d = uInt.i * uInt.dd by Def5;
      then uDyadic.i * uDyadic.d == uInt.(i*dd) by Th15;
      hence thesis by Def5;
    end;
    suppose
A8:   i+j = m1 & i <>0 & j<>0;
      then reconsider i1=i-1,j1=j-1 as Nat by NAT_1:20;
      per cases;
      suppose
A9:     d in DYADIC(j1);
        m1 = i+j1+1 by A8;
        hence thesis by A9,A5;
      end;
      suppose not d in DYADIC(j1);
        then d in DYADIC(j1+1)\DYADIC(j1) by A7,XBOOLE_0:def 5;
        then consider k be Integer such that
A10:    d = (2*k+1)/(2|^(j1+1)) by Th20;
        set x = uDyadic.i, y = uDyadic.d;
A11:    y = [{uDyadic.(k/(2|^j1))},{uDyadic.((k+1)/(2|^j1))}]
        by A10,Def5;
        uDyadic.i = uInt.(i1+1) by Def5;
        then
A12:    x = [{uInt.i1},{}] by Def1
        .= [{uDyadic.i1},{}] by Def5;
        comp(R_x,x,y,R_y) = comp(R_y,y,x,R_x) &
        comp(R_x,x,y,L_y) = comp(L_y,y,x,R_x) by SURREALR:53;
        then
A13:    comp(R_x,x,y,L_y) = {} = comp(R_x,x,y,R_y)
        by A12,SURREALR:49;
        i1+j1+1=m by A8;
        then
A14:    i1+j1 < m by NAT_1:13;
A15:    i1+j = m & i+j1 = m by A8;
A16:    k/(2|^j1) in DYADIC(j1) by Def4;
        set M=2|^(j1+1);
A17:    2*(2|^j1) = M by NEWTON:6;
A18:    i1*(k/(2|^j1)) = i1*((2*k)/M) by A17,XCMPLX_1:91
        .= (i1*(2*k))/M by XCMPLX_1:74;
        i1*d +(i*(k/(2|^j1))) = (i1*((2*k+1)/M)) +(i*((2*k)/M))
        by A10,A17,XCMPLX_1:91
        .= (i1*(2*k+1))/M +(i*((2*k)/M)) by XCMPLX_1:74
        .= (i1*(2*k+1))/M +(i*(2*k))/M by XCMPLX_1:74
        .= (i1*(2*k+1)+i*(2*k))/M by XCMPLX_1:62;
        then
A19:    (i1*d) +(i*(k/(2|^j1)))+ -(i1*(k/(2|^j1))) =
        (i1*(2*k+1)+i*(2*k))/M - ((i1*(2*k))/M) by A18
        .= (i1*(2*k+1)+i*(2*k) - (i1*(2*k)))/M by XCMPLX_1:120
        .= (i*(2*k+1) -1)/M;
        (uDyadic.i1)*y == uDyadic.(i1*d)
        & x*uDyadic.(k/(2|^j1)) == uDyadic.(i*(k/(2|^j1))) &
        (uDyadic.i1)*(uDyadic.(k/(2|^j1))) == uDyadic.(i1*(k/(2|^j1)))
        by A14,A15,A16,A7,A5;
        then
A20:    - (uDyadic.i1)*(uDyadic.(k/(2|^j1))) ==
        - uDyadic.(i1*(k/(2|^j1))) = uDyadic.-(i1*(k/(2|^j1))) &
        (uDyadic.i1)*y + x*uDyadic.(k/(2|^j1)) ==
        uDyadic.(i1*d) + uDyadic.(i*(k/(2|^j1)))
        ==uDyadic.((i1*d) +(i*(k/(2|^j1)))) by SURREALR:10,43,Th27,Th39;
        then (uDyadic.i1)*y + x*uDyadic.(k/(2|^j1)) ==
        uDyadic.((i1*d) +(i*(k/(2|^j1)))) by SURREALO:4;
        then (uDyadic.i1)*y + x*uDyadic.(k/(2|^j1)) + -
        (uDyadic.i1)*(uDyadic.(k/(2|^j1))) ==
        uDyadic.((i1*d) +(i*(k/(2|^j1)))) + uDyadic.-(i1*(k/(2|^j1)))==
        uDyadic.((i1*d) +(i*(k/(2|^j1)))+ -(i1*(k/(2|^j1))))
        by A20,SURREALR:43,Th39;
        then (uDyadic.i1)*y + x*uDyadic.(k/(2|^j1)) + -
        (uDyadic.i1)*(uDyadic.(k/(2|^j1))) ==
        uDyadic.((i*(2*k+1) -1)/M) by A19,SURREALO:4;
        then
A21:    {(uDyadic.i1)*y + x*uDyadic.(k/(2|^j1)) + -
        (uDyadic.i1)*(uDyadic.(k/(2|^j1)))}<==>
        {uDyadic.((i*(2*k+1) -1)/M)} by SURREALO:32;
A22:    comp(L_x,x,y,L_y)
        = { (uDyadic.i1)*y + x*uDyadic.(k/(2|^j1)) -
        (uDyadic.i1)*(uDyadic.(k/(2|^j1)))} by SURREALR:52,A11,A12;
A23:    (k+1)/(2|^j1) in DYADIC(j1) by Def4;
A24:    i1*((k+1)/(2|^j1)) = i1*((2*(k+1))/M) by A17,XCMPLX_1:91
        .= (i1*(2*(k+1)))/M by XCMPLX_1:74;
        i1*d +(i*((k+1)/(2|^j1))) = (i1*((2*k+1)/M)) +(i*((2*(k+1))/M))
        by A10,A17,XCMPLX_1:91
        .= (i1*(2*k+1))/M +(i*((2*(k+1))/M)) by XCMPLX_1:74
        .= (i1*(2*k+1))/M +(i*(2*(k+1)))/M by XCMPLX_1:74
        .= (i1*(2*k+1)+i*(2*(k+1)))/M by XCMPLX_1:62;
        then
A25:    (i1*d) +(i*((k+1)/(2|^j1)))+ -(i1*((k+1)/(2|^j1))) =
        (i1*(2*k+1)+i*(2*(k+1)))/M  - ((i1*(2*(k+1)))/M) by A24
        .= (i*(2*k+1)-(2*k+1) +i*(2*(k+1)) - (i*(2*(k+1))-(2*(k+1))))/M
        by XCMPLX_1:120
        .= (i*(2*k+1)-1 +2)/M;
        (uDyadic.i1)*y == uDyadic.(i1*d)
        & x*uDyadic.((k+1)/(2|^j1)) == uDyadic.(i*((k+1)/(2|^j1))) &
        (uDyadic.i1)*(uDyadic.((k+1)/(2|^j1))) == uDyadic.(i1*((k+1)/(2|^j1)))
        by A14,A15,A23,A7,A5;
        then
A26:    - (uDyadic.i1)*(uDyadic.((k+1)/(2|^j1)))
        == - uDyadic.(i1*((k+1)/(2|^j1)))
        = uDyadic.-(i1*((k+1)/(2|^j1)))&
        (uDyadic.i1)*y + x*uDyadic.((k+1)/(2|^j1)) ==
        uDyadic.(i1*d) + uDyadic.(i*((k+1)/(2|^j1)))
        ==uDyadic.((i1*d) +(i*((k+1)/(2|^j1))))
        by SURREALR:10,43,Th27,Th39;
        then (uDyadic.i1)*y + x*uDyadic.((k+1)/(2|^j1)) ==
        uDyadic.((i1*d) +(i*((k+1)/(2|^j1)))) by SURREALO:4;
        then (uDyadic.i1)*y + x*uDyadic.((k+1)/(2|^j1)) + -
        (uDyadic.i1)*(uDyadic.((k+1)/(2|^j1))) ==
        uDyadic.((i1*d) +(i*((k+1)/(2|^j1)))) + uDyadic.-(i1*((k+1)/(2|^j1)))==
        uDyadic.((i1*d) +(i*((k+1)/(2|^j1)))+ -(i1*((k+1)/(2|^j1))))
        by A26,SURREALR:43,Th39;
        then (uDyadic.i1)*y + x*uDyadic.((k+1)/(2|^j1)) + -
        (uDyadic.i1)*(uDyadic.((k+1)/(2|^j1))) ==
        uDyadic.((i*(2*k+1)-1 +2)/M) by A25,SURREALO:4;
        then
A27:    {(uDyadic.i1)*y + x*uDyadic.((k+1)/(2|^j1)) + -
        (uDyadic.i1)*(uDyadic.((k+1)/(2|^j1)))} <==>
        {uDyadic.((i*(2*k+1) -1+2)/M)} by SURREALO:32;
A28:    comp(L_x,x,y,R_y)
        = { (uDyadic.i1)*y + x*uDyadic.((k+1)/(2|^j1)) -
        (uDyadic.i1)*(uDyadic.((k+1)/(2|^j1)))} by SURREALR:52,A11,A12;
        reconsider DD = [{uDyadic.((i*(2*k+1) -1)/M)},
        {uDyadic.((i*(2*k+1) -1+2)/M)}] as Surreal by Th38;
        x * y = [comp(L_x,x,y,L_y) \/ comp(R_x,x,y,R_y),
        comp(L_x,x,y,R_y) \/ comp(R_x,x,y,L_y)] by SURREALR:50
        .= [comp(L_x,x,y,L_y),comp(L_x,x,y,R_y)] by A13;
        then
A29:    x*y == DD == uDyadic.((i*(2*k+1)-1+1)/M)
        by A22,A28,A21,A27,SURREALO:29,Th38;
        (i*(2*k+1)-1+1)/M = i * d by A10,XCMPLX_1:74;
        hence thesis by A29,SURREALO:4;
      end;
    end;
  end;
A30:P[m] from NAT_1:sch 2(A2,A4);
  consider n be Nat such that
A31:i =n or i =-n by INT_1:2;
  per cases by A31;
  suppose
A32:i=n;
    consider j be Integer, m be Nat such that
A33:d = j / (2|^m) by Th18;
A34: d in DYADIC(m) by A33,Def4;
    P[n+m] by A30;
    hence thesis by A34,A32;
  end;
  suppose
A35:i=-n;
    consider j be Integer, m be Nat such that
A36: -d = j / (2|^m) by Th18;
A37: -d in DYADIC(m) by A36,Def4;
    P[n+m] by A30;
    then
A38: uDyadic.n * uDyadic.-d == uDyadic.(n*(-d))
    = uDyadic.(i*d) by A35,A37;
    uDyadic.i = - uDyadic.n & - uDyadic.-d = uDyadic.- -d by A35,Th27;
    hence thesis by A38,SURREALR:58;
  end;
end;

theorem Th40:
  uDyadic.d1 * uDyadic.d2 == uDyadic.(d1*d2)
proof
  defpred P[Nat] means for n1,n2 be Nat st n1+n2 <= $1 & n1 <= n2
  for d1,d2 st d1 in DYADIC(n1) & d2 in DYADIC(n2)
  holds uDyadic.d1 * uDyadic.d2 == uDyadic.(d1*d2);
A1: P[0]
  proof
    let n1,n2 be Nat such that
A2: n1+n2 <= 0 & n1 <= n2;
A3: n1=0 = n2 by A2;
    let d1,d2 such that
A4: d1 in DYADIC(n1) & d2 in DYADIC(n2);
    reconsider i1=d1,i2=d2 as Integer by A4,A3,Th21;
    uDyadic.d1 = uInt.i1 & uDyadic.d2 = uInt.i2 &
    uDyadic.(d1*d2) = uInt.(i1*i2) by Def5;
    hence thesis by Th15;
  end;
A5: P[m] implies P[m+1]
  proof
    assume
A6: P[m];
    set m1=m+1;
    let n1,n2 be Nat such that
A7: n1+n2 <= m1 & n1 <= n2;
    let d1,d2 such that
A8: d1 in DYADIC(n1) & d2 in DYADIC(n2);
    per cases;
    suppose n1=0;
      then reconsider i1=d1 as Integer by A8,Th21;
      uDyadic.i1 * uDyadic.d2 == uDyadic.(i1*d2) by Lm9;
      hence thesis;
    end;
    suppose
A9:   n1 <>0;
      then reconsider N1=n1-1 as Nat by NAT_1:20;
A10:  N1+n2+1 <= m1 by A7;
      then
A11:  N1+n2 <= m by XREAL_1:6;
      n2 <>0 by A7,A9;
      then reconsider N2=n2-1 as Nat by NAT_1:20;
A12:  N1+n2 = n1+N2;
      N1+N2+1<= m by A10,XREAL_1:6;
      then
A13:  N1+N2 < m by NAT_1:13;
      N1+1 <= n2 by A7;
      then N1 < n2=N2+1 by NAT_1:13;
      then
A14:  N1 <= N2 by NAT_1:13;
A15:  (N1 <= n2 or n2 <= N1) & (n1 <= N2 or N2 <= n1);
      per cases;
      suppose d1 in DYADIC(N1) or  d2 in DYADIC(N2);
        hence thesis by A12,A11,A8,A6,A15;
      end;
      suppose
A16:    not d1 in DYADIC(N1) & not d2 in DYADIC(N2);
        then d1 in DYADIC(N1+1)\DYADIC(N1) by A8,XBOOLE_0:def 5;
        then consider i1 be Integer such that
A17:    d1 = (2*i1+1) / 2|^(N1+1) by Th20;
        d2 in DYADIC(N2+1)\DYADIC(N2) by A8,A16,XBOOLE_0:def 5;
        then consider i2 be Integer such that
A18:    d2 = (2*i2+1) / 2|^(N2+1) by Th20;
A19:    uDyadic.d1 =
        [{uDyadic.(i1/(2|^N1))},{uDyadic.((i1+1)/(2|^N1))}] by A17,Def5;
A20:    uDyadic.d2 =
        [{uDyadic.(i2/(2|^N2))},{uDyadic.((i2+1)/(2|^N2))}] by A18,Def5;
        set x = uDyadic.d1,y=uDyadic.d2;
A21:    i1/(2|^N1) in DYADIC(N1) & (i1+1)/(2|^N1) in DYADIC(N1) &
        i2/(2|^N2) in DYADIC(N2) & (i2+1)/(2|^N2) in DYADIC(N2) by Def4;
A22:    uDyadic.(i1/(2|^N1)) * y == uDyadic.(i1/(2|^N1)*d2)
        by A21,A11,A8,A6,A15;
A23:    x * uDyadic.(i2/(2|^N2)) == uDyadic.(d1 *(i2/(2|^N2)))
        by A21,A12,A11,A8,A6,A15;
A24:    uDyadic.((i1+1)/(2|^N1)) * y == uDyadic.((i1+1)/(2|^N1) * d2)
        by A21,A11,A8,A6,A15;
A25:    x * uDyadic.((i2+1)/(2|^N2)) == uDyadic.(d1 *((i2+1)/(2|^N2)))
        by A21,A12,A11,A8,A6,A15;
A26:    2|^(N1+1) = 2*2|^N1 & 2|^(N2+1) = 2*2|^N2 by NEWTON:6;
        set M= 2|^(N1+N2+1);
A27:    M = (2|^(N1 +N2))*2 by NEWTON:6
        .= (2|^N1)*(2|^N2) * 2 by NEWTON:8;
A28:    (i1/(2|^N1))*d2 = (i1*(2*i2+1)) / ((2|^N1) *2|^(N2+1))
        by XCMPLX_1:76,A18
        .= (2*i1*i2+i1)/M by A27,A26;
A29:    d1 *(i2/(2|^N2)) = ((2*i1+1)*i2)/ (2|^(N1+1) *(2|^N2))
        by XCMPLX_1:76,A17
        .= (2*i1*i2+i2)/ M by A27,A26;
A30:    (i1/(2|^N1)) *(i2/(2|^N2)) = (i1*i2)/ ((2|^N1)*(2|^N2))
        by XCMPLX_1:76
        .= (i1*i2*2) / M by A27,XCMPLX_1:91;
A31:    ((i1+1)/(2|^N1))*d2 = ((i1+1)*(2*i2+1)) / ((2|^N1) *2|^(N2+1))
        by XCMPLX_1:76,A18
        .= (2*i1*i2+i1+2*i2+1)/M by A27,A26;
A32:    d1 *((i2+1)/(2|^N2)) = ((2*i1+1)*(i2+1))/ (2|^(N1+1) *(2|^N2))
        by XCMPLX_1:76,A17
        .= (2*i1*i2+i2+2*i1+1)/ M by A27,A26;
A33:    ((i1+1)/(2|^N1))*((i2+1)/(2|^N2))=((i1+1)*(i2+1))/((2|^N1)*(2|^N2))
        by XCMPLX_1:76
        .= ((i1*i2 +i1+i2+1)*2) / M by A27,XCMPLX_1:91;
A34:    (i1/(2|^N1)) *((i2+1)/(2|^N2)) = (i1*(i2+1))/ ((2|^N1)*(2|^N2))
        by XCMPLX_1:76
        .= ((i1*i2 +i1)*2) / M by A27,XCMPLX_1:91;
A35:    ((i1+1)/(2|^N1)) *(i2/(2|^N2)) = ((i1+1)*i2)/ ((2|^N1)*(2|^N2))
        by XCMPLX_1:76
        .= ((i1*i2 +i2)*2) / M by A27,XCMPLX_1:91;
A36:    (i1/(2|^N1))*d2 + d1 *(i2/(2|^N2))+ -((i1/(2|^N1)) *(i2/(2|^N2)))
        = ((2*i1*i2+i1)+(2*i1*i2+i2))/M + - (i1*i2*2) / M
        by A28,A29,A30,XCMPLX_1:62
        .= ((2*i1*i2+i1)+(2*i1*i2+i2))/M - (i1*i2*2) / M
        .= ((2*i1*i2+i1)+(2*i1*i2+i2) - (i1*i2*2)) / M by XCMPLX_1:120
        .= ( 2*i1*i2+(i1+i2)) / M;
A37:    ((i1+1)/(2|^N1))*d2 + d1 *((i2+1)/(2|^N2))+
        -(((i1+1)/(2|^N1)) *((i2+1)/(2|^N2)))
        = ((2*i1*i2+i1+2*i2+1)+(2*i1*i2+i2+2*i1+1))/M
        + - ((i1*i2 +i1+i2+1)*2) / M by A31,A32,A33,XCMPLX_1:62
        .= (4*i1*i2+3*i1+3*i2+2)/M - ((i1*i2 +i1+i2+1)*2) / M
        .= ((4*i1*i2+3*i1+3*i2+2) - ((i1*i2 +i1+i2+1)*2)) / M
        by XCMPLX_1:120
        .= (2*i1*i2+i1+i2) / M;
A38:    (i1/(2|^N1))*d2 + d1 *((i2+1)/(2|^N2))+
        -((i1/(2|^N1)) *((i2+1)/(2|^N2)))
        = ((2*i1*i2+i1)+(2*i1*i2+i2+2*i1+1))/M
        + - ((i1*i2 +i1)*2) / M by A34,A28,A32,XCMPLX_1:62
        .= (4*i1*i2+3*i1+i2+1)/M - ((i1*i2 +i1)*2) / M
        .= ((4*i1*i2+3*i1+i2+1) - ((i1*i2 +i1)*2)) / M
        by XCMPLX_1:120
        .= (2*i1*i2+i1+i2+1) / M;
A39:    ((i1+1)/(2|^N1))*d2 + d1 *(i2/(2|^N2))+
        -(((i1+1)/(2|^N1)) *(i2/(2|^N2)))
        = ((2*i1*i2+i1+2*i2+1)+(2*i1*i2+i2))/M
        + - ((i1*i2 +i2)*2) / M by A35,A29,A31,XCMPLX_1:62
        .= (4*i1*i2+i1+3*i2+1)/M - ((i1*i2 +i2)*2) / M
        .= ((4*i1*i2+i1+3*i2+1) - ((i1*i2 +i2)*2)) / M
        by XCMPLX_1:120
        .= (2*i1*i2+i1+i2+1) / M;
        uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2) + uDyadic.(d1 *(i2/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2 + d1 *(i2/(2|^N2)))
        by SURREALR:43,Th39,A22,A23;
        then
A40:    uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))==
        uDyadic.(i1/(2|^N1)*d2 + d1 *(i2/(2|^N2))) by SURREALO:4;
        - (uDyadic.(i1/(2|^N1))) * (uDyadic.(i2/(2|^N2))) ==
        - uDyadic.((i1/(2|^N1)) * (i2/(2|^N2)))
        = uDyadic. -((i1/(2|^N1)) * (i2/(2|^N2)))
        by A14,A13,A21,A6,SURREALR:65,Th27;
        then uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))+ -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.(i2/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2 + d1 *(i2/(2|^N2))) +
        uDyadic. -((i1/(2|^N1)) *(i2/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2 + d1 *(i2/(2|^N2))+
        -((i1/(2|^N1)) *(i2/(2|^N2)))) by A40,SURREALR:43,Th39;
        then
A41:    uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))+ -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.(i2/(2|^N2)))
        == uDyadic.(( 2*i1*i2+(i1+i2)) / M) by SURREALO:4,A36;
        then
A42:    {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))+ -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.(i2/(2|^N2)))}
        <==> {uDyadic.(( 2*i1*i2+(i1+i2)) / M)} by SURREALO:32;
A43:    comp(L_x,x,y,L_y)
        = {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2))) -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.(i2/(2|^N2)))}
        by A19,A20,SURREALR:52;
        uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2) + uDyadic.(d1 *((i2+1)/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2 + d1 *((i2+1)/(2|^N2)))
        by SURREALR:43,Th39,A24,A25;
        then
A44:    uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))==
        uDyadic.((i1+1)/(2|^N1)*d2 + d1 *((i2+1)/(2|^N2))) by SURREALO:4;
        - (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2))) ==
        - uDyadic.(((i1+1)/(2|^N1)) * ((i2+1)/(2|^N2)))
        = uDyadic. -(((i1+1)/(2|^N1)) * ((i2+1)/(2|^N2)))
        by A14,A13,A21,A6,SURREALR:65,Th27;
        then uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))+ -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2 + d1 *((i2+1)/(2|^N2))) +
        uDyadic. -(((i1+1)/(2|^N1)) *((i2+1)/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2 +
        d1 *((i2+1)/(2|^N2))+ -(((i1+1)/(2|^N1)) *((i2+1)/(2|^N2))))
        by A44,SURREALR:43,Th39;
        then
A45:    uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))+ -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))
        == uDyadic.((2*i1*i2+i1+i2) / M) by SURREALO:4,A37;
A46:    comp(R_x,x,y,R_y)
        = {uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2))) -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))}
        by A19,A20,SURREALR:52;
        uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2) + uDyadic.(d1 *((i2+1)/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2 + d1 *((i2+1)/(2|^N2)))
        by SURREALR:43,Th39,A22,A25;
        then
A47:    uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))==
        uDyadic.(i1/(2|^N1)*d2 + d1 *((i2+1)/(2|^N2))) by SURREALO:4;
        - (uDyadic.(i1/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2))) ==
        - uDyadic.((i1/(2|^N1)) *((i2+1)/(2|^N2)))
        = uDyadic. -((i1/(2|^N1)) *((i2+1)/(2|^N2)))
        by A14,A13,A21,A6,SURREALR:65,Th27;
        then
        uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))+ -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2 + d1 *((i2+1)/(2|^N2))) +
        uDyadic. -((i1/(2|^N1)) *((i2+1)/(2|^N2)))
        == uDyadic.(i1/(2|^N1)*d2 +
        d1 *((i2+1)/(2|^N2))+ -((i1/(2|^N1)) *((i2+1)/(2|^N2))))
        by A47,SURREALR:43,Th39;
        then
A48:    uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))+ -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))
        == uDyadic.((2*i1*i2+i1+i2+1) / M)
        by SURREALO:4,A38;
        then
A49:    {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2)))+ -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))}
        <==> {uDyadic.((2*i1*i2+i1+i2+1)/ M)} by SURREALO:32;
A50:    comp(L_x,x,y,R_y)
        = {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2))) -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))}
        by SURREALR:52,A19,A20;
        uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2) + uDyadic.(d1 *(i2/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2 + d1 *(i2/(2|^N2)))
        by SURREALR:43,Th39,A23,A24;
        then
A51:    uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))==
        uDyadic.((i1+1)/(2|^N1)*d2 + d1 *(i2/(2|^N2))) by SURREALO:4;
        - (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.(i2/(2|^N2))) ==
        - uDyadic.(((i1+1)/(2|^N1)) *(i2/(2|^N2)))
        = uDyadic. -(((i1+1)/(2|^N1)) *(i2/(2|^N2)))
        by A14,A13,A21,A6,SURREALR:65,Th27;
        then
        uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))+ -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.(i2/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2 + d1 *(i2/(2|^N2))) +
        uDyadic. -(((i1+1)/(2|^N1)) *(i2/(2|^N2)))
        == uDyadic.((i1+1)/(2|^N1)*d2 +
        d1 *(i2/(2|^N2))+ -(((i1+1)/(2|^N1)) *(i2/(2|^N2))))
        by A51,SURREALR:43,Th39;
        then
A52:    uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2)))+ -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.(i2/(2|^N2)))
        == uDyadic.((2*i1*i2+i1+i2+1) / M) by SURREALO:4,A39;
A53:    comp(R_x,x,y,L_y)
        = {uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2))) -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.(i2/(2|^N2)))}
        by SURREALR:52,A19,A20;
A54:    x * y = [comp(L_x,x,y,L_y) \/ comp(R_x,x,y,R_y),
        comp(L_x,x,y,R_y) \/ comp(R_x,x,y,L_y)] by SURREALR:50
        .=[ {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2))) + -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.(i2/(2|^N2))),
        uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2))) + -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))},
        comp(L_x,x,y,R_y) \/ comp(R_x,x,y,L_y)] by A43,A46,ENUMSET1:1;
        then reconsider DD1 =[
        {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2))) + -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.(i2/(2|^N2)))},
        comp(L_x,x,y,R_y) \/ comp(R_x,x,y,L_y)] as Surreal by SURREALO:26;
A55:    x * y == DD1 by A54,SURREALO:4,25,A41,A45;
        then reconsider DD2=[{uDyadic.((2*i1*i2+i1+i2)/ M)},
        comp(L_x,x,y,R_y) \/ comp(R_x,x,y,L_y)] as Surreal
        by A42,SURREALI:37,TARSKI:1;
A56:    DD1==DD2 by A42,SURREALO:29;
A57:    DD2 = [{uDyadic.((2*i1*i2+i1+i2)/ M)},
        {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2))) + -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2))),
        uDyadic.((i1+1)/(2|^N1))*y + x*(uDyadic.(i2/(2|^N2))) + -
        (uDyadic.((i1+1)/(2|^N1))) * (uDyadic.(i2/(2|^N2)))}]
        by A50,A53,ENUMSET1:1;
        then reconsider DD3 = [{uDyadic.((2*i1*i2+i1+i2)/ M)},
        {uDyadic.(i1/(2|^N1))*y + x*(uDyadic.((i2+1)/(2|^N2))) + -
        (uDyadic.(i1/(2|^N1))) * (uDyadic.((i2+1)/(2|^N2)))}] as Surreal
        by SURREALO:28;
A58:    DD2 == DD3 by A57,SURREALO:4,27,A48,A52;
        then reconsider DD4=[{uDyadic.((2*i1*i2+i1+i2)/ M)},
        {uDyadic.((2*i1*i2+i1+i2+1)/ M)}] as Surreal
        by A49,SURREALI:37,TARSKI:1;
        x * y == DD2 by A55,A56,SURREALO:4;
        then
A59:    x*y==DD3 by A58,SURREALO:4;
        DD3==DD4 by A49,SURREALO:29;
        then
A60:    x*y == DD4 by A59,SURREALO:4;
A61:    2*M = 2|^(N1+N2+1+1) by NEWTON:6;
A62:    (2*i1*i2+i1+i2)/ M = ((2*i1*i2+i1+i2)*2)/ (2*M) by XCMPLX_1:91;
        (2*i1*i2+i1+i2+1)/ M = ((2*i1*i2+i1+i2+1)*2)/ (2*M) by XCMPLX_1:91
        .= ((2*i1*i2+i1+i2)*2+2)/ (2*M);
        then
A63:    DD4 == uDyadic.(((2*i1*i2+i1+i2)*2+1)/ (2|^(N1+N2+1+1)))
        by A61,A62,Th38;
A64:    2|^(N1+N2+1+1) = 2|^((N1+1)+(N2+1))
        .= (2|^(N1+1))*(2|^(N2+1)) by NEWTON:8;
        (2*i1*i2+i1+i2)*2+1 = (2*i1+1)*(2*i2+1);
        then ((2*i1*i2+i1+i2)*2+1)/ (2|^(N1+N2+1+1)) = d1 * d2
        by A17,A18,A64,XCMPLX_1:76;
        hence thesis by A60,A63,SURREALO:4;
      end;
    end;
  end;
A65: P[m] from NAT_1:sch 2(A1,A5);
  consider i1 be Integer, n1 be Nat such that
A66: d1 = i1 / (2|^n1) by Th18;
  consider i2 be Integer, n2 be Nat such that
A67: d2 = i2 / (2|^n2) by Th18;
A68: d2 in DYADIC(n2) c= DYADIC(n1+n2) by A67,Def4,Th19,NAT_1:11;
A69: d1 in DYADIC(n1) by A66,Def4;
A70: n1 <= n1+n2 by NAT_1:11;
  P[n1+(n1+n2)] by A65;
  hence thesis by A68,A69,A70;
end;

begin :: Mappings between Real Numbers and Surreal Real Numbers

reserve r,r1,r2 for Real;

definition
  func sReal -> ManySortedSet of REAL means :Def6:
      it.r = [the set of all uDyadic.( [/ r*(2|^n)-1 \] / (2|^n) ),
              the set of all uDyadic.( [\ r*(2|^m)+1 /] / (2|^m) )];
  existence
  proof
    deffunc r(Element of REAL)
    =[the set of all uDyadic.( [/ $1*(2|^n)-1\] / (2|^n) ),
    (the set of all uDyadic.( [\ $1*(2|^m) +1 /] / (2|^m) ))];
    consider R be Function such that
A1: dom R = REAL and
A2: for x be Element of REAL holds R.x = r(x) from FUNCT_1:sch 4;
    reconsider R as ManySortedSet of REAL by PARTFUN1:def 2,A1,RELAT_1:def 18;
    take R;
    let r;
    r in REAL by XREAL_0:def 1;
    hence thesis by A2;
  end;
  uniqueness
  proof
    deffunc r(Real)
    =[the set of all uDyadic.( [/ $1*(2|^n)-1\] / (2|^n) ),
    (the set of all uDyadic.( [\ $1*(2|^m) +1 /] / (2|^m) ))];
    let M1,M2 be ManySortedSet of REAL such that
A3: M1.r = r(r) and
A4: M2.r = r(r);
A5: dom M1 = REAL = dom M2 by PARTFUN1:def 2;
    o in REAL implies M1.o = M2.o
    proof
      assume o in REAL;
      then reconsider r=o as Real;
      M1.o = r(r) by A3;
      hence thesis by A4;
    end;
    hence thesis by A5,FUNCT_1:2;
  end;
end;

theorem Th41: :::
  [/ r*(2|^n)-1\] / (2|^n) < r < [\ r*(2|^n)+1/] / (2|^n)
proof
  [/ r*(2|^n)-1\] < r*(2|^n)-1+1 by INT_1:def 7;
  then
A1:[/ r*(2|^n)-1\]/(2|^n) < (r*(2|^n))/(2|^n) by XREAL_1:74;
  r*(2|^n)+1 -1 < [\ r*(2|^n)+1/] by INT_1:def 6;
  then (r*(2|^n))/(2|^n) < [\ r*(2|^n)+1/] /(2|^n)
  by XREAL_1:74;
  hence thesis by A1,XCMPLX_1:89;
end;

Lm10: sReal.r in Day omega
proof
  set X1 =the set of all uDyadic.( [/ r*(2|^n)-1\] / (2|^n) );
  set X2 =the set of all uDyadic.( [\ r*(2|^n)+1/] / (2|^n) );
A1: for o st o in X1 \/ X2 ex O st O in NAT & o in Day O
  proof
    let o;
    assume o in X1 \/ X2;
    then o in X1 or o in X2 by XBOOLE_0:def 3;
    then consider n such that
A2: o = uDyadic.( [/ r*(2|^n)-1\] / (2|^n) ) or
    o=uDyadic.( [\ r*(2|^n)+1/] / (2|^n) );
    reconsider o as Surreal by A2;
    take born o;
    born o is finite by Th37,A2;
    hence thesis by SURREAL0:def 18,ORDINAL1:def 12;
  end;
  X1 << X2
  proof
    let L,R be Surreal such that
A3: L in X1 & R in X2;
    consider n such that
A4: L = uDyadic.([/ r*(2|^n)-1\] / (2|^n)) by A3;
    consider m such that
A5: R = uDyadic.([\ r*(2|^m)+1/] / (2|^m)) by A3;
    [/ r*(2|^n)-1\] / (2|^n) < r < [\ r*(2|^m)+1/] / (2|^m) by Th41;
    then [/ r*(2|^n)-1\] / (2|^n) < [\ r*(2|^m)+1/] / (2|^m) by XXREAL_0:2;
    hence thesis by A4,A5,Th24;
  end;
  then [X1,X2] in Day omega by A1,SURREAL0:46;
  hence thesis by Def6;
end;

registration
  let r;
  cluster sReal.r -> surreal;
  coherence by Lm10;
end;

definition
   func uReal -> ManySortedSet of REAL means :Def7:
     it.r = Unique_No sReal.r;
  existence
  proof
    deffunc r(Element of REAL) = Unique_No sReal.$1;
    consider R be Function such that
A1: dom R = REAL and
A2: for x be Element of REAL holds R.x = r(x) from FUNCT_1:sch 4;
    reconsider R as ManySortedSet of REAL by PARTFUN1:def 2,A1,RELAT_1:def 18;
    take R;
    let r;
    r in REAL by XREAL_0:def 1;
    hence thesis by A2;
  end;
  uniqueness
  proof
    deffunc r(Real) = Unique_No sReal.$1;
    let M1,M2 be ManySortedSet of REAL such that
A3: M1.r = r(r) and
A4: M2.r = r(r);
A5: dom M1 = REAL = dom M2 by PARTFUN1:def 2;
    o in REAL implies M1.o = M2.o
    proof
      assume o in REAL;
      then reconsider r=o as Real;
      M1.o = r(r) by A3;
      hence thesis by A4;
    end;
    hence thesis by A5,FUNCT_1:2;
  end;
end;

registration
  let r;
  cluster uReal.r -> surreal;
  coherence
  proof
    uReal.r = Unique_No sReal.r by Def7;
    hence thesis;
  end;
end;

registration
  let r;
  cluster uReal.r -> uniq-surreal;
  coherence
  proof
    uReal.r = Unique_No sReal.r by Def7;
    hence thesis;
  end;
end;

theorem Th42:
  x in L_(sReal.r) iff ex n st x = uDyadic.([/ r*(2|^n)-1\] / (2|^n))
proof
  sReal.r = [(the set of all uDyadic.( [/ r*(2|^k)-1 \] / (2|^k))
  where k is Nat),the set of all uDyadic.( [\ r*(2|^m)+1 /] / (2|^m) )]
  by Def6;
  hence thesis;
end;

theorem Th43:
  x in R_(sReal.r) iff ex n st x = uDyadic.([\ r*(2|^n)+1/] / (2|^n))
proof
  sReal.r = [(the set of all uDyadic.( [/ r*(2|^k)-1 \] / (2|^k))
  where k is Nat),
  the set of all uDyadic.( [\ r*(2|^m)+1 /] / (2|^m) )] by Def6;
  hence thesis;
end;

theorem Th44:
  uDyadic.([/ r*(2|^n)-1\] / (2|^n))
    < sReal.r <
      uDyadic.([\ r*(2|^n)+1/] / (2|^n))
proof
  set R=sReal.r;
  L_R << {R} << R_R & R in {R} by SURREALO:11,TARSKI:def 1;
  hence thesis by Th42,Th43;
end;

theorem Th45: :::
  for i1,i2 be Integer, n1,n2 be Nat st i1/(2|^n1) < i2/(2|^n2)
    holds
       i1/(2|^n1) < (i1*(2|^n2)*2+1)/(2|^(n1+n2+1))
         <= (i2*(2|^n1)*2-1)/(2|^(n1+n2+1)) < i2/(2|^n2)
proof
  let i1,i2 be Integer, n1,n2 be Nat;
  assume i1/(2|^n1) < i2/(2|^n2);
  then i1*(2|^n2)+1 <= i2*(2|^n1) by INT_1:7,XREAL_1:102;
  then
A1: (i1*(2|^n2)+1)*2 <= i2*(2|^n1)*2 by XREAL_1:64;
  2|^(n1+n2+1) = 2|^(n1+(n2+1))
  .= (2|^n1)*(2|^(n2+1)) by NEWTON:8
  .= (2|^n1)*(2*2|^n2) by NEWTON:6;
  then
  (i1*(2|^n2)*2)/(2|^(n1+n2+1)) = (i1 * ((2|^n2)*2)) / ((2|^n1)*(2*2|^n2))
  .= i1 /(2|^n1) by XCMPLX_1:91;
  hence i1 /(2|^n1) < (i1*(2|^n2)*2+1)/(2|^(n1+n2+1))
  by XREAL_1:29,XREAL_1:74;
  i1*(2|^n2)*2+1 +1 <= i2*(2|^n1)*2 by A1;
  then i1*(2|^n2)*2+1 <= i2*(2|^n1)*2-1 by XREAL_1:19;
  hence (i1*(2|^n2)*2+1)/(2|^(n1+n2+1)) <= (i2*(2|^n1)*2-1)/(2|^(n1+n2+1))
  by XREAL_1:72;
A2: i2*(2|^n1)*2-1 < i2*(2|^n1)*2-1+1 by XREAL_1:29;
  2|^(n1+n2+1) = 2|^(n2+(n1+1))
  .= (2|^n2)*(2|^(n1+1)) by NEWTON:8
  .= (2|^n2)*(2*2|^n1) by NEWTON:6;
  then (i2*(2|^n1)*2)/(2|^(n1+n2+1)) = (i2*((2|^n1)*2))/((2|^n2)*(2*2|^n1))
  .= i2/(2|^n2) by XCMPLX_1:91;
  hence thesis by A2,XREAL_1:74;
end;

theorem Th46:
  sReal.d == uDyadic.d = uReal.d
proof
  set Rd=sReal.d,Dd=uDyadic.d;
  consider i be Integer, k be Nat such that
A1: d = i / (2|^k) by Th18;
A2: L_Rd << {Dd} << R_Rd
  proof
    thus L_Rd << {Dd}
    proof
      let l,r be Surreal such that
A3:   l in L_Rd & r in {Dd};
      consider n such that
A4:   l = uDyadic.([/ d*(2|^n)-1 \] / (2|^n)) by A3,Th42;
      l < Dd by Th41,A4,Th24;
      hence thesis by A3,TARSKI:def 1;
    end;
    let l,r be Surreal such that
A5: l in {Dd} & r in R_Rd;
    consider n such that
A6: r = uDyadic.([\ d*(2|^n)+1 /] / (2|^n)) by A5,Th43;
    Dd < r by Th41,A6,Th24;
    hence thesis by A5,TARSKI:def 1;
  end;
  for z st L_Rd << {z} << R_Rd holds born Dd c= born z
  proof
    born Dd is finite by Th37;
    then
    reconsider B=born Dd as Nat;
    let z such that
A7: L_Rd << {z} << R_Rd;
    assume
A8: not born Dd c= born z;
    then born z in Segm B by ORDINAL1:16;
    then reconsider Z=born z as Nat;
    z in Day Z by SURREAL0:def 18;
    then consider f be Dyadic such that
A9: z == uDyadic.f & uDyadic.f in Day Z by Th35;
    consider j be Integer, m be Nat such that
A10:f = j / (2|^m) by Th18;
    set F = uDyadic.f;
A11:L_Rd << {F} & F in {F} & {F} << R_Rd by A7,A9,SURREALO:17,18,TARSKI:def 1;
    m+k+1 = k+(m+1);
    then 2|^(m+k+1) = (2|^k)*(2|^(m+1)) by NEWTON:8
    .= (2|^k)*(2*2|^m)by NEWTON:6;
    then
A12: d*(2|^(m+k+1)) = d*(2|^k)*(2*2|^m)
    .= i *(2*2|^m) by A1,XCMPLX_1:87;
    per cases by XXREAL_0:1;
    suppose f < d;
      then f < (j*(2|^k)*2+1)/(2|^(m+k+1))
      <=(i*(2|^m)*2-1)/(2|^(m+k+1)) by Th45,A10,A1;
      then
A13:  f < (i*(2|^m)*2-1)/(2|^(m+k+1)) by XXREAL_0:2;
      [/ d*(2|^(m+k+1))-1 \] = i *(2*2|^m)-1 by A12;
      then uDyadic.((i*(2|^m)*2-1)/(2|^(m+k+1))) <= F by A11,Th42;
      hence thesis by A13,Th24;
    end;
    suppose d < f;
      then (i*(2|^m)*2+1)/(2|^(m+k+1))
      <=(j*(2|^k)*2-1)/(2|^(m+k+1)) < f by Th45,A10,A1;
      then
A14:  (i*(2|^m)*2+1)/(2|^(m+k+1))< f by XXREAL_0:2;
      [\ d*(2|^(m+k+1))+1 /] = i *(2*2|^m)+1 by A12;
      then F<= uDyadic.((i*(2|^m)*2+1)/(2|^(m+k+1))) by A11,Th43;
      hence thesis by A14,Th24;
    end;
    suppose d = f;
      hence thesis by A9,SURREAL0:def 18,A8;
    end;
  end;
  hence
A15:sReal.d == uDyadic.d by A2,SURREALO:16;
  uReal.d = Unique_No sReal.d by Def7;
  then sReal.d == uReal.d by SURREALO:def 10;
  then uReal.d == uDyadic.d by A15,SURREALO:4;
  hence thesis by SURREALO:50;
end;

theorem Th47:
  uReal.0 = 0_No
proof
  thus uReal.0 = uDyadic.0 by Th46
  .= uInt.0 by Def5
  .=0_No by Def1;
end;

theorem Th48:
  uReal.1 = 1_No
proof
  thus uReal.1 = uDyadic.1 by Th46
  .=1_No by Th11,Def5;
end;

theorem Th49:
  born (sReal.r) c= omega
proof
  sReal.r in Day omega by Lm10;
  hence thesis by SURREAL0:def 18;
end;

theorem Th50:
  sReal.r1 < sReal.r2 iff r1 < r2
proof
  set R1 = sReal.r1, R2 = sReal.r2;
A1:L_R1 << {R1} <<R_R1 & R1 in {R1} &
  L_R2 << {R2} << R_R2 & R2 in {R2} by SURREALO:11,TARSKI:def 1;
  thus R1 < R2 implies r1 < r2
  proof
    assume
A2: R1 < R2;
    then
A3: r1 <> r2 by SURREALO:3;
    assume not r1 < r2;
    then r2 < r1 by A3,XXREAL_0:1;
    then 0< r1-r2 by XREAL_1:50;
    then consider k be Nat such that
A4: 1/ (2|^k) <= r1-r2 by PREPOWER:92;
    set K2 = 2|^(k+1);
    K2  = 2* (2|^k) by NEWTON:6;
    then
A5: K2*(1/ (2|^k)) = 2* ((2|^k)*(1/ (2|^k)))
    .= 2*1 by XCMPLX_1:106;
A6: K2*(r2 + 1/ (2|^k)) <= r1*K2 by A4,XREAL_1:19,XREAL_1:64;
A7: uDyadic.([/r1*K2 -1\] / K2) <= R1 by A1, Th42;
    R2 <= uDyadic.([\r2*K2 +1/] / K2) by A1,Th43;
    then R1 < uDyadic.([\r2*K2 +1/] / K2) by A2,SURREALO:4;
    then uDyadic.([/r1*K2 -1\] / K2) < uDyadic.([\r2*K2 +1/] / K2)
    by A7,SURREALO:4;
    then r1*K2 -1 <= [/r1*K2 -1\] < [\r2*K2 +1/]
    by Th24,XREAL_1:72,INT_1:def 7;
    then r1*K2 -1 < [\r2*K2 +1/] <= r2*K2 +1 by XXREAL_0:2,INT_1:def 6;
    then r1*K2 -1 < r2*K2 +1 by XXREAL_0:2;
    then r1*K2 -1+1 < r2*K2 +1+1 =r2*K2 +2 by XREAL_1:6;
    hence thesis by A6,A5;
  end;
  assume r1 < r2;
  then 0< r2-r1 by XREAL_1:50;
  then consider k be Nat such that
A8:  1/ (2|^k) <= r2-r1 by PREPOWER:92;
  set K2 = 2|^(k+1);
  K2  = 2* (2|^k) by NEWTON:6;
  then
A9: K2*(1/ (2|^k)) = 2* ((2|^k)*(1/ (2|^k)))
  .= 2*1 by XCMPLX_1:106;
  K2*(r1 + 1/ (2|^k)) <= r2*K2 by A8,XREAL_1:19,XREAL_1:64;
  then K2*r1 +2-1 <= r2*K2-1 by A9,XREAL_1:9;
  then [\ (K2*r1 +1) /] <= (K2*r1 +1) <= (r2*K2-1) by INT_1:def 6;
  then [\ (K2*r1 +1)/] <= (r2*K2-1) <= [/(r2*K2-1)\]
  by XXREAL_0:2, INT_1:def 7;
  then [\ (K2*r1 +1) /] <= [/(r2*K2-1)\] by XXREAL_0:2;
  then
A10:uDyadic.([\K2*r1 +1/]/K2) <= uDyadic.([/r2*K2-1\]/K2)
  by XREAL_1:72,Th24;
  R1 < uDyadic.([\K2*r1 +1/]/K2) by A1,Th43;
  then
A11: R1 < uDyadic.([/r2*K2-1\]/K2) by A10,SURREALO:4;
  uDyadic.([/r2*K2-1\]/K2) <= R2 by A1,Th42;
  hence R1 < R2 by A11,SURREALO:4;
end;

theorem Th51:
  uReal.r1 < uReal.r2 iff r1 < r2
proof
  uReal.r1 = Unique_No sReal.r1 & uReal.r2 = Unique_No sReal.r2 by Def7;
  then
A1:uReal.r1 == sReal.r1 & uReal.r2 == sReal.r2 by SURREALO:def 10;
  thus uReal.r1 < uReal.r2 implies r1 < r2
  proof
    assume uReal.r1 < uReal.r2;
    then uReal.r1 < sReal.r2 by A1,SURREALO:4;
    then sReal.r1 < sReal.r2 by A1,SURREALO:4;
    hence thesis by Th50;
  end;
  assume r1 < r2;
  then uReal.r1 < sReal.r2 by A1,SURREALO:4,Th50;
  hence thesis by A1,SURREALO:4;
end;

registration
  let r be positive Real;
  cluster uReal.r -> positive;
  coherence by Th51,Th47;
end;

theorem
  born uReal.r = omega iff not r is Dyadic
proof
  uReal.r = Unique_No sReal.r by Def7;
  then
A1: born_eq (sReal.r) = born_eq (uReal.r) by SURREALO:def 10,33;
A2: born_eq uReal.r = born uReal.r by SURREALO:48;
  thus born (uReal.r) = omega implies not r is Dyadic
  proof
    assume
A3: born(uReal.r) = omega & r is Dyadic;
    then reconsider r as Dyadic;
    born  uDyadic.r is finite by Th37;
    hence thesis by Th46,A3;
  end;
  assume that
A4:not r is Dyadic and
A5:born (uReal.r) <> omega;
  born_eq (sReal.r) c= born (sReal.r) c= omega by SURREALO:def 5,Th49;
  then born_eq (uReal.r) c< omega
  by A1,A2,A5,XBOOLE_0:def 8,XBOOLE_1:1;
  then born_eq (uReal.r) in omega by ORDINAL1:11;
  then reconsider B=born_eq (uReal.r) as Nat;
  consider x be Surreal such that
A6: born x = B & uReal.r ==x by SURREALO:def 5;
  x in Day B by A6,SURREAL0:def 18;
  then consider d be Dyadic such that
A7:x == uDyadic.d & uDyadic.d in Day B by Th35;
  uReal.r == uDyadic.d == uReal.d by A7,A6,SURREALO:4,Th46;
  then r <= d <= r by SURREALO:4,Th51;
  hence thesis by XXREAL_0:1,A4;
end;

theorem Th53: :::
  r1 < r2 implies
    ex n st [\r1*(2|^n)+1/] / (2|^n) < r2
proof
  assume r1 < r2;
  then 0< r2-r1 by XREAL_1:50;
  then consider k be Nat such that
A1:  1/ (2|^k) <= r2-r1 by PREPOWER:92;
  take k+1;
  set K2 = 2|^(k+1);
  K2  = 2* (2|^k) by NEWTON:6;
  then
A2: K2*(1/ (2|^k)) = 2* ((2|^k)*(1/ (2|^k)))
  .= 2*1 by XCMPLX_1:106;
  K2*(r1 + 1/ (2|^k)) <= r2*K2 by A1,XREAL_1:19,XREAL_1:64;
  then [\ (K2*r1 +1) /]<= K2*r1 +2-1 < r2*K2-0
  by A2,XREAL_1:15,INT_1:def 6;
  then [\ (K2*r1 +1) /] < K2*r2 by XXREAL_0:2;
  then [\ (K2*r1 +1)/]/K2 < (r2*K2)/K2 = r2 by XREAL_1:74,XCMPLX_1:89;
  hence thesis;
end;

theorem Th54: :::
  r1 < r2 implies
    ex n st r1 < [/r2*(2|^n)-1\] / (2|^n)
proof
  assume r1 < r2;
  then 0< r2-r1 by XREAL_1:50;
  then consider k be Nat such that
A1:  1/ (2|^k) <= r2-r1 by PREPOWER:92;
  take k+1;
  set K2 = 2|^(k+1);
  K2  = 2* (2|^k) by NEWTON:6;
  then
A2: K2*(1/ (2|^k)) = 2* ((2|^k)*(1/ (2|^k)))
  .= 2*1 by XCMPLX_1:106;
  K2*(r1 + 1/ (2|^k)) <= r2*K2 by A1,XREAL_1:19,XREAL_1:64;
  then K2*r1 +2-2 < r2*K2-1 <=[/ (K2*r2 -1) \] by
  A2,XREAL_1:15,INT_1:def 7;
  then K2*r1 <[/ (K2*r2 -1) \] by XXREAL_0:2;
  then r1 = (r1*K2)/K2 < [/ (K2*r2 -1) \]/K2 by XREAL_1:74,XCMPLX_1:89;
  hence thesis;
end;

Lm11: L_(sReal.r1) ++ {sReal.r2} << {sReal.(r1+r2)}
proof
  let a,b be Surreal such that
A1:a in L_(sReal.r1) ++ {sReal.r2} & b in {sReal.(r1+r2)};
  consider a1,a2 be Surreal such that
A2: a1 in L_(sReal.r1) & a2 in {sReal.r2} & a= a1+a2 by A1,SURREALR:def 8;
A3: a2 = sReal.r2 by A2,TARSKI:def 1;
  consider n such that
A4:a1 = uDyadic.([/ r1*(2|^n) -1\] / (2|^n)) by A2,Th42;
  set d = [/ r1*(2|^n) -1\] / (2|^n);
  0 < r1-d by Th41,XREAL_1:50;
  then r2+0 < r1-d+r2 by XREAL_1:8;
  then consider k be Nat such that
A5:[\r2*(2|^k)+1/] / (2|^k) < r1-d+r2 by Th53;
A6:a < a1+uDyadic.([\r2*(2|^k)+1/] / (2|^k)) by A3,Th44,A2,SURREALR:44;
  a1+uDyadic.([\r2*(2|^k)+1/] / (2|^k)) ==
  uDyadic.(d+[\r2*(2|^k)+1/] / (2|^k)) == sReal.(d+[\r2*(2|^k)+1/] / (2|^k))
  by A4,Th39,Th46;
  then a1+uDyadic.([\r2*(2|^k)+1/] / (2|^k)) ==
  sReal.(d+[\r2*(2|^k)+1/] / (2|^k)) by SURREALO:4;
  then
A7:a <= sReal.(d+[\r2*(2|^k)+1/] / (2|^k)) by A6,SURREALO:4;
  d+[\r2*(2|^k)+1/] / (2|^k) < d + (r1-d+r2 )=r1+r2 by A5,XREAL_1:6;
  then a < sReal.(r1+r2) by Th50,A7,SURREALO:4;
  hence thesis by A1,TARSKI:def 1;
end;

Lm12:{sReal.(r1+r2)} << R_(sReal.r1) ++ {sReal.r2}
proof
  let a,b be Surreal such that
A1:a in {sReal.(r1+r2)} & b in R_(sReal.r1) ++ {sReal.r2};
  consider b1,b2 be Surreal such that
A2:b1 in R_(sReal.r1) & b2 in {sReal.r2} & b= b1+b2 by A1,SURREALR:def 8;
A3:b2 = sReal.r2 by A2,TARSKI:def 1;
  consider n such that
A4:b1 = uDyadic.([\ r1*(2|^n) +1/] / (2|^n)) by A2,Th43;
  set d = [\ r1*(2|^n) +1/] / (2|^n);
  0 < d-r1 by Th41,XREAL_1:50;
  then r1+r2-d+0 < d-r1+(r1+r2-d)=r2 by XREAL_1:8;
  then consider k be Nat such that
A5:r1+r2-d < [/r2*(2|^k)-1\] / (2|^k) by Th54;
A6:b1+ uDyadic.([/r2*(2|^k)-1\] / (2|^k))<b by A3,Th44,A2,SURREALR:44;
  b1+uDyadic.([/r2*(2|^k)-1\] / (2|^k)) ==
  uDyadic.(d+[/r2*(2|^k)-1\] / (2|^k)) == sReal.(d+[/r2*(2|^k)-1\] / (2|^k))
  by A4,Th39,Th46;
  then b1+uDyadic.([/r2*(2|^k)-1\] / (2|^k)) ==
  sReal.(d+[/r2*(2|^k)-1\] / (2|^k)) by SURREALO:4;
  then
A7: sReal.(d+[/r2*(2|^k)-1\] / (2|^k))<=b by A6,SURREALO:4;
  r1+r2 = d+(r1+r2-d)< d+[/r2*(2|^k)-1\] / (2|^k) by A5,XREAL_1:6;
  then sReal.(r1+r2) <b by Th50,A7,SURREALO:4;
  hence thesis by A1,TARSKI:def 1;
end;

Lm13: sReal.r1 + sReal.r2 == sReal.(r1+r2)
proof
  set r12=r1+r2;
  set R1 = sReal.r1, R2 = sReal.r2, R12=sReal.r12;
A1: R1+R2 = [(L_R1 ++ {R2})\/({R1} ++ L_R2), (R_R1 ++ {R2}) \/({R1} ++ R_R2)]
  by SURREALR:28;
  L_R1 ++ {R2} << {R12} & {R1} ++ L_R2 = L_R2 ++ {R1} << {R12} by Lm11;
  then
A2:L_(R1+R2) << {R12} by A1,SURREAL0:41;
  {R1+R2} << R_R12
  proof
    let a,b be Surreal such that
A3: a in {R1+R2} & b in R_R12;
A4: a=R1+R2 by A3,TARSKI:def 1;
    consider n such that
A5: b = uDyadic.([\r12*(2|^n)+1/]/(2|^n)) by A3,Th43;
    set d = [\r12*(2|^n)+1/]/(2|^n);
    set r = (d-r12)/2;
A6: 0 < d-r12 by Th41,XREAL_1:50;
    then consider n1 be Nat such that
A7: [\r1*(2|^n1)+1/] / (2|^n1) < r1+r by Th53,XREAL_1:29;
    consider n2 be Nat such that
A8: [\r2*(2|^n2)+1/] / (2|^n2) < r2+r by A6,XREAL_1:29,Th53;
    R1 <= uDyadic.([\r1*(2|^n1)+1/] / (2|^n1)) &
    R2< uDyadic.([\r2*(2|^n2)+1/] / (2|^n2)) by Th44;
    then
A9: R1+R2 < uDyadic.([\r1*(2|^n1)+1/] / (2|^n1)) +
    uDyadic.([\r2*(2|^n2)+1/] / (2|^n2)) by SURREALR:44;
A10: uDyadic.([\r1*(2|^n1)+1/] / (2|^n1)) +
    uDyadic.([\r2*(2|^n2)+1/] / (2|^n2)) ==
    uDyadic.([\r1*(2|^n1)+1/] / (2|^n1) + [\r2*(2|^n2)+1/] / (2|^n2))
    by Th39;
    r1+r+(r2+r) = d;
    then [\r1*(2|^n1)+1/] / (2|^n1) + [\r2*(2|^n2)+1/] / (2|^n2) < d
    by A7,A8,XREAL_1:8;
    then uDyadic.([\r1*(2|^n1)+1/] / (2|^n1)) +
    uDyadic.([\r2*(2|^n2)+1/] / (2|^n2))<= b by SURREALO:4,A10,A5,Th24;
    hence thesis by A4,SURREALO:4,A9;
  end;
  hence R1+R2 <= R12 by SURREAL0:43,A2;
A11: L_R12 << {R1+R2}
  proof
    let a,b be Surreal such that
A12:a in L_R12 & b in {R1+R2};
A13:b=R1+R2 by A12,TARSKI:def 1;
    consider n such that
A14: a = uDyadic.([/r12*(2|^n)-1\]/(2|^n)) by A12,Th42;
    set d = [/r12*(2|^n)-1\]/(2|^n);
    set r = (r12-d)/2;
A15: 0 < r12-d by Th41,XREAL_1:50;
    then consider n1 be Nat such that
A16: r1 -r < [/r1*(2|^n1)-1\] / (2|^n1) by XREAL_1:44,Th54;
    consider n2 be Nat such that
A17: r2-r < [/r2*(2|^n2)-1\] / (2|^n2) by A15,XREAL_1:44,Th54;
    uDyadic.([/r1*(2|^n1)-1\] / (2|^n1)) <= R1 &
    uDyadic.([/r2*(2|^n2)-1\] / (2|^n2))<R2 by Th44;
    then
A18: uDyadic.([/r1*(2|^n1)-1\] / (2|^n1)) +
    uDyadic.([/r2*(2|^n2)-1\] / (2|^n2))< R1+R2 by SURREALR:44;
A19: uDyadic.([/r1*(2|^n1)-1\] / (2|^n1)) +
    uDyadic.([/r2*(2|^n2)-1\] / (2|^n2)) ==
    uDyadic.([/r1*(2|^n1)-1\] / (2|^n1) + [/r2*(2|^n2)-1\] / (2|^n2))
    by Th39;
    r1-r+(r2-r) = d;
    then d < [/r1*(2|^n1)-1\] / (2|^n1) + [/r2*(2|^n2)-1\] / (2|^n2)
    by A16,A17,XREAL_1:8;
    then a<=uDyadic.([/r1*(2|^n1)-1\] / (2|^n1)) +
    uDyadic.([/r2*(2|^n2)-1\] / (2|^n2)) by A14,Th24,SURREALO:4,A19;
    hence thesis by A13,SURREALO:4,A18;
  end;
  {R12} << R_R1 ++ {R2} & {R12} << {R1} ++ R_R2 by Lm12;
  then {R12} << R_(R1+R2) by A1,SURREAL0:42;
  hence thesis by A11,SURREAL0:43;
end;

theorem Th55:
  uReal.r1 + uReal.r2 == uReal.(r1+r2)
proof
  uReal.r1 = Unique_No sReal.r1 &
  uReal.r2 = Unique_No sReal.r2 by Def7;
  then sReal.r1 == uReal.r1 & sReal.r2 == uReal.r2 by SURREALO:def 10;
  then uReal.r1 + uReal.r2 == sReal.r1 + sReal.r2 ==
  sReal.(r1+r2) by SURREALR:43,Lm13;
  then A1:uReal.r1 + uReal.r2 == sReal.(r1+r2) by SURREALO:4;
  uReal.(r1+r2) = Unique_No sReal.(r1+r2) by Def7;
  then sReal.(r1+r2) == uReal.(r1+r2) by SURREALO:def 10;
  hence thesis by A1,SURREALO:4;
end;

Lm14:
  - sReal.r == sReal.-r
proof
  sReal.r + sReal.-r == sReal.(r+-r)==uDyadic.0 by Lm13,Th46;
  then sReal.r + sReal.-r ==uDyadic.0 =uInt.0 by SURREALO:4,Def5;
  then 0_No == sReal.r + sReal.-r by Def1;
  then - sReal.r = - sReal.r +0_No ==
  sReal.r + sReal.-r +(- sReal.r) by SURREALR:43;
  then
A1:- sReal.r == sReal.-r +(sReal.r +(- sReal.r)) by SURREALR:37;
  sReal.r - (sReal.r) ==0_No by SURREALR:39;
  then sReal.-r +(sReal.r +(- sReal.r)) == sReal.-r+0_No by SURREALR:43;
  hence thesis by A1,SURREALO:4;
end;

theorem Th56:
  - uReal.r == uReal.-r
proof
A1: uReal.r = Unique_No sReal.r &
  uReal.-r = Unique_No sReal.-r by Def7;
  then
A2: sReal.r == uReal.r & sReal.-r == uReal.-r &
  - sReal.r == sReal.-r by Lm14,SURREALO:def 10;
  - uReal.r == - sReal.r by A1,SURREALR:65,SURREALO:def 10;
  then - uReal.r == sReal.-r by A2,SURREALO:4;
  hence thesis by A2,SURREALO:4;
end;

Lm15: sReal.(r*i) == sReal.r * uDyadic.i
proof
  defpred P[Nat] means sReal.($1*r) == sReal.r * uDyadic.$1;
A1:uDyadic.1 =1_No by Th11,Def5;
A2:uDyadic.0 =uInt.0 = 0_No by Def5,Def1;
A3:P[0] by A2,Th46;
A4:P[n] implies P[n+1]
  proof
    assume
A5: P[n];
    (n+1)*r = n*r+r;
    then
A6: sReal.((n+1)*r) == sReal.(n*r) + sReal.r by Lm13;
    sReal.(n*r) + sReal.r == (sReal.r * uDyadic.n)+sReal.r * 1_No
    == sReal.r*( uDyadic.n+1_No) by A5,SURREALR:66,67;
    then sReal.(n*r) + sReal.r == sReal.r*( uDyadic.n+1_No) by SURREALO:4;
    then
A7: sReal.((n+1)*r) == sReal.r*( uDyadic.n+1_No) by A6,SURREALO:4;
    sReal.r*( uDyadic.n+1_No) == sReal.r* uDyadic.(n+1) by SURREALR:51,A1,Th39;
    then sReal.((n+1)*r) == sReal.r* uDyadic.(n+1) by A7,SURREALO:4;
    hence thesis;
  end;
A8:P[n] from NAT_1:sch 2(A3,A4);
  consider n such that
A9:  n= i or i = -n by INT_1:2;
  per cases by A9;
  suppose n=i;
    hence thesis by A8;
  end;
  suppose
A10:i=-n;
    then
A11: - uDyadic.n = uDyadic.i by Th27;
A12: - sReal.(n*r) == -(sReal.r * uDyadic.n) =
    sReal.r * (- uDyadic.n) by A8,SURREALR:58,SURREALR:65;
    - sReal.(n*r) == sReal.-(n*r) by Lm14;
    hence thesis by A10,A11,A12,SURREALO:4;
   end;
end;

Lm16: sReal.(r / 2) == sReal. r * uDyadic. (1/(2|^1))
proof
  set r2=r/2;
  r2+r2=r;
  then
A1:sReal.r2 + sReal.r2 == sReal. r by Lm13;
  1_No * sReal.r2 = sReal.r2;
  then
A2: sReal.r2 + sReal.r2 == sReal.r2 *(1_No+1_No) by SURREALR:67;
  1_No+1_No = uInt.(1+1) = uDyadic.2 by Th11,Def5,Th13;
  then sReal.r == sReal.r2 * uDyadic.2 by A1,A2,SURREALO:4;
  then sReal.r * uDyadic. (1/(2|^1)) == sReal.r2 * uDyadic.2 *
  uDyadic. (1/(2|^1))== sReal.r2 * (uDyadic.2 *
  uDyadic. (1/(2|^1))) by SURREALR:51,SURREALR:69;
  then
A3: sReal.r * uDyadic. (1/(2|^1)) == sReal.r2 * (uDyadic.2 *
  uDyadic. (1/(2|^1))) by SURREALO:4;
  2*(1/(2|^1))=1;
  then uDyadic.2 * uDyadic. (1/(2|^1)) == uDyadic.1 = uInt.1
  by Th40,Def5;
  then sReal.r2 * (uDyadic.2 *
  uDyadic. (1/(2|^1))) == sReal.r2 * 1_No = sReal.r2 by Th11,SURREALR:51;
  hence thesis by A3,SURREALO:4;
end;

Lm17:
  sReal.(r*d) == sReal.r * uDyadic.d
proof
  defpred P[Nat] means
  for r,d st d in DYADIC($1) holds sReal.(r*d) == sReal.r * uDyadic.d;
A1: P[0] by Lm15,Th21;
A2: P[n] implies P[n+1]
  proof
    assume
A3: P[n];
    let r,d such that
A4: d in DYADIC(n+1);
    consider i be Integer such that
A5: d =i/(2|^(n+1)) by A4,Def4;
A6: i*1=i;
A7: i/(2|^n) in DYADIC(n) by Def4;
    2|^(n+1) = 2*2|^n by NEWTON:6;
    then
A8: d = (i/(2|^n)) *(1/2) by A6,A5,XCMPLX_1:76;
    then r*d = (r/2) * (i/(2|^n));
    then
A9: sReal.(r*d) == sReal.(r/2)*uDyadic.(i/(2|^n)) by A7,A3;
    sReal.(r/2)*uDyadic.(i/(2|^n)) ==
    sReal. r * uDyadic. (1/(2|^1)) * uDyadic.(i/(2|^n))
    == sReal. r * (uDyadic. (1/(2|^1)) * uDyadic.(i/(2|^n)))
    by Lm16,SURREALR:51,69;
    then
A10: sReal.(r/2)*uDyadic.(i/(2|^n)) ==
    sReal. r * (uDyadic. (1/(2|^1)) * uDyadic.(i/(2|^n)))
    by SURREALO:4;
    sReal. r * (uDyadic. (1/(2|^1)) * uDyadic.(i/(2|^n)))
    == sReal. r * uDyadic.d by A8,Th40,SURREALR:51;
    then sReal.(r/2)*uDyadic.(i/(2|^n)) ==
    sReal. r * uDyadic.d by A10,SURREALO:4;
    hence thesis by A9,SURREALO:4;
  end;
A11:P[n] from NAT_1:sch 2(A1,A2);
  consider i be Integer, n be Nat such that
A12:d = i/(2|^n) by Th18;
  d in DYADIC(n) by A12,Def4;
  hence thesis by A11;
end;

Lm18:
 for d1,d2 be Dyadic holds
    (uDyadic.d1)*(sReal.r2) + (sReal.r1) * (uDyadic.d2) +-
    (uDyadic.d1)*(uDyadic.d2) ==
     sReal.(d1*r2+r1*d2-d1*d2)
proof
  let d1,d2 be Dyadic;
  (uDyadic.d1)*(sReal.r2) == sReal.(d1*r2) &
  (sReal.r1) * (uDyadic.d2) == sReal.(r1*d2) by Lm17;
  then (uDyadic.d1)*(sReal.r2) + (sReal.r1) * (uDyadic.d2) ==
  sReal.(d1*r2)+sReal.(r1*d2) == sReal.(d1*r2+r1*d2) by SURREALR:43,Lm13;
  then
A1:(uDyadic.d1)*(sReal.r2) + (sReal.r1) * (uDyadic.d2) ==
  sReal.(d1*r2+r1*d2) by SURREALO:4;
  (uDyadic.d1)*(uDyadic.d2)==uDyadic.(d1*d2) ==sReal.(d1*d2) by Th40,Th46;
  then (uDyadic.d1)*(uDyadic.d2) ==sReal.(d1*d2) by SURREALO:4;
  then -((uDyadic.d1)*(uDyadic.d2)) ==-sReal.(d1*d2) == sReal.-(d1*d2)
  by Lm14,SURREALR:10;
  then -((uDyadic.d1)*(uDyadic.d2)) == sReal.-(d1*d2) by SURREALO:4;
  then (uDyadic.d1)*(sReal.r2) + (sReal.r1) * (uDyadic.d2) +-
  (uDyadic.d1)*(uDyadic.d2) == sReal.(d1*r2+r1*d2) + sReal.-(d1*d2)
  == sReal.((d1*r2+r1*d2)+-(d1*d2)) by A1,SURREALR:43,Lm13;
  hence thesis by SURREALO:4;
end;

Lm19:
   sReal.r1 * sReal.r2 == sReal.(r1*r2)
proof
  set r12=r1*r2;
  set R1 = sReal.r1, R2 = sReal.r2, R12=sReal.r12;
A1: R1*R2 =
  [comp(L_R1,R1,R2,L_R2) \/ comp(R_R1,R1,R2,R_R2),
  comp(L_R1,R1,R2,R_R2) \/ comp(R_R1,R1,R2,L_R2)] by SURREALR:50;
A2:comp(L_R1,R1,R2,L_R2) << {R12}
  proof
    let a,b be Surreal such that
A3: a in comp(L_R1,R1,R2,L_R2) & b in {R12};
    consider x1,y1 be Surreal such that
A4: a = x1*R2 + R1*y1 - x1*y1 & x1 in L_R1 & y1 in L_R2
    by A3,SURREALR:def 15;
    consider n1 be Nat such that
A5: x1 = uDyadic.([/ r1*(2|^n1)-1\] / (2|^n1)) by Th42,A4;
    set d1=[/ r1*(2|^n1)-1\] / (2|^n1);
    consider n2 be Nat such that
A6: y1 = uDyadic.([/ r2*(2|^n2)-1\] / (2|^n2)) by Th42,A4;
    set d2 = [/ r2*(2|^n2)-1\] / (2|^n2);
A7: a == sReal.(d1*r2+r1*d2-(d1*d2)) by A4,A5,A6,Lm18;
    0 < r1-d1 & 0 < r2-d2 by Th41,XREAL_1:50;
    then 0< (r1-d1)*(r2-d2);
    then 0 < r12 -((d1*r2)+(d2*r1)-(d1*d2));
    then consider k be Nat such that
A8: (d1*r2)+(d2*r1)-(d1*d2) < [/r12*(2|^k)-1\] / (2|^k) by Th54,XREAL_1:47;
    set d = [/r12*(2|^k)-1\] / (2|^k);
    sReal.(d1*r2+r1*d2-(d1*d2)) < sReal.d ==uDyadic.d by A8,Th50,Th46;
    then sReal.(d1*r2+r1*d2-(d1*d2)) <= uDyadic.d < R12
    by Th44,SURREALO:4;
    then sReal.(d1*r2+r1*d2-(d1*d2)) < R12 = b
    by SURREALO:4,A3,TARSKI:def 1;
    hence thesis by A7,SURREALO:4;
  end;
  comp(R_R1,R1,R2,R_R2) << {R12}
  proof
    let a,b be Surreal such that
A9: a in comp(R_R1,R1,R2,R_R2) & b in {R12};
    consider x1,y1 be Surreal such that
A10:a = x1*R2 + R1*y1 - x1*y1 & x1 in R_R1 & y1 in R_R2 by A9,SURREALR:def 15;
    consider n1 be Nat such that
A11: x1 = uDyadic.([\ r1*(2|^n1)+1/] / (2|^n1)) by Th43,A10;
    set d1=[\ r1*(2|^n1)+1/] / (2|^n1);
    consider n2 be Nat such that
A12: y1 = uDyadic.([\ r2*(2|^n2)+1/] / (2|^n2)) by Th43,A10;
    set d2 = [\ r2*(2|^n2)+1/] / (2|^n2);
A13:a == sReal.(d1*r2+r1*d2-(d1*d2)) by A10,A11,A12,Lm18;
    r1-d1 < 0 & r2-d2 <0 by Th41,XREAL_1:49;
    then 0 < (r1-d1)*(r2-d2);
    then 0 < r12 -((d1*r2)+(d2*r1)-(d1*d2));
    then consider k be Nat such that
A14:(d1*r2)+(d2*r1)-(d1*d2) < [/r12*(2|^k)-1\] / (2|^k)
    by Th54,XREAL_1:47;
    set d = [/r12*(2|^k)-1\] / (2|^k);
    sReal.(d1*r2+r1*d2-(d1*d2)) < sReal.d ==uDyadic.d by A14,Th50,Th46;
    then sReal.(d1*r2+r1*d2-(d1*d2)) <= uDyadic.d < R12
    by Th44,SURREALO:4;
    then sReal.(d1*r2+r1*d2-(d1*d2)) < R12 = b
    by SURREALO:4,A9,TARSKI:def 1;
    hence thesis by A13,SURREALO:4;
  end;
  then
A15: L_(R1*R2) << {R12} by A1,A2,SURREAL0:41;
A16:{R12} << comp(L_R1,R1,R2,R_R2)
  proof
    let b,a be Surreal such that
A17:b in {R12} & a in comp(L_R1,R1,R2,R_R2);
    consider x1,y1 be Surreal such that
A18:a = x1*R2 + R1*y1 - x1*y1 & x1 in L_R1 & y1 in R_R2
    by A17,SURREALR:def 15;
    consider n1 be Nat such that
A19: x1 = uDyadic.([/ r1*(2|^n1)-1\] / (2|^n1)) by Th42,A18;
    set d1=[/ r1*(2|^n1)-1\] / (2|^n1);
    consider n2 be Nat such that
A20: y1 = uDyadic.([\ r2*(2|^n2)+1/] / (2|^n2)) by Th43,A18;
    set d2 = [\ r2*(2|^n2)+1/] / (2|^n2);
A21: a == sReal.(d1*r2+r1*d2-(d1*d2)) by A18,A19,A20,Lm18;
    0< r1-d1 & r2-d2 <0 by Th41,XREAL_1:49,50;
    then (r1-d1)*(r2-d2) <0;
    then r12 -((d1*r2)+(d2*r1)-(d1*d2))<0;
    then consider k be Nat such that
A22:[\r12*(2|^k)+1/] / (2|^k) < (d1*r2)+(d2*r1)-(d1*d2)
    by Th53,XREAL_1:48;
    set d = [\r12*(2|^k)+1/] / (2|^k);
    uDyadic.d == sReal.d < sReal.(d1*r2+r1*d2-(d1*d2)) by A22,Th50,Th46;
    then R12 < uDyadic.d <= sReal.(d1*r2+r1*d2-(d1*d2))
    by Th44,SURREALO:4;
    then b = R12 < sReal.(d1*r2+r1*d2-(d1*d2))
    by SURREALO:4,A17,TARSKI:def 1;
    hence thesis by A21,SURREALO:4;
  end;
  {R12} << comp(R_R1,R1,R2,L_R2)
  proof
    let b,a be Surreal such that
A23:b in {R12} & a in comp(R_R1,R1,R2,L_R2);
    consider x1,y1 be Surreal such that
A24:a = x1*R2 + R1*y1 - x1*y1 & x1 in R_R1 & y1 in L_R2
    by A23,SURREALR:def 15;
    consider n1 be Nat such that
A25: x1 = uDyadic.([\ r1*(2|^n1)+1/] / (2|^n1)) by Th43,A24;
    set d1=[\ r1*(2|^n1)+1/] / (2|^n1);
    consider n2 be Nat such that
A26: y1 = uDyadic.([/ r2*(2|^n2)-1\] / (2|^n2)) by Th42,A24;
    set d2 = [/ r2*(2|^n2)-1\] / (2|^n2);
A27:a == sReal.(d1*r2+r1*d2-(d1*d2)) by A24,A25,A26,Lm18;
    0< r2-d2 & r1-d1 <0 by Th41,XREAL_1:49,50;
    then (r1-d1)*(r2-d2) <0;
    then r12 -((d1*r2)+(d2*r1)-(d1*d2))<0;
    then consider k be Nat such that
A28:[\r12*(2|^k)+1/] / (2|^k) < (d1*r2)+(d2*r1)-(d1*d2)
    by Th53,XREAL_1:48;
    set d = [\r12*(2|^k)+1/] / (2|^k);
    uDyadic.d == sReal.d < sReal.(d1*r2+r1*d2-(d1*d2)) by A28,Th50,Th46;
    then R12 < uDyadic.d <= sReal.(d1*r2+r1*d2-(d1*d2))
    by Th44,SURREALO:4;
    then b = R12 < sReal.(d1*r2+r1*d2-(d1*d2))
    by SURREALO:4,A23,TARSKI:def 1;
    hence thesis by A27,SURREALO:4;
  end;
  then
A29: {R12} << R_(R1*R2) by A1,A16,SURREAL0:42;
A30:L_R12 << {R1*R2}
  proof
    let a,b be Surreal such that
A31: a in L_R12 & b in {R1*R2};
    consider n such that
A32: a = uDyadic.([/ r12*(2|^n)-1\] / (2|^n)) by Th42,A31;
    set d=[/ r12*(2|^n)-1\] / (2|^n);
    0 < r12 -d by Th41,XREAL_1:50;
    then consider k be Nat such that
A33: 1/(2|^k) <= r12 -d by PREPOWER:92;
    set M= 1/(2|^k);
    consider k1 be Nat such that
A34: r1-M < [/r1*(2|^k1)-1\] / (2|^k1) by Th54,XREAL_1:44;
    set d1=[/r1*(2|^k1)-1\] / (2|^k1);
    consider k2 be Nat such that
A35: r2-M < [/r2*(2|^k2)-1\] / (2|^k2) by Th54,XREAL_1:44;
    set d2=[/r2*(2|^k2)-1\] / (2|^k2);
    0 < r1 - d1 < M & 0 < r2 - d2 < M by Th41,A34,A35,XREAL_1:11,50;
    then 0 < (r1-d1)*(r2-d2)< M*M by XREAL_1:96;
    then r12 - (r1*d2 + r2*d1 - d1*d2) < M*M;
    then
A36: r12 - M*M < r1*d2 + r2*d1 - d1*d2 by XREAL_1:11;
    1 <= 1*2|^k by NAT_1:14;
    then 1/(2|^k) <=1 by XREAL_1:79;
    then
A37: M* M <= M*1 by XREAL_1:64;
    d <= r12 -M <= r12 -M*M by A33,A37,XREAL_1:10,11;
    then d<=r12 -M*M by XXREAL_0:2;
    then d < r1*d2 + r2*d1 - d1*d2 by A36,XXREAL_0:2;
    then a == sReal.d < sReal.(r1*d2 + r2*d1 - d1*d2) by A32,Th50,Th46;
    then
A38: a <= sReal.(r1*d2 + r2*d1 - d1*d2) by SURREALO:4;
A39: L_(R1*R2) << {R1*R2} & R1*R2 in {R1*R2} by TARSKI:def 1,SURREALO:11;
    uDyadic.d1 in L_R1 & uDyadic.d2 in L_R2 by Th42;
    then R1*uDyadic.d2 + (uDyadic.d1)*R2 - (uDyadic.d1)*(uDyadic.d2) in
    comp(L_R1,R1,R2,L_R2) by SURREALR:def 15;
    then
A40: R1*uDyadic.d2 + (uDyadic.d1)*R2 +- (uDyadic.d1)*(uDyadic.d2) in
    L_(R1*R2) by XBOOLE_0:def 3,A1;
    R1*uDyadic.d2 + (uDyadic.d1)*R2 +- (uDyadic.d1)*(uDyadic.d2) ==
    sReal.(r1*d2 + r2*d1 - d1*d2) by Lm18;
    then sReal.(r1*d2 + r2*d1 - d1*d2) < R1*R2 by A40,A39,SURREALO:4;
    then a < R1*R2 by A38,SURREALO:4;
    hence thesis by A31,TARSKI:def 1;
  end;
  {R1*R2} << R_R12
  proof
    let b,a be Surreal such that
A41:b in {R1*R2}  & a in R_R12;
    consider n such that
A42: a = uDyadic.([\ r12*(2|^n)+1/] / (2|^n)) by Th43,A41;
    set d=[\ r12*(2|^n)+1/] / (2|^n);
    0 < d- r12 by Th41,XREAL_1:50;
    then consider k be Nat such that
A43: 1/(2|^k) <= d-r12 by PREPOWER:92;
    set M= 1/(2|^k);
    consider k1 be Nat such that
A44:  r1-M < [/r1*(2|^k1)-1\] / (2|^k1) by Th54,XREAL_1:44;
    set d1=[/r1*(2|^k1)-1\] / (2|^k1);
    consider k2 be Nat such that
A45: [\r2*(2|^k2)+1/] / (2|^k2) < r2+M by Th53,XREAL_1:29;
    set d2=[\r2*(2|^k2)+1/] / (2|^k2);
    0 < r1 - d1 < M & 0 < d2 - r2 < M
    by Th41,A44,A45,XREAL_1:11,19,50;
    then 0 < (r1-d1)*(d2-r2)< M*M by XREAL_1:96;
    then (r1*d2 + r2*d1 - d1*d2) -r12 < M*M;
    then
A46: r1*d2 + r2*d1 - d1*d2 < M*M+r12 by XREAL_1:19;
    1 <= 1*2|^k by NAT_1:14;
    then 1/(2|^k) <=1 by XREAL_1:79;
    then
A47: M* M <= M*1 by XREAL_1:64;
    d >= r12 +M >= r12 +M*M by A43,A47,XREAL_1:6,19;
    then d >= r12 +M*M by XXREAL_0:2;
    then d > r1*d2 + r2*d1 - d1*d2 by A46,XXREAL_0:2;
    then sReal.(r1*d2 + r2*d1 - d1*d2) < sReal.d == a by A42,Th50,Th46;
    then
A48: sReal.(r1*d2 + r2*d1 - d1*d2) <= a by SURREALO:4;
A49: {R1*R2} << R_(R1*R2) & R1*R2 in {R1*R2} by TARSKI:def 1,
    SURREALO:11;
    uDyadic.d1 in L_R1 & uDyadic.d2 in R_R2 by Th42,Th43;
    then R1*uDyadic.d2 + (uDyadic.d1)*R2 - (uDyadic.d1)*(uDyadic.d2)
    in comp(L_R1,R1,R2,R_R2) by SURREALR:def 15;
    then
A50: R1*uDyadic.d2 + (uDyadic.d1)*R2 +- (uDyadic.d1)*(uDyadic.d2) in
    R_(R1*R2) by XBOOLE_0:def 3,A1;
    R1*uDyadic.d2 + (uDyadic.d1)*R2 +- (uDyadic.d1)*(uDyadic.d2)
    == sReal.(r1*d2 + r2*d1 - d1*d2) by Lm18;
    then R1*R2 < sReal.(r1*d2 + r2*d1 - d1*d2) by A50,A49,SURREALO:4;
    then R1*R2 < a by A48,SURREALO:4;
    hence thesis by A41,TARSKI:def 1;
  end;
  hence thesis by A15,A29,A30,SURREAL0:43;
end;

theorem Th57:
  uReal.r1 * uReal.r2 == uReal.(r1*r2)
proof
  uReal.r1 = Unique_No sReal.r1 & uReal.r2 = Unique_No sReal.r2 by Def7;
  then uReal.r1 * uReal.r2 == uReal.r1 * sReal.r2 ==
  sReal.r1 * sReal.r2 by SURREALO:def 10,SURREALR:51;
  then uReal.r1 * uReal.r2 == sReal.r1 * sReal.r2 ==
  sReal.(r1*r2) by Lm19,SURREALO:4;
  then A1:uReal.r1 * uReal.r2 == sReal.(r1*r2) by SURREALO:4;
  uReal.(r1*r2) = Unique_No sReal.(r1*r2) by Def7;
  then sReal.(r1*r2) == uReal.(r1*r2) by SURREALO:def 10;
  hence thesis by A1,SURREALO:4;
end;

theorem Th58:
  n>0 implies (uInt.n)" == uReal.(1/n)
proof
  assume
A1: n>0;
  then 0_No = uInt.0 < uInt.n by Th9,Def1;
  then
A2:not uInt.n == 0_No;
  A3:n * (1/n) =1 by A1,XCMPLX_1:106;
  uInt.n = uDyadic.n = uReal.n by Def5,Th46;
  then uInt.n *  uReal.(1/n) == uReal.1 =1_No by A3,Th57,Th48;
  hence thesis by SURREALI:42,A2;
end;

begin ::*Real Surreal Numbers

definition
  let x be Surreal;
  func real_qua x -> Surreal means :Def8:
    L_ it = the set of all x - (uInt.n)" where n is positive Nat &
    R_ it = the set of all x + (uInt.n)" where n is positive Nat;
  existence
  proof
    set L = the set of all x - (uInt.n)" where n is positive Nat;
    set R = the set of all x + (uInt.n)" where n is positive Nat;
A1: L is surreal-membered
    proof
      let o;
      assume o in L;
      then ex n be positive Nat st o = x - (uInt.n)";
      hence thesis;
    end;
    R is surreal-membered
    proof
      let o;
      assume o in R;
      then ex n be positive Nat st o = x + (uInt.n)";
      hence thesis;
    end;
    then reconsider L,R as surreal-membered set by A1;
    consider M be Ordinal such that
A2: for o st o in L\/R ex A be Ordinal st A in M & o in Day A
    by SURREAL0:47;
    L<<R
    proof
      let l,r be Surreal such that
A3:   l in L & r in R;
      consider nL be positive Nat such that
A4:   l = x - (uInt.nL)" by A3;
      consider nR be positive Nat such that
A5:   r = x + (uInt.nR)" by A3;
      - (uInt.nL)" < - 0_No = 0_No by SURREALR:10,SURREALI:def 8;
      then
A6:   x +- (uInt.nL)" < x + 0_No =x by SURREALR:44;
      x = x + 0_No <= x+ (uInt.nR)" by SURREALR:44,SURREALI:def 8;
      hence thesis by A4,A5,A6,SURREALO:4;
    end;
    then [L,R] in Day M by A2,SURREAL0:46;
    then reconsider LR=[L,R] as Surreal;
    take LR;
    thus thesis;
  end;
  uniqueness by XTUPLE_0:2;
end;

definition
  let x be Surreal;
  attr x is *real means
    x == real_qua x & ex n be Nat st uInt.-n < x < uInt.n;
end;

theorem Th59:
  for n be positive Nat holds
    x - (uInt.n)" < real_qua x < x+ (uInt.n)"
proof
  let n be positive Nat;
    x- (uInt.n)" in
       the set of all x - (uInt.k)" where k is positive Nat;
  then
A1: x+- (uInt.n)" in L_real_qua x by Def8;
  x+ (uInt.n)" in the set of all x + (uInt.k)" where k is positive Nat;
  then
A2: x+ (uInt.n)" in R_real_qua x by Def8;
  L_real_qua x << {real_qua x} << R_real_qua x & real_qua x in {real_qua x}
  by TARSKI:def 1,SURREALO:11;
  hence thesis by A1,A2;
end;

Lm20:
  x == y implies real_qua x <= real_qua y
proof
  assume
A1: x==y;
A2:L_real_qua x << {real_qua y}
  proof
    let l,r be Surreal;
    assume
A3: l in L_real_qua x & r in {real_qua y};
    then l in the set of all x - (uInt.n)" where n is positive Nat by Def8;
    then consider nL be positive Nat such that
A4:  l = x - (uInt.nL)";
    1*nL < 2*nL by XREAL_1:68;
    then uReal.(1/(2*nL)) < uReal.(1/nL) == (uInt.nL)"
    by XREAL_1:76,Th58,Th51;
    then (uInt.(2*nL))" == uReal.(1/(2*nL)) < (uInt.nL)" by Th58,SURREALO:4;
    then (uInt.(2*nL))" < (uInt.nL)" by SURREALO:4;
    then - (uInt.nL)" < - (uInt.(2*nL))" by SURREALR:10;
    then
A5: x +- (uInt.nL)" <= y+- (uInt.(2*nL))" by A1,SURREALR:44;
    r = real_qua y by A3,TARSKI:def 1;
    then y- (uInt.(2*nL))" < r by Th59;
    hence thesis by A4,A5,SURREALO:4;
  end;
  {real_qua x} << R_real_qua y
  proof
    let l,r be Surreal;
    assume
A6: l in {real_qua x} & r in R_real_qua y;
    then r in the set of all y + (uInt.n)" where n is positive Nat by Def8;
    then consider nL be positive Nat such that
A7:  r = y + (uInt.nL)";
    1*nL < 2*nL by XREAL_1:68;
    then uReal.(1/(2*nL)) < uReal.(1/nL) == (uInt.nL)"
    by XREAL_1:76,Th58,Th51;
    then (uInt.(2*nL))" == uReal.(1/(2*nL)) < (uInt.nL)" by Th58,SURREALO:4;
    then (uInt.(2*nL))" < (uInt.nL)" by SURREALO:4;
    then
A8: x + (uInt.(2*nL))" <= y+ (uInt.(nL))" by A1,SURREALR:44;
    l = real_qua x by A6,TARSKI:def 1;
    hence thesis by A7,A8,Th59,SURREALO:4;
  end;
  hence thesis by A2,SURREAL0:43;
end;

theorem
  x == y implies real_qua x == real_qua y by Lm20;

Lm21:
  sReal.r == real_qua sReal.r
proof
  set R = sReal.r;
  uReal.r = Unique_No R by Def7;
  then
A1: uReal.r == R by SURREALO:def 10;
A2: L_R << {real_qua R}
  proof
    let l,r1 be Surreal;
    assume
A3: l in L_R & r1 in {real_qua R};
    then consider n be Nat such that
A4: l = uDyadic.([/ r * (2 |^ n)-1\] / (2 |^ n)) by Th42;
    set D= [/ r*(2|^n)-1\] / (2|^n);
    0 < r-D  by XREAL_1:50,Th41;
    then consider k be Nat such that
A5: 1/ (2|^k) <= r-D by PREPOWER:92;
    D <= r - 1/ (2|^k) by A5,XREAL_1:11;
    then l= uReal.D <= uReal.(r + - 1/ (2|^k))
    == (uReal.r) + uReal.(- 1/ (2|^k)) by Th46, A4,Th51,Th55;
    then
A6: l <= (uReal.r) + uReal.(- 1/ (2|^k)) by SURREALO:4;
    uReal.(- 1/ (2|^k)) == - uReal.(1/(2|^k)) == - (uInt.(2|^k))"
    by Th58,Th56,SURREALR:65;
    then uReal.(- 1/ (2|^k)) == - (uInt.(2|^k))" by SURREALO:4;
    then (uReal.r) + uReal.(- 1/ (2|^k)) == R + (- (uInt.(2|^k))")
    by A1,SURREALR:66;
    then l <= R - (uInt.(2|^k))" < real_qua R = r1
    by A3,TARSKI:def 1,Th59,A6,SURREALO:4;
    hence thesis by SURREALO:4;
  end;
A7: {R} << R_real_qua R
  proof
    let l,r1 be Surreal such that
A8: l in {R} & r1 in R_real_qua R;
    r1 in the set of all R + (uInt.n)" where n is positive Nat by A8,Def8;
    then consider nL be positive Nat such that
A9:  r1 = R + (uInt.nL)";
    R= R + 0_No < R+ (uInt.nL)" by SURREALR:44,SURREALI:def 8;
    hence thesis by A9,A8,TARSKI:def 1;
  end;
A10:L_real_qua R << {R}
  proof
    let l,r1 be Surreal such that
A11: l in L_real_qua R & r1 in {R};
    l in the set of all R - (uInt.n)" where n is positive Nat by A11,Def8;
    then consider nL be positive Nat such that
A12:  l = R - (uInt.nL)";
    - (uInt.nL)" < - 0_No = 0_No by SURREALR:10,SURREALI:def 8;
    then R +- (uInt.nL)" < R + 0_No =R by SURREALR:44;
    hence thesis by A12,A11,TARSKI:def 1;
  end;
  {real_qua R} << R_R
  proof
    let r1,l be Surreal;
    assume
A13: r1 in {real_qua R} & l in R_R;
    then consider n be Nat such that
A14:l = uDyadic.([\ r * (2 |^ n)+1/] / (2 |^ n)) by Th43;
    set D= [\ r*(2|^n)+1/] / (2|^n);
    0 < D-r  by Th41,XREAL_1:50;
    then consider k be Nat such that
A15:1/ (2|^k) <= D-r by PREPOWER:92;
    l= uReal.D >= uReal.(r + 1/ (2|^k))
    == (uReal.r) + uReal.( 1/ (2|^k)) by A14,A15,XREAL_1:19,Th46,Th51,Th55;
    then
A16: l >= (uReal.r) + uReal.(1/ (2|^k)) by SURREALO:4;
    uReal.(1/(2|^k)) == (uInt.(2|^k))" by Th58;
    then (uReal.r) + uReal.(1/ (2|^k)) == R + ((uInt.(2|^k))")
    by A1,SURREALR:66;
    then r1 = real_qua R < R + (uInt.(2|^k))" <= l
    by A13,TARSKI:def 1,Th59,A16,SURREALO:4;
    hence thesis by SURREALO:4;
  end;
  hence thesis by A2,A7,A10,SURREAL0:43;
end;

Lm22: ex n be Nat st -n < r < n :::
proof
  per cases;
  suppose
A1: 0 <= r;
    consider n be Nat such that
A2: r < n by SEQ_4:3;
    -n < 0 by A2,A1;
    hence thesis by A1,A2;
  end;
  suppose
A3: r < 0;
    consider n be Nat such that
A4: - r < n by SEQ_4:3;
    0 - r < n by A4;
    then -n = 0 -n < r & r < 0 <= n by A3,XREAL_1:11;
    hence thesis;
  end;
end;

theorem Th61:
  x==y & x is *real implies y is *real
proof
   assume
A1:x==y & x is *real;
   then consider n be Nat such that
A2: uInt.-n < x < uInt.n;
A3: uInt.-n < y < uInt.n by A2,A1,SURREALO:4;
   x == real_qua x == real_qua y by A1,Lm20;
   then x== real_qua y by SURREALO:4;
   then y== real_qua y by A1,SURREALO:4;
   hence thesis by A3;
end;

registration
  let r be Real;
  cluster sReal.r -> *real;
  coherence
  proof
    consider n such that
A1: -n < r < n by Lm22;
A2: sReal.n == uDyadic.n = uInt.n &
    sReal.-n == uDyadic.-n = uInt.-n by Th46,Def5;
    uInt.-n < sReal.r < uInt.n by A1,Th50,A2,SURREALO:4;
    hence thesis by Lm21;
  end;
  cluster uReal.r -> *real;
  coherence
  proof
    uReal.r = Unique_No sReal.r by Def7;
    then uReal.r == sReal.r by SURREALO:def 10;
    hence thesis by Th61;
  end;
end;

registration
  cluster *real for uSurreal;
  existence
  proof
    take C=uReal.0;
    thus thesis;
  end;
end;

theorem Th62:
  x is *real iff ex r st x == uReal.r
proof
  thus x is *real implies ex r st x == uReal.r
  proof
    assume
A1: x is *real;
    defpred L[object] means $1 is Real & for r be Real st r=$1 holds
    uReal.r < x;
    defpred R[object] means $1 is Real & for r be Real st r=$1 holds
    x < uReal.r;
A2: for r,s being ExtReal st L[r] & R[s] holds r <= s
    proof
      let r,s be ExtReal such that
A3:   L[r] & R[s];
      reconsider R=r,S=s as Real by A3;
      uReal.R < x <= uReal.S by A3;
      then uReal.R < uReal.S by SURREALO:4;
      hence thesis by Th51;
    end;
    consider s be ExtReal such that
A4: for r be ExtReal st L[r] holds r <= s and
A5: for r be ExtReal st R[r] holds s <= r from XXREAL_1:sch 1(A2);
    consider n be Nat such that
A6: uInt.-n < x < uInt.n by A1;
    uReal.n = uDyadic.n = uInt.n &
    uReal.-n = uDyadic.-n = uInt.-n by Th46,Def5;
    then L[-n] & R[n] by A6;
    then -n <= s <= n & n in REAL & -n in REAL by A4,A5,XREAL_0:def 1;
    then s in REAL by XXREAL_0:45;
    then reconsider s as Real;
    take s;
    set S=uReal.s;
    S = Unique_No sReal.s by Def7;
    then
A7: sReal.s == S & x == real_qua x by A1,SURREALO:def 10;
A8: x <= S
    proof
      assume S < x;
      then S < real_qua x by A7,SURREALO:4;
      then sReal.s < real_qua x by A7,SURREALO:4;
      then per cases by SURREALO:13;
      suppose ex xR be Surreal st xR in R_sReal.s & sReal.s < xR <= real_qua x;
        then consider xR be Surreal such that
A9:     xR in R_sReal.s & sReal.s < xR <= real_qua x;
        consider n such that
A10:    xR = uDyadic.([\ s*(2|^n)+1/] / (2|^n)) by A9,Th43;
        set D= [\ s*(2|^n)+1/] / (2|^n);
A11:    s < D by Th41;
        then
A12:    (s+D)/2 < D by XREAL_1:226;
A13:    xR = uReal.D by A10,Th46;
        xR <= x by A9,A7,SURREALO:4;
        then L[(s+D)/2] by A12,A13,SURREALO:4,Th51;
        hence thesis by A4,A11, XREAL_1:226;
      end;
      suppose ex yL be Surreal st yL in L_real_qua x &
        sReal.s <= yL < real_qua x;
        then consider yL be Surreal such that
A14:    yL in L_real_qua x & sReal.s <= yL < real_qua x;
        yL in the set of all x - (uInt.n)" where n is positive Nat by Def8,A14;
        then consider nL be positive Nat such that
A15:    yL = x - (uInt.nL)";
        1*nL < 2*nL by XREAL_1:68;
        then uReal.(1/(2*nL)) < uReal.(1/nL) == (uInt.nL)"
        by XREAL_1:76,Th58,Th51;
        then uReal.(1/(2*nL)) < (uInt.nL)" by SURREALO:4;
        then - ((uInt.nL)") < - uReal.(1/(2*nL)) by SURREALR:10;
        then yL < x+- uReal.(1/(2*nL)) by A15,SURREALR:44;
        then sReal.s < x- uReal.(1/(2*nL)) by A14,SURREALO:4;
        then uReal.s +uReal.(1/(2*nL)) == sReal.s +uReal.(1/(2*nL)) < x
        by A7,SURREALR:42,SURREALR:66;
        then uReal.(s+(1/(2*nL))) == uReal.s +uReal.(1/(2*nL)) < x
        by SURREALO:4,Th55;
        then L[s+(1/(2*nL))] by SURREALO:4;
        then s+(1/(2*nL)) <= s+0 by A4;
        hence thesis by XREAL_1:6;
      end;
    end;
    S <= x
    proof
      assume x < S;
      then real_qua x < S by A7,SURREALO:4;
      then real_qua x < sReal.s  by A7,SURREALO:4;
      then per cases by SURREALO:13;
      suppose ex xR be Surreal st xR in R_real_qua x &
        real_qua x < xR <= sReal.s;
        then consider xR be Surreal such that
A16:    xR in R_real_qua x & real_qua x < xR <= sReal.s;
        xR in the set of all x + (uInt.n)" where n is positive Nat by Def8,A16;
        then consider nL be positive Nat such that
A17:    xR = x + (uInt.nL)";
        1*nL < 2*nL by XREAL_1:68;
        then uReal.(1/(2*nL)) < uReal.(1/nL) == (uInt.nL)"
        by XREAL_1:76,Th58,Th51;
        then uReal.(1/(2*nL)) < (uInt.nL)" by SURREALO:4;
        then x+ uReal.(1/(2*nL)) < xR by A17,SURREALR:44;
        then x+ uReal.(1/(2*nL)) < sReal.s by A16,SURREALO:4;
        then x+ uReal.(1/(2*nL)) < uReal.s by A7,SURREALO:4;
        then
A18:    x < uReal.s -uReal.(1/(2*nL)) by SURREALR:42;
        -uReal.(1/(2*nL)) == uReal.-(1/(2*nL)) by Th56;
        then uReal.s +-uReal.(1/(2*nL)) == uReal.s +uReal.-(1/(2*nL))
        by SURREALR:66;
        then x < uReal.s +uReal.-(1/(2*nL)) == uReal.(s+-(1/(2*nL)))
        by Th55,A18,SURREALO:4;
        then R[s-(1/(2*nL))] by SURREALO:4;
        then 0+s <= s+-(1/(2*nL)) by A5;
        hence thesis by XREAL_1:6;
      end;
      suppose ex yL be Surreal st yL in L_sReal.s & real_qua x <= yL < sReal.s;
        then consider yL be Surreal such that
A19:    yL in L_sReal.s & real_qua x <= yL < sReal.s;
        consider n such that
A20:    yL = uDyadic.([/ s*(2|^n)-1\] / (2|^n)) by A19,Th42;
        set D= [/ s*(2|^n)-1\] / (2|^n);
A21:    D < s by Th41;
        then
A22:    D < (s+D)/2 by XREAL_1:226;
A23:    yL = uReal.D by A20,Th46;
        x <= yL by A19,A7,SURREALO:4;
        then R[(s+D)/2] by A22,A23,Th51,SURREALO:4;
        hence thesis by A5,A21, XREAL_1:226;
      end;
    end;
    hence thesis by A8;
  end;
  thus thesis by Th61;
end;

registration
  let x be *real Surreal;
  cluster -x -> *real;
  coherence
  proof
    consider r be Real such that
A1: x == uReal.r by Th62;
    -x == -uReal.r == uReal.-r by A1,Th56,SURREALR:65;
    then -x == uReal.-r by SURREALO:4;
    hence thesis by Th62;
  end;
  let y be *real Surreal;
  cluster x+y -> *real;
  coherence
  proof
    consider r be Real such that
A2: x == uReal.r by Th62;
    consider s be Real such that
A3: y == uReal.s by Th62;
    x+y == uReal.r+uReal.s == uReal.(r+s) by A2,A3,SURREALR:66,Th55;
    then x+y == uReal.(r+s) by SURREALO:4;
    hence thesis by Th62;
  end;
  cluster x*y -> *real;
  coherence
  proof
    consider r be Real such that
A4: x == uReal.r by Th62;
    consider s be Real such that
A5: y == uReal.s by Th62;
    x*y == uReal.r* y == uReal.r*uReal.s by A4,A5,SURREALR:54;
    then x*y == uReal.r*uReal.s == uReal.(r*s) by SURREALO:4,Th57;
    then x*y == uReal.(r*s) by SURREALO:4;
    hence thesis by Th62;
  end;
end;

begin :: Surreal Ordinals

definition
  let x be Surreal;
  attr x is No_ordinal means :Def10:
    R_x = {};
end;

registration
  cluster 0_No -> No_ordinal;
  coherence;
  let n;
  cluster uInt.n -> No_ordinal;
  coherence by Th7;
end;

registration
  cluster No_ordinal for uSurreal;
  existence
  proof
    0_No is No_ordinal;
    hence thesis;
  end;
end;

definition
  let A be Ordinal;
  func No_Ordinal_op A -> set means :Def11:
    ex S be Sequence st it = S.A & dom S = succ A &
      (for O st succ O in succ A holds S.succ O = [{S.O},{}]) &
      for O st O in succ A & O is limit_ordinal holds
         S.O = [rng (S|O),{}];
  existence
  proof
    deffunc C(Ordinal,set) = [{$2},{}];
    deffunc D(Ordinal,Sequence) = [rng $2,{}];
    consider L be Sequence such that
A1: dom L = succ A and
A2: 0 in succ A implies L.0 = 0_No and
A3: for A1 be Ordinal st
    succ A1 in succ A holds L.(succ A1) = C(A1,L.A1) and
A4: for A1 be Ordinal st A1 in succ A & A1 <> 0 & A1
    is limit_ordinal holds L.A1 = D(A1,L|A1) from ORDINAL2:sch 5;
    take L.A,L;
    thus L.A = L.A &
    dom L = succ A & for O st succ O in succ A holds L.succ O = [{L.O},{}]
    by A1,A3;
    let O such that
A5: O in succ A & O is limit_ordinal;
    per cases;
    suppose O=0;
      hence thesis by A2,A5;
    end;
    suppose O<>0;
      hence thesis by A5,A4;
    end;
  end;
  uniqueness
  proof
    deffunc C(Ordinal,set) = [{$2},{}];
    deffunc D(Ordinal,Sequence) = [rng $2,{}];
    let IT1,IT2 be set;
    given S1 be Sequence such that
A7: IT1 = S1.A and
A8: dom S1 = succ A and
A9: for O st succ O in succ A holds S1.succ O = C(O,S1.O) and
A10: for O st O in succ A & O is limit_ordinal holds
    S1.O = D(O,S1|O);
    given S2 be Sequence such that
A11: IT2 = S2.A and A12: dom S2 = succ A and
A13: for O st succ O in succ A holds S2.succ O = C(O,S2.O) and
A14: for O st O in succ A & O is limit_ordinal holds
    S2.O = D(O,S2|O);
    0 c= A;
    then
A15: S1.0 = D(0,S1|0) & D(0,S2|0) = S2.0
    by ORDINAL1:22,ORDINAL2:4,A10,A14;
A16: 0 in succ A implies S1.0 = 0_No by A15;
A17: 0 in succ A implies S2.0 = 0_No by A15;
A18: for O st O in succ A & O <>0 & O is limit_ordinal holds
    S1.O = D(O,S1|O) by A10;
A19: for O st O in succ A & O<>0 & O is limit_ordinal holds
    S2.O = D(O,S2|O) by A14;
    S1=S2 from ORDINAL2:sch 4(A8,A16,A9,A18,A12,A17,A13,A19);
    hence thesis by A7,A11;
  end;
end;

theorem Th63:
  for S be Sequence st dom S = succ A &
    (for O st succ O in succ A holds S.succ O = [{S.O},{}]) &
    (for O st O in succ A & O is limit_ordinal holds S.O = [rng (S|O),{}])
  for O st O in succ A holds S.O = No_Ordinal_op O
proof
  let S be Sequence such that
A1:dom S = succ A and
A2:(for O st succ O in succ A holds S.succ O = [{S.O},{}]) &
  (for O st O in succ A & O is limit_ordinal holds
  S.O = [rng (S|O),{}]);
  let O be Ordinal such that
A3: O in succ A;
  consider So be Sequence such that
A4:No_Ordinal_op O = So.O & dom So = succ O and
A5:(for B st succ B in succ O holds So.succ B = [{So.B},{}]) &
  for B st B in succ O & B is limit_ordinal holds
  So.B = [rng (So|B),{}] by Def11;
  defpred P[Ordinal] means $1 c= O implies So.$1=S.$1;
A6: for B be Ordinal st for C be Ordinal st C in B holds P[C] holds P[B]
  proof
    let B be Ordinal such that
A7: for C be Ordinal st C in B holds P[C];
    assume
A8: B c= O;
    then
A9: B in succ O by ORDINAL1:22;
    A10:B in succ A by A3,A8,ORDINAL1:12;
    per cases;
    suppose not B is limit_ordinal;
      then consider C be Ordinal such that
A11:  B = succ C by ORDINAL1:29;
A12:  C in B by A11,ORDINAL1:21;
      S.C = So.C by A8,A12,A7,ORDINAL1:def 2;
      then So.B = [{S.C},{}] by A5,A8,ORDINAL1:22,A11;
      hence thesis by A3,A8,ORDINAL1:12,A2,A11;
    end;
    suppose B is limit_ordinal;
      then
A13:  S.B = [rng (S|B), {}] & So.B = [rng (So|B), {}]
      by A2,A5,A8,ORDINAL1:22,A3,ORDINAL1:12;
A14:  dom (S|B)=B & dom (So|B)=B by A4,A1,A9,ORDINAL1:def 2,RELAT_1:62,A10;
      for x be object st x in B holds (So|B).x = (S|B).x
      proof
        let x be object such that
A15:    x in B;
        reconsider x as Ordinal by A15;
        (So|B).x = So.x by A15,FUNCT_1:49
        .= S.x by A15,A7,A8,ORDINAL1:def 2;
        hence thesis by A15,FUNCT_1:49;
      end;
      hence thesis by A13,A14,FUNCT_1:2;
    end;
  end;
  for B be Ordinal holds P[B] from ORDINAL1:sch 2(A6);
  hence thesis by A4;
end;

theorem Th64:
  No_Ordinal_op 0 = 0_No
proof
  consider S be Sequence such that
A1:  No_Ordinal_op 0 = S.0 & dom S = succ 0 and
A2:  (for O st succ O in succ 0 holds S.succ O = [{S.O},{}]) &
  for O st O in succ 0 & O is limit_ordinal holds
  S.O = [rng (S|O),{}] by Def11;
  S.0 = [rng (S|0),{}] by A2,ORDINAL1:6,ORDINAL2:4;
  hence thesis by A1;
end;

theorem Th65:
  No_Ordinal_op succ A = [{No_Ordinal_op A},{}]
proof
  set B=succ A;
  consider S be Sequence such that
A1:  No_Ordinal_op B = S.B & dom S = succ B and
A2:  (for O st succ O in succ B holds S.succ O = [{S.O},{}]) &
  for O st O in succ B & O is limit_ordinal holds S.O = [rng (S|O),{}]
  by Def11;
A3:B in succ B & A in B by ORDINAL1:6;
  S.B = [{S.A},{}] by ORDINAL1:6,A2;
  hence thesis by A3,A1,A2,Th63,ORDINAL1:10;
end;

theorem Th66:
  A is limit_ordinal implies
    ex X be set st No_Ordinal_op A = [X,{}] &
       (for o holds o in X iff ex B st B in A & o = No_Ordinal_op B)
proof
  assume
A1: A is limit_ordinal;
  set B=succ A;
  consider S be Sequence such that
A2:  No_Ordinal_op A = S.A & dom S = B and
A3:  (for O st succ O in B holds S.succ O = [{S.O},{}]) &
  for O st O in B & O is limit_ordinal holds S.O = [rng (S|O),{}] by Def11;
  take X= rng (S|A);
  thus No_Ordinal_op A = [X,{}] by ORDINAL1:6,A1,A2,A3;
  let o;
A4: A in B by ORDINAL1:6;
  then
A5:dom (S|A)=A by A2,ORDINAL1:def 2,RELAT_1:62;
  thus o in X implies ex B st B in A & o = No_Ordinal_op B
  proof
    assume o in X;
    then consider x be object such that
A6: x in dom (S|A) & (S|A).x =o by FUNCT_1:def 3;
    reconsider x as Ordinal by A6;
    S.x = No_Ordinal_op x by A2,A3,Th63,A4,A6,ORDINAL1:10;
    hence thesis by A6,FUNCT_1:47;
  end;
  given C be Ordinal such that
A7:C in A & o = No_Ordinal_op C;
  No_Ordinal_op C = S.C = (S|A).C
    by A7,A4,ORDINAL1:10,A5,A2,A3,Th63,FUNCT_1:47;
  hence thesis by A5,A7,FUNCT_1:def 3;
end;

theorem Th67:
  No_Ordinal_op A in Day A
proof
  defpred P[Ordinal] means No_Ordinal_op $1 in Day $1;
A1: for D be Ordinal st for C be Ordinal st C in D holds P[C] holds P[D]
  proof
    let D be Ordinal;
    assume
A2: for C be Ordinal st C in D holds P[C];
    per cases;
    suppose D is limit_ordinal;
      then consider X be set such that
A3:   No_Ordinal_op D = [X,{}] &
      (for o holds o in X iff ex B st B in D & o = No_Ordinal_op B) by Th66;
A4:   X<<{};
      for o be object st o in X\/ {} ex O st O in D & o in Day O
      proof
        let o;
        assume o in X \/ {};
        then consider B such that
A5:     B in D & o = No_Ordinal_op B by A3;
        No_Ordinal_op B in Day B by A5,A2;
        hence thesis by A5;
      end;
      hence thesis by A3,A4,SURREAL0:46;
    end;
    suppose not D is limit_ordinal;
      then consider B such that
A6:   succ B = D by ORDINAL1:29;
A7:   No_Ordinal_op B in Day B by A6,ORDINAL1:6,A2;
      then reconsider OB=No_Ordinal_op B as Surreal;
A8:   {OB}<< {};
      for o be object st o in {OB} \/ {} ex O st O in D & o in Day O
      proof
        let o;
        assume o in {OB} \/ {};
        then o=OB by TARSKI:def 1;
        hence thesis by A7,A6,ORDINAL1:6;
      end;
      then [{OB},{}] in Day D by A8,SURREAL0:46;
      hence thesis by A6,Th65;
    end;
  end;
  for D be Ordinal holds P[D] from ORDINAL1:sch 2(A1);
  hence thesis;
end;

registration
  let A;
  cluster No_Ordinal_op A -> surreal;
  coherence
  proof
    No_Ordinal_op A in Day A by Th67;
    hence No_Ordinal_op A is surreal;
  end;
end;

registration
  let A;
  cluster No_Ordinal_op A -> No_ordinal;
  coherence
  proof
    per cases;
    suppose A is limit_ordinal;
      then ex X be set st No_Ordinal_op A = [X,{}] &
      (for o holds o in X iff ex B st B in A & o = No_Ordinal_op B) by Th66;
      hence thesis;
    end;
    suppose not A is limit_ordinal;
      then consider B such that
A1:   succ B = A by ORDINAL1:29;
      No_Ordinal_op A = [{No_Ordinal_op B},{}] by Th65,A1;
      hence thesis;
    end;
  end;
end;

Lm23: A in B implies No_Ordinal_op A < No_Ordinal_op B
proof
  defpred P[Ordinal] means A in $1 implies
  No_Ordinal_op A < No_Ordinal_op $1;
A1: for D be Ordinal st for C be Ordinal st C in D holds P[C] holds P[D]
  proof
    let D be Ordinal such that
A2: for C be Ordinal st C in D holds P[C];
    assume
A3: A in D;
A4: L_(No_Ordinal_op D) << {No_Ordinal_op D} &
    No_Ordinal_op D in {No_Ordinal_op D}
    by SURREALO:11,TARSKI:def 1;
    per cases;
    suppose D is limit_ordinal;
      then consider X be set such that
A5:   No_Ordinal_op D = [X,{}] &
      (for o holds o in X iff ex B st B in D & o = No_Ordinal_op B) by Th66;
      thus thesis by A4,A3,A5;
    end;
    suppose not D is limit_ordinal;
      then consider B such that
A6:   succ B = D by ORDINAL1:29;
A7:   P[B] by A2,A6,ORDINAL1:6;
      No_Ordinal_op D = [{No_Ordinal_op B},{}] by A6,Th65;
      then
A8:   {No_Ordinal_op B} = L_(No_Ordinal_op D) << {No_Ordinal_op D}
      by SURREALO:11;
A9:   A c= B by A3,A6,ORDINAL1:22;
      No_Ordinal_op A <= No_Ordinal_op B by A7,ORDINAL1:11,A9,XBOOLE_0:def 8;
      hence thesis by A8,SURREALO:4,SURREALO:21;
    end;
  end;
  for D be Ordinal holds P[D] from ORDINAL1:sch 2(A1);
  hence thesis;
end;

theorem Th68:
  No_Ordinal_op A < No_Ordinal_op B iff A in B
proof
  thus No_Ordinal_op A < No_Ordinal_op B implies A in B
  proof
    assume
A1: No_Ordinal_op A < No_Ordinal_op B;
    assume not A in B;
    then per cases by ORDINAL1:16,XBOOLE_0:def 8;
    suppose A=B;
      hence thesis by A1,SURREALO:3;
    end;
    suppose B c< A;
      then No_Ordinal_op B <= No_Ordinal_op A by Lm23,ORDINAL1:11;
      hence thesis by A1;
    end;
  end;
  thus thesis by Lm23;
end;

theorem Th69:
  x in Day A implies x <= No_Ordinal_op A
proof
  defpred P[Ordinal] means for x st x in Day $1 holds
  x <= No_Ordinal_op $1;
A1: for D be Ordinal st for C be Ordinal st C in D holds P[C] holds P[D]
  proof
    let D be Ordinal such that
A2: for C be Ordinal st C in D holds P[C];
    set O = No_Ordinal_op D;
    let x;
    assume
A3: x in Day D;
    L_x << {O}
    proof
      let a,b be Surreal such that
A4:   a in L_x & b in {O};
A5:   a in L_x\/R_x by XBOOLE_0:def 3,A4;
      then
A6:   born a in born x by SURREALO:1;
A7:   No_Ordinal_op born a < No_Ordinal_op born x by A5,SURREALO:1,Th68;
A8:   born x c= D by A3,SURREAL0:def 18;
      then
A9:   No_Ordinal_op born x <= O by Th68,ORDINAL1:5;
      a in Day born a by SURREAL0:def 18;
      then a <= No_Ordinal_op born a by A2,A6,A8;
      then a < No_Ordinal_op born x by A7,SURREALO:4;
      then a < O by A9,SURREALO:4;
      hence thesis by A4,TARSKI:def 1;
    end;
    then L_x << {O} & {x}<<R_O by Def10;
    hence thesis by SURREAL0:43;
  end;
  for D be Ordinal holds P[D] from ORDINAL1:sch 2(A1);
  hence thesis;
end;

theorem Th70:
  born No_Ordinal_op A = A
  proof
A1: No_Ordinal_op A in Day A by Th67;
    for O st No_Ordinal_op A in Day O holds A c= O
    proof
      let O such that
A2:   No_Ordinal_op A in Day O & not A c= O;
      No_Ordinal_op O < No_Ordinal_op A by Th68,A2,ORDINAL1:16;
      hence thesis by Th69,A2;
    end;
    hence thesis by A1,SURREAL0:def 18;
  end;

theorem Th71:
  x in L_(No_Ordinal_op A) implies ex B st B in A & x = No_Ordinal_op B
  proof
    assume
A1: x in L_(No_Ordinal_op A);
    per cases;
    suppose A is limit_ordinal;
      then consider X be set such that
A2:   No_Ordinal_op A = [X,{}] &
      (for o holds o in X iff ex B st B in A & o = No_Ordinal_op B) by Th66;
      thus thesis by A1,A2;
    end;
    suppose not A is limit_ordinal;
      then consider B such that
A3:   succ B = A by ORDINAL1:29;
      No_Ordinal_op A = [{No_Ordinal_op B},{}] by Th65,A3;
      then x = No_Ordinal_op B by A1,TARSKI:def 1;
      hence thesis by A3,ORDINAL1:6;
    end;
  end;

Lm24: x is No_ordinal implies ex A st x == No_Ordinal_op A
proof
  defpred P[Ordinal] means x <= No_Ordinal_op $1;
  x in Day born x by SURREAL0:def 18;
  then x <= No_Ordinal_op born x by Th69;
  then
A1:ex C be Ordinal st P[C];
  consider Min be Ordinal such that
A2:  P[Min] & for C be Ordinal st P[C] holds Min c= C
  from ORDINAL1:sch 1(A1);
  assume
A3: x is No_ordinal;
  take Min;
  set M=No_Ordinal_op Min;
  L_M << {x}
  proof
    let a,b be Surreal such that
A4: a in L_M & b in {x} & not a < b;
    consider B such that
A5: B in Min & a= No_Ordinal_op B by A4,Th71;
    P[B] by A5,A4,TARSKI:def 1;
    hence thesis by A2,A5,ORDINAL1:5;
  end;
  then L_M << {x} & {M} << R_x by A3;
  hence thesis by A2,SURREAL0:43;
end;

theorem Th72:
  uInt.n = No_Ordinal_op n
proof
  defpred P[Nat] means uInt.$1 = No_Ordinal_op $1;
A1:P[0] by Def1,Th64;
A2:P[m] implies P[m+1]
  proof
    assume
A3: P[m];
    Segm (m+1) = succ Segm m by NAT_1:38;
    hence No_Ordinal_op (m+1) = [{No_Ordinal_op m},{}] by Th65
    .= uInt.(m+1) by Def1,A3;
  end;
  P[m] from NAT_1:sch 2(A1,A2);
  hence thesis;
end;

registration
  let O be No_ordinal Surreal;
  cluster Unique_No O -> No_ordinal;
  coherence
  proof
    set c = Unique_No O;
    consider A such that
A1: O == No_Ordinal_op A by Lm24;
    c == O by SURREALO:def 10;
    then
A2: c == No_Ordinal_op A by A1,SURREALO:4;
    then
A3: born c = born_eq c c= born No_Ordinal_op A = A
    by SURREALO:def 5,SURREALO:48,Th70;
    assume not c is No_ordinal;
    then consider C be object such that
A4: C in R_c by XBOOLE_0:def 1;
    reconsider C as Surreal by A4,SURREAL0:def 16;
    C in L_c \/ R_c by A4,XBOOLE_0:def 3;
    then
A5: born C in born c by SURREALO:1;
    C in Day born C by SURREAL0:def 18;
    then C <= No_Ordinal_op born C by Th69;
    then C < No_Ordinal_op A by A5,Th68,A3,SURREALO:4;
    then
A6: C <= c by A2,SURREALO:4;
    c in {c} << R_c by TARSKI:def 1,SURREALO:11;
    hence thesis by A4,A6;
  end;
end;

definition
  let A be Ordinal;
  func No_uOrdinal_op A -> No_ordinal uSurreal equals
    Unique_No No_Ordinal_op A;
  coherence;
end;

theorem Th73:
   No_uOrdinal_op A == No_Ordinal_op A & born No_uOrdinal_op A = A
proof
A1:No_uOrdinal_op A == No_Ordinal_op A by SURREALO:def 10;
  born_eq No_uOrdinal_op A = born_eq No_Ordinal_op A c= born No_Ordinal_op A
  = A by SURREALO:33,def 5,def 10,Th70;
  then
A2:born No_uOrdinal_op A c= A by SURREALO:48;
  A c= born No_uOrdinal_op A
  proof
    set B=born No_uOrdinal_op A;
    assume not A c= born No_uOrdinal_op A;
    then
A3: No_Ordinal_op B < No_Ordinal_op A by Th68,ORDINAL1:16;
    No_uOrdinal_op A in Day B by SURREAL0:def 18;
    then No_uOrdinal_op A <= No_Ordinal_op B by Th69;
    hence thesis by A1,A3,SURREALO:4;
  end;
  hence thesis by SURREALO:def 10,A2,XBOOLE_0:def 10;
end;

theorem Th74:
  No_uOrdinal_op A in Day A
proof
  born No_uOrdinal_op A = A by Th73;
  hence thesis by SURREAL0:def 18;
end;

theorem Th75:
  No_uOrdinal_op A < No_uOrdinal_op B iff A in B
proof
A1: No_uOrdinal_op A == No_Ordinal_op A &
  No_uOrdinal_op B == No_Ordinal_op B by Th73;
  thus No_uOrdinal_op A < No_uOrdinal_op B implies A in B
  proof
    assume No_uOrdinal_op A < No_uOrdinal_op B;
    then No_Ordinal_op A < No_uOrdinal_op B by A1,SURREALO:4;
    then No_Ordinal_op A < No_Ordinal_op B by A1,SURREALO:4;
    hence thesis by Th68;
  end;
  assume A in B;
  then No_uOrdinal_op A < No_Ordinal_op B by Th68,A1,SURREALO:4;
  hence thesis by A1,SURREALO:4;
end;

theorem Th76:
  x in Day A implies x <= No_uOrdinal_op A
proof
  assume x in Day A;
  then x <= No_Ordinal_op A == No_uOrdinal_op A by Th69,Th73;
  hence thesis by SURREALO:4;
end;

theorem
  x is No_ordinal implies ex A st x == No_uOrdinal_op A
proof
  assume x is No_ordinal;
  then consider A such that
A1:x == No_Ordinal_op A by Lm24;
  No_Ordinal_op A == No_uOrdinal_op A by Th73;
  then x == No_uOrdinal_op A by A1,SURREALO:4;
  hence thesis;
end;

theorem
  uInt.n = No_uOrdinal_op n
proof
   uInt.n = No_Ordinal_op n == No_uOrdinal_op n by Th72,Th73;
   hence thesis by SURREALO:50;
end;

theorem
  No_uOrdinal_op succ A = [{No_uOrdinal_op A},{}]
proof
   set OA=No_uOrdinal_op A,x = [{OA},{}];
A1: {OA}<<{};
A2: born OA = A by Th73;
   then
A3: OA in Day A by SURREAL0:def 18;
   o in {OA}\/{} implies ex O st O in succ A & o in Day O
   proof
     assume o in {OA}\/{};
     then o = OA by TARSKI:def 1;
     hence thesis by A3,ORDINAL1:6;
   end;
   then
A4:x in Day succ A by A1,SURREAL0:46;
   then reconsider x as Surreal;
A5: No_Ordinal_op succ A = [{No_Ordinal_op A},{}] by Th65;
   OA == No_Ordinal_op A by Th73;
   then {OA} <==> {No_Ordinal_op A} by SURREALO:32;
   then
A6: x == No_Ordinal_op succ A by A5,SURREALO:29;
A7: born x c= succ A by A4,SURREAL0:def 18;
   OA in L_x \/ R_x by TARSKI:def 1;
   then
A8: succ A c= born x by A2,SURREALO:1,ORDINAL1:21;
   for y be Surreal st y == x holds succ A c= born y
   proof
     let y be Surreal such that
A9:  y == x & not succ A c= born y;
     No_uOrdinal_op born y < No_uOrdinal_op succ A == No_Ordinal_op succ A
     by Th75,Th73,A9,ORDINAL1:16;
     then No_uOrdinal_op born y < No_Ordinal_op succ A
     by SURREALO:4;
     then
A10: No_uOrdinal_op born y < x by A6,SURREALO:4;
     born y c= A by A9,ORDINAL1:16,ORDINAL1:22;
     then y in Day born y c= Day A by SURREAL0:35,SURREAL0:def 18;
     then y <= No_uOrdinal_op born y by Th76;
     hence thesis by A9,A10,SURREALO:4;
   end;
   then
A11: born_eq x = succ A by A8,SURREALO:def 5,A7,XBOOLE_0:def 10;
   then
A12:x in born_eq_set x by A4,SURREALO:def 6;
A13: L_x\/R_x is uniq-surreal-membered;
   for z st z in born_eq_set x & L_z\/R_z is uniq-surreal-membered & x<>z
     holds card (L_x) (+) card (R_x) in card (L_z) (+) card (R_z)
   proof
     let z such that
A14: z in born_eq_set x & L_z\/R_z is uniq-surreal-membered & x<>z
     and
A15: not card (L_x) (+) card (R_x) in card (L_z) (+) card (R_z);
A16: z == x & z in Day succ A by A11,A14,SURREALO:def 6;
     then L_z << {x} & L_x << {z} by SURREAL0:43;
     then (ex xR be Surreal st xR in R_OA & OA < xR <= z) or
     (ex yL be Surreal st yL in L_z & OA <= yL < z) by SURREALO:13,21;
     then consider zL be Surreal such that
A17: zL in L_z & OA <= zL < z by Def10;
     zL in L_z\/R_z by A17,XBOOLE_0:def 3;
     then
A18: zL is uSurreal by A14;
     zL in L_z \/ R_z by A17,XBOOLE_0:def 3;
     then born zL in born z c= succ A
     by SURREALO:1,A16,SURREAL0:def 18;
     then zL in Day born zL c= Day A
     by SURREAL0:35,SURREAL0:def 18,ORDINAL1:22;
     then zL == OA by Th76,A17;
     then
A19: zL = OA by A18,SURREALO:50;
     card (L_x) = 1 & card (R_x)=0 by CARD_1:30;
     then card (L_x) (+) card (R_x) = 1 by ORDINAL7:69;
     then card (L_z) (+) card (R_z) = 1 by
     CARD_1:49,A15,ORDINAL1:16,A17,ZFMISC_1:33;
     then consider w be Surreal such that
A20: z= [{},{w}] or z = [{w},{}] by SURREALO:47;
     thus thesis by A20,A17,A14,A19,TARSKI:def 1;
   end;
   then
A21:x is uSurreal by A12,A13,SURREALO:49;
   No_Ordinal_op succ A == No_uOrdinal_op succ A by Th73;
   then No_uOrdinal_op succ A == x by A6,SURREALO:4;
   hence thesis by A21,SURREALO:50;
end;

theorem
  ex x be No_ordinal Surreal st
      born x = A & No_uOrdinal_op A == x &
     (for o holds o in L_x iff ex B st B in A & o = No_uOrdinal_op B)
proof
  defpred P[object] means ex B st B in A & $1 = No_uOrdinal_op B;
  consider X be set such that
A1: o in X iff o in Day A & P[o] from XBOOLE_0:sch 1;
A2:X<<{};
  o in X \/ {} implies ex O st O in A & o in Day O
  proof
    assume o in X \/ {};
    then consider B such that
A3: B in A & o = No_uOrdinal_op B by A1;
    born No_uOrdinal_op B = B by Th73;
    then No_uOrdinal_op B in Day B by SURREAL0:def 18;
    hence thesis by A3;
  end;
  then
A4: [X,{}] in Day A by A2,SURREAL0:46;
  then reconsider x= [X,{}] as Surreal;
  R_x = {};
  then reconsider x as No_ordinal Surreal by Def10;
  take x;
  for O st x in Day O holds A c= O
  proof
    let O such that
A5: x in Day O & not A c= O;
A6: No_uOrdinal_op O in Day O by Th74;
    Day O c= Day A by A5,SURREAL0:35;
    then No_uOrdinal_op O in X=L_x<<{x} & x in {x}
    by A6,A5,ORDINAL1:16,A1,SURREALO:11,TARSKI:def 1;
    hence thesis by A5,Th76;
  end;
  hence born x = A by A4,SURREAL0:def 18;
  L_(No_Ordinal_op A) << {x}
  proof
    let a,b be Surreal such that
A7: a in L_(No_Ordinal_op A) & b in {x};
    consider B such that
A8: B in A & a = No_Ordinal_op B by A7,Th71;
A9: No_uOrdinal_op B in Day B c= Day A
    by A8,ORDINAL1:def 2,Th74,SURREAL0:35;
    No_uOrdinal_op B in X =L_x<<{x} by A8,A1,SURREALO:11,A9;
    then a == No_uOrdinal_op B < b by A8,Th73,A7;
    hence thesis by SURREALO:4;
  end;
  then
A10: L_(No_Ordinal_op A) << {x} & {No_Ordinal_op A}<< R_x;
  L_x << {No_Ordinal_op A}
  proof
    let a,b be Surreal such that
A11:a in L_x & b in {No_Ordinal_op A};
    consider B such that
A12:B in A & a = No_uOrdinal_op B by A1,A11;
    a < No_uOrdinal_op A == No_Ordinal_op A by A12,Th75,Th73;
    then a < No_Ordinal_op A by SURREALO:4;
    hence thesis by A11,TARSKI:def 1;
  end;
  then L_x << {No_Ordinal_op A} & {x} << R_(No_Ordinal_op A) by Def10;
  then No_uOrdinal_op A == No_Ordinal_op A == x by SURREAL0:43,A10,Th73;
  hence No_uOrdinal_op A==x by SURREALO:4;
  let o;
  thus o in L_x implies ex B st B in A & o = No_uOrdinal_op B by A1;
  given B such that
A13: B in A & o = No_uOrdinal_op B;
  o in Day B c= Day A by A13,ORDINAL1:def 2,Th74,SURREAL0:35;
  hence thesis by A13,A1;
end;

registration
  let alpha,beta be No_ordinal Surreal;
  cluster alpha + beta -> No_ordinal;
  coherence
  proof
A1: alpha + beta = [(L_alpha ++ {beta})\/({alpha} ++ L_beta),
    (R_alpha ++ {beta}) \/({alpha} ++ R_beta)] by SURREALR:28;
    R_alpha = {} = R_beta by Def10;
    then R_alpha ++ {beta} = {} = {alpha} ++ R_beta by SURREALR:27;
    hence thesis by A1;
  end;
  cluster alpha * beta -> No_ordinal;
  coherence
  proof
    R_alpha = {} = R_beta by Def10;
    then
A2: alpha * beta = [comp(L_alpha,alpha,beta,L_beta) \/
    comp(R_alpha,alpha,beta,{}),
    comp(L_alpha,alpha,beta,{}) \/comp({},alpha,beta,L_beta)] by SURREALR:50;
    comp({},alpha,beta,L_beta) = comp(L_beta,beta,alpha,{}) by SURREALR:53;
    then comp({},alpha,beta,L_beta)={} = comp(L_alpha,alpha,beta,{})
    by SURREALR:49;
    hence thesis by A2;
  end;
end;