chore(topology/bases): golf a proof (#12127) Also add function.injective_iff_pairwise_ne.
function.injective_iff_pairwise_ne