I suspect there's a good chance the answer to this is unknown and hard (or at least extremely tedious), but I figured it would be worth asking.
It's well known that the functions $K:=\lambda x.\lambda y.x$ and $S:=\lambda x.\lambda y.\lambda z.xz(yz)$ together generate all functions of lambda calculus.
It's also possible to do it with just a single function, as mentioned here: If we define $U=\lambda x.xSK$, then we can obtain $K=U(U(UU))$, and $S=U(U(U(UU))$, and thus everything.
It's also possible to do this with $V:=\lambda x.xKS$, since $S=VVV$, and $K=V(VVVVV)$.
What I want to know is, picking a reasonable notion of "length", is there any way that is shorter than $U$ or $V$? Let's say for now that the length is the number of occurrences of a variable, including when they're introduced, so e.g., $K$ has a length of 3, $S$ has a length of 7, and $U$ and $V$ each have length 12. (Or is there a usual notion of "length" that's been studied?) Is it possible to do better than 12, and what's the shortest way?
What if we allow for more than one generator and total the lengths? Then the usual set $\{S,K\}$ does it with 10. (Should we add a penalty for using more than one? Well, I guess you could, but I'm not going to define it that way here. I mean, unless people have studied this problem and already doing it that way...). Can this variant be done in fewer than 10, and what's the shortest?
I don't expect there's any easy way to answer the "what's the shortest" question, but I'm hoping maybe that at least if there is a shorter way that someone will know it or find it.
Yes, but expressing only the variables doesn't suffice to make it clear which wff you've referred to. Thus, classifying those wffs as having length 9 makes less sense then classifying them as having 17. Also, note that Lukasiewicz's shorter 13 symbol formula CCCpqrCCrpCsp can generate all formulas of HI. But that system isn't the same as HI, since CCCpqpp is a theorem, and thus I've digressed.
– Doug Spoonwood Jun 23 '15 at 17:34