This is just showing that if P(X|Y) = P(X), then X and Y are independent.
By definition, P(X|Y) = P(X,Y)/P(Y). (, meaning intersection).
Since P(X|Y) = P(X) (by assumption), we have
P(X,Y)/P(Y) = P(X) ==> P(X,Y) = P(X)P(Y).
Also, P(Y|X) = P(Y,X)/P(X) = P(X,Y)/P(X) = P(X)P(Y)/P(X) = P(Y)...