Advantage and DC are character-independent. You're looking for Proficiency.
DCs are set independently of who is attempting them (DMG 238, emphasis added):
If you've decided that an ability check is called for, then most likely the task at hand isn't a very easy one. Most people can accomplish a DC 5 task with little chance of failure... ask yourself, "Is this task's difficulty easy, moderate, or hard?"
For more evidence on this point, note that spell save DCs are determined not by the person who is saving against them, but rather the caster's stats (PHB 75). Likewise, consider this example from the DMG (239):
Let's say a door requires a successful DC 15 Strength check to be battered down. A fighter with a Strength of 20 might helplessly flail against the door because of bad die rolls. Meanwhile, the rogue with a Strength of 10 rolls a 20 and knocks the door from its hinges.
Note that the fighter who is super strong doesn't face a lower DC, and the weaker rogue doesn't face a higher DC--the door's DC is determined by its material properties, not its challenger.
First, advantage is centered around temporary advantageous circumstances (DMG 239, emphasis added):
Advantage and disadvantage are among the most useful tools in your DM's toolbox. They reflect temporary circumstances that might affect the chances of a character succeeding or failing at a task.
DMG 239:
Consider granting advantage when ... Circumstances not related to a creature's inherent capabilities provide it with an edge.
However, proficiency is centered on training and practice (DMG 239 emphasis added):
One way to think about this question is to consider whether a character could become better at a particular task through training and practice. If the answer is no, it's fine to say that no proficiency applies. But if the answer is yes, assign an appropriate skill or tool proficiency to reflect that training and practice.
Using Proficiency in practice
With these distinctions in mind, I would treat the three characters this way:
- No proficiency bonus. While the librarian might be proficient generally, he has no training or knowledge in this particular question, so he doesn't get his proficiency bonus. This removal of the bonus is precedented by tool proficiencies, which only apply when the tool is actually being used (DMG 239).
- Normal proficiency bonus. This is the average case, where the character might know something more than the average person.
- Double proficiency bonus. For the purposes of this check, the elf is super-proficient and has a much higher inherent chance of success. The DMG uses doubled proficiency bonuses to represent particularly heightened abilities or special knowledge, such as the Book of Vile Darkness (DMG 223):
You can reference the Book of Vile Darkness whenever you make an Intelligence check to recall information about some aspect of evil, such as lore about demons. When you do so, double your proficiency bonus on that check.
or the Talisman of the Sphere (DMG 207)
When you make an Intelligence (Arcana) check to control a sphere of annihilation while you are holding this talisman, you double your proficiency bonus on the check.