equal
deleted
inserted
replaced
666 |
666 |
667 lemma abs_if_lattice: "\<bar>a\<bar> = (if a < 0 then -a else (a::'a::{lordered_ab_group_abs, linorder}))" |
667 lemma abs_if_lattice: "\<bar>a\<bar> = (if a < 0 then -a else (a::'a::{lordered_ab_group_abs, linorder}))" |
668 proof - |
668 proof - |
669 show ?thesis by (simp add: abs_lattice join_eq_if) |
669 show ?thesis by (simp add: abs_lattice join_eq_if) |
670 qed |
670 qed |
|
671 |
|
672 lemma abs_eq [simp]: |
|
673 fixes a :: "'a::{lordered_ab_group_abs, linorder}" |
|
674 shows "0 \<le> a ==> abs a = a" |
|
675 by (simp add: abs_if_lattice linorder_not_less [symmetric]) |
|
676 |
|
677 lemma abs_minus_eq [simp]: |
|
678 fixes a :: "'a::{lordered_ab_group_abs, linorder}" |
|
679 shows "a < 0 ==> abs a = -a" |
|
680 by (simp add: abs_if_lattice linorder_not_less [symmetric]) |
671 |
681 |
672 lemma abs_ge_zero[simp]: "0 \<le> abs (a::'a::lordered_ab_group_abs)" |
682 lemma abs_ge_zero[simp]: "0 \<le> abs (a::'a::lordered_ab_group_abs)" |
673 proof - |
683 proof - |
674 have a:"a <= abs a" and b:"-a <= abs a" by (auto simp add: abs_lattice meet_join_le) |
684 have a:"a <= abs a" and b:"-a <= abs a" by (auto simp add: abs_lattice meet_join_le) |
675 show ?thesis by (rule add_mono[OF a b, simplified]) |
685 show ?thesis by (rule add_mono[OF a b, simplified]) |