Computer science Type theory Theorem
Type safety
Builds on Simply typed lambda calculusOperational semanticsType systemStrong normalization of simply typed lambda calculus
Statement
Consider the simply typed lambda calculus with a base type , constants , and conditionals typed by the usual rule. The values are , and the abstractions . Let be the call-by-value small-step operational semantics on terms.
- Progress: if with the empty context, then is a value or there is a term with .
- Preservation: if and , then .
Hence, if and , then is a value or can take a further step; a well-typed closed term never reaches a stuck state.
Remarks
Progress is proved by induction on the typing derivation, using a canonical forms lemma. The lemma says that a closed value of type is or , and a closed value of type is an abstraction. Preservation is proved by induction on the derivation of , and its key case is a substitution lemma: if and , then . The term is stuck: it is not a value and no rule applies. The theorem predicts this, since the term has no type: the condition is a function, not a . Progress needs the empty context: the open term with is well typed, not a value and cannot step.
Going deeper
For a student
This syntactic form of type safety, split into progress and preservation, is due to Wright and Felleisen. The same two lemmas are the standard way to prove safety of any type system given by an operational semantics. Safety does not say that programs terminate: it also holds for languages with general recursion, where a safe program may run forever. For the simply typed calculus, strong normalization adds termination on top of safety.
Reading path
To understand this page from the ground up, read these 32 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Beta normal form concept
- Beta reduction concept
- Binary relation concept
- Element definition
- Intuitionistic logic concept
- Lambda calculus concept
- Normalization property concept
- Proposition concept
- Set concept
- Type system concept
- ChurchβRosser theorem statement
- Operational semantics concept
- Set definition
- Conjunction definition
- Disjunction definition
- Implication definition
- Negation definition
- Biconditional definition
- Truth table concept
- Modus ponens concept
- Mathematical proof concept
- Propositional logic concept
- Tautology definition
- Logical equivalence definition
- Double negation law statement
- Proof by contradiction concept
- Russell's paradox statement
- Type theory concept
- CurryβHoward correspondence concept
- Simply typed lambda calculus concept
- Strong normalization of simply typed lambda calculus statement
- Type safety statement
Further reading
About this page
| Tag | CY0V19041Y |
|---|---|
| URI | m2://CY0V19041Y |
| Kind | statement, theorem |
| Writing | W0 stub |
| MSC | 68N15, 68Q55, 03B40 |
| Status | This copy of the site has no build data. Run m2 status CY0V19041Y. |
| About | Type system, Simply typed lambda calculus |
| Uses | Simply typed lambda calculus, Operational semantics, Type system, Strong normalization of simply typed lambda calculus |
| Changed | 3 November 2026 |
Markdown Β· JSON Β· Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.