What are the odds of a librarian villager selling Mending books at tier 1?
First the type of enchantment is selected randomly and then after that the level of enchantment is selected randomly. This means the probability of choosing mending is 1/(number of enchantments)
.
In you simplified example of Sharpness and Infinity, there is 1/2 probability of choosing Sharpness. Then the level of sharpness is determined by another random roll.