Math 2.0

Combinatorics Proof

Proof of unique paths in trees

Builds on TreeConnected graphAcyclic graphReachabilityWalkPathCircuitCycleEvery walk contains a path

Proof

We prove both directions. Step 1 is a fact about closed walks that both directions use.

  1. Let (z0,z1,…,zm)(z_0, z_1, \dots, z_m) be a closed walk with m≥3m \ge 3, zm=z0z_m = z_0, and z1,…,zmz_1, \dots, z_m pairwise distinct. Then its mm edges are pairwise distinct, so it is a circuit, and hence a cycle.
  2. Proof of step 1. Read the indices modulo mm. The edges are {zt−1,zt}\set{z_{t-1}, z_t} for t=1,…,mt = 1, \dots, m. Two of them can be equal only if the pairs share both vertices.
  3. Since z1,…,zmz_1, \dots, z_m are distinct, the equality {zs−1,zs}={zt−1,zt}\set{z_{s-1}, z_s} = \set{z_{t-1}, z_t} with s≠ts \ne t forces zs−1=ztz_{s-1} = z_t and zs=zt−1z_s = z_{t-1}. Then t≡s−1t \equiv s - 1 and s≡t−1s \equiv t - 1, so 2≡02 \equiv 0 modulo mm, which is false for m≥3m \ge 3.
  4. (⇒\Rightarrow) Let GG be a tree. It is connected, so it has a vertex and any two vertices u,vu, v are joined by a walk.
  5. By every walk contains a path, there is a path from uu to vv.
  6. Suppose P=(p0,…,pa)P = (p_0, \dots, p_a) and Q=(q0,…,qb)Q = (q_0, \dots, q_b) are different paths from uu to vv.
  7. Neither is a proper initial part of the other. For example, if a<ba < b and pt=qtp_t = q_t for t≤at \le a, then qa=pa=v=qbq_a = p_a = v = q_b, which contradicts the distinct vertices of QQ.
  8. So there is a least index ii with 1≤i≤min⁡(a,b)1 \le i \le \min(a, b) and pi≠qip_i \ne q_i. Then pi−1=qi−1p_{i-1} = q_{i-1}; call this vertex xx.
  9. Let j≥ij \ge i be the least index such that pj=qlp_j = q_l for some l≥il \ge i. It exists, because pa=v=qbp_a = v = q_b and b≥ib \ge i.
  10. Consider the closed walk C=(x,pi,pi+1,…,pj,ql−1,ql−2,…,qi,x)C = (x, p_i, p_{i+1}, \dots, p_j, q_{l-1}, q_{l-2}, \dots, q_i, x), where pj=qlp_j = q_l and qi−1=xq_{i-1} = x. Its length is (j−i+1)+(l−i+1)(j - i + 1) + (l - i + 1).
  11. The vertices pi,…,pjp_i, \dots, p_j are distinct and differ from x=pi−1x = p_{i-1}, since PP is a path. The vertices ql−1,…,qiq_{l-1}, \dots, q_i are distinct and differ from x=qi−1x = q_{i-1}, since QQ is a path.
  12. No qtq_t with i≤t<li \le t < l equals some psp_s with i≤s≤ji \le s \le j. For s<js < j this follows from the minimality of jj, and for s=js = j from pj=qlp_j = q_l and t≠lt \ne l.
  13. So the vertices of CC after the first are pairwise distinct. If the length were 22, then j=l=ij = l = i and pi=qip_i = q_i, which is false. So the length is at least 33.
  14. By step 1, CC is a cycle in GG. This contradicts that GG is acyclic. Hence the path from uu to vv is unique.
  15. (⇐\Leftarrow) Suppose GG has a vertex, and any two vertices are joined by exactly one path.
  16. A path is a walk, so any two vertices are reachable from each other. So GG is connected.
  17. Suppose GG has a cycle (w0,w1,…,wk)(w_0, w_1, \dots, w_k). Its length kk is at least 33: k=1k = 1 needs a loop, and k=2k = 2 uses the edge w0w1w_0 w_1 twice.
  18. Then (w0,w1)(w_0, w_1) and (wk,wk−1,…,w1)(w_k, w_{k-1}, \dots, w_1) are paths from w0=wkw_0 = w_k to w1w_1. The second has distinct vertices because w1,…,wkw_1, \dots, w_k are distinct.
  19. These two paths have lengths 11 and k−1≥2k - 1 \ge 2, so they are different. This contradicts uniqueness, so GG is acyclic.
  20. By steps 16 and 19, GG is a tree.

Idea

Two different routes between the same two vertices must split apart at some vertex and later meet again. The two pieces between the split and the first meeting point form a cycle. Conversely, a cycle gives two different routes between neighbouring vertices on it.

Reading path

To understand this page from the ground up, read these 24 pages in order. The foundations come first. The path takes the proofs Proof of strong induction from ordinary induction, Proof that every walk contains a path.

Show the path as a graph
Definition by recursion, concept, no evidence levelDefinition by recursi…conceptGraph, definition, no evidence levelGraphdefinitionMathematical induction, concept, no evidence levelMathematical inductionconceptNatural numbers, object, no evidence levelNatural numbersobjectPeano axioms, concept, no evidence levelPeano axiomsconceptWalk, definition, no evidence levelWalkdefinitionSuccessor function, definition, no evidence levelSuccessor functiondefinitionPath, definition, no evidence levelPathdefinitionReachability, definition, no evidence levelReachabilitydefinitionTrail, definition, no evidence levelTraildefinitionAddition of natural numbers, definition, no evidence levelAddition of natural n…definitionThe successor function is injective, statement, no evidence levelThe successor functio…statementZero is not a successor, statement, no evidence levelZero is not a success…statementConnected graph, definition, no evidence levelConnected graphdefinitionCircuit, definition, no evidence levelCircuitdefinitionOrder on the natural numbers, definition, no evidence levelOrder on the natural …definitionCycle, definition, no evidence levelCycledefinitionProof of strong induction from ordinary induction, proof, no evidence levelProof of strong induc…proofAcyclic graph, definition, no evidence levelAcyclic graphdefinitionStrong induction, statement, no evidence levelStrong inductionstatementTree, definition, no evidence levelTreedefinitionProof that every walk contains a path, proof, no evidence levelProof that every walk…proofEvery walk contains a path, statement, no evidence levelEvery walk contains a…statementProof of unique paths in trees, proof, no evidence levelProof of unique paths…proof
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Definition by recursion concept
  2. Graph definition
  3. Mathematical induction concept
  4. Natural numbers object
  5. Peano axioms concept
  6. Walk definition
  7. Successor function definition
  8. Path definition
  9. Reachability definition
  10. Trail definition
  11. Addition of natural numbers definition
  12. The successor function is injective statement
  13. Zero is not a successor statement
  14. Connected graph definition
  15. Circuit definition
  16. Order on the natural numbers definition
  17. Cycle definition
  18. Proof of strong induction from ordinary induction proof
  19. Acyclic graph definition
  20. Strong induction statement
  21. Tree definition
  22. Proof that every walk contains a path proof
  23. Every walk contains a path statement
  24. Proof of unique paths in trees proof

Where this leads

1 page builds on this one.

Further reading

  1. Web https://github.com/oscarlevin/discrete-book/blob/a8e4949bc45daf100930c1182983778f56ab689f/ptx/sec_gt-trees.ptx#L154
About this page
TagNTM3TVVXEF
URIm2://NTM3TVVXEF
Kindproof
WritingW0 stub
MSC05C05
ProvesUnique paths in trees
UsesTree, Connected graph, Acyclic graph, Reachability, Walk, Path, Circuit, Cycle, Every walk contains a path
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.