src/HOL/Int.thy
changeset 57514 bdc2c6b40bf2
parent 57512 cc97b347b301
child 58512 dc4d76dfa8f0
equal deleted inserted replaced
57513:55b2afc5ddfc 57514:bdc2c6b40bf2
   516   assumes "0 \<le> k" obtains n where "k = int n"
   516   assumes "0 \<le> k" obtains n where "k = int n"
   517   using assms by (rule nonneg_eq_int)
   517   using assms by (rule nonneg_eq_int)
   518 
   518 
   519 lemma Let_numeral [simp]: "Let (numeral v) f = f (numeral v)"
   519 lemma Let_numeral [simp]: "Let (numeral v) f = f (numeral v)"
   520   -- {* Unfold all @{text let}s involving constants *}
   520   -- {* Unfold all @{text let}s involving constants *}
   521   unfolding Let_def ..
   521   by (fact Let_numeral) -- {* FIXME drop *}
   522 
   522 
   523 lemma Let_neg_numeral [simp]: "Let (- numeral v) f = f (- numeral v)"
   523 lemma Let_neg_numeral [simp]: "Let (- numeral v) f = f (- numeral v)"
   524   -- {* Unfold all @{text let}s involving constants *}
   524   -- {* Unfold all @{text let}s involving constants *}
   525   unfolding Let_def ..
   525   by (fact Let_neg_numeral) -- {* FIXME drop *}
   526 
   526 
   527 text {* Unfold @{text min} and @{text max} on numerals. *}
   527 text {* Unfold @{text min} and @{text max} on numerals. *}
   528 
   528 
   529 lemmas max_number_of [simp] =
   529 lemmas max_number_of [simp] =
   530   max_def [of "numeral u" "numeral v"]
   530   max_def [of "numeral u" "numeral v"]
   557   assumes le: "0 \<le> z"
   557   assumes le: "0 \<le> z"
   558   shows "(0::int) < 1 + z"
   558   shows "(0::int) < 1 + z"
   559 proof -
   559 proof -
   560   have "0 \<le> z" by fact
   560   have "0 \<le> z" by fact
   561   also have "... < z + 1" by (rule less_add_one)
   561   also have "... < z + 1" by (rule less_add_one)
   562   also have "... = 1 + z" by (simp add: add_ac)
   562   also have "... = 1 + z" by (simp add: ac_simps)
   563   finally show "0 < 1 + z" .
   563   finally show "0 < 1 + z" .
   564 qed
   564 qed
   565 
   565 
   566 lemma odd_less_0_iff:
   566 lemma odd_less_0_iff:
   567   "(1 + z + z < 0) = (z < (0::int))"
   567   "(1 + z + z < 0) = (z < (0::int))"