 <ol> <li><code>flip elem listx</code> is equivalent to <code>(flip elem) listx</code>. </li> <li><code>(flip elem)</code> is the same as <code>elem</code>, but with the arguments in opposite order. This is what <code>flip</code> does.</li> <li><code>elem</code> is a function that takes an element and a list, and checks whether the element belongs to the list.</li> <li>So <code>flip elem</code> is a function that that takes a list and an element, and checks whether the element belongs to the list.</li> <li>Therefore <code>flip elem listx</code> is a function that that takes an element, and checks whether the element belongs to <code>listx</code>.</li> <li>Now <code>all</code> takes a predicate and a list, and checks whether all elements of the list satisfy the predicate.</li> <li><code>all (flip elem listx)</code> take a list, and checks whether all elements of the list satisfy <code>flip elem listx</code>. That is, whether they all belong to <code>listx</code>.</li> <li><code>all (flip elem listx) input</code> checks whether all elements of <code>input</code> belong to <code>listx</code>.</li> <li>Q.E.D.</li> </ol>