{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $R$ be a commutative ring and let $d \\ge 1$ be an integer.\nLet $E$ be a [[linear recurrence with constant coefficients|081THG13JZ]] of order $d$ over $R$, with coefficients $c_0, \\dots, c_{d-1} \\in R$.\nLet $u$ and $v$ be [[solutions|0ZV2YKKZ58]] of $E$, that is, sequences $\\N \\to R$ with $u_{n+d} = \\sum_{i=0}^{d-1} c_i u_{n+i}$ and $v_{n+d} = \\sum_{i=0}^{d-1} c_i v_{n+i}$ for all $n \\in \\N$.\nIf $u_i = v_i$ for $i = 0, 1, \\dots, d-1$, then $u_n = v_n$ for all $n \\in \\N$.\n\n## Remarks\n\nThe proof is a strong induction on $n$.\nFor $n \u003c d$ the claim is the hypothesis.\nFor $n \\ge d$, the recurrence writes $u_n$ and $v_n$ by the same formula in the $d$ previous terms, which agree by induction.\nExistence also holds: for each choice of $u_0, \\dots, u_{d-1}$ in $R$, the recurrence defines the later terms one by one.\nSo the map $u \\mapsto (u_0, \\dots, u_{d-1})$ is a bijection from the solutions onto $R^d$; see the [[space of solutions|099GXMHV40]].\nExample: let $\\varphi$ and $\\psi$ be the roots of $X^2 - X - 1$, and let $v_n = (\\varphi^n - \\psi^n)/\\sqrt{5}$.\nThen $v$ solves $u_{n+2} = u_{n+1} + u_n$ over $\\R$, and $v_0 = 0$, $v_1 = 1$.\nThe [[Fibonacci sequence|0GA9K57A39]] solves the same recurrence with the same two initial values, so it equals $v$; this proves Binet's formula.\nFewer initial values are not enough: $(0, 1, 1, 2, 3, \\dots)$ and $(0, 2, 2, 4, 6, \\dots)$ both solve $u_{n+2} = u_{n+1} + u_n$ and agree in the first term only.\n\n## Explanations\n\n### L1 human\n\nA linear recurrence of order $d$ tells you how to compute each term from the $d$ terms before it.\nSo once the first $d$ terms are known, there is no freedom left: every later term is forced.\nTwo sequences that obey the same rule and start the same way are the same sequence.\n\n### L2 human\n\nThis fact is the basic tool for proving closed formulas for recurrent sequences.\nTo check a formula, one checks that it satisfies the recurrence and that it has the right first $d$ terms.\nTogether with existence, it shows that the solutions form a free module of rank $d$ with the initial values as coordinates.\nIn Mathlib it is `LinearRecurrence.eq_mk_of_is_sol_of_eq_init`.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "06MJC8YDYR"
    ],
    "kind": "statement",
    "msc": [
      "39A06",
      "11B37"
    ],
    "name": "Uniqueness of solutions given initial values",
    "role": "proposition",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Linear_recurrence_with_constant_coefficients"
      }
    ],
    "tag": "WREYNFJHH2",
    "uses": [
      "081THG13JZ",
      "0ZV2YKKZ58"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/WREYNFJHH2/",
  "links": [
    {
      "field": "about",
      "target": "06MJC8YDYR"
    },
    {
      "field": "uses",
      "target": "081THG13JZ"
    },
    {
      "field": "uses",
      "target": "0ZV2YKKZ58"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/WREYNFJHH2.md",
  "msc": [
    "39A06",
    "11B37"
  ],
  "name": "Uniqueness of solutions given initial values",
  "prov": null,
  "role": "proposition",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/WRE/WREYNFJHH2.md",
  "status": null,
  "tag": "WREYNFJHH2",
  "uri": "m2://WREYNFJHH2",
  "url": "https://tamnd.github.io/math2/wiki/uniqueness-of-solutions-given-initial-values/",
  "writing": {
    "tag": "WREYNFJHH2",
    "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
      }
    ]
  }
}
