A unified minimal realization theory with duality