Equivalence of path dependence and gauge dependence