For a guess of a finite-alphabet variable , let and . The chain rule for conditional entropy gives . The first term is at most the binary entropy . The second is zero when the guess is right and at most when it is wrong, proving . This needs no optimality assumption on the guess.
Apply the definitions of conditional entropy and insert :
Inserting instead gives the alternative chain rule for conditional entropy
Both are expansions of the same joint conditional uncertainty, with the variables exposed in opposite orders.
Because is determined by , its conditional entropy satisfies . Equate the two forms of the chain rule for conditional entropy to obtain
Conditioning cannot increase classical Shannon entropy: by nonnegativity of mutual information. Thus . When , the value of is exactly and . When and , the value is excluded, leaving at most possibilities. By maximum entropy on a finite alphabet,
Averaging the two conditional cases now yields
and consequently
This is Fano's inequality via an error indicator. Events of zero probability contribute zero to the average and need no conditional distribution. For , the inference is automatically correct and the entropy is zero; the displayed logarithmic form is intended for . Optimality of the guess is not needed for the inequality: it holds for every deterministic .