src/HOL/Int.thy
changeset 51329 4a3c453f99a1
parent 51185 145d76c35f8b
child 51994 82cc2aeb7d13
equal deleted inserted replaced
51328:d63ec23c9125 51329:4a3c453f99a1
   300 proof
   300 proof
   301   fix z show "of_int z = id z"
   301   fix z show "of_int z = id z"
   302     by (cases z rule: int_diff_cases, simp)
   302     by (cases z rule: int_diff_cases, simp)
   303 qed
   303 qed
   304 
   304 
       
   305 
       
   306 instance int :: no_top
       
   307   apply default
       
   308   apply (rule_tac x="x + 1" in exI)
       
   309   apply simp
       
   310   done
       
   311 
       
   312 instance int :: no_bot
       
   313   apply default
       
   314   apply (rule_tac x="x - 1" in exI)
       
   315   apply simp
       
   316   done
   305 
   317 
   306 subsection {* Magnitude of an Integer, as a Natural Number: @{text nat} *}
   318 subsection {* Magnitude of an Integer, as a Natural Number: @{text nat} *}
   307 
   319 
   308 lift_definition nat :: "int \<Rightarrow> nat" is "\<lambda>(x, y). x - y"
   320 lift_definition nat :: "int \<Rightarrow> nat" is "\<lambda>(x, y). x - y"
   309   by auto
   321   by auto