src/HOL/Int.thy
changeset 61234 a9e6052188fa
parent 61204 3e491e34a62e
child 61524 f2e51e704a96
equal deleted inserted replaced
61233:1da01148d4b1 61234:a9e6052188fa
   256 
   256 
   257 lemma of_int_0_eq_iff [simp]:
   257 lemma of_int_0_eq_iff [simp]:
   258   "0 = of_int z \<longleftrightarrow> z = 0"
   258   "0 = of_int z \<longleftrightarrow> z = 0"
   259   using of_int_eq_iff [of 0 z] by simp
   259   using of_int_eq_iff [of 0 z] by simp
   260 
   260 
       
   261 lemma of_int_eq_1_iff [iff]:
       
   262    "of_int z = 1 \<longleftrightarrow> z = 1"
       
   263   using of_int_eq_iff [of z 1] by simp
       
   264 
   261 end
   265 end
   262 
   266 
   263 context linordered_idom
   267 context linordered_idom
   264 begin
   268 begin
   265 
   269 
   289 
   293 
   290 lemma of_int_less_0_iff [simp]:
   294 lemma of_int_less_0_iff [simp]:
   291   "of_int z < 0 \<longleftrightarrow> z < 0"
   295   "of_int z < 0 \<longleftrightarrow> z < 0"
   292   using of_int_less_iff [of z 0] by simp
   296   using of_int_less_iff [of z 0] by simp
   293 
   297 
       
   298 lemma of_int_1_le_iff [simp]:
       
   299   "1 \<le> of_int z \<longleftrightarrow> 1 \<le> z"
       
   300   using of_int_le_iff [of 1 z] by simp
       
   301 
       
   302 lemma of_int_le_1_iff [simp]:
       
   303   "of_int z \<le> 1 \<longleftrightarrow> z \<le> 1"
       
   304   using of_int_le_iff [of z 1] by simp
       
   305 
       
   306 lemma of_int_1_less_iff [simp]:
       
   307   "1 < of_int z \<longleftrightarrow> 1 < z"
       
   308   using of_int_less_iff [of 1 z] by simp
       
   309 
       
   310 lemma of_int_less_1_iff [simp]:
       
   311   "of_int z < 1 \<longleftrightarrow> z < 1"
       
   312   using of_int_less_iff [of z 1] by simp
       
   313 
   294 end
   314 end
       
   315 
       
   316 text \<open>Comparisons involving @{term of_int}.\<close>
       
   317 
       
   318 lemma of_int_eq_numeral_iff [iff]:
       
   319    "of_int z = (numeral n :: 'a::ring_char_0) 
       
   320    \<longleftrightarrow> z = numeral n"
       
   321   using of_int_eq_iff by fastforce
       
   322 
       
   323 lemma of_int_le_numeral_iff [simp]:           
       
   324    "of_int z \<le> (numeral n :: 'a::linordered_idom) 
       
   325    \<longleftrightarrow> z \<le> numeral n"
       
   326   using of_int_le_iff [of z "numeral n"] by simp
       
   327 
       
   328 lemma of_int_numeral_le_iff [simp]:  
       
   329    "(numeral n :: 'a::linordered_idom) \<le> of_int z \<longleftrightarrow> numeral n \<le> z"
       
   330   using of_int_le_iff [of "numeral n"] by simp
       
   331 
       
   332 lemma of_int_less_numeral_iff [simp]:           
       
   333    "of_int z < (numeral n :: 'a::linordered_idom) 
       
   334    \<longleftrightarrow> z < numeral n"
       
   335   using of_int_less_iff [of z "numeral n"] by simp
       
   336 
       
   337 lemma of_int_numeral_less_iff [simp]:           
       
   338    "(numeral n :: 'a::linordered_idom) < of_int z \<longleftrightarrow> numeral n < z"
       
   339   using of_int_less_iff [of "numeral n" z] by simp
   295 
   340 
   296 lemma of_nat_less_of_int_iff:
   341 lemma of_nat_less_of_int_iff:
   297   "(of_nat n::'a::linordered_idom) < of_int x \<longleftrightarrow> int n < x"
   342   "(of_nat n::'a::linordered_idom) < of_int x \<longleftrightarrow> int n < x"
   298   by (metis of_int_of_nat_eq of_int_less_iff)
   343   by (metis of_int_of_nat_eq of_int_less_iff)
   299 
   344