Clearly it's not set theory, because set theory is built on first order logic, which is in a sense more fundamental as it comes first (you need first order logic to even state the axioms of ZFC)
And then comes the philosophical nightmare that I have been wrestling with for weeks. What comes before first order logic.
The question started when I began my quest on studying logic. It bothered me to a great extent that the books I read always assumed a knowledge of sets, natural numbers, functions, relations and in one of them, even cardinality! And to put the cherry on the cake, a few chapters later the books would go on to describe ZFC and building set theory, as if they had not been using sets casually for the past few chapters.
Here are the answers I have received so far
- First-order logic does not require the use of set theory
- There are certain things that you have to accept as primitives and part of an accepted metalanguage, which are needed as a starting point to lay the foundations of mathematics
- It's turtles all the way down
Regarding the first one, I have literally seen books on logic use terms like a language is a set of symbols or even "sets of well formed formulas", particularly something like $\{\phi_1,\phi_2,\dots,\phi_n\}\vDash \psi$ so I really don't know where the first point is coming from.
Regarding the second point, this makes much more sense, except that it seems no one can tell me what are the things we take as primitive and part of "common sense". Do we start off with a "common sense" understanding of sets and then build logic? Is it the same for natural numbers, functions, countability etc.? Is that to say that the ultimate foundation of all of mathematics is Naive Set Theory and Naive Number Theory? That just sounds so... unsatisfying. How can math be consistent, if our metalanguage of English is not (we can form contradictions like "This statement is false"). Ok basically my main question for this part is what are the things that we take as accepted and "common understanding" before we build mathematics. Like precisely what are they. Sets? Natural Numbers? (Is the domain of discourse in first order logic also a "common sense" term?)
The third one really grinds my gears because it just brushes the whole issue aside and doesn't explain it at all.
To sum up my question, as a foundation for mathematics, there are some things that we humans have to take as understood for us to draw a baseline. What precisely are these things and does a naive understanding of them in a metalanguage mean that mathematics is not as precise as it appears to be. Also as an aside, when we prove things about first order logic, do we do it in our imprecise metalanguage? I have seen logic proofs that use induction and I'm so confused because Number Theory is a much higher level thing than logic.