src/HOL/Deriv.thy
changeset 68601 7828f3b85156
parent 68527 2f4e2aab190a
child 68611 4bc4b5c0ccfc
equal deleted inserted replaced
68598:d465b396ef85 68601:7828f3b85156
  1416     apply (blast intro: DERIV_isCont)
  1416     apply (blast intro: DERIV_isCont)
  1417    apply (force dest: order_less_imp_le simp add: real_differentiable_def)
  1417    apply (force dest: order_less_imp_le simp add: real_differentiable_def)
  1418   apply (blast dest: DERIV_unique order_less_imp_le)
  1418   apply (blast dest: DERIV_unique order_less_imp_le)
  1419   done
  1419   done
  1420 
  1420 
  1421 
  1421 lemma pos_deriv_imp_strict_mono:
  1422 text \<open>A function is constant if its derivative is 0 over an interval.\<close>
  1422   assumes "\<And>x. (f has_real_derivative f' x) (at x)"
       
  1423   assumes "\<And>x. f' x > 0"
       
  1424   shows   "strict_mono f"
       
  1425 proof (rule strict_monoI)
       
  1426   fix x y :: real assume xy: "x < y"
       
  1427   from assms and xy have "\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z"
       
  1428     by (intro MVT2) (auto dest: connectedD_interval)
       
  1429   then obtain z where z: "z > x" "z < y" "f y - f x = (y - x) * f' z" by blast
       
  1430   note \<open>f y - f x = (y - x) * f' z\<close>
       
  1431   also have "(y - x) * f' z > 0" using xy assms by (intro mult_pos_pos) auto
       
  1432   finally show "f x < f y" by simp
       
  1433 qed
       
  1434 
       
  1435 
       
  1436 subsubsection \<open>A function is constant if its derivative is 0 over an interval.\<close>
  1423 
  1437 
  1424 lemma DERIV_isconst_end:
  1438 lemma DERIV_isconst_end:
  1425   fixes f :: "real \<Rightarrow> real"
  1439   fixes f :: "real \<Rightarrow> real"
  1426   shows "a < b \<Longrightarrow>
  1440   shows "a < b \<Longrightarrow>
  1427     \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x \<Longrightarrow>
  1441     \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x \<Longrightarrow>
  1545     by (rule DERIV_const_ratio_const2 [OF _ der]) (simp add: neq)
  1559     by (rule DERIV_const_ratio_const2 [OF _ der]) (simp add: neq)
  1546   ultimately show ?thesis
  1560   ultimately show ?thesis
  1547     using neq by (force simp add: add.commute)
  1561     using neq by (force simp add: add.commute)
  1548 qed
  1562 qed
  1549 
  1563 
  1550 text \<open>
  1564 subsubsection\<open>A function with positive derivative is increasing\<close>
  1551   A function with positive derivative is increasing.
  1565 text \<open>A simple proof using the MVT, by Jeremy Avigad. And variants.\<close>
  1552   A simple proof using the MVT, by Jeremy Avigad. And variants.
       
  1553 \<close>
       
  1554 lemma DERIV_pos_imp_increasing_open:
  1566 lemma DERIV_pos_imp_increasing_open:
  1555   fixes a b :: real
  1567   fixes a b :: real
  1556     and f :: "real \<Rightarrow> real"
  1568     and f :: "real \<Rightarrow> real"
  1557   assumes "a < b"
  1569   assumes "a < b"
  1558     and "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> (\<exists>y. DERIV f x :> y \<and> y > 0)"
  1570     and "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> (\<exists>y. DERIV f x :> y \<and> y > 0)"