equal
deleted
inserted
replaced
250 |
250 |
251 (*Maps #n to n for n = 0, 1, 2*) |
251 (*Maps #n to n for n = 0, 1, 2*) |
252 lemmas numerals = nat_numeral_0_eq_0 nat_numeral_1_eq_1 numeral_2_eq_2 |
252 lemmas numerals = nat_numeral_0_eq_0 nat_numeral_1_eq_1 numeral_2_eq_2 |
253 |
253 |
254 |
254 |
255 subsection{*General Theorems About Powers Involving Binary Numerals*} |
255 subsection{*Powers with Numeric Exponents*} |
256 |
256 |
257 text{*We cannot refer to the number @{term 2} in @{text Ring_and_Field.thy}. |
257 text{*We cannot refer to the number @{term 2} in @{text Ring_and_Field.thy}. |
258 We cannot prove general results about the numeral @{term "-1"}, so we have to |
258 We cannot prove general results about the numeral @{term "-1"}, so we have to |
259 use @{term "- 1"} instead.*} |
259 use @{term "- 1"} instead.*} |
260 |
260 |
274 by (simp add: power2_eq_square zero_le_square) |
274 by (simp add: power2_eq_square zero_le_square) |
275 |
275 |
276 lemma zero_less_power2 [simp]: |
276 lemma zero_less_power2 [simp]: |
277 "(0 < a\<twosuperior>) = (a \<noteq> (0::'a::{ordered_idom,recpower}))" |
277 "(0 < a\<twosuperior>) = (a \<noteq> (0::'a::{ordered_idom,recpower}))" |
278 by (force simp add: power2_eq_square zero_less_mult_iff linorder_neq_iff) |
278 by (force simp add: power2_eq_square zero_less_mult_iff linorder_neq_iff) |
|
279 |
|
280 lemma power2_less_0 [simp]: |
|
281 fixes a :: "'a::{ordered_idom,recpower}" |
|
282 shows "~ (a\<twosuperior> < 0)" |
|
283 by (force simp add: power2_eq_square mult_less_0_iff) |
279 |
284 |
280 lemma zero_eq_power2 [simp]: |
285 lemma zero_eq_power2 [simp]: |
281 "(a\<twosuperior> = 0) = (a = (0::'a::{ordered_idom,recpower}))" |
286 "(a\<twosuperior> = 0) = (a = (0::'a::{ordered_idom,recpower}))" |
282 by (force simp add: power2_eq_square mult_eq_0_iff) |
287 by (force simp add: power2_eq_square mult_eq_0_iff) |
283 |
288 |
338 "0 \<le> a ^ Suc(2*n) ==> 0 \<le> (a::'a::{ordered_idom,recpower})" |
343 "0 \<le> a ^ Suc(2*n) ==> 0 \<le> (a::'a::{ordered_idom,recpower})" |
339 apply (insert odd_power_less_zero [of a n]) |
344 apply (insert odd_power_less_zero [of a n]) |
340 apply (force simp add: linorder_not_less [symmetric]) |
345 apply (force simp add: linorder_not_less [symmetric]) |
341 done |
346 done |
342 |
347 |
|
348 text{*Simprules for comparisons where common factors can be cancelled.*} |
|
349 lemmas zero_compare_simps = |
|
350 add_strict_increasing add_strict_increasing2 add_increasing |
|
351 zero_le_mult_iff zero_le_divide_iff |
|
352 zero_less_mult_iff zero_less_divide_iff |
|
353 mult_le_0_iff divide_le_0_iff |
|
354 mult_less_0_iff divide_less_0_iff |
|
355 zero_le_power2 power2_less_0 |
343 |
356 |
344 subsubsection{*Nat *} |
357 subsubsection{*Nat *} |
345 |
358 |
346 lemma Suc_pred': "0 < n ==> n = Suc(n - 1)" |
359 lemma Suc_pred': "0 < n ==> n = Suc(n - 1)" |
347 by (simp add: numerals) |
360 by (simp add: numerals) |