Artificial intelligent assistant

How do set theory, and formal logic fit in together? Im at that stage in my mathematical understanding where I kinda understand what set theory is and what first order logic is but dont really understand how they fit together to create Mathematics. I assume that the ZF system uses first order logic to create the foundations of mathematics and in the grand scheme of things, set theory is dependent on logic for its existence whereas logic or any formal system can exist on its own. Is this the correct view?

The received wisdom is that pretty well any mathematical statement can in principle be formulated and hence formalised in ZF. I think this is rather an overstatement, but let's bear with it. So in some sense, logic can be viewed as providing a formal foundation for mathematics. However, to do logic rigorously, you need to be able to define and reason about syntax, so a certain amount of mathematics is required to underpin logic. Many people take the view that the finitistic mathematics you need to reason about syntax is sufficiently certain that the apparent circularity is harmless. (Personally, I am agnostic on nearly all such issues.)

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 5c4a13bae9f060f72d7620513cac7687