Fast pretyping of application.
Fast pretyping of application.

We use a fast path for types that are already in product form, and keep an
explicit substitution around.

Fixes #12118 (mostly). The algorithm is still quadratic outside of the fast
path, and there is another stupid source of quadraticity even in the fast
path, but the major source of slowdown has been removed.

SkySkimmer/coq,SkySkimmer/coq,coq/coq,Zimmi48/coq,ejgallego/coq,coq/coq,coq/coq,Zimmi48/coq,SkySkimmer/coq,coq/coq,Zimmi48/coq,ejgallego/coq,ejgallego/coq,Zimmi48/coq,ejgallego/coq,SkySkimmer/coq