TITLE: What technical and/or theoretical challenges are involved in automatically extracting proofs from books and papers into Coq code?
QUESTION [23 upvotes]: Over the years, advances in machine learning has allowed us to communicate and interact, using the same natural language, more and more semantically with computers, e.g. Google, Siri, Watson, etc. On the other side, proof automation and formalization has gained more and more steam, culminating at, for example, recent efforts by Gonthier et al. to encode the Feit-Thompson theorem, and this trend will not stop as homotopy type theory has become a hot research topic. It then only seems natural to ask what open problems or technical challenges still lie ahead before we arrive at a Google Books style of automatically extracting human proofs written on paper (or just in latex) to formalized and checked proofs in something like Coq?
Ideally, answers regarding both the mathematical side and the more empirical machine learning side (or perhaps other viewpoints I've not considered here) are welcome, but I'm not quite sure if the latter is on topic on mathoverflow. And ideally, I should think we want to avoid babbling philosophy here, e.g. what's the point of mathematics, etc.

REPLY [22 votes]: I think Andrej's opinion is very accurate. Here are a few more comments based on my experience as a contributor to the Coq proof of the Feit-Thompson theorem (sorry it's a bit long).
This formal development comprises three natures of libraries: some are for infrastructure purposes and no
mathematician cares about the lemmas they prove (litanies of lemmas on
booleans, lists or natural numbers, seemingly cryptic boilerplate code...),
some contain constructions (permutation groups, rational numbers,...),
and some contain meaningful theories (finite
group theory, linear algebra, character theory,...). At least in this
last category, which is by far the largest in size, the length of both
statements and proof scripts are of the same order of size than the
LaTeX code of their paper counterpart. The statements are kept as
readable as possible by a choice of LaTeX-like notations which mimic
the corresponding type-setting source
code. Proof scripts on the other hand look rather different, but long
ones (for long proofs) are usually structured with many explicitly
stated intermediate lemmas, that are as readable as the main one.
Beside a (dumb and merciless) proof checker, interactive proof
assistants actually include
various tools that are there to help with the gap issue.
As already mentioned in this thread, comprehensive and well-organized
libraries of formalized mathematics are a mandatory ingredient. Also
it is possible to automate the description of computational parts in proofs
by implementing formal-proof-producing decision or normalization
procedures (like for instance computer-algebra-like routines for
algebraic expressions). But this is not enough --and by the way the
libraries of the Feit-Thompson theorem actually barely use this latter
form of automation.
One crucial point there was to be able to input mathematical
sentences, for
instance the formal statement of wannabe theorems, with as much
facilities as one would write them on paper. Otherwise very soon you
just cannot read them (nor are you able to input them in fact).
But in that case you need to have the proof
assistant automatically and silently decorate the objects with the
implicit information carried by the standard mathematical notations.
Once the appropriate infrastructure is set (which requires
in particular understanding the common notational practices of the
authors in the field), the routine arguments mentioned by Andy Putman
require close to zero input from the user. For instance if you know
that $K$ and $H$ are two subgroups of a same group, showing that
$0 \lt \#(H \cap N(K))$ is just trivial (i.e. a two character Coq proof
script), because the system knows that the
normalizer of a group and the intersection of two
groups are themselves groups, and that the cardinal of a group is always
positive for a group has at least one (neutral) element. Indeed,
these bureaucratic steps can be implemented by a program chaining some
identified lemmas for you behind the scene. This either closes some
branches in the proof or calculates the glue needed to make your
current goal match the known result you want to use at this stage.
Crafting this infrastructure was one of the fun and creative parts of
the formalization work (it is not just about tagging some lemmas) and
I do not really see how automated tools could significantly help
here. There is still much to be done: we do not have yet, in any proof
assistant on the market, a comprehensive set of compatible formal
mathematical libraries that would encompass a common socle of theories
for graduate level in algebra and geometry and analysis etc.
For instance the libraries we wrote do not address real and complex
analysis at all. Although I am near to ignorant in AI or machine learning,
this seems to me a prerequisite step to have automated tools produce
formal proofs from any kind (script, paper, voice,...) of input description.
Yet the advent of modern ways of interacting with proof assistants (to
describe formal proofs, and search existing content) is probably
one of the major challenges to overcome, in order for proof assistants
to become as popular as computer algebra systems (or even type-setting
environments) among researchers in mathematics.