On the bases of two or three witnesses.
Yes, I am well aware that some religions interpret "witness" to include inanimate objects in nature... that are CREATED BY GOD. As creations of god they can bare witness on his behalf.
I guess.
Jesus in Matthew 18:16 was actually reiterating what Moses said in Deuteronomy 17:6 - and this had to do with someone wronging someone else. If you ever witnessed two Jewish people in a heated argument over a wrong it can get rather... lively. In this case, the rule is perfectly understandable.
However, because Jews do not view "god" in the narrative format that Christians do, there is a spirituality that is assigned to the elements. The rocks gave forth water, honey, mana came from heaven, god spoke through a bush, the ground opened up to swallow the calf worshipers, Hanna received water from the ground, Aaron's rod grew flowers, rocks were used for the urim and the thummim. The earth as they knew it WAS LIVING. It had LIFE.
So in that mind, yes, elements of the earth can bare witness. That was NOT what Jesus was saying and it certainly was not what Paul was instructing in 2 Corinthians 13:1 as the church in Corinth were having serious problems... and Paul had to tell them " BY THE TESTIMONY OF TWO OR THREE WITNESSES" as there was much dispute about the authority of Jesus and such. Remember, not everyone can read, so once a letter was read to the church or a visit happened, people can go off to neighboring villiages and say whatever... arguing a point they cannot verify because they do not have the source material at hand.
Anyway, my opinion is that some of these people could have been using the old Jewish thinking about evoking the "witness" of inanimate objects... but regardless Paul said no... and he uses the words "at the mouth" (sometimes translated as "testimony". The witness had to be able to speak. So ask a Jewish person about the old law regarding the witness of a pile of rocks, but for the new law established by Jesus (who also uses "by the mouth"), the answer is no... inanimate objects should not be "witnesses".