src/HOL/Real/real_arith.ML
changeset 14355 67e2e96bfe36
parent 14352 a8b1a44d8264
child 14356 9e3ce012f843
equal deleted inserted replaced
14354:988aa4648597 14355:67e2e96bfe36
   265    cvar(real_mult_left_mono, hd(tl(prems_of real_mult_left_mono))))]
   265    cvar(real_mult_left_mono, hd(tl(prems_of real_mult_left_mono))))]
   266 
   266 
   267 (* reduce contradictory <= to False *)
   267 (* reduce contradictory <= to False *)
   268 val simps = [True_implies_equals,
   268 val simps = [True_implies_equals,
   269              inst "a" "(number_of ?v)::real" right_distrib,
   269              inst "a" "(number_of ?v)::real" right_distrib,
   270              divide_1,times_divide_eq_right,times_divide_eq_left];
   270              divide_1,times_divide_eq_right,times_divide_eq_left,
       
   271          real_of_nat_zero, real_of_nat_Suc, real_of_nat_add, real_of_nat_mult,
       
   272          real_of_int_zero, real_of_one, real_of_int_add RS sym,
       
   273          real_of_int_minus RS sym, real_of_int_diff RS sym,
       
   274          real_of_int_mult RS sym];
       
   275 
       
   276 val int_inj_thms = [real_of_int_le_iff RS iffD2, real_of_int_less_iff RS iffD2,
       
   277                     real_of_int_inject RS iffD2];
       
   278 
       
   279 val nat_inj_thms = [real_of_nat_le_iff RS iffD2, real_of_nat_less_iff RS iffD2,
       
   280                     real_of_nat_inject RS iffD2];
   271 
   281 
   272 in
   282 in
   273 
   283 
   274 val fast_real_arith_simproc = Simplifier.simproc (Theory.sign_of (the_context ()))
   284 val fast_real_arith_simproc = Simplifier.simproc (Theory.sign_of (the_context ()))
   275   "fast_real_arith" ["(m::real) < n","(m::real) <= n", "(m::real) = n"]
   285   "fast_real_arith" ["(m::real) < n","(m::real) <= n", "(m::real) = n"]
   277 
   287 
   278 val real_arith_setup =
   288 val real_arith_setup =
   279  [Fast_Arith.map_data (fn {add_mono_thms, mult_mono_thms, inj_thms, lessD, simpset} =>
   289  [Fast_Arith.map_data (fn {add_mono_thms, mult_mono_thms, inj_thms, lessD, simpset} =>
   280    {add_mono_thms = add_mono_thms @ add_mono_thms_real,
   290    {add_mono_thms = add_mono_thms @ add_mono_thms_real,
   281     mult_mono_thms = mult_mono_thms @ real_mult_mono_thms,
   291     mult_mono_thms = mult_mono_thms @ real_mult_mono_thms,
   282     inj_thms = inj_thms, (*FIXME: add real*)
   292     inj_thms = int_inj_thms @ nat_inj_thms @ inj_thms,
   283     lessD = lessD,  (*Can't change LA_Data_Ref.lessD: the reals are dense!*)
   293     lessD = lessD,  (*Can't change lessD: the reals are dense!*)
   284     simpset = simpset addsimps add_rules
   294     simpset = simpset addsimps add_rules
   285                       addsimps simps
   295                       addsimps simps
   286                       addsimprocs simprocs}),
   296                       addsimprocs simprocs}),
       
   297   arith_inj_const ("RealDef.real", HOLogic.natT --> HOLogic.realT),
       
   298   arith_inj_const ("RealDef.real", HOLogic.intT --> HOLogic.realT),
   287   arith_discrete ("RealDef.real",false),
   299   arith_discrete ("RealDef.real",false),
   288   Simplifier.change_simpset_of (op addsimprocs) [fast_real_arith_simproc]];
   300   Simplifier.change_simpset_of (op addsimprocs) [fast_real_arith_simproc]];
   289 
   301 
   290 (* some thms for injection nat => real:
   302 (* some thms for injection nat => real:
   291 real_of_nat_zero
   303 real_of_nat_zero