reserve x,y for Real,
  i, j for non zero Element of NAT,
  I, O for non empty set,
  s,s1,s2,s3 for Element of I,
  w, w1, w2 for FinSequence of I,
  t for Element of O,
  S for non empty FSM over I,
  q, q1 for State of S;
reserve n, m, o, p for non zero Element of NAT,
  M for non empty Moore-SM_Final over I, O,
  q for State of M;

theorem Th26:
  for M being non empty Moore-SM_Final over [:REAL, REAL:], succ REAL
  st M is calculating_type & the carrier of M = succ REAL &
  the FinalS of M = REAL & the InitS of M = REAL &
  the OFun of M = id the carrier of M &
  (for x,y st x>0 or y>0 holds (the Tran of M).[the InitS of M, [x,y]] = 1) &
  (for x,y st (x=0 or y=0) & x <= 0 & y <=0
  holds (the Tran of M).[the InitS of M, [x,y]] = 0) &
  (for x,y st x<0 & y<0 holds (the Tran of M).[the InitS of M, [x,y]] = -1)
  for x,y being Element of REAL holds max(sgn x,sgn y) is_result_of [x,y], M
proof
  deffunc F(Real,Real) = In(max(sgn $1,sgn $2),REAL);
  consider f being BinOp of REAL such that
A1: for x,y being Element of REAL holds f.(x,y) = F(x,y)
from BINOP_1:sch 4;
A2: for x,y being Element of REAL holds f.(x,y) = max(sgn x,sgn y)
   proof let x,y be Element of REAL;
     reconsider x,y as Real;
     f.(x,y) = F(x,y) by A1;
    hence thesis;
   end;
  let M being non empty Moore-SM_Final over [:REAL, REAL:], succ REAL;
  assume that
A3: M is calculating_type and
A4: the carrier of M = succ REAL and
A5: the FinalS of M = REAL and
A6: the InitS of M = REAL and
A7: the OFun of M = id the carrier of M;
  assume that
A8: for x,y st x>0 or y>0 holds (the Tran of M).[the InitS of M, [x,y]] = 1 and
A9: for x,y st (x=0 or y=0) & x <= 0 & y <=0 holds (the Tran of M).[the
  InitS of M, [x,y]] = 0 and
A10: for x,y st x<0 & y<0 holds (the Tran of M).[the InitS of M, [x,y]] = -1;
  let x,y be Element of REAL;
  now
    let x,y be Element of REAL;
    (the Tran of M).[the InitS of M, [x,y]] = F(x,y)
    proof
      now per cases;
        suppose
A11:      x > 0;
          then
A12:      sgn x = 1 by ABSVALUE:def 2;
          now per cases;
            suppose y > 0;
              then sgn y = 1 by ABSVALUE:def 2;
              hence thesis by A8,A11,A12;
            end;
            suppose y = 0;
              then sgn y = 0 by ABSVALUE:def 2;
              then max(sgn x, sgn y) = 1 by A12,XXREAL_0:def 10;
              hence thesis by A8,A11;
            end;
            suppose y < 0;
              then sgn y = -1 by ABSVALUE:def 2;
              then max(sgn x, sgn y) = 1 by A12,XXREAL_0:def 10;
              hence thesis by A8,A11;
            end;
          end;
          hence thesis;
        end;
        suppose
A13:      x = 0;
          then
A14:      sgn x = 0 by ABSVALUE:def 2;
          now per cases;
            suppose
A15:          y > 0;
              then sgn y = 1 by ABSVALUE:def 2;
              then max(sgn x, sgn y) = 1 by A14,XXREAL_0:def 10;
              hence thesis by A8,A15;
            end;
            suppose
A16:          y = 0;
              then sgn y = 0 by ABSVALUE:def 2;
              hence thesis by A9,A13,A16;
            end;
            suppose
A17:          y < 0;
              then sgn y = -1 by ABSVALUE:def 2;
              then max(sgn x, sgn y) = 0 by A14,XXREAL_0:def 10;
              hence thesis by A9,A13,A17;
            end;
          end;
          hence thesis;
        end;
        suppose
A18:      x < 0;
          then
A19:      sgn x = -1 by ABSVALUE:def 2;
          now per cases;
            suppose
A20:          y > 0;
              then sgn y = 1 by ABSVALUE:def 2;
              then max(sgn x, sgn y) = 1 by A19,XXREAL_0:def 10;
              hence thesis by A8,A20;
            end;
            suppose
A21:          y = 0;
              then sgn y = 0 by ABSVALUE:def 2;
              then max(sgn x, sgn y) = 0 by A19,XXREAL_0:def 10;
              hence thesis by A9,A18,A21;
            end;
            suppose
A22:          y < 0;
              then sgn y = -1 by ABSVALUE:def 2;
              hence thesis by A10,A18,A19,A22;
            end;
          end;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
    hence (the Tran of M).[the InitS of M, [x,y]] = f.(x,y) by A2;
  end;
  then f.(x,y) is_result_of [x,y], M by A3,A4,A5,A6,A7,Th22;
  hence thesis by A2;
end;
