{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe build open sets $U_r$ indexed by dyadic rationals and let $f(x)$ be the least index of a set that contains $x$. For $W \\subseteq X$, write $\\overline{W}$ for the [[closure|0DRKT1QJR7]]. By [[the closure is the smallest closed superset|0SHC6Z304Z]], $W \\subseteq \\overline{W}$, $\\overline{W}$ is closed, and $\\overline{W} \\subseteq F$ for each closed $F \\supseteq W$.\n\nA shrinking lemma.\n\n1. Claim: if $C$ is closed, $W$ is open and $C \\subseteq W$, then some open $V$ has $C \\subseteq V$ and $\\overline{V} \\subseteq W$.\n2. The set $X \\setminus W$ is [[closed|0G5AV9Q4RR]], since its complement $W$ is open. It is disjoint from $C$.\n3. Since $X$ is [[normal|0AJ646N339]], there are disjoint open sets $V \\supseteq C$ and $V' \\supseteq X \\setminus W$.\n4. Then $V \\subseteq X \\setminus V'$, and $X \\setminus V'$ is closed. So $\\overline{V} \\subseteq X \\setminus V' \\subseteq W$. This proves the claim.\n\nThe sets $U_r$.\n\n5. For $n \\ge 0$, let $D_n = \\set{k / 2^n : k \\in \\Z, \\ 0 \\le k \\le 2^n}$. Then $D_n \\subseteq D_{n+1}$. Let $D$ be the union of all $D_n$.\n6. Let $U_1 = X \\setminus B$. It is open, and $A \\subseteq U_1$ since $A \\cap B = \\varnothing$. Step 1 gives an open $U_0$ with $A \\subseteq U_0$ and $\\overline{U_0} \\subseteq U_1$.\n7. Let $P_n$ say: open sets $U_r$ are given for $r \\in D_n$, with $\\overline{U_r} \\subseteq U_s$ whenever $r \u003c s$ in $D_n$. Step 6 gives $P_0$.\n8. Under $P_n$, if $r \\le s$ in $D_n$, then $U_r \\subseteq U_s$. For $r \u003c s$ this is $U_r \\subseteq \\overline{U_r} \\subseteq U_s$.\n9. Assume $P_n$. Each $r \\in D_{n+1} \\setminus D_n$ has the form $r = (2k+1)/2^{n+1}$. Let $r^- = k / 2^n$ and $r^+ = (k+1)/2^n$, the neighbours of $r$ in $D_n$.\n10. By $P_n$, $\\overline{U_{r^-}} \\subseteq U_{r^+}$. Step 1 gives an open $U_r$ with $\\overline{U_{r^-}} \\subseteq U_r$ and $\\overline{U_r} \\subseteq U_{r^+}$.\n11. We check $P_{n+1}$. Let $r \u003c s$ in $D_{n+1}$. If $r, s \\in D_n$, use $P_n$.\n12. If $r \\notin D_n$ and $s \\in D_n$, then $s \\ge r^+$, since $r^+$ is the least element of $D_n$ above $r$. So $\\overline{U_r} \\subseteq U_{r^+} \\subseteq U_s$ by steps 10 and 8.\n13. If $r \\in D_n$ and $s \\notin D_n$, then $r \\le s^-$. Also $\\overline{U_r} \\subseteq \\overline{U_{s^-}}$, by $P_n$ when $r \u003c s^-$. So $\\overline{U_r} \\subseteq \\overline{U_{s^-}} \\subseteq U_s$.\n14. If $r, s \\notin D_n$, then $s - r \\ge 2 / 2^{n+1}$, since both are odd multiples of $1/2^{n+1}$. So $r^+ \\le s^-$, and $\\overline{U_r} \\subseteq U_{r^+} \\subseteq U_{s^-} \\subseteq \\overline{U_{s^-}} \\subseteq U_s$.\n15. By induction on $n$, $P_n$ holds for all $n$. Sets chosen at one stage are kept at later stages. So for all $r \u003c s$ in $D$ we have $\\overline{U_r} \\subseteq U_s$, and $U_r \\subseteq U_s$.\n\nThe function $f$.\n\n16. For $x \\in X$, let $S(x) = \\set{r \\in D : x \\in U_r} \\cup \\set{1}$. It is nonempty and contained in $[0, 1]$. By the [[existence of the infimum|0EDH403M21]], let $f(x) = \\inf S(x)$. Then $0 \\le f(x) \\le 1$.\n17. Let $a \\in A$. Then $a \\in U_0$, so $0 \\in S(a)$ and $f(a) = 0$.\n18. Let $b \\in B$. Then $b \\notin U_1$, and $U_r \\subseteq U_1$ for all $r \\in D$ by step 15. So $S(b) = \\set{1}$ and $f(b) = 1$.\n19. Fact (i): if $r \\in D$ and $x \\notin U_r$, then $f(x) \\ge r$. Indeed, if $s \\in D$ and $x \\in U_s$, then $s \u003e r$, since $s \\le r$ would give $x \\in U_r$. Also $1 \\ge r$. So $r$ is a lower bound of $S(x)$, and $r \\le f(x)$ by the definition of the [[infimum|04KFTA34C5]].\n20. Density: if $0 \\le c \u003c e \\le 1$, some $s \\in D$ has $c \u003c s \u003c e$. Since [[the reals are Archimedean|0A3GWZ86AY]], choose $n$ with $n (e - c) \u003e 1$. Then $2^n \\ge n$ gives $2^{-n} \u003c e - c$.\n21. Let $k = \\floor{2^n c} + 1$, using the [[floor|0YVRNEDSVG]]. Then $c \u003c k / 2^n \\le c + 2^{-n} \u003c e$. Since $0 \\le c$ and $e \\le 1$, we get $0 \u003c k \\le 2^n$. So $s = k / 2^n \\in D_n$ works.\n22. Fact (ii): if $r \\in D$ and $x \\in \\overline{U_r}$, then $f(x) \\le r$. This is clear for $r = 1$. Let $r \u003c 1$ and suppose $f(x) \u003e r$.\n23. By step 20 with $c = r$ and $e = f(x)$, some $s \\in D$ has $r \u003c s \u003c f(x)$. By step 15, $x \\in \\overline{U_r} \\subseteq U_s$, so $s \\in S(x)$ and $f(x) \\le s$. This is a contradiction.\n\nContinuity of $f$.\n\n24. Give $[0, 1]$ the [[subspace topology|0D5YHQGDJY]] of the [[metric topology|0A6YRNZB2R]] of $\\R$. Let $O$ be open in $[0, 1]$, let $x_0 \\in f^{-1}(O)$ and let $t = f(x_0)$.\n25. Write $O = [0, 1] \\cap O'$ with $O'$ open in $\\R$. There is $\\varepsilon \u003e 0$ with $(t - \\varepsilon, t + \\varepsilon) \\subseteq O'$. So $(t - \\varepsilon, t + \\varepsilon) \\cap [0, 1] \\subseteq O$.\n26. Upper side. If $t + \\varepsilon \u003e 1$, let $W_1 = X$; then $f(x) \\le 1 \u003c t + \\varepsilon$ on $W_1$. Otherwise step 20 gives $q \\in D$ with $t \u003c q \u003c t + \\varepsilon$.\n27. In that case, $f(x_0) \u003c q$, so $x_0 \\in U_q$ by fact (i). Let $W_1 = U_q$. For $x \\in W_1$, $x \\in \\overline{U_q}$, so $f(x) \\le q \u003c t + \\varepsilon$ by fact (ii).\n28. Lower side. If $t - \\varepsilon \u003c 0$, let $W_2 = X$; then $f(x) \\ge 0 \u003e t - \\varepsilon$ on $W_2$. Otherwise step 20 gives $p \\in D$ with $t - \\varepsilon \u003c p \u003c t$.\n29. In that case, $f(x_0) \u003e p$, so $x_0 \\notin \\overline{U_p}$ by fact (ii). Let $W_2 = X \\setminus \\overline{U_p}$, which is open. For $x \\in W_2$, $x \\notin U_p$, so $f(x) \\ge p \u003e t - \\varepsilon$ by fact (i).\n30. Let $W = W_1 \\cap W_2$. It is open by the axioms of a [[topology|0CNQXVBHCX]], and $x_0 \\in W$. By steps 25 to 29, $f(W) \\subseteq (t - \\varepsilon, t + \\varepsilon) \\cap [0, 1] \\subseteq O$.\n31. So $f^{-1}(O)$ is a [[neighbourhood|09CJ00H3NW]] of each of its points, hence open. Thus $f \\colon X \\to [0, 1]$ is [[continuous|0SY9ECQ19Q]], with $f = 0$ on $A$ and $f = 1$ on $B$ by steps 17 and 18.\n\n## Idea\n\nNormality lets us fit an open set, with its closure, strictly between a closed set and an open set around it. Repeating this at every dyadic level gives a nested family $U_r$ that grows from around $A$ to the complement of $B$. Then $f(x)$ records the first level at which $x$ enters the family. The strict nesting of closures makes $f$ continuous.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "54D15"
    ],
    "name": "Proof of Urysohn's lemma by dyadic open sets",
    "proves": "01EY3VR7ZD",
    "sources": [
      {
        "locator": "Proof sketch",
        "url": "https://en.wikipedia.org/wiki/Urysohn%27s_lemma"
      }
    ],
    "tag": "8PR3HCHWR7",
    "uses": [
      "0AJ646N339",
      "0G5AV9Q4RR",
      "0DRKT1QJR7",
      "0SHC6Z304Z",
      "0CNQXVBHCX",
      "0EDH403M21",
      "04KFTA34C5",
      "0A3GWZ86AY",
      "0YVRNEDSVG",
      "0D5YHQGDJY",
      "0A6YRNZB2R",
      "09CJ00H3NW",
      "0SY9ECQ19Q"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/8PR3HCHWR7/",
  "links": [
    {
      "field": "proves",
      "target": "01EY3VR7ZD"
    },
    {
      "field": "uses",
      "target": "0AJ646N339"
    },
    {
      "field": "uses",
      "target": "0G5AV9Q4RR"
    },
    {
      "field": "uses",
      "target": "0DRKT1QJR7"
    },
    {
      "field": "uses",
      "target": "0SHC6Z304Z"
    },
    {
      "field": "uses",
      "target": "0CNQXVBHCX"
    },
    {
      "field": "uses",
      "target": "0EDH403M21"
    },
    {
      "field": "uses",
      "target": "04KFTA34C5"
    },
    {
      "field": "uses",
      "target": "0A3GWZ86AY"
    },
    {
      "field": "uses",
      "target": "0YVRNEDSVG"
    },
    {
      "field": "uses",
      "target": "0D5YHQGDJY"
    },
    {
      "field": "uses",
      "target": "0A6YRNZB2R"
    },
    {
      "field": "uses",
      "target": "09CJ00H3NW"
    },
    {
      "field": "uses",
      "target": "0SY9ECQ19Q"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/8PR3HCHWR7.md",
  "msc": [
    "54D15"
  ],
  "name": "Proof of Urysohn's lemma by dyadic open sets",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/8PR/8PR3HCHWR7.md",
  "status": null,
  "tag": "8PR3HCHWR7",
  "uri": "m2://8PR3HCHWR7",
  "url": "https://math2.tamnd.com/wiki/proof-of-urysohns-lemma-by-dyadic-open-sets/",
  "writing": {
    "tag": "8PR3HCHWR7",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
