Let $X$ and $Y$ be finite sets, and let $P$ be some property. I am defining the set $Z$ to be the set of all functions with domain $X$ and codomain $Y$ that satisfy property $P$ as follows: \begin{gather} Z=\{z\in Y^X\mid z\text{ satisfies property }P\} \end{gather} Following both Wikipedia and some authoritative sources in my field, I have been using the notation $Y^X$ to denote the set of all functions $z$ with domain $X$ and codomain $Y$, but someone recently challenged this notation and suggested it is not correct, as the objects in $Y^X$ are technically not functions.
Hence, my doubts:
If $Y^X$ is commonplace notation to denote the set of all functions from $X$ to $Y$, could someone explain why?
If $Y^X$ is not commonplace notation to denote the set of all functions from $X$ to $Y$, could someone tell me how to denote the set of all functions from $X$ to $Y$?
Would the following expression be better to denote the set I am interested in? \begin{gather} Z=\{z:X\to Y\mid z\text{ satisfies property }P\} \end{gather}