The \mathsf{Boolean} type is defined as: \forall\alpha.\alpha \to \alpha \to \alpha, where \alpha is a
type variable. This means: \mathsf{Boolean} is the type of all functions which take as input a type α and two expressions of type α, and produce as output an expression of type α (note that we consider \to to be
right-associative.) The following two definitions for the Boolean values \mathbf{T} and \mathbf{F} are used, extending the definition of
Church Booleans: : \mathbf{T} = \Lambda\alpha{.}\lambda x^{\alpha} \lambda y^\alpha{.}x : \mathbf{F} = \Lambda\alpha{.}\lambda x^{\alpha} \lambda y^{\alpha}{.}y (Note that the above two functions require
three — not two — arguments. The latter two should be lambda expressions, but the first one should be a type. This fact is reflected in the fact that the type of these expressions is \forall\alpha.\alpha \to \alpha \to \alpha; the universal quantifier binding the α corresponds to the Λ binding the alpha in the lambda expression itself. Also, note that \mathsf{Boolean} is a convenient shorthand for \forall\alpha.\alpha \to \alpha \to \alpha, but it is not a symbol of System F itself, but rather a "meta-symbol". Likewise, \mathbf{T} and \mathbf{F} are also "meta-symbols", convenient shorthands, of System F "assemblies" (in the Bourbaki sense); otherwise, if such functions could be named (within System F), then there would be no need for the lambda-expressive apparatus capable of defining functions anonymously and for the
fixed-point combinator, which works around that restriction.) Then, with these two \lambda-terms, we can define some logic operators (which are of type \mathsf{Boolean} \rightarrow \mathsf{Boolean} \rightarrow \mathsf{Boolean}): : \begin{align} \mathrm{AND} &= \lambda x^{\mathsf{Boolean}} \lambda y^{\mathsf{Boolean}}{.} x \, \mathsf{Boolean} \, y\, \mathbf{F}\\ \mathrm{OR} &= \lambda x^{\mathsf{Boolean}} \lambda y^{\mathsf{Boolean}}{.} x \, \mathsf{Boolean} \, \mathbf{T}\, y\\ \mathrm{NOT} &= \lambda x^{\mathsf{Boolean}}{.} x \, \mathsf{Boolean} \, \mathbf{F}\, \mathbf{T} \end{align} Note that in the definitions above, \mathsf{Boolean} is a type argument to x, specifying that the other two parameters that are given to x are of type \mathsf{Boolean}. As in Church encodings, there is no need for an function as one can just use raw \mathsf{Boolean}-typed terms as decision functions. However, if one is requested: : \mathrm{IFTHENELSE} = \Lambda \alpha.\lambda x^{\mathsf{Boolean}}\lambda y^{\alpha}\lambda z^{\alpha}. x \alpha y z will do. A
predicate is a function which returns a \mathsf{Boolean}-typed value. The most fundamental predicate is which returns \mathbf{T} if and only if its argument is the
Church numeral : : \mathrm{ISZERO} = \lambda n^{\forall \alpha. (\alpha \rightarrow \alpha) \rightarrow \alpha \rightarrow \alpha}{.}n \, \mathsf{Boolean} \, (\lambda x^{\mathsf{Boolean}}{.}\mathbf{F})\, \mathbf{T} Furthermore, the
existential quantifier (and therefore existential types) can be implemented in system F by the following: : \exists X. A = \forall Y. (\forall X. A \rightarrow Y) \rightarrow Y ==System F structures==