
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
$22.$ In the Cartesian coordinate system $xoy$, the equation of line $l$ is $x-y+4=0$. In the polar coordinate system with the origin $o$ as the pole and the positive half of the $x$-axis as the polar axis, the polar equation of curve $C$ is ${\rho }^{2}-4\sqrt{2}\rho \mathrm{cos}(\theta -\frac{\pi }{4})+6=0$.

$(1)$ Find the polar equation of line $l$ and the Cartesian equation of curve $C$;

$(2)$ If point $P$ is any point on curve $C$, and the Cartesian coordinates of point $P$ are $(x,y)$, find the maximum and minimum values of $x+2y$.

Present the answer in LaTex format: \boxed{Your answer}
user