reserve x,y,z,w for ExtReal,
  r for Real;
reserve f,g for ExtReal;

theorem
  0<= x & 0<= y & 0<= z implies (x + y) + z = x + (y + z)
proof
  assume that
A1: 0<= x and
A2: 0<= y and
A3: 0<= z;
  per cases by A1,A2,A3,XXREAL_0:14;
  suppose
    x in REAL & y in REAL & z in REAL;
    then consider a,b,c,d,e being Real such that
A4: x = a & y = b & z = c and
    x + y = d and
    y + z = e;
    (x + y) + z = (a + b) + c by A4
      .= a + (b + c)
      .= x + (y + z) by A4;
    hence thesis;
  end;
  suppose
A5: x = +infty;
    then (x + y) + z = +infty + z by A2,Def2
      .= +infty by A3,Def2
      .= +infty + (y + z) by A2,A3,Def2;
    hence thesis by A5;
  end;
  suppose
A6: y = +infty;
    then (x + y) + z = +infty + z by A1,Def2
      .= +infty by A3,Def2
      .= x + (+infty) by A1,Def2
      .= x + (+infty + z) by A3,Def2;
    hence thesis by A6;
  end;
  suppose
A7: z = +infty;
    then (x + y) + z = +infty by A1,A2,Def2
      .= x + (+infty) by A1,Def2
      .= x + (y + (+infty)) by A2,Def2;
    hence thesis by A7;
  end;
end;
