src/HOL/Real.thy
changeset 61799 4cf66f21b764
parent 61694 6571c78c9667
child 61942 f02b26f7d39d
equal deleted inserted replaced
61798:27f3c10b0b50 61799:4cf66f21b764
  1399 apply (rule_tac x = " (min d1 d2) /2" in exI)
  1399 apply (rule_tac x = " (min d1 d2) /2" in exI)
  1400 apply (simp add: min_def)
  1400 apply (simp add: min_def)
  1401 done
  1401 done
  1402 
  1402 
  1403 
  1403 
  1404 text\<open>Similar results are proved in @{text Fields}\<close>
  1404 text\<open>Similar results are proved in \<open>Fields\<close>\<close>
  1405 lemma real_less_half_sum: "x < y ==> x < (x+y) / (2::real)"
  1405 lemma real_less_half_sum: "x < y ==> x < (x+y) / (2::real)"
  1406   by auto
  1406   by auto
  1407 
  1407 
  1408 lemma real_gt_half_sum: "x < y ==> (x+y)/(2::real) < y"
  1408 lemma real_gt_half_sum: "x < y ==> (x+y)/(2::real) < y"
  1409   by auto
  1409   by auto
  1486     then have "i < b + j * b"
  1486     then have "i < b + j * b"
  1487       by (metis linorder_not_less of_int_add of_int_le_iff of_int_mult order_trans_rules(21))
  1487       by (metis linorder_not_less of_int_add of_int_le_iff of_int_mult order_trans_rules(21))
  1488     moreover have "j * b < 1 + i"
  1488     moreover have "j * b < 1 + i"
  1489     proof -
  1489     proof -
  1490       have "real_of_int (j * b) < real_of_int i + 1"
  1490       have "real_of_int (j * b) < real_of_int i + 1"
  1491         using `a < 1 + real_of_int i` `real_of_int j * real_of_int b \<le> a` by force
  1491         using \<open>a < 1 + real_of_int i\<close> \<open>real_of_int j * real_of_int b \<le> a\<close> by force
  1492       thus "j * b < 1 + i"
  1492       thus "j * b < 1 + i"
  1493         by linarith
  1493         by linarith
  1494     qed
  1494     qed
  1495     ultimately have "(j - i div b) * b \<le> i mod b" "i mod b < ((j - i div b) + 1) * b"
  1495     ultimately have "(j - i div b) * b \<le> i mod b" "i mod b < ((j - i div b) + 1) * b"
  1496       by (auto simp: field_simps)
  1496       by (auto simp: field_simps)