{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe prove the two directions separately. For $u \\ne v$ in $I$ write $s(u, v) = \\dfrac{f(v) - f(u)}{v - u}$, the slope of the chord. Note that $s(u, v) = s(v, u)$.\n\n*Convex implies $f'$ increasing.*\n\n1. Assume $f$ is [[convex|0VV0HSW1ZS]]. Let $x \u003c y$ in $I$; we show $f'(x) \\le f'(y)$.\n2. For each $t$ with $x \u003c t \u003c y$, the [[slope inequalities|0BY5FTHEEE]] give $s(x, t) \\le s(x, y) \\le s(t, y)$.\n3. By the definition of the [[derivative|0F1WR9C83K]], $s(x, t) = \\dfrac{f(x + h) - f(x)}{h}$ with $h = t - x$. So $s(x, t) \\to f'(x)$ as $t \\to x^+$.\n4. Suppose $f'(x) \u003e s(x, y)$. Put $\\varepsilon = f'(x) - s(x, y)$. By step 3 there is $t \\in (x, y)$ with $s(x, t) \u003e f'(x) - \\varepsilon = s(x, y)$.\n5. This contradicts step 2. So $f'(x) \\le s(x, y)$.\n6. Likewise $s(t, y) = \\dfrac{f(y + h) - f(y)}{h}$ with $h = t - y \u003c 0$. So $s(t, y) \\to f'(y)$ as $t \\to y^-$.\n7. Suppose $f'(y) \u003c s(x, y)$. With $\\varepsilon = s(x, y) - f'(y)$, step 6 gives $t \\in (x, y)$ with $s(t, y) \u003c s(x, y)$. This contradicts step 2.\n8. So $f'(x) \\le s(x, y) \\le f'(y)$. Hence $f'$ is increasing on $I$.\n\n*$f'$ increasing implies convex.*\n\n9. Assume $f'$ is increasing on $I$. Let $u, v \\in I$ and $\\lambda \\in [0, 1]$. We show $f(\\lambda u + (1 - \\lambda) v) \\le \\lambda f(u) + (1 - \\lambda) f(v)$.\n10. If $u = v$, or $\\lambda \\in \\set{0, 1}$, both sides are equal. Exchanging $u$ with $v$ and $\\lambda$ with $1 - \\lambda$ leaves the claim unchanged. So we may assume $u \u003c v$ and $0 \u003c \\lambda \u003c 1$.\n11. Let $p = \\lambda u + (1 - \\lambda) v$. Then $p - u = (1 - \\lambda)(v - u) \u003e 0$ and $v - p = \\lambda (v - u) \u003e 0$. So $u \u003c p \u003c v$.\n12. Since $I$ is an [[interval|0TK8Y3J5RW]], $[u, v] \\subseteq I$. The function $f$ is differentiable on $I$, hence [[continuous|07ZMX4ANJS]] on $I$.\n13. By the [[mean value theorem|0BARQY52N5]] on $[u, p]$ and on $[p, v]$, there are $c_1 \\in (u, p)$ and $c_2 \\in (p, v)$ with $s(u, p) = f'(c_1)$ and $s(p, v) = f'(c_2)$.\n14. Since $c_1 \u003c c_2$ and $f'$ is increasing, $s(u, p) \\le s(p, v)$.\n15. By step 11 this reads $\\dfrac{f(p) - f(u)}{(1 - \\lambda)(v - u)} \\le \\dfrac{f(v) - f(p)}{\\lambda (v - u)}$.\n16. Multiplying by $\\lambda (1 - \\lambda)(v - u) \u003e 0$ gives $\\lambda (f(p) - f(u)) \\le (1 - \\lambda)(f(v) - f(p))$.\n17. Rearranging, $f(p) \\le \\lambda f(u) + (1 - \\lambda) f(v)$. So $f$ is convex.\n\n## Idea\n\nFor a convex function, the slope of a chord over $[x, y]$ lies between the tangent slopes at $x$ and at $y$, since chord slopes increase. Conversely, the mean value theorem turns chord slopes into values of $f'$. If $f'$ is increasing, chords to the left of a point are less steep than chords to the right, and that is convexity.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "26A51"
    ],
    "name": "Proof that a differentiable function is convex iff its derivative is increasing",
    "proves": "005JT76HCK",
    "sources": [
      {
        "url": "https://proofwiki.org/wiki/Real_Function_is_Convex_iff_Derivative_is_Increasing"
      }
    ],
    "tag": "EMKG76V8PS",
    "uses": [
      "0VV0HSW1ZS",
      "0BY5FTHEEE",
      "0BARQY52N5",
      "0F1WR9C83K",
      "07ZMX4ANJS",
      "0TK8Y3J5RW"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/EMKG76V8PS/",
  "links": [
    {
      "field": "proves",
      "target": "005JT76HCK"
    },
    {
      "field": "uses",
      "target": "0VV0HSW1ZS"
    },
    {
      "field": "uses",
      "target": "0BY5FTHEEE"
    },
    {
      "field": "uses",
      "target": "0BARQY52N5"
    },
    {
      "field": "uses",
      "target": "0F1WR9C83K"
    },
    {
      "field": "uses",
      "target": "07ZMX4ANJS"
    },
    {
      "field": "uses",
      "target": "0TK8Y3J5RW"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/EMKG76V8PS.md",
  "msc": [
    "26A51"
  ],
  "name": "Proof that a differentiable function is convex iff its derivative is increasing",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/EMK/EMKG76V8PS.md",
  "status": null,
  "tag": "EMKG76V8PS",
  "uri": "m2://EMKG76V8PS",
  "url": "https://math2.tamnd.com/wiki/proof-that-a-differentiable-function-is-convex-iff-its-derivative-is-increasing/",
  "writing": {
    "tag": "EMKG76V8PS",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
