I want to write equation for optimization problem. I have error norm equation like f(X) = || X - X0 ||2 , what I want is to add a constraint or prior term in this equation. The constraint I want to add is of unique values that is X should not contain repeatable values that is f(x) = || X - X0 ||2 + U(X). Now I want to define U(X) that is X should contain only unique values. How do I represent U(X) in equation or how do i define it mathematically like U(x)=.... ?