reserve A,B,C for Ordinal,
        o for object,
        x,y,z,t,r,l for Surreal,
        X,Y for set;

theorem Th37:
  (x+y)+z = x+(y+z)
proof
  defpred P[Ordinal] means
    for x,y,z be Surreal st born x (+) born y (+) born z c= $1
    holds (x+y)+z = x+(y+z);
  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];
    A3:for X,Y,Z be set st for x,y,z be Surreal st x in X & y in Y & z in Z
       holds born x (+) born y (+) born z in D holds
    X++(Y++Z) = (X++Y)++Z
    proof
      let X,Y,Z be set such that
      A4:for x,y,z be Surreal st x in X & y in Y & z in Z holds
      born x (+) born y (+) born z in D;
      thus X++(Y++Z) c= (X++Y)++Z
      proof
        let xyz be object;
        assume xyz in X++(Y++Z);
        then consider x,yz be Surreal such that
        A5: x in X & yz in Y++Z & xyz = x+yz by Def8;
        consider y,z be Surreal such that
        A6: y in Y & z in Z & yz = y+z by A5,Def8;
        x+y in X++Y by A5,A6,Def8;
        then A7:x+y+z in (X++Y)++Z by A6,Def8;
        born x (+) born y (+) born z in D by A5,A6,A4;
        hence thesis by A5,A6,A7,A2;
      end;
      let xyz be object;
      assume xyz in X++Y++Z;
      then consider xy,z be Surreal such that
      A8: xy in X++Y & z in Z & xyz = xy+z by Def8;
      consider x,y be Surreal such that
      A9: x in X & y in Y & xy = x+y by A8,Def8;
      y+z in Y++Z by A8,A9,Def8;
      then A10:x+(y+z) in X++(Y++Z) by A9,Def8;
      born x (+) born y (+) born z in D by A8,A9,A4;
      hence thesis by A8,A9,A10,A2;
    end;
    let x,y,z be Surreal such that A11:born x (+) born y (+) born z c= D;
    set xy=x+y,yz=y+z;
    A12: x + y=[(L_x ++ {y})\/({x} ++ L_y),(R_x ++ {y})\/({x} ++ R_y)]
    by Th28;
    A13: y + z=[(L_y ++ {z})\/({y} ++ L_z),(R_y ++ {z})\/({y} ++ R_z)]
    by Th28;
    A14:for a,b,c be Surreal st a in L_x & b in {y} & c in {z} holds
      born a (+) born b (+) born c in D
    proof
      let a,b,c be Surreal;
      assume a in L_x & b in {y} & c in {z};
      then A15:a in L_x\/R_x & b =y & c = z by TARSKI:def 1,XBOOLE_0:def 3;
      then born a (+) born b in born x (+) born y by SURREALO:1,ORDINAL7:94;
      then born a (+) born b (+) born c in
      born x (+) born y (+) born z by ORDINAL7:94,A15;
      hence thesis by A11;
    end;
    A16:for a,b,c be Surreal st a in {x} & b in L_y & c in {z} holds
    born a (+) born b (+) born c in D
    proof
      let a,b,c be Surreal;
      assume a in {x} & b in L_y& c in {z};
      then A17:a=x & b in L_y\/R_y & c = z by TARSKI:def 1,XBOOLE_0:def 3;
      then born a (+) born b in born x (+) born y by SURREALO:1,ORDINAL7:94;
      then born a (+) born b (+) born c in
      born x (+) born y (+) born z by ORDINAL7:94,A17;
      hence thesis by A11;
    end;
    A18:for a,b,c be Surreal st a in {x} & b in {y} & c in L_z holds
    born a (+) born b (+) born c in D
    proof
      let a,b,c be Surreal;
      assume a in {x} & b in {y} & c in L_z;
      then a=x & b=y & c in L_z\/R_z by TARSKI:def 1,XBOOLE_0:def 3;
      then born a (+) born b (+) born c in
      born x (+) born y (+) born z by SURREALO:1,ORDINAL7:94;
      hence thesis by A11;
    end;
    A19:(((L_x ++ {y})\/({x} ++ L_y)) ++ {z})\/({xy} ++ L_z)
    = ((L_x ++ {y}) ++ {z})\/(({x} ++ L_y) ++ {z})\/({xy} ++ L_z) by Th33
    .= (L_x ++ ({y} ++ {z}))\/(({x} ++ L_y) ++ {z})\/({xy} ++ L_z) by A14,A3
    .= (L_x ++ ({y} ++ {z}))\/({x} ++ (L_y ++ {z}))\/({xy} ++ L_z) by A16,A3
    .= (L_x ++ ({y} ++ {z}))\/({x} ++ (L_y ++ {z}))\/(( {x}++{y}) ++ L_z)
    by Th36
    .= (L_x ++ ({y} ++ {z}))\/({x} ++ (L_y ++ {z}))\/({x}++({y} ++ L_z))
    by A18,A3
    .= (L_x ++ ({y} ++ {z}))\/(({x} ++ (L_y ++ {z}))\/({x}++({y} ++ L_z)))
    by XBOOLE_1:4
    .= (L_x ++ ({y} ++ {z}))\/({x} ++ ((L_y ++ {z})\/({y} ++ L_z))) by Th33
    .= (L_x ++ ({yz}))\/({x} ++ (L_yz)) by A13,Th36;
    A20:for a,b,c be Surreal st a in R_x & b in {y} & c in {z} holds
    born a (+) born b (+) born c in D
    proof
      let a,b,c be Surreal;
      assume a in R_x & b in {y} & c in {z};
      then A21:a in L_x\/R_x & b =y & c = z by TARSKI:def 1,XBOOLE_0:def 3;
      then born a (+) born b in born x (+) born y by SURREALO:1,ORDINAL7:94;
      then born a (+) born b (+) born c in
      born x (+) born y (+) born z by ORDINAL7:94,A21;
      hence thesis by A11;
    end;
    A22:for a,b,c be Surreal st a in {x} & b in R_y & c in {z} holds
    born a (+) born b (+) born c in D
    proof
      let a,b,c be Surreal;
      assume a in {x} & b in R_y& c in {z};
      then A23:a=x & b in L_y\/R_y & c = z by TARSKI:def 1,XBOOLE_0:def 3;
      then born a (+) born b in born x (+) born y by SURREALO:1,ORDINAL7:94;
      then born a (+) born b (+) born c in
      born x (+) born y (+) born z by ORDINAL7:94,A23;
      hence thesis by A11;
    end;
    A24:for a,b,c be Surreal st a in {x} & b in {y} & c in R_z holds
    born a (+) born b (+) born c in D
    proof
      let a,b,c be Surreal;
      assume a in {x} & b in {y} & c in R_z;
      then a=x & b=y & c in L_z\/R_z by TARSKI:def 1,XBOOLE_0:def 3;
      then born a (+) born b (+) born c in
      born x (+) born y (+) born z by SURREALO:1,ORDINAL7:94;
      hence thesis by A11;
    end;
    A25: (((R_x ++ {y}) \/({x} ++ R_y)) ++ {z}) \/({xy} ++ R_z) =
    ((R_x ++ {y})++ {z}) \/(({x} ++ R_y) ++ {z})\/({xy} ++ R_z) by Th33
    .= (R_x ++ ({y}++ {z})) \/(({x} ++ R_y) ++ {z})\/({xy} ++ R_z) by A20,A3
    .= (R_x ++ ({yz})) \/(({x} ++ R_y) ++ {z})\/({xy} ++ R_z) by Th36
    .= (R_x ++ {yz}) \/(({x} ++ R_y) ++ {z})\/(({x}++{y}) ++ R_z) by Th36
    .= (R_x ++ {yz}) \/({x} ++ (R_y ++ {z}))\/(({x}++{y}) ++ R_z) by A22,A3
    .= (R_x ++ {yz}) \/({x} ++ (R_y ++ {z}))\/({x}++({y} ++ R_z)) by A24,A3
    .= (R_x ++ {yz}) \/(({x} ++ (R_y ++ {z}))\/({x}++({y} ++ R_z)))
    by XBOOLE_1:4
    .= (R_x ++ {yz}) \/({x} ++ R_yz) by A13,Th33;
    xy +z = [(L_xy ++ {z})\/({xy} ++ L_z), (R_xy ++ {z}) \/({xy} ++ R_z)]
    by Th28
    .= [(L_x ++ ({yz}))\/({x} ++ (L_yz)),
    (R_x ++ {yz}) \/({x} ++ R_yz)] by A25,A19,A12;
    hence thesis by Th28;
  end;
  A26:for D be Ordinal holds P[D] from ORDINAL1:sch 2(A1);
  P[born x (+) born y (+) born z] by A26;
  hence thesis;
end;
