Prithviraj Chauhan was defeated by X.
Aibak was the commander of X, and established the Mamluk Dynasty in India. Y was the slave of Aibak. Y made Delhi a fitting seat for the Sultanate by constructing several monuments. Y also protected his kingdom from invasions, and built a complex administrative machinery. Identify X and Y.