{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $(B_t)_{t \\ge 0}$ be a standard one-dimensional [[Brownian motion|22735FGJV6]] with $B_0 = 0$, and let $L(t, x)$ be its [[local time|E7ZC459PSA]].\nLet $\\sgn(y) = 1$ for $y \u003e 0$, $\\sgn(y) = -1$ for $y \u003c 0$ and $\\sgn(0) = 0$.\nThen for every $x \\in \\R$, almost surely, for all $t \\ge 0$,\n$$\\abs{B_t - x} = \\abs{x} + \\int_0^t \\sgn(B_s - x) \\, dB_s + L(t, x),$$\nwhere the integral is an [[Itô integral|JA95NH206E]].\n\n## Remarks\n\nThe function $y \\mapsto \\abs{y - x}$ is not twice differentiable at $x$, so [[Itô's lemma|2J1RVQB0CM]] does not apply to it directly.\nApply Itô's lemma to the convex functions $f_\\varepsilon$ that agree with $\\abs{y - x}$ outside $(x - \\varepsilon, x + \\varepsilon)$ and are quadratic with $f_\\varepsilon'' = 1/\\varepsilon$ inside.\nThese functions are only $C^1$, but Itô's lemma still holds for them, by smoothing $f_\\varepsilon$ further, because $f_\\varepsilon''$ is bounded with two jumps.\nThe second-order term is $\\frac{1}{2\\varepsilon} \\int_0^t \\mathbf{1}_{\\set{\\abs{B_s - x} \u003c \\varepsilon}} \\, ds$, which tends to $L(t, x)$ as $\\varepsilon \\to 0$.\nThe value chosen for $\\sgn(0)$ does not matter, because Brownian motion spends a set of times of Lebesgue measure zero at $x$.\nExample: taking expectations with $x = 0$ gives $E[L(t, 0)] = E\\abs{B_t} = \\sqrt{2t/\\pi}$.\n\n## Explanations\n\n### L1 human\n\nTanaka's formula is Itô's chain rule for the absolute value of a Brownian motion.\nThe kink of $\\abs{y}$ at $0$ produces an extra term, the local time at $0$.\nThis term grows only when the path is at $0$ and pushes $\\abs{B}$ up so that it stays nonnegative.\n\n### L2 human\n\nThe formula shows that $\\abs{B}$ is a semimartingale: a martingale part plus an increasing part $L(\\cdot, 0)$.\nBy [[Lévy's characterization|8CKDVESXT6]], the integral $W_t = \\int_0^t \\sgn(B_s) \\, dB_s$ is a Brownian motion.\nThen $\\abs{B} = W + L(\\cdot, 0)$ and the Skorokhod reflection lemma give $L(t, 0) = \\max_{s \\le t} (-W_s)$.\nThis leads to Lévy's identity in law between $\\abs{B}$ and $M - B$, where $M$ is the running maximum.\nThe same idea gives the Itô–Tanaka formula for differences of convex functions.\n",
  "commit": "5fc425f97f1f6b11da5892c2948ef8c5d8805665",
  "front": {
    "about": [
      "E7ZC459PSA"
    ],
    "kind": "statement",
    "msc": [
      "60J55",
      "60J65",
      "60H05"
    ],
    "name": "Tanaka's formula",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q3068230",
      "wikipedia": "Tanaka's formula"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Tanaka%27s_formula"
      }
    ],
    "tag": "GEM0ERJ5ZB",
    "uses": [
      "22735FGJV6",
      "E7ZC459PSA",
      "JA95NH206E",
      "2J1RVQB0CM",
      "8CKDVESXT6"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/GEM0ERJ5ZB/",
  "links": [
    {
      "field": "about",
      "target": "E7ZC459PSA"
    },
    {
      "field": "uses",
      "target": "22735FGJV6"
    },
    {
      "field": "uses",
      "target": "E7ZC459PSA"
    },
    {
      "field": "uses",
      "target": "JA95NH206E"
    },
    {
      "field": "uses",
      "target": "2J1RVQB0CM"
    },
    {
      "field": "uses",
      "target": "8CKDVESXT6"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/GEM0ERJ5ZB.md",
  "msc": [
    "60J55",
    "60J65",
    "60H05"
  ],
  "name": "Tanaka's formula",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/GEM/GEM0ERJ5ZB.md",
  "status": null,
  "tag": "GEM0ERJ5ZB",
  "uri": "m2://GEM0ERJ5ZB",
  "url": "https://math2.tamnd.com/wiki/tanakas-formula/",
  "writing": {
    "tag": "GEM0ERJ5ZB",
    "kind": "statement",
    "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
      }
    ]
  }
}
