I’m not a mathematician, but aren’t some fundamental terms in mathematics NOT clearly defined? For example a set?
There are philosophical questions around what it means to "define" something. But if you want to go there, well then nothing is clearly defined.
With set theory, it looks like there was some reformulating of the fundamental terms to prevent paradox, but I'm not quite clear on whether that leaves us with a consistent formal system in the end:
Note that even were ZFC be proven to be inconsistent it would probably not be a huge issue practically speaking for most mathematicians. This Math Overflow answer describes it best: https://mathoverflow.net/a/41030
For example, if mathematicians say (https://www.britannica.com/science/Peano-axioms):
“Zero is a natural number.”
Mathematicians have worked hard on minimizing the amount of common understanding needed, though.
Certainly, the fairly complex concept “set” gets a clear, unambiguous definition.
Sets, functions, and integers all have precise definitions. They are respectively provided by ZFC set theory, ZFC set theory again, and the Peano axioms (with your chosen method of extending the natural numbers to the integers, the easiest being an algebraic extension, or you could use equivalence classes of pairs).
Here's one of the basics of FOL.
Formula = PrimitiveFormula | Formula Connective Formula | not Formula | Quantifier Variable Formula
VariableList = Variable | Variable,VariableList
PrimitiveFormula = Predicate(VariableList)
Term = Constant | Variable
Connective = implies | and | or
Quantifier = forall | exists
Constant = c | c Constant
Variable = v | v Constant
Predicate = p | p Predicate
It's adapted and formalized from https://web.engr.oregonstate.edu/~afern/classes/cs532/notes/.... Note I've left out function symbols so as to minimize confusion. Function symbols are not functions themselves, but they can be represented by predicates with an additional argument so I've left them out for clarity.
It's kind of restricted in that variables are now called v, vv, vvv, etc., predicates are called p, pp, ppp, etc., but that seems minor and I was being lazy.
I think your objection is to the fact that most treatments of first order logic informally talk about a "set of variables indexed by the natural numbers" or something of that sort, but that's informal, and it's understood that really what's going on is an algorithm "under the hood." Crucially I'm using recursion here, but a recursive definition has no need to appeal to sets, functions, or integers. In fact since we're on HN it's worth pointing out all that recursion is is a while loop, and I could've done that instead. In that case though I wouldn't have provided a BNF and I instead would need to provide a full program (which is definitely possible, this is what tools like bison do for you automatically).
If what you're concerned about is the "interpret" part (i.e. the model part of model theory), that's a far deeper philosophical question that touches on whether it's possible to define anything at all.
Modern mathematics can be thought of as simply a syntactic game. That's why it can be formalized by computers. Philosophically this may be troubling because it doesn't explain why certain results are interesting or why an application of math to real-world objects "works," but like I said, that's starting to touch on the broader issue of whether it's possible to define anything at all and what exactly language is and that's a deep deep deep philosophical hole that affects the entirety of human language. This is where you have to start closely scrutinizing what the word "is" really, well, is.
Perhaps it's first useful to sort out an example of a definition of anything that you find is watertight, compare and contrast, and discuss from there?
And I wonder about whether certain mathematical truths will be inherently difficult to locate because they are far away from the space of other existing problems, and thus subject to problems of a search algorithm getting stuck in a local maximum.
In any case, an accelerated search through this space sounds really promising and exciting!