Solution (source code)

= Solution

In surrounding <refractive index> $n'$, the geometrical segments contribute $n'[\sqrt{a^2+d^2}+\sqrt{b^2+d^2}]$ to the <optical path length>, while replacement by the lens adds $(n-n')\ell(d)$. <Fermat's principle> therefore gives
$$
n'\left(\frac1a+\frac1b\right)=2\alpha(n-n').
$$
The physical <focal length> measured in the surrounding medium is
$$
\boxed{f(n')=\frac{n'}{2\alpha(n-n')}=\frac1{2\alpha(n/n'-1)}.}
$$
For $\alpha>0$ and $n>1$, increasing $n'$ from $1$ towards $n$ makes the positive <focal length> grow monotonically from its vacuum value to infinity: $df/dn'=n/[2\alpha(n-n')^2]>0$. At $n'=n$, there is no <refraction> at the boundary, so the element has zero <optical power> and no finite <optical focus>. If $n'>n$, its <optical power> changes sign and the same shape becomes diverging.