Why do the swap step in Prim's algorithm for minimum spanning trees?
Charles Leiserson is presenting a proof to what is known as the blue rule in Tarjan's "Data Structures and Network Analysis" book. 

The proof goes by contradiction, that is you assume that the edge $(u,v)$ is not in the MST $T$. Don't be confused by the board, it has to be $(u,v)\not \in T$. Let $(a,b)$ the edge that we swap with $(u,v)$. Bot edges are cut edges between $A$ and $A\setminus V$.
The tree $T'$ after the swap has weight 
$$w(T')=w(T)+w((u,v))-w((a,b)).$$ 
As a consequence $w(T')&lt;w(T)$, which is a contradiction and therefor the assumption $(u,v)\not\in T$ was wrong.

Notice that this proof uses the assumption that all edge weights are distinct, however it is easy to modify it for general edge weights.