Skip to content

Container (type theory)

A shape-and-positions representation of strictly positive collection-like type constructors in dependent type theory.

Version
v2 · 2026-09-19 · History
Domain-specific #
3875
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomain
Type Theory → Mathematics

Core Idea

A unary container consists of a shape type S and a position family P indexed by S; its extension at element type X is the dependent sum of a shape and a function from positions to X. Structure is separated from contents: choose a shape, obtain its valid position type and label each position with an element, making maps and generic traversals operate uniformly across lists, trees and related functors. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

How would you explain it like I'm…

The Egg Carton Idea

Think of an egg carton. First you pick the carton, which decides how many spots there are. Then you put something in each spot. A container in type theory works like that: a shape with spots, and a thing placed in every spot.

Shapes With Slots to Fill

In computer science and math, a container is a way of describing things like lists and trees by splitting them into two parts. The first part is the shape: for a list, that's how long it is; for a tree, how it branches. Each shape comes with its own set of spots, called positions. The second part is the contents: you say what item goes in each position. Separating shape from contents lets you write one method, like 'change every item,' that works for lists, trees and similar structures in the same way.

Shape-and-Position Datatype Description

In type theory, a container describes a data structure by separating its structure from its contents. It has a type of shapes S, and for each shape s a type of positions P(s), the slots that shape provides. A concrete value is a choice of shape together with a function assigning an element of type X to every position of that shape. For example, a list's shape can be its length, and its positions are the indices up to that length. This way of describing things lets maps and other generic operations work uniformly across lists, trees and similar structures, because they act only on the contents while keeping the shape. Not every type-forming operation can be described this way; there are limits such as strict positivity.

 

A unary container is a pair (S, P) where S is a type of shapes and P is a family of position types indexed by S. Its extension at an element type X is the dependent sum Σ(s : S). (P(s) → X): a shape together with a labeling of that shape's positions by elements of X. This separates structure from contents, and the extension is functorial in X, so mapping, traversal and other generic operations act uniformly on the datatypes containers represent, such as lists (shape = length, positions = indices) and trees. Container morphisms describe structure-preserving transformations between such functors. A precise account must fix the universe and type theory, the shape type, the dependent position family, the extension formula, the element type and labeling function, the morphism or functor action, the datatype represented, and limits such as strict positivity, which constrains which datatypes containers can describe.

Scope of Application

Container (type theory) belongs to type theory and is useful where the analyst can specify the typed type theory carrier, including objects, relations, parameters, conventions, evidence, boundaries, and comparison targets, then evaluate the universe and type theory, shape type, dependent position family, extension formula, element type and labeling function, morphism or functor action, represented datatype and limits such as strict positivity are explicit. The scope is broad within that domain but bounded by the need for the universe and type theory, shape type, dependent position family, extension formula, element type and labeling function, morphism or functor action, represented datatype and limits such as strict positivity are explicit.

Clarity

The abstraction clarifies a crowded vocabulary by making the universe and type theory, shape type, dependent position family, extension formula, element type and labeling function, morphism or functor action, represented datatype and limits such as strict positivity are explicit the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Container (type theory). Container (type theory) compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: the typed type theory carrier, including objects, relations, parameters, conventions, evidence, boundaries, and comparison targets. Reject examples whose alleged carrier belongs to a different problem.
  2. Lock the constitutive rule. Express the universe and type theory, shape type, dependent position family, extension formula, element type and labeling function, morphism or functor action, represented datatype and limits such as strict positivity are explicit independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of type theory because they reuse the typed type theory carrier, including objects, relations, parameters, conventions, evidence, boundaries, and comparison targets, Structure is separated from contents: choose a shape, obtain its valid position type and label each position with an element, making maps and generic traversals operate uniformly across lists, trees and related functors., and type the carrier, state every parameter and convention in the definition, test that the universe and type theory, shape type, dependent position family, extension formula, element type and labeling function, morphism or functor action, represented datatype and limits such as strict positivity are explicit, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Container (type theory)Parents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Container(type theory)DOMAINPrime abstraction: Abstract Data Type — is a kind ofAbstractData TypePRIME

Current abstraction Container (type theory) Domain-specific

Parents (1) — outgoing typed relations

  • Container (type theory) is a kind of Abstract Data Type Prime

    It remains its own entry because its identity is fixed by the universe and type theory, shape type, dependent position family, extension formula, element type and labeling function, morphism or functor action, represented datatype and limits such as strict positivity.

Hierarchy paths (3) — routes to 2 parentless roots

Neighborhood in Abstraction Space

Container (type theory) sits in a crowded region of the domain-specific corpus (3rd percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Order, Type & Classification Foundations (49 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25