Why does the infinite prisoners and hats puzzle require the axiom of choice?

If each prisoner individually picks an arbitrary representative of the equivalence class of the actual sequence of hat colors, and guesses their own hat color according to this arbitrarily selected one, then it is possible that every single prisoner guesses their hat color wrong. There is no limit.

They need to coordinate and agree on one representative for every single equivalence class and stick to the chosen representative, because then only finitely many of them can be wrong instead of arbitrarily many of them.


They aren't allowed to discuss things once they are in line, so it might be that each prisoner picks a different representative for the equivalence class. They need to pick a representative beforehand to avoid this problem, and if they pick beforehand they need to pick a representative for every equivalence class because they don't know which one they will be in yet.