Book contents
- Frontmatter
- Contents
- Foreword
- Preface
- Acknowledgements
- Greek alphabet
- 1 Untyped lambda calculus
- 2 Simply typed lambda calculus
- 3 Second order typed lambda calculus
- 4 Types dependent on types
- 5 Types dependent on terms
- 6 The Calculus of Constructions
- 7 The encoding of logical notions in λC
- 8 Definitions
- 9 Extension of λC with definitions
- 10 Rules and properties of λD
- 11 Flag-style natural deduction in λD
- 12 Mathematics in λD: a first attempt
- 13 Sets and subsets
- 14 Numbers and arithmetic in λD
- 15 An elaborated example
- 16 Further perspectives
- Appendix A Logic in λD
- Appendix B Arithmetical axioms, definitions and lemmas
- Appendix C Two complete example proofs in λD
- Appendix D Derivation rules for λD
- References
- Index of names
- Index of definitions
- Index of symbols
- Index of subjects
4 - Types dependent on types
Published online by Cambridge University Press: 05 November 2014
- Frontmatter
- Contents
- Foreword
- Preface
- Acknowledgements
- Greek alphabet
- 1 Untyped lambda calculus
- 2 Simply typed lambda calculus
- 3 Second order typed lambda calculus
- 4 Types dependent on types
- 5 Types dependent on terms
- 6 The Calculus of Constructions
- 7 The encoding of logical notions in λC
- 8 Definitions
- 9 Extension of λC with definitions
- 10 Rules and properties of λD
- 11 Flag-style natural deduction in λD
- 12 Mathematics in λD: a first attempt
- 13 Sets and subsets
- 14 Numbers and arithmetic in λD
- 15 An elaborated example
- 16 Further perspectives
- Appendix A Logic in λD
- Appendix B Arithmetical axioms, definitions and lemmas
- Appendix C Two complete example proofs in λD
- Appendix D Derivation rules for λD
- References
- Index of names
- Index of definitions
- Index of symbols
- Index of subjects
Summary
Type constructors
In the previous chapter we introduced the possibility of constructing generalised terms, by abstracting a term from a type variable. For example, the term λx : σ · x (which is the identity on the fixed type σ) can be generalised to the term λα : * · λ x : α · x (the ‘polymorphic’ identity, i.e. the identity on variable type α, abstracted from this α).
In a similar manner, there is a natural wish to construct generalised types. For example, types like β → β, γ → γ, (γ → β) → (γ → β), …, all have the general structure ◇ → ◇, with the same type both left and right of the arrow. Abstracting over ◇ makes it possible to describe the whole family of types with this structure.
In order to handle this, we introduce a generalised expression that embodies the essence of this structure: λα : * · α → α. This is itself not a type, but a function with a type as a value. It is therefore called a type constructor. Only when we ‘feed’ it with e.g. β, γ or (γ → β), we obtain types:
(λα : * · α → α) β → β β → β,
(λα : * · α → α) γ → β γ → γ,
(λα : * · α → α) (γ → β) → β (γ → β) → (γ → β).
- Type
- Chapter
- Information
- Type Theory and Formal ProofAn Introduction, pp. 85 - 102Publisher: Cambridge University PressPrint publication year: 2014