This started out at a comment on Kevin Buzzard’s recent blog post on division by zero in Lean, but I got caught up in my own thoughts, and was turning into one of those “I have a question but it’s more of a mini-talk about my own ideas” non-questions at seminars. So I moved it here.
The background is this: in the proof assistant Lean, fields are defined so that inverse is an everywhere-defined function, with the inverse of zero being zero. Kevin points out that this doesn’t actually change anything, since the axioms on fields explicitly demand that you can only get if you know
. In Lean, this means you have to supply a proof that this is the case. So one cannot abuse
in incorrect proofs that would use actual division by zero. There is no mathematical difference between defining inversion as a total function, and only defining axioms in ‘guarded’ situations, and only defining inversion as a partial function. The fact that
is, from a programming point of view, fairly arbitrary; the output (i.e. the right hand side of the
) could be any “junk” value. In other languages one might specify it to be ‘NaN', and have rules about how that interacts via addition and multiplication.