The anthropic principle states that universes must be observed to be compatible with the sapient life that observes it. Thus, only universes containing sapient life will be observed. Is this equivalent to the theory of immortality?
Yes. This is the core of the currently accepted paradigm in cosmology: Conformal Cyclical Cosmology, or CCC.
The anthropic principle is, in fact, meaningless without the assumption that an observer must always exist. This is proven axiomatically in CCC. CCC also has empirical predictions, which have been confirmed, but those are just in addition to its formal proof.
The mathematics behind the proof are too lengthy to post here. However, CCC can be understood simply as the idea that the universe must always exist and contain information, except at the instant before and after heat death, when the universe's information content approaches that of a singularity and the cycle restarts. Only the portions of time containing life will be observed, per the anthropic principle, they will repeat endlessly. This seems to have been taken as self evident by premodern civilizations, while the formal proof of it is fairly recent (2007).