src/HOL/Real.thy
changeset 62626 de25474ce728
parent 62623 dbc62f86a1a9
child 63040 eb4ddd18d635
equal deleted inserted replaced
62623:dbc62f86a1a9 62626:de25474ce728
  1402   by auto
  1402   by auto
  1403 
  1403 
  1404 lemma real_sum_of_halves: "x/2 + x/2 = (x::real)"
  1404 lemma real_sum_of_halves: "x/2 + x/2 = (x::real)"
  1405   by simp
  1405   by simp
  1406 
  1406 
  1407 subsection\<open>Absolute Value Function for the Reals\<close>
       
  1408 
       
  1409 lemma abs_minus_add_cancel: "\<bar>x + (- y)\<bar> = \<bar>y + (- (x::real))\<bar>"
       
  1410   by (simp add: abs_if)
       
  1411 
       
  1412 lemma abs_add_one_gt_zero: "(0::real) < 1 + \<bar>x\<bar>"
       
  1413   by (simp add: abs_if)
       
  1414 
       
  1415 lemma abs_add_one_not_less_self: "~ \<bar>x\<bar> + (1::real) < x"
       
  1416   by simp
       
  1417 
       
  1418 lemma abs_sum_triangle_ineq: "\<bar>(x::real) + y + (-l + -m)\<bar> \<le> \<bar>x + -l\<bar> + \<bar>y + -m\<bar>"
       
  1419   by simp
       
  1420 
       
  1421 
       
  1422 subsection\<open>Floor and Ceiling Functions from the Reals to the Integers\<close>
  1407 subsection\<open>Floor and Ceiling Functions from the Reals to the Integers\<close>
  1423 
  1408 
  1424 (* FIXME: theorems for negative numerals. Many duplicates, e.g. from Archimedean_Field.thy. *)
  1409 (* FIXME: theorems for negative numerals. Many duplicates, e.g. from Archimedean_Field.thy. *)
  1425 
  1410 
  1426 lemma real_of_nat_less_numeral_iff [simp]:
  1411 lemma real_of_nat_less_numeral_iff [simp]:
  1562   assumes "x = of_int \<lfloor>x\<rfloor>"
  1547   assumes "x = of_int \<lfloor>x\<rfloor>"
  1563   shows "\<lfloor>x ^ n\<rfloor> = \<lfloor>x\<rfloor> ^ n"
  1548   shows "\<lfloor>x ^ n\<rfloor> = \<lfloor>x\<rfloor> ^ n"
  1564 proof -
  1549 proof -
  1565   have "x ^ n = of_int (\<lfloor>x\<rfloor> ^ n)"
  1550   have "x ^ n = of_int (\<lfloor>x\<rfloor> ^ n)"
  1566     using assms by (induct n arbitrary: x) simp_all
  1551     using assms by (induct n arbitrary: x) simp_all
  1567   then show ?thesis by (metis floor_of_int) 
  1552   then show ?thesis by (metis floor_of_int)
  1568 qed
  1553 qed
  1569 
  1554 
  1570 lemma floor_numeral_power[simp]:
  1555 lemma floor_numeral_power[simp]:
  1571   "\<lfloor>numeral x ^ n\<rfloor> = numeral x ^ n"
  1556   "\<lfloor>numeral x ^ n\<rfloor> = numeral x ^ n"
  1572   by (metis floor_of_int of_int_numeral of_int_power)
  1557   by (metis floor_of_int of_int_numeral of_int_power)