Mahdi- how would you know?

Re: Mahdi- how would you know?

That speaks of the death of a Caliph...does that mean a Khilafat will be established before that ?