Artificial intelligent assistant

Meaning of function mapping notation $d: X \times X \to \mathscr{R}$ I am trying to do some self-studying and am consistently getting bogged down by sophisticated mathematical notation. For example, something simple like this in a book: Let $X$ be a non empty set and then we define a metric $d$ on X as the function: $$ d: X \times X \rightarrow \mathscr R $$ Here, I have a confusion as to how I should read it. So d is a function that takes the quantity $X \times X$ and maps it to a real number? I am not sure why this is not written as $$ d:X \rightarrow \mathscr R $$ I find this notation really in the first equation in the online book: <

The notation means that $d$ is a function that takes a pair of numbers and maps them to the reals. The pair of numbers could be thought of as an ordered pair $(x,y)$ where $x \in X$ and $y \in X$, and the tuple $(x,y)$ is in the Cartesian product of $X$ with itself: $X \times X$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 68bf85759e21430c18e08d11aad3a6dc