A metric on a set X is a map d:X×X→R satisfying the following conditions.
((a)) d(x,y)≥0 for all x,y∈X;
((b)) d(x,y)=0 exactly when x=y;
((c)) d(x,y)=d(y,x);
((d)) d(x,y)≤d(x,z)+d(z,y).
In other words, a metric is simply a generalization of the notion of distance. Prove that Hamming distance is a metric on Z2n. Decoding a message actually reduces to deciding which is the closest codeword in terms of distance.