Yang–Mills theory from a topological theory