Added function to create a property for equality of invariants
Keep the remove_duplicates function generic