ArticleslgStudy

mathematics

Lambda cube

Lambda cube is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Lambda cube rather than just read about it. In short: In mathematical logic and type theory, the λ-cube (also written lambda cube) is a framework introduced by Henk Barendregt to investigate the different dimensions in which the calculus of constructions is a generalization of the simply typed λ-calculus. Each dimension of the cube corresponds to a new kind of dependency between terms and types.

Lambda cube — main illustration
Lambda cube — illustration

Key takeaways

  • Lambda cube belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Lambda cube to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Lambda cube from memory before moving on to harder problems.

Reference excerpt

In mathematical logic and type theory, the λ-cube (also written lambda cube) is a framework introduced by Henk Barendregt to investigate the different dimensions in which the calculus of constructions is a generalization of the simply typed λ-calculus. Each dimension of the cube corresponds to a new kind of dependency between terms and types. Here, "dependency" refers to the capacity of a term or type to bind a term or type. The respective dimensions of the λ-cube correspond to:

x-axis ( → {\displaystyle \rightarrow } ): types that can depend on terms, corresponding to dependent types. y-axis ( ↑ {\displaystyle \uparrow } ): terms that can depend on types, corresponding to polymorphism. z-axis ( ↗ {\displaystyle \nearrow } ): types that can depend on other types, corresponding to (binding) type operators. The different ways to combine these three dimensions yield the 8 vertices of the cube, each corresponding to a different kind of typed system. The λ-cube can be generalized into the concept of a pure type system.

Examples of systems

(λ→) Simply typed lambda calculus The simplest system found in the λ-cube is the simply typed lambda calculus, also called λ→. In this system, the only way to construct an abstraction is by making a term depend on a term, with the typing rule:

Γ , x : σ ⊢ t : τ Γ ⊢ λ x . t : σ → τ {\displaystyle {\frac {\Gamma ,x:\sigma \;\vdash \;t:\tau }{\Gamma \;\vdash \;\lambda x.t:\sigma \to \tau }}}

(λ2) System F In System F (also named λ2 for the "second-order typed lambda calculus") there is another type of abstraction, written with a Λ {\displaystyle \Lambda } , that allows terms to depend on types, with the following rule:

Γ ⊢ t : σ Γ ⊢ Λ α . t : Π α . σ if α does not occur free in Γ {\displaystyle {\frac {\Gamma \;\vdash \;t:\sigma }{\Gamma \;\vdash \;\Lambda \alpha .t:\Pi \alpha .\sigma }}\;{\text{ if }}\alpha {\text{ does not occur free in }}\Gamma }

The terms beginning with a Λ {\displaystyle \Lambda } are called polymorphic, as they can be applied to different types to get different functions, similarly to polymorphic functions in ML-like languages. For instance, the polymorphic identity of OCaml has type meaning it can take an argument of any type 'a and return an element of that type. This type corresponds in λ2 to the type Π α . α → α {\displaystyle \Pi \alpha .\alpha \to \alpha } .

(λω) System Fω In System F ω _ {\displaystyle {\underline {\omega }}} a construction is introduced to supply types that depend on other types. This is called a type constructor and provides a way to build "a function with a type as a value". An example of such a type constructor is the type of binary trees with leaves labeled by data of a given type A {\displaystyle A} : T R E E := λ A : ∗ . Π B . ( A → B ) → ( B → B → B ) → B {\displaystyle {\mathsf {TREE}}:=\lambda A:*.\Pi B.(A\to B)\to (B\to B\to B)\to B} , where " A : ∗ {\displaystyle A:*} " informally means " A {\displaystyle A} is a type". This is a function that takes a type parameter A {\displaystyle A} as an argument and returns the type of T R E E {\displaystyle {\mathsf {TREE}}} s of values of type A {\displaystyle A} . In concrete programming, this feature corresponds to the ability to define type constructors inside the language, rather than considering them as primitives. The previous type constructor roughly corresponds to the following definition of a tree with labeled leaves in OCaml: This type constructor can be applied to other types to obtain new types. E.g., to obtain type of trees of integers: System F ω _ {\displaystyle {\underline {\omega }}} is generally not used on its own, but is useful to isolate the independent feature of type constructors.

(λP) Lambda-P In the λP system, also named λΠ, which is closely related to the LF Logical Framework, one has so called dependent types. These are types that are allowed to depend on terms. The crucial introduction rule of the system is

… excerpt ends here. Continue reading the full article.

Illustrations

Lambda cube: The lambda cube. Direction of each arrow is direction of inclusion.
The lambda cube. Direction of each arrow is direction of inclusion.

Worked examples

Example 1 — a first encounter with Lambda cube

Start with the simplest possible case. Write down what Lambda cube claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Lambda cube before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Lambda cube ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Lambda cube

In research
Lambda cube appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Lambda cube in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Lambda cube is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cubes, Lambda calculus, Type theory, so understanding it makes those chapters shorter.
In everyday life
Look for Lambda cube outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Lambda cube in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Lambda cube means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Lambda cube out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Lambda cube in simple terms?

In mathematical logic and type theory, the λ-cube (also written lambda cube) is a framework introduced by Henk Barendregt to investigate the different dimensions in which the calculus of constructions is a generalization of the simply typed λ-calculus. Each dimension of the cube corresponds to a ne…

Why does Lambda cube matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Lambda cube?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Lambda cube.

Tags

  • Cubes
  • Lambda calculus
  • Type theory

Keep exploring