
theorem Th13:
  for x,y be Element of BOOLEAN holds add_ovfl(<*x*>,<*y*>) = TRUE
  iff x = TRUE & y = TRUE
proof
  let x,y be Element of BOOLEAN;
A1: (<*TRUE*>/.1) '&' (<*TRUE*>/.1) = TRUE by FINSEQ_4:16;
  thus add_ovfl(<*x*>,<*y*>) = TRUE implies x = TRUE & y = TRUE
  proof
    assume add_ovfl(<*x*>,<*y*>) = TRUE;
    then
    (<*x*>/.1) '&' (<*y*>/.1) 'or' (<*x*>/.1) '&' ((carry(<*x*>,<*y*>))/.1
    ) 'or' (<*y*>/.1) '&' ((carry(<*x*>,<*y*>))/.1) = TRUE by BINARITH:def 6;
    then
A2: (<*x*>/.1) '&' (<*y*>/.1) 'or' (<*x*>/.1) '&' ((carry(<*x*>,<*y*>))/.1
    ) = TRUE or (<*y*>/.1) '&' ((carry(<*x*>,<*y*>))/.1) = TRUE by Th12;
    now
      per cases by A2,Th12;
      suppose
A3:     (<*x*>/.1) '&' (<*y*>/.1) = TRUE;
        then (<*x*>/.1) = TRUE by MARGREL1:12;
        hence thesis by A3,FINSEQ_4:16;
      end;
      suppose
        (<*x*>/.1) '&' ((carry(<*x*>,<*y*>))/.1) = TRUE;
        then (carry(<*x*>,<*y*>))/.1 = TRUE by MARGREL1:12;
        hence thesis by BINARITH:def 2;
      end;
      suppose
        (<*y*>/.1) '&' ((carry(<*x*>,<*y*>))/.1) = TRUE;
        then (carry(<*x*>,<*y*>))/.1 = TRUE by MARGREL1:12;
        hence thesis by BINARITH:def 2;
      end;
    end;
    hence thesis;
  end;
  assume that
A4: x = TRUE and
A5: y = TRUE;
  thus add_ovfl(<*x*>,<*y*>) = (<*TRUE*>/.1) '&' (<*TRUE*>/.1) 'or' (<*TRUE*>
/.1) '&' ((carry(<*TRUE*>,<*TRUE*>))/.1) 'or' (<*TRUE*>/.1) '&' (((carry(<*TRUE
  *>,<*TRUE*>))/.1)) by A4,A5,BINARITH:def 6
    .= TRUE by A1;
end;
