new conversion theorems for int, nat to float
authorpaulson <lp15@cam.ac.uk>
Wed, 11 Nov 2015 17:11:50 +0000
changeset 61639 6ef461bee3fa
parent 61638 7ffc9c4f1f74
child 61641 34460a266346
new conversion theorems for int, nat to float
src/HOL/Library/Float.thy
--- a/src/HOL/Library/Float.thy	Wed Nov 11 16:42:30 2015 +0100
+++ b/src/HOL/Library/Float.thy	Wed Nov 11 17:11:50 2015 +0000
@@ -31,7 +31,6 @@
 declare real_of_float_inverse[simp] float_of_inverse [simp]
 declare real_of_float [simp]
 
-
 subsection \<open>Real operations preserving the representation as floating point number\<close>
 
 lemma floatI: fixes m e :: int shows "m * 2 powr e = x \<Longrightarrow> x \<in> float"
@@ -214,6 +213,12 @@
 
 end
 
+lemma real_of_float [simp]: "real_of_float (of_nat n) = of_nat n"
+by (induct n) simp_all
+
+lemma real_of_float_of_int_eq [simp]: "real_of_float (of_int z) = of_int z"
+  by (cases z rule: int_diff_cases) (simp_all add: of_rat_diff)
+
 lemma Float_0_eq_0[simp]: "Float 0 e = 0"
   by transfer simp