As a personal project, I decided to prove everything I learned in mathematics using formal proofs. The difference between informal proof, which is commonly used by mathematicians, and formal proof is shown in Chapter 3 of the book "Logic, Mathematics, and Computer Science" by Yves Nievergelt.
During the course of this project, I encountered a problem that I will attempt to illustrate below. Let's consider the axiom of pairing:
$$\vdash \forall x\forall y\exists z\forall w(w\in z\leftrightarrow w=x\vee w=y)$$
You can prove that there's only one set $z$ satisfying the previous axiom, that is, you can prove that
$$\vdash \forall x\forall y\exists \color{red}{!}z\forall w(w\in z\leftrightarrow w=x\vee w=y)\,\,\color{red}{(1)}$$
Because of this, it's conventional to denote the set $z$ by $\{x,y\}$. However, according to the book "Set Theory" by András Hajnal (see page 115), an additional axiom is required to formalize this convention. The approach given in this book with regard to the axiom of pairing is as follows:
First you define $\phi(x,y,z):=\forall w(w\in z\leftrightarrow w=x\vee w=y)$. The book calls this the defining postulate of the operator $\{\,,\}$.
According to $(1)$, we have $\vdash \forall x\forall y\exists !z\phi (x,y,z)$. Then we add the following axiom: $\vdash \forall x \forall y\phi(x,y,\{x,y\})$. This extension is an effective strict conservative extension (see the Theorem A2.1 of the book).
My question is: does type theory help us avoid the need to add more axioms for each new definition?
I am looking for a formal language that can express, for example, the axiom of pairing and introduce the set builder notation $\{\,,\}$ without requiring an additional axiom.
Having skimmed through "Type Theory and Formal Proof” by Rob Nederpelt, I have the impression that it's possible to achieve this using an extension of Calculus of Constructions denoted by $\lambda D$ in this book. However, since I know nothing about type theory, it's possible that I am misinterpreting its usage.
Thank you for your attention!