Example 7 The mathematics competition problem committee consists of 9 professors. The prepared problems are stored in a safe, which can only be opened when at least 6 professors are present. How many locks should the safe have at least, how many keys should be distributed, and how should the keys be distributed to the committee members?


Let $B$ be the set of locks installed on the safe, and $A$ be the set of all 5-person groups among the 9 proposition committee members. Clearly,
$$
|A|=\mathrm{C}_{9}^{5}=126.
$$

For a 5-person group $a \in A$, according to the problem, there must be a unique lock $b \in B$ that none of the members in the 5-person group can open. Let $b$ be the image of $a$ under the mapping $f$ from $A$ to $B$, i.e., $b=f(a)$. Thus, a mapping $f$ from set $A$ to set $B$ is defined. We now prove that $f$ is a one-to-one correspondence.

For two different 5-person groups $a_{1}$ and $a_{2}$ in set $A$, the locks $b_{1}(=f(a_{1}))$ and $b_{2}(=f(a_{2}))$ they correspond to must be different. Otherwise, if $b_{1}=b_{2}$, then when both 5-person groups $a_{1}$ and $a_{2}$ (at least 6 proposition committee members) are present, they still cannot open lock $b_{1}$, which contradicts the problem statement. Therefore, $f$ is injective.

Furthermore, for each lock $b \in B$, there must be a 5-person group $a \in A$ who cannot open lock $b$, i.e., $b=f(a)$. Therefore, $f$ is surjective.
In summary, $f$ is a one-to-one correspondence from $A$ to $B$.
Thus, $|B|=|A|=126$, meaning 126 locks should be installed.
Now, let's consider how to distribute the keys. For each lock $b \in B$, there must be a 5-person group $a \in A$ where each member cannot open lock $b$, while the other 4 people can each open lock $b$. Therefore, each lock should have 4 keys, which are given to the 4 people outside the 5-person group corresponding to this lock. Hence, a total of $4 \times 126 = 504$ keys should be distributed, with each lock's 4 keys given to a 4-person group, and different 4-person groups correspond to different keys.