From 3d duality to 2d duality