The turtle and elephant bit come from Hindu mythology. But the Vedas mention only one elephant and the world spins at the end of his trunk. I want to know if there are other mythologies Pratchett is specifically referencing here.
A few different cultures have turtles/tortoises as well as elephants as part of their creation myths. As a combined image, however, it may have come down through the years partly from John Locke, a philosopher who used the example in his book An Essay Concerning Human Understanding, in a mocking way, of an elephant holding up the world, and a turtle holding it up.
He may have been mangling Hindu mythology, but he was using the example as a metaphor attacking the credibility of beliefs by examining their supporting evidence.
I believe he's borrowing directly from Hindu mythology. The World Turtle mytheme is present in at least North American, Chinese, and Indian culture, while the World Elephant is more specific to Hindu mythology.
In terms of numbers, the elephants are at the compass points and so there are some multiple of four; for example in Ramayana the number is specified as exactly four:
deva daanava rakSobhiH pishaaca pataga uragaiH puujyamaanam mahaatejaa dishaa gajam apashyata
And he that resplendent Amshuman beheld one of the four directional elephant of the earth which is being venerated by gods, monsters, demons, imps, vultures and serpents.
While in Amarkosha (PDF) there are eight (as with lords and planets):
airāvataḥ puṇḍarīko vāmanaḥ kumudo 'ñjanaḥ puṣpadantaḥ sārvabhaumaḥ supratīkaśca diggajāḥ Respective elephants associated to the eight directions
In The Folklore of Discworld (co-written with Jacqueline Simpson), Pratchett discusses the origin:
Further details of Hindu cosmology vary. According to one myth, there are four (or eight) great elephants named the diggaja or diśāgaja, 'elephants of the directions', guarding the four (or eight) compass points of this disc, with a type of god called a lokapala riding on the back of each one. But the oldest texts do not claim that they carry the world. According to another myth, however, the world rests on the back of a single elephant, Maha-Padma, and he is standing on a tortoise named Chukwa. Finally, it is said in yet another muth that the god Vishnu once took on the form of a vast tortoise or turtle (kūrma), so huge that Mount Meru, the sacred central mountain of the world, could rest o fhis back and be used as a stick to churn the ocean. At some stage, though nobody knows just when, these insights began to blend, with the result that some (but not all) Hindu mythographers now say the world is a disc supported by four elephants supported by a turtle.
ABU: Does the world have a roof?
GENIE: Of course! Supported by seven pillars, and the seven pillars are set on the shoulders of a genie whose strength is beyond thought, and the genie stands on an eagle, and the eagle on a bull, and the bull on a fish, and the fish swims in the sea of eternity.
I think he's solving the "Turtles All the Way Down" problem. It's not turtles all the way down, it's one turtle flying through space. Makes much more sense when you think about it.
The idea of an elephant/elephants standing upon a giant turtle which supports the world is a part of numerous different cultures mythologies, mainly Hindu but this myth has similaritiesin other cultures such as; China
In Chinese mythology the creator goddess Nüwa cut the legs off the giant sea turtle Ao (鳌) and used them to prop up the sky after Gong Gong damaged the Buzhou Mountain that had previously supported the heavens.
In North America although elephants were not apart of the myth, the idea of the world residing on the back of a turtle is constant.
Although this myth has developed into the phase where it is believed that the world resides on the back of a varying number of elephants on one gigantic turtle I believe Pratchett was using the Hindu version of the myth. One interesting thing to think about is that in the begining this mythology did NOT state that the disc the elephaphants were carrying was the world, some people believe that it was actually refers to the creation of the universe and the 'Milky Way's place in the galaxy.
Here are some websites that go into a little more detail on the Elephant/turtle myth.
According to this article from Tor, he was inspired by a combination of Hindu mythology and the "turtles all the way down" problem popularized by Bertrand Russell (which was inspired by the World Turtle mytheme).
The Discworld itself is, from an astrozoological point of view, founded on the exploration of a logical fallacy. Specifically, the infinite regress fallacy illustrated by the “turtles all the way down” cosmological myth, popularised in the West by the late philosopher and logician Bertrand Russell, but dating back centuries, with the earliest known references found in 16th century Hindu mythology.
And yet, most interestingly, Pratchett cuts straight to the core, does away with the infinite regress, and shows that fallacy is only false through lack of imagination. This is how we end up with the four Elephants, Jubul[sic], Jerakeen, Berilia and Great T’Phon, standing on the back of Great A’Tuin the World Turtle (sex unknown), who is not standing in turn upon an infinite tower of “turtles all the way down”, but is far more sensibly swimming through space, towards an unfathomable destination all its own.
"The Tao of Sir Terry: Pratchett vs. Logic", J.R.H. Lawless, Tor.com, May 6, 2019
Turtles all the way down:
"Turtles all the way down" is an expression of the problem of infinite regress. The saying alludes to the mythological idea of a World Turtle that supports the earth on its back. It suggests that this turtle rests on the back of an even larger turtle, which itself is part of a column of increasingly large world turtles that continues indefinitely (i.e., "turtles all the way down").
"Turtles all the way down", Wikipedia
World Turtle mytheme:
The World Turtle (also referred to as the Cosmic Turtle or the World-bearing Turtle) is a mytheme of a giant turtle (or tortoise) supporting or containing the world. The mytheme, which is similar to that of the World Elephant and World Serpent, occurs in Hindu mythology, Chinese mythology and the mythologies of the indigenous peoples of the Americas
"World Turtle", Wikipedia