src/HOL/Int.thy
changeset 54147 97a8ff4e4ac9
parent 53652 18fbca265e2e
child 54223 85705ba18add
equal deleted inserted replaced
54146:97f69d44f732 54147:97a8ff4e4ac9
   448 
   448 
   449 text{*This version is proved for all ordered rings, not just integers!
   449 text{*This version is proved for all ordered rings, not just integers!
   450       It is proved here because attribute @{text arith_split} is not available
   450       It is proved here because attribute @{text arith_split} is not available
   451       in theory @{text Rings}.
   451       in theory @{text Rings}.
   452       But is it really better than just rewriting with @{text abs_if}?*}
   452       But is it really better than just rewriting with @{text abs_if}?*}
   453 lemma abs_split [arith_split,no_atp]:
   453 lemma abs_split [arith_split, no_atp]:
   454      "P(abs(a::'a::linordered_idom)) = ((0 \<le> a --> P a) & (a < 0 --> P(-a)))"
   454      "P(abs(a::'a::linordered_idom)) = ((0 \<le> a --> P a) & (a < 0 --> P(-a)))"
   455 by (force dest: order_less_le_trans simp add: abs_if linorder_not_less)
   455 by (force dest: order_less_le_trans simp add: abs_if linorder_not_less)
   456 
   456 
   457 lemma negD: "x < 0 \<Longrightarrow> \<exists>n. x = - (int (Suc n))"
   457 lemma negD: "x < 0 \<Longrightarrow> \<exists>n. x = - (int (Suc n))"
   458 apply transfer
   458 apply transfer
  1156   minus_equation_iff [of _ "numeral v"]
  1156   minus_equation_iff [of _ "numeral v"]
  1157   minus_equation_iff [of _ "neg_numeral v"] for v
  1157   minus_equation_iff [of _ "neg_numeral v"] for v
  1158 
  1158 
  1159 text{*To Simplify Inequalities Where One Side is the Constant 1*}
  1159 text{*To Simplify Inequalities Where One Side is the Constant 1*}
  1160 
  1160 
  1161 lemma less_minus_iff_1 [simp,no_atp]:
  1161 lemma less_minus_iff_1 [simp]:
  1162   fixes b::"'b::linordered_idom"
  1162   fixes b::"'b::linordered_idom"
  1163   shows "(1 < - b) = (b < -1)"
  1163   shows "(1 < - b) = (b < -1)"
  1164 by auto
  1164 by auto
  1165 
  1165 
  1166 lemma le_minus_iff_1 [simp,no_atp]:
  1166 lemma le_minus_iff_1 [simp]:
  1167   fixes b::"'b::linordered_idom"
  1167   fixes b::"'b::linordered_idom"
  1168   shows "(1 \<le> - b) = (b \<le> -1)"
  1168   shows "(1 \<le> - b) = (b \<le> -1)"
  1169 by auto
  1169 by auto
  1170 
  1170 
  1171 lemma equation_minus_iff_1 [simp,no_atp]:
  1171 lemma equation_minus_iff_1 [simp]:
  1172   fixes b::"'b::ring_1"
  1172   fixes b::"'b::ring_1"
  1173   shows "(1 = - b) = (b = -1)"
  1173   shows "(1 = - b) = (b = -1)"
  1174 by (subst equation_minus_iff, auto)
  1174 by (subst equation_minus_iff, auto)
  1175 
  1175 
  1176 lemma minus_less_iff_1 [simp,no_atp]:
  1176 lemma minus_less_iff_1 [simp]:
  1177   fixes a::"'b::linordered_idom"
  1177   fixes a::"'b::linordered_idom"
  1178   shows "(- a < 1) = (-1 < a)"
  1178   shows "(- a < 1) = (-1 < a)"
  1179 by auto
  1179 by auto
  1180 
  1180 
  1181 lemma minus_le_iff_1 [simp,no_atp]:
  1181 lemma minus_le_iff_1 [simp]:
  1182   fixes a::"'b::linordered_idom"
  1182   fixes a::"'b::linordered_idom"
  1183   shows "(- a \<le> 1) = (-1 \<le> a)"
  1183   shows "(- a \<le> 1) = (-1 \<le> a)"
  1184 by auto
  1184 by auto
  1185 
  1185 
  1186 lemma minus_equation_iff_1 [simp,no_atp]:
  1186 lemma minus_equation_iff_1 [simp]:
  1187   fixes a::"'b::ring_1"
  1187   fixes a::"'b::ring_1"
  1188   shows "(- a = 1) = (a = -1)"
  1188   shows "(- a = 1) = (a = -1)"
  1189 by (subst minus_equation_iff, auto)
  1189 by (subst minus_equation_iff, auto)
  1190 
  1190 
  1191 
  1191