The theoretical patent application (filed and published) contains a theoretical independent claim for the use of cholesterol in the treatment of cancer. There is also a dependent claim where the type of cholesterol used is "X-cholesterol".
Now let's say that my research also revealed that a type of cholestrol, "A-cholestrol" is particularly effective in the treatment of cancer. I should have explicitly claimed A-cholestrol in my patent application but didn't.
This is not a simple question. Even though your independent claim literally covers A-cholesterol, the claim might have written description problems rendering the claim invalid.
By way of example, assuming you have described B-cholesterol and X-cholesterol in your patent application, you are entitled to draft claims covering at least those types of cholesterol, but it is not clear that you are entitled to a broad claim that includes A,C,D, etc.-cholesterols in its scope. In an analogous electrical or a mechanical case, disclosing 1 or 2 species is usually enough to demonstrate that the applicant is entitled to a broad genus claim. But in the non-predictable arts substantially more description is often needed. If it turned out that many or most types of cholesterol do not work, a defendant might succeed in invalidating your broad claim as not being supported. (Under 35 USC 112, 1st paragraph).
Can a competitor come along and patent A-cholestrol in the treatment of cancer? If so, how can this be - i.e. wouldn't my broad claim cover the use of A-cholestrol and thus bar my competitor from patenting the same?
Invalidation of your competitor's claims is based on what you describe and what is obvious in light of what you describe in your application rather than just what is claimed. Even if your genus claim to cholesterol is invalid, your application contain enough disclosure to bar the competitor from patenting A-cholesterol, or it might not.
If it's the case that my competitor can patent A-cholestrol in the treatment and they successfully patent, would they need a license from me to practice the invention? If so, why (would it be an improvement of my invention?)
It doesn't appear a license would be necessary from the facts of your case as I understand them. If your independent claim is invalid, nobody needs a license from you. If your independent claim is valid and includes A-cholesterol, then the competitor's claims would not be valid which would violate the premise of your hypo.