In the theory of "objects" developed in Terence Tao's Analysis I, he defines objects of type "function" on page 49 as follows:
Definition 3.3.1 (Functions). Let $X$, $Y$ be sets, and let $P(x, y)$ be a property pertaining to an object $x \in X$ and an object $y \in Y$, such that for every $x \in X$, there is exactly one $y \in Y$ for which $P(x, y)$ is true (this is sometimes known as the vertical line test). Then we define the function $f \colon X \to Y$ defined by $P$ on the domain $X$ and range $Y$ to be the object which, given any input $x \in X$, assigns an output $f(x) \in Y$, defined to be the unique object $f(x)$ for which $P(x, f(x))$ is true. Thus, for any $x \in X$ and $y \in Y$, $$ y = f(x) \iff P(x, y) \text{ is true.} $$
He goes on to clarify what he means by calling a function a "unique object" when he defines equality of functions on page 51 as follows:
Definition 3.3.7 (Equality of functions). Two functions $f \colon X \to Y$, $g\colon X \to Y$ with the same domain and range are said to be equal, $f = g$, if and only if $f(x) = g(x)$ for all $x \in X$.
I think that these definitions encompass some implicit axiom schemata, the first an assertion that given certain premises about sets $X$, $Y$ and a property $P$, then a function $f$ exists, and the second that this function is unique.
The part of the above definition that says "there is exactly one $y \in Y$ for which $P(x, y)$ is true" relies on there being a definition of equality for objects of the type of $y$, in order to refer to the uniqueness of $y$ (as discussed in my previous question, he requires that the equality predicate be defined separately for each "class $T$ of objects under consideration").
I'm kind of concerned, that if functions are a type of object, and the definition of a function relies on there being a defined equality predicate for each type of object $y$, then is it a problem if $y$ is of type function (which we are just now defining the equality predicate for)? Or is it okay to simply assume that in case $y$ is of type function, we will just use the function equality predicate that is subsequently defined?
Assuming that we can do this, my attempt to write the definitions above as axiom schemata is as follows:
Let $X$, $Y$ be sets, and let $\phi$ be a formula with free variables $x$ and $y$ such that for all $x\in X$, there exists $y\in Y$ such that $\phi(x,y)$ is true, and also for any $y'\in Y$ such that $\phi(x,y')$ is true, then $y$ and $y'$ are of the same type $T$, and $y=y'$. Then there exists an object $f$, of type function, determined by $X$, $Y$, and $\phi$.
Moreover, for each function $f'$ determined by sets $X'$, $Y'$ and a formula $\phi'$ in free variables $x$ and $y$, then $f = f'$ if and only if $X = X'$, $Y = Y'$, and for all $x\in X$ and $y\in Y$, $\phi(x,y)$ is true if and only if $\phi'(x,y)$ is true.
Is the above correct? As an axiom schema, I think the second paragraph above would need to be included for every pair of formulas $\phi$ and $\phi'$ in free variables $x$ and $y$?