How does Rick prove that both his grandchildren Morty and Summer are a piece of shit? Lets Look at it mathematically.
Summer is equivalent to Morty if and only if there exists a mapping/function called "f" that takes elements from some set called "S" as inputs and elements from some set called "M" as outputs such that given any element x of the set S, there exists a unique element y of the set M such that the pair (x,y) is in f.
S=Summer and M=Morty
So Summer is equivalent to Morty whenever there is some function from S to M that is well-defined (hence proved).