src/HOL/Parity.thy
changeset 62083 7582b39f51ed
parent 61799 4cf66f21b764
child 62597 b3f2b8c906a6
equal deleted inserted replaced
62082:614ef6d7a6b6 62083:7582b39f51ed
   319   next
   319   next
   320     case False then have "0 \<le> a" by auto
   320     case False then have "0 \<le> a" by auto
   321     with \<open>a \<le> b\<close> show ?thesis using power_mono by auto
   321     with \<open>a \<le> b\<close> show ?thesis using power_mono by auto
   322   qed
   322   qed
   323 qed
   323 qed
   324  
   324 
       
   325 lemma (in comm_ring_1) uminus_power_if: "(- x) ^ n = (if even n then x^n else - (x ^ n))"
       
   326   by auto
       
   327 
   325 text \<open>Simplify, when the exponent is a numeral\<close>
   328 text \<open>Simplify, when the exponent is a numeral\<close>
   326 
   329 
   327 lemma zero_le_power_eq_numeral [simp]:
   330 lemma zero_le_power_eq_numeral [simp]:
   328   "0 \<le> a ^ numeral w \<longleftrightarrow> even (numeral w :: nat) \<or> odd (numeral w :: nat) \<and> 0 \<le> a"
   331   "0 \<le> a ^ numeral w \<longleftrightarrow> even (numeral w :: nat) \<or> odd (numeral w :: nat) \<and> 0 \<le> a"
   329   by (fact zero_le_power_eq)
   332   by (fact zero_le_power_eq)