They can't — any kind of formal verification is always with respect to a TCB — but you can get pretty high assurance through making the TCBs smaller and smaller, and making multiple independent TCBs. The Lean community has done both. I think at this point the chance of there being an error is smaller than the chance that aliens show up in the next year or similar.
TCB = trusted computing base
> I think at this point the chance of there being an error is smaller than the chance that aliens show up in the next year or similar.
hah, so you're saying the chance is less than 2% (https://polymarket.com/event/will-the-us-confirm-that-aliens...)
When the same bugs show up in multiple "independent" implementations of the "trusted computing base", I start suspecting that they're all ports of each other, making the same unforced choices of algorithm etc. Many folk from the LCF school will point and laugh at the description of Lean's TCB as "smaller". (Does the Lean kernel still contain an entire copy of GMP?) If reimplementing the kernel is much more than a weekend project, I'm certainly not willing to bet against the existence of errors, regardless of whether people claim to have proven their absence.
Does this mean that the aspirations of Principia Mathematica are now in effect achievable? Whitehead and Russell were just a century too early?