equal
deleted
inserted
replaced
345 by (simp add: diff_minus add_ac) |
345 by (simp add: diff_minus add_ac) |
346 |
346 |
347 lemma eq_iff_diff_eq_0: "a = b \<longleftrightarrow> a - b = 0" |
347 lemma eq_iff_diff_eq_0: "a = b \<longleftrightarrow> a - b = 0" |
348 by (simp add: algebra_simps) |
348 by (simp add: algebra_simps) |
349 |
349 |
|
350 (* FIXME: duplicates right_minus_eq from class group_add *) |
|
351 (* but only this one is declared as a simp rule. *) |
350 lemma diff_eq_0_iff_eq [simp, noatp]: "a - b = 0 \<longleftrightarrow> a = b" |
352 lemma diff_eq_0_iff_eq [simp, noatp]: "a - b = 0 \<longleftrightarrow> a = b" |
351 by (simp add: algebra_simps) |
353 by (simp add: algebra_simps) |
352 |
354 |
353 end |
355 end |
354 |
356 |
792 lemma double_zero [simp]: |
794 lemma double_zero [simp]: |
793 "a + a = 0 \<longleftrightarrow> a = 0" |
795 "a + a = 0 \<longleftrightarrow> a = 0" |
794 proof |
796 proof |
795 assume assm: "a + a = 0" |
797 assume assm: "a + a = 0" |
796 then have a: "- a = a" by (rule minus_unique) |
798 then have a: "- a = a" by (rule minus_unique) |
797 then show "a = 0" by (simp add: neg_equal_zero) |
799 then show "a = 0" by (simp only: neg_equal_zero) |
798 qed simp |
800 qed simp |
799 |
801 |
800 lemma double_zero_sym [simp]: |
802 lemma double_zero_sym [simp]: |
801 "0 = a + a \<longleftrightarrow> a = 0" |
803 "0 = a + a \<longleftrightarrow> a = 0" |
802 by (rule, drule sym) simp_all |
804 by (rule, drule sym) simp_all |
805 "0 < a + a \<longleftrightarrow> 0 < a" |
807 "0 < a + a \<longleftrightarrow> 0 < a" |
806 proof |
808 proof |
807 assume "0 < a + a" |
809 assume "0 < a + a" |
808 then have "0 - a < a" by (simp only: diff_less_eq) |
810 then have "0 - a < a" by (simp only: diff_less_eq) |
809 then have "- a < a" by simp |
811 then have "- a < a" by simp |
810 then show "0 < a" by (simp add: neg_less_nonneg) |
812 then show "0 < a" by (simp only: neg_less_nonneg) |
811 next |
813 next |
812 assume "0 < a" |
814 assume "0 < a" |
813 with this have "0 + 0 < a + a" |
815 with this have "0 + 0 < a + a" |
814 by (rule add_strict_mono) |
816 by (rule add_strict_mono) |
815 then show "0 < a + a" by simp |
817 then show "0 < a + a" by simp |