{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nA subset $S$ of $\\mathbb{R}^n$ is convex if for all $x, y \\in S$ and each real number $t$ with $0 \\leq t \\leq 1$,\n$$(1 - t)\\, x + t\\, y \\in S.$$\nThat is, $S$ contains the segment from $x$ to $y$.\n\n## Remarks\n\nThe same definition works in each real vector space or real affine space. Mathlib's `Convex` is stated for a module over an ordered semiring.\nA convex set contains each convex combination $\\sum_i w_i x_i$ of its points, an [[affine combination|0KJH6SRFZK]] with $w_i \\geq 0$.\nThe empty set and the whole space are convex. Each intersection of convex sets is convex, but a union of convex sets need not be convex.\nBalls, half-spaces, lines and triangles with their inside are convex.\n\n## Explanations\n\n### L1 human\n\nA set is convex if you can see each of its points from each other point, with the line of sight inside the set. A disc is convex. A ring is not: the segment between two opposite points of the ring passes through the hole.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "defines": "02AS45T3H9",
    "kind": "definition",
    "msc": [
      "52A20"
    ],
    "name": "Convex set",
    "sources": [
      {
        "locator": "Definitions",
        "url": "https://en.wikipedia.org/wiki/Convex_set"
      },
      {
        "locator": "Properties",
        "url": "https://en.wikipedia.org/wiki/Convex_set"
      },
      {
        "locator": "Intersections and unions",
        "url": "https://en.wikipedia.org/wiki/Convex_set"
      }
    ],
    "tag": "0K06X9QXDX",
    "uses": [
      "0XPR1E85W0",
      "0KJH6SRFZK"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/0K06X9QXDX/",
  "links": [
    {
      "field": "defines",
      "target": "02AS45T3H9"
    },
    {
      "field": "uses",
      "target": "0XPR1E85W0"
    },
    {
      "field": "uses",
      "target": "0KJH6SRFZK"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0K06X9QXDX.md",
  "msc": [
    "52A20"
  ],
  "name": "Convex set",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0K0/0K06X9QXDX.md",
  "status": null,
  "tag": "0K06X9QXDX",
  "uri": "m2://0K06X9QXDX",
  "url": "https://math2.tamnd.com/wiki/convex-set-definition/",
  "writing": {
    "tag": "0K06X9QXDX",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
