  We present the proof of Diophantus' 20th problem (book VI of Diophantus'
Arithmetica), which consists in wondering if there exist right triangles whose
sides may be measured as integers and whose surface may be a square. This
problem was negatively solved by Fermat in the 17th century, who used the
"wonderful" method (ipse dixit Fermat) of infinite descent. This method, which
is, historically, the first use of induction, consists in producing smaller and
smaller non-negative integer solutions assuming that one exists; this naturally
leads to a reductio ad absurdum reasoning because we are bounded by zero. We
describe the formalization of this proof which has been carried out in the Coq
proof assistant. Moreover, as a direct and no less historical application, we
also provide the proof (by Fermat) of Fermat's last theorem for n=4, as well as
the corresponding formalization made in Coq.
