src/HOL/OrderedGroup.thy
changeset 30629 5cd9b19edef3
parent 29914 c9ced4f54e82
child 30691 0047f57f6669
equal deleted inserted replaced
30606:40a1865ab122 30629:5cd9b19edef3
   312 
   312 
   313 lemma diff_diff_eq2[algebra_simps]: "a - (b - c) = (a + c) - b"
   313 lemma diff_diff_eq2[algebra_simps]: "a - (b - c) = (a + c) - b"
   314 by (simp add: diff_minus add_ac)
   314 by (simp add: diff_minus add_ac)
   315 
   315 
   316 lemma eq_iff_diff_eq_0: "a = b \<longleftrightarrow> a - b = 0"
   316 lemma eq_iff_diff_eq_0: "a = b \<longleftrightarrow> a - b = 0"
       
   317 by (simp add: algebra_simps)
       
   318 
       
   319 lemma diff_eq_0_iff_eq [simp, noatp]: "a - b = 0 \<longleftrightarrow> a = b"
   317 by (simp add: algebra_simps)
   320 by (simp add: algebra_simps)
   318 
   321 
   319 end
   322 end
   320 
   323 
   321 subsection {* (Partially) Ordered Groups *} 
   324 subsection {* (Partially) Ordered Groups *} 
  1294 apply (simp add: le_iff_diff_le_0[of y x] le_iff_diff_le_0[of  y' x'])
  1297 apply (simp add: le_iff_diff_le_0[of y x] le_iff_diff_le_0[of  y' x'])
  1295 apply (simp add: neg_le_iff_le[symmetric, of "y-x" 0] neg_le_iff_le[symmetric, of "y'-x'" 0])
  1298 apply (simp add: neg_le_iff_le[symmetric, of "y-x" 0] neg_le_iff_le[symmetric, of "y'-x'" 0])
  1296 done
  1299 done
  1297 
  1300 
  1298 lemma eq_eqI: "(x::'a::ab_group_add) - y = x' - y' \<Longrightarrow> (x = y) = (x' = y')"
  1301 lemma eq_eqI: "(x::'a::ab_group_add) - y = x' - y' \<Longrightarrow> (x = y) = (x' = y')"
  1299 by (simp add: eq_iff_diff_eq_0[of x y] eq_iff_diff_eq_0[of x' y'])
  1302 by (simp only: eq_iff_diff_eq_0[of x y] eq_iff_diff_eq_0[of x' y'])
  1300 
  1303 
  1301 lemma diff_def: "(x::'a::ab_group_add) - y == x + (-y)"
  1304 lemma diff_def: "(x::'a::ab_group_add) - y == x + (-y)"
  1302 by (simp add: diff_minus)
  1305 by (simp add: diff_minus)
  1303 
  1306 
  1304 lemma add_minus_cancel: "(a::'a::ab_group_add) + (-a + b) = b"
  1307 lemma add_minus_cancel: "(a::'a::ab_group_add) + (-a + b) = b"
  1342 by (auto intro: add_strict_right_mono add_strict_left_mono
  1345 by (auto intro: add_strict_right_mono add_strict_left_mono
  1343   add_less_le_mono add_le_less_mono add_strict_mono)
  1346   add_less_le_mono add_le_less_mono add_strict_mono)
  1344 
  1347 
  1345 text{*Simplification of @{term "x-y < 0"}, etc.*}
  1348 text{*Simplification of @{term "x-y < 0"}, etc.*}
  1346 lemmas diff_less_0_iff_less [simp, noatp] = less_iff_diff_less_0 [symmetric]
  1349 lemmas diff_less_0_iff_less [simp, noatp] = less_iff_diff_less_0 [symmetric]
  1347 lemmas diff_eq_0_iff_eq [simp, noatp] = eq_iff_diff_eq_0 [symmetric]
       
  1348 lemmas diff_le_0_iff_le [simp, noatp] = le_iff_diff_le_0 [symmetric]
  1350 lemmas diff_le_0_iff_le [simp, noatp] = le_iff_diff_le_0 [symmetric]
  1349 
  1351 
  1350 ML {*
  1352 ML {*
  1351 structure ab_group_add_cancel = Abel_Cancel
  1353 structure ab_group_add_cancel = Abel_Cancel
  1352 (
  1354 (