What did the Triceratops use their horns for?

The Triceratops used their horns for both courtship and combat, including defending against aggressive predators such as the Tyrannosaurus.