A data type for complex numbers can be defined with a constructor complexCartesian $[x, y]$ and the selectors re[c] and $\operatorname{im}[c]$. The representation is by a data element of the form cartesian $[x, y]$. It describes the number $x+i y$. These definitions implement the constructor and the selectors (The built-in complex numbers must not be used for this exercise).
$$
\begin{aligned}
& \text { complexCartesian }\left[x_{-}, y_{-}\right]:=\operatorname{cartesian}[x, y] \\
& \text { re[cartesian[x, } \left.\left.y_{-}\right]\right]:=x \\
& \text { im[cartesian[ } \left.\left[x_{-}, y_{-}\right]\right]:=y
\end{aligned}
$$
${ }^1$
1. Give definitions for addition, multiplication, and inverse of complex numbers that work exclusively with constructors and selectors. Complete the right side:
cartesian/: a_cartesian + b_cartesian := $\ldots$
cartesian/: a_cartesian *b_cartesian := $\ldots$
cartesian/: a_cartesian $\wedge-1:=\ldots$
Give similar definitions for the sum of a complex number and an integer or a rational number, as well as the product of a complex number with an integer or a rational number.
2. Are the rules from part 1 sufficient for all four arithmetic operations (addition, subtraction, multiplication, and division)?
$\bullet$ If yes, show how cartesian $[1,2]$ - cartesian $[0,1]$ and cartesian $[1,2] /$ cartesian $[0,1]$ are computed.
$\bullet$ If no, give more definitions sufficient for all four arithmetic operations. Show how the above two examples are now computed.
3. Complex numbers can also be given in polar coordinates as $r e^{i \varphi}=r \cos \varphi+i r \sin \varphi$. Here is the definition of a constructor complexPolar $[r, \varphi]$ that creates a data element polar $[r, \varphi]$ describing the complex number $r e^{i \varphi}$ :
$$
\text { complexPolar }\left[r_{-}, p_{-}\right]:=\operatorname{polar}[r, p] \text {. }
$$
Give definitions for the selectors $\mathrm{re}[]$ and $\mathrm{im}[]$ for data of type polar. With these definitions, re[polar[1, Pi/4]] evaluates to Sqrt[2]/2, because $e^{i \pi / 4}=\sqrt{2} / 2+$ $i \sqrt{2} / 2$.