But how do you know Lean itself is entirely bug free, and/or a 17M line monstrosity doesn't produce some latent bug?
I understand that you can break a big problem down into many smaller ones that are easy to prove, but I still get the sense that there's a lot of well, religious faith involved in the combination of Lean itself and these massive proofs.
You don't, but it has been verified using multiple independently written implementations. So maybe they all share the same defect that invalidates the proof, but it's believed to be rather unlikely.
For example if you have already managed to prove the statement P → Q ("P implies Q" i.e. whenever P is true we then also know that Q is true), and then you manage to prove the statement P, then you can use those two statements to prove Q. Lean knows that P → Q plus P proves Q ("modus ponens").
As another example, if you have P or Q, and you prove P is false, then Q follows. (e.g. x is odd or even, then you prove it's not odd, therefore it's even.)
To accept the proof you don't need to look at all the millions of lines of proof. You just need to accept three things:
* Lean's inference rules (like the one above)
* The axioms (e.g. definitions of numbers)
* The statement of the theorem in Lean symbols
These are all hugely shorter than the theorem's proof.