TITLE: Show that a graph has a unique MST if all edges have distinct weights
QUESTION [9 upvotes]: Prove that if all edge-costs are different, then there is only one cheapest tree (minimum spanning tree or MST). (Use contradiction and make sure to keep track of the costs of the different trees involved.)

Here is my attempt:
Proof by contradiction
Assume that there is more than one cheapest tree, A and B. Assume that tree A and B are different and have the same weight. Let says that the smallest difference in edge cost between A and B is 1. Now, change one of the random edge (not contain in B) in A by half. This does not affect the path or order. However, A is cheaper than B now. This is contradiction. Thus, the original statement still hold.
Is this the correct logic? How do I write it out formally?

REPLY [12 votes]: Suppose there are two minimum trees, $A$ and $B$. Let $e$ be the edge in just one of $A,B$ with the smallest cost. Suppose it is in $A$ but not $B$. Suppose $e$ is the edge $PQ$. Then $B$ must contain a path from $P$ to $Q$ which is not simply the edge $e$. So if we add $e$ to $B$, then we get a cycle. If all the other edges in the cycle were in $A$, then $A$ would contain a cycle, which it cannot. So the cycle must contain an edge $f$ not in $A$. Hence, by the definition of $e$ (and the fact that all edge-costs are different) the cost of $f$ must be greater than the cost of $e$. So if we replace $f$ by $e$ we get a spanning tree with smaller total cost. Contradiction.