First of all I apologize if this question is too out of topic but it's been bothering me for a while.
From what I've gathered after years of study it seems that set theory is essentially the foundation of modern mathematics.
Now, I've been studying formal logic for a while and it seems to me that logic is even more fundamental than set theory in the sense that we rely on it to prove things about sets. However, from what I've read we also rely on set theory to prove things about logic.
I realize that formal logic is not the same as naïve logic. But if we expect to have a solid foundation for mathematics, shouldn't we have a rigourous approach to the way we reason that is independent from set theory? Is such a thing even possible?
In a nutshell, is it possible to have a reasonable framework for logic that is rigourous and independent from set theory?
I'm sorry if this question is too vague. And maybe a lot of people don't really care as long as everything makes sense. But since modern mathematics is so concerned with consistency and rigour, how do we know logic itself isn't flawed?
I would really appreciate your insight on this topic! Thank you!
PS: Please let me know if this question isn't appropriate for this forum.
I am by no means an expert on the topic but in one sense, no, set theory (built on a foundation of first order logic) is no more fundamental than alternative foundations, such as type theory. In fact, type theory can encode logical operators (e.g., disjunctions and conjunctions) as types themselves, which means it (unlike set theory) can be constructed without a basis of first order logic.
For prior discussions of the most low-level foundations of math, see (Question 1334678) and (Question 121128).