The term simple type is also used to refer to extensions of the simply typed lambda calculus such as products, coproducts or natural numbers (System T) or even full recursion (like PCF). In contrast, systems which introduce polymorphic types (like System F) or dependent types (like the Logical Framework) are not considered simply typed. The former, except full recursion, are still considered simple because the Church encodings of such structures can be done using only →{\displaystyle \to } and suitable type variables, while polymorphism and dependency cannot.

We also fix a set of term constants for the base types. For example, we might assume a base type nat, and the term constants could be the natural numbers. In the original presentation, Church used only two base types: o{\displaystyle o} for "the type of propositions" and ι{\displaystyle \iota } for "the type of individuals". The type o{\displaystyle o} has no term constants, whereas ι{\displaystyle \iota } has one term constant. Frequently the calculus with only one base type, usually o{\displaystyle o}, is considered.

The syntax of the simply typed lambda calculus is essentially that of the lambda calculus itself. We write x:τ{\displaystyle x{\mathbin {:}}\tau } to denote that the variable x{\displaystyle x} is of type τ{\displaystyle \tau }. The term syntax, in BNF, is then:

That is, variable reference, abstractions, application, and constant. A variable reference x{\displaystyle x} is bound if it is inside of an abstraction binding x{\displaystyle x}. A term is closed if there are no unbound variables.

Compare this to the syntax of untyped lambda calculus:

e::=x∣λx.e∣ee{\displaystyle e::=x\mid \lambda x.e\mid e\,e}

We see that in typed lambda calculus every function (abstraction) must specify the type of its argument.

To define the set of well typed lambda terms of a given type, we will define a typing relation between terms and types. First, we introduce typing contexts or typing environmentsΓ,Δ,…{\displaystyle \Gamma ,\Delta ,\dots }, which are sets of typing assumptions. A typing assumption has the form x:σ{\displaystyle x{\mathbin {:}}\sigma }, meaning x{\displaystyle x} has type σ{\displaystyle \sigma }.

The typing relationΓ⊢e:σ{\displaystyle \Gamma \vdash e{\mathbin {:}}\sigma } indicates that e{\displaystyle e} is a term of type σ{\displaystyle \sigma } in context Γ{\displaystyle \Gamma }. In this case e{\displaystyle e} is said to be well-typed (having type σ{\displaystyle \sigma }). Instances of the typing relation are called typing judgements. The validity of a typing judgement is shown by providing a typing derivation, constructed using typing rules (wherein the premises above the line allow us to derive the conclusion below the line). Simply-typed lambda calculus uses these rules:

These are the typed lambda calculus representations of the basic combinators of combinatory logic.

Each type τ{\displaystyle \tau } is assigned an order, a number o(τ){\displaystyle o(\tau )}. For base types, o(T)=0{\displaystyle o(T)=0}; for function types, o(σ→τ)=max(o(σ)+1,o(τ)){\displaystyle o(\sigma \to \tau )={\mbox{max}}(o(\sigma )+1,o(\tau ))}. That is, the order of a type measures the depth of the most left-nested arrow. Hence:

Broadly speaking, there are two different ways of assigning meaning to the simply typed lambda calculus, as to typed languages more generally, sometimes called intrinsic vs. extrinsic, or Church-style vs. Curry-style.[1]
An intrinsic/Church-style semantics only assigns meaning to well-typed terms, or more precisely, assigns meaning directly to typing derivations. This has the effect that terms differing only by type annotations can nonetheless be assigned different meanings. For example, the identity term λx:int.x{\displaystyle \lambda x{\mathbin {:}}{\mathtt {int}}.~x} on integers and the identity term λx:bool.x{\displaystyle \lambda x{\mathbin {:}}{\mathtt {bool}}.~x} on booleans may mean different things. (The classic intended interpretations
are the identity function on integers and the identity function on boolean values.)
In contrast, an extrinsic/Curry-style semantics assigns meaning to terms regardless of typing, as they would be interpreted in an untyped language. In this view, λx:int.x{\displaystyle \lambda x{\mathbin {:}}{\mathtt {int}}.~x} and λx:bool.x{\displaystyle \lambda x{\mathbin {:}}{\mathtt {bool}}.~x} mean the same thing (i.e., the same thing as λx.x{\displaystyle \lambda x.~x}).

The distinction between intrinsic and extrinsic semantics is sometimes associated with the presence or absence of annotations on lambda abstractions, but strictly speaking this usage is imprecise. It is possible to define a Curry-style semantics on annotated terms simply by ignoring the types (i.e., through type erasure), as it is possible to give a Church-style semantics on unannotated terms when the types can be deduced from context (i.e., through type inference). The essential difference between intrinsic and extrinsic approaches is just whether the typing rules are viewed as defining the language, or as a formalism for verifying properties of a more primitive underlying language. Most of the different semantic interpretations discussed below can be seen through either a Church or Curry perspective.

The simply typed lambda calculus (with βη{\displaystyle \beta \eta }-equivalence) is the internal language of Cartesian closed categories (CCCs), as was first observed by Lambek. Given any specific CCC, the basic types of the corresponding lambda calculus are just the objects, and the terms are the morphisms. Conversely, every simply typed lambda calculus gives a CCC whose objects are the types, and morphisms are equivalence classes of terms.

To make the correspondence clear, a type constructor for the Cartesian product is typically added to the above. To preserve the categoricity of the Cartesian product, one adds type rules for pairing, projection, and a unit term. Given two terms s:σ{\displaystyle s{\mathbin {:}}\sigma } and t:τ{\displaystyle t{\mathbin {:}}\tau }, the term (s,t){\displaystyle (s,t)} has type σ×τ{\displaystyle \sigma \times \tau }. Likewise, if one has a term u:τ1×τ2{\displaystyle u{\mathbin {:}}\tau _{1}\times \tau _{2}}, then there are terms π1(u):τ1{\displaystyle \pi _{1}(u){\mathbin {:}}\tau _{1}} and π2(u):τ2{\displaystyle \pi _{2}(u){\mathbin {:}}\tau _{2}} where the πi{\displaystyle \pi _{i}} correspond to the projections of the Cartesian product. The unit term, of type 1, is written as (){\displaystyle ()} and vocalized as 'nil', is the final object. The equational theory is extended likewise, so that one has

The above can then be turned into a category by taking the types as the objects. The morphismsσ→τ{\displaystyle \sigma \to \tau } are equivalence classes of pairs (x:σ,t:τ){\displaystyle (x{\mathbin {:}}\sigma ,t{\mathbin {:}}\tau )} where x is a variable (of type σ{\displaystyle \sigma }) and t is a term (of type τ{\displaystyle \tau }), having no free variables in it, except for (optionally) x. Closure is obtained from currying and application, as usual.

More precisely, there exist functors between the category of Cartesian closed categories, and the category of simply-typed lambda theories.

The presentation given above is not the only way of defining the syntax of the simply typed lambda calculus. One alternative is to remove type annotations entirely (so that the syntax is identical to the untyped lambda calculus), while ensuring that terms are well-typed via Hindley–Milner type inference. The inference algorithm is terminating, sound, and complete: whenever a term is typable, the algorithm computes its type. More precisely, it computes the term's principal type, since often an unannotated term (such as λx.x{\displaystyle \lambda x.~x}) may have more than one type (int→int{\displaystyle {\mathtt {int}}\to {\mathtt {int}}}, bool→bool{\displaystyle {\mathtt {bool}}\to {\mathtt {bool}}}, etc., which are all instances of the principal type α→α{\displaystyle \alpha \to \alpha }).

Another alternative presentation of simply typed lambda calculus is based on bidirectional type checking, which requires more type annotations than Hindley–Milner inference but is easier to describe. The type system is divided into two judgments, representing both checking and synthesis, written Γ⊢e⇐τ{\displaystyle \Gamma \vdash e\Leftarrow \tau } and Γ⊢e⇒τ{\displaystyle \Gamma \vdash e\Rightarrow \tau } respectively. Operationally, the three components Γ{\displaystyle \Gamma }, e{\displaystyle e}, and τ{\displaystyle \tau } are all inputs to the checking judgment Γ⊢e⇐τ{\displaystyle \Gamma \vdash e\Leftarrow \tau }, whereas the synthesis judgment Γ⊢e⇒τ{\displaystyle \Gamma \vdash e\Rightarrow \tau } only takes Γ{\displaystyle \Gamma } and e{\displaystyle e} as inputs, producing the type τ{\displaystyle \tau } as output. These judgments are derived via the following rules:

Observe that the rules for synthesis are read top-to-bottom, whereas the rules for checking are read bottom-to-top. Note in particular that we do not need any annotation on the lambda abstraction in rule [3], because the type of the bound variable can be deduced from the type at which we check the function. Finally, we explain rules [5] and [6] as follows:

Because of these last two rules coercing between synthesis and checking, it is easy to see that any well-typed but unannotated term can be checked in the bidirectional system, so long as we insert "enough" type annotations. And in fact, annotations are needed only at β-redexes.

Given the standard semantics, the simply typed lambda calculus is strongly normalizing: that is, well-typed terms always reduce to a value, i.e., a λ{\displaystyle \lambda } abstraction. This is because recursion is not allowed by the typing rules: it is impossible to find types for fixed-point combinators and the looping term Ω=(λx.xx)(λx.xx){\displaystyle \Omega =(\lambda x.~x~x)(\lambda x.~x~x)}. Recursion can be added to the language by either having a special operator fixα{\displaystyle {\mathtt {fix}}_{\alpha }}of type (α→α)→α{\displaystyle (\alpha \to \alpha )\to \alpha } or adding general recursive types, though both eliminate strong normalization.

Since it is strongly normalising, it is decidable whether or not a simply typed lambda calculus program halts: in fact, it always halts. We can therefore conclude that the language is notTuring complete.

Tait showed in 1967 that β{\displaystyle \beta }-reduction is strongly normalizing. As a corollary βη{\displaystyle \beta \eta }-equivalence is decidable. Statman showed in 1977 that the normalisation problem is not elementary recursive, a proof which was later simplified by Mairson (1992). A purely semantic normalisation proof (see normalisation by evaluation) was given by Berger and Schwichtenberg in 1991.

The unification problem for βη{\displaystyle \beta \eta }-equivalence is undecidable. Huet showed in 1973 that 3rd order unification is undecidable and this was improved upon by Baxter in 1978 then by Goldfarb in 1981 by showing that 2nd order unification is already undecidable. A proof that higher order matching (unification where only one term contains existential variables) is decidable was announced by Colin Stirling in 2006, and a full proof was published in 2009.[2]

We can encode natural numbers by terms of the type (o→o)→(o→o){\displaystyle (o\to o)\to (o\to o)} (Church numerals). Schwichtenberg showed in 1976 that in λ→{\displaystyle \lambda ^{\to }} exactly the extended polynomials are representable as functions over Church numerals; these are roughly the polynomials closed up under a conditional operator.

A full model of λ→{\displaystyle \lambda ^{\to }} is given by interpreting base types as sets and function types by the set-theoretic function space. Friedman showed in 1975 that this interpretation is complete for βη{\displaystyle \beta \eta }-equivalence, if the base types are interpreted by infinite sets. Statman showed in 1983 that βη{\displaystyle \beta \eta }-equivalence is the maximal equivalence which is typically ambiguous, i.e. closed under type substitutions (Statman's Typical Ambiguity Theorem). A corollary of this is that the finite model property holds, i.e. finite sets are sufficient to distinguish terms which are not identified by βη{\displaystyle \beta \eta }-equivalence.

Plotkin introduced logical relations in 1973 to characterize the elements of a model which are definable by lambda terms. In 1993 Jung and Tiuryn showed that a general form of logical relation (Kripke logical relations with varying arity) exactly characterizes lambda definability. Plotkin and Statman conjectured that it is decidable whether a given element of a model generated from finite sets is definable by a lambda term (Plotkin–Statman conjecture). The conjecture was shown to be false by Loader in 1993.