This is part of a series of questions on the Gemara in Bechoros 8b-9a. Below is a summary of the relevant parts of the Gemara. After being challenged by Caesar, R' Yehoshua went to Athens to defeat the Athenian Elders in a battle of wits.
In the process of their debate, the Elders challenged R' Yehoshua to build a house in midair. R' Yehoshua said the Shem of Hashem and began levitating. "Bring me some bricks and mortar," he said, "and I'll do it."
Why was R' Yehoshua permitted to say the Name of Hashem just for the sake of proving to the Elders that it's possible to build something in midair?