A question on data distribution probability
You stated that D are i.i.d. so they are independent to each other.

The crucial question is whether D are all independent of x.

p(D|x) = p(D)


only if D are all independent of x