src/HOL/nat_simprocs.ML
changeset 24431 02d29baa42ff
parent 24093 5d0ecd0c8f3c
child 24630 351a308ab58d
equal deleted inserted replaced
24430:df56b9779a3d 24431:02d29baa42ff
   545 (*** Prepare linear arithmetic for nat numerals ***)
   545 (*** Prepare linear arithmetic for nat numerals ***)
   546 
   546 
   547 local
   547 local
   548 
   548 
   549 (* reduce contradictory <= to False *)
   549 (* reduce contradictory <= to False *)
   550 val add_rules =
   550 val add_rules = @{thms ring_distribs} @
   551   [@{thm Let_number_of}, @{thm Let_0}, @{thm Let_1}, @{thm nat_0}, @{thm nat_1},
   551   [@{thm Let_number_of}, @{thm Let_0}, @{thm Let_1}, @{thm nat_0}, @{thm nat_1},
   552    @{thm add_nat_number_of}, @{thm diff_nat_number_of}, @{thm mult_nat_number_of},
   552    @{thm add_nat_number_of}, @{thm diff_nat_number_of}, @{thm mult_nat_number_of},
   553    @{thm eq_nat_number_of}, @{thm less_nat_number_of}, @{thm le_number_of_eq_not_less},
   553    @{thm eq_nat_number_of}, @{thm less_nat_number_of}, @{thm le_number_of_eq_not_less},
   554    @{thm le_Suc_number_of}, @{thm le_number_of_Suc},
   554    @{thm le_Suc_number_of}, @{thm le_number_of_Suc},
   555    @{thm less_Suc_number_of}, @{thm less_number_of_Suc},
   555    @{thm less_Suc_number_of}, @{thm less_number_of_Suc},
   556    @{thm Suc_eq_number_of}, @{thm eq_number_of_Suc},
   556    @{thm Suc_eq_number_of}, @{thm eq_number_of_Suc},
   557    @{thm mult_Suc}, @{thm mult_Suc_right},
   557    @{thm mult_Suc}, @{thm mult_Suc_right},
       
   558    @{thm add_Suc}, @{thm add_Suc_right},
   558    @{thm eq_number_of_0}, @{thm eq_0_number_of}, @{thm less_0_number_of},
   559    @{thm eq_number_of_0}, @{thm eq_0_number_of}, @{thm less_0_number_of},
   559    @{thm of_int_number_of_eq}, @{thm of_nat_number_of_eq}, @{thm nat_number_of}, @{thm if_True}, @{thm if_False}];
   560    @{thm of_int_number_of_eq}, @{thm of_nat_number_of_eq}, @{thm nat_number_of}, @{thm if_True}, @{thm if_False}];
       
   561 
       
   562 (* Products are multiplied out during proof (re)construction via
       
   563 ring_distribs. Ideally they should remain atomic. But that is
       
   564 currently not possible because 1 is replaced by Suc 0, and then some
       
   565 simprocs start to mess around with products like (n+1)*m. The rule
       
   566 1 == Suc 0 is necessary for early parts of HOL where numerals and
       
   567 simprocs are not yet available. But then it is difficult to remove
       
   568 that rule later on, because it may find its way back in when theories
       
   569 (and thus lin-arith simpsets) are merged. Otherwise one could turn the
       
   570 rule around (Suc n = n+1) and see if that helps products being left
       
   571 alone. *)
   560 
   572 
   561 val simprocs = Nat_Numeral_Simprocs.combine_numerals
   573 val simprocs = Nat_Numeral_Simprocs.combine_numerals
   562   :: Nat_Numeral_Simprocs.cancel_numerals;
   574   :: Nat_Numeral_Simprocs.cancel_numerals;
   563 
   575 
   564 in
   576 in