Math 2.0

Computer science Definition

Parametricity

Builds on System FBinary relation

Definition

Let τ\tau be a type built from one type variable α\alpha and some fixed base types, such as the booleans, with the arrow →\to. For a set AA, write τ(A)\tau(A) for the set obtained by reading α\alpha as AA and each base type as its set of values. Here σ1→σ2\sigma_1 \to \sigma_2 is read as the set of all functions from σ1(A)\sigma_1(A) to σ2(A)\sigma_2(A). A polymorphic value of type ∀α. τ\forall \alpha.\, \tau is a family p=(pA)p = (p_A) with pA∈τ(A)p_A \in \tau(A) for every set AA. For sets A,BA, B and a binary relation R⊆A×BR \subseteq A \times B, the relational interpretation τ[R]⊆τ(A)×τ(B)\tau[R] \subseteq \tau(A) \times \tau(B) is defined by induction on τ\tau.

  1. For τ=α\tau = \alpha, the relation is RR.
  2. For a base type, the relation is equality.
  3. For τ=τ1→τ2\tau = \tau_1 \to \tau_2, functions ff and gg are related if f(a)f(a) and g(b)g(b) are related by τ2[R]\tau_2[R] whenever aa and bb are related by τ1[R]\tau_1[R].

The polymorphic value pp is parametric if pAp_A and pBp_B are related by τ[R]\tau[R] for all sets AA, BB and all relations R⊆A×BR \subseteq A \times B.

Remarks

Example: let pp be a parametric value of type ∀α. α→α\forall \alpha.\, \alpha \to \alpha, let AA be a set and a∈Aa \in A. Take B=AB = A and the relation R={(a,a)}R = \set{(a, a)}. Clause 3 gives that pA(a)p_A(a) and pA(a)p_A(a) are related by RR, so pA(a)=ap_A(a) = a, and pAp_A is the identity on AA.

Non-example: let qAq_A be the swap of 𝗍𝗋𝗎𝖾\mathsf{true} and 𝖿𝖺𝗅𝗌𝖾\mathsf{false} when AA is the set of booleans, and the identity on every other set AA. This is a family of maps A→AA \to A, but it is not parametric. With A={0,1}A = \set{0, 1}, BB the booleans and R={(0,𝖿𝖺𝗅𝗌𝖾),(1,𝗍𝗋𝗎𝖾)}R = \set{(0, \mathsf{false}), (1, \mathsf{true})}, clause 3 fails: 00 and 𝖿𝖺𝗅𝗌𝖾\mathsf{false} are related, but qA(0)=0q_A(0) = 0 and qB(𝖿𝖺𝗅𝗌𝖾)=𝗍𝗋𝗎𝖾q_B(\mathsf{false}) = \mathsf{true} are not. Such a family cannot be written as a term of System F, since a term cannot test which type it is applied to.

For a function h ⁣:A→Bh \colon A \to B, taking RR to be the graph of hh turns the relational statement into an equation, which is how the free theorems are read off. For all of System F, with nested quantifiers and several type variables, the relational interpretation has one more clause. Values of ∀β. τ1\forall \beta.\, \tau_1 are related if, for all AA, BB and S⊆A×BS \subseteq A \times B, their instances at AA and BB are related by the interpretation of τ1\tau_1 at SS. Reynolds showed that System F has no model in which types are plain sets and ∀\forall ranges over all sets. So this general form is used in other models, such as models built from partial equivalence relations, or in a syntactic form. Reynolds' abstraction theorem says that every closed term of System F is parametric in this sense.

Reading path

To understand this page from the ground up, read these 26 pages in order. The foundations come first.

Show the path as a graph
Binary relation, concept, no evidence levelBinary relationconceptElement, definition, no evidence levelElementdefinitionIntuitionistic logic, concept, no evidence levelIntuitionistic logicconceptLambda calculus, concept, no evidence levelLambda calculusconceptProposition, concept, no evidence levelPropositionconceptSet, concept, no evidence levelSetconceptSet, definition, no evidence levelSetdefinitionConjunction, definition, no evidence levelConjunctiondefinitionDisjunction, definition, no evidence levelDisjunctiondefinitionImplication, definition, no evidence levelImplicationdefinitionNegation, definition, no evidence levelNegationdefinitionBiconditional, definition, no evidence levelBiconditionaldefinitionTruth table, concept, no evidence levelTruth tableconceptModus ponens, concept, no evidence levelModus ponensconceptMathematical proof, concept, no evidence levelMathematical proofconceptPropositional logic, concept, no evidence levelPropositional logicconceptTautology, definition, no evidence levelTautologydefinitionLogical equivalence, definition, no evidence levelLogical equivalencedefinitionDouble negation law, statement, no evidence levelDouble negation lawstatementProof by contradiction, concept, no evidence levelProof by contradictionconceptRussell's paradox, statement, no evidence levelRussell's paradoxstatementType theory, concept, no evidence levelType theoryconceptCurry–Howard correspondence, concept, no evidence levelCurry–Howard correspo…conceptSimply typed lambda calculus, concept, no evidence levelSimply typed lambda c…conceptSystem F, concept, no evidence levelSystem FconceptParametricity, definition, no evidence levelParametricitydefinition
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Binary relation concept
  2. Element definition
  3. Intuitionistic logic concept
  4. Lambda calculus concept
  5. Proposition concept
  6. Set concept
  7. Set definition
  8. Conjunction definition
  9. Disjunction definition
  10. Implication definition
  11. Negation definition
  12. Biconditional definition
  13. Truth table concept
  14. Modus ponens concept
  15. Mathematical proof concept
  16. Propositional logic concept
  17. Tautology definition
  18. Logical equivalence definition
  19. Double negation law statement
  20. Proof by contradiction concept
  21. Russell's paradox statement
  22. Type theory concept
  23. Curry–Howard correspondence concept
  24. Simply typed lambda calculus concept
  25. System F concept
  26. Parametricity definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Parametricity
About this page
TagHHBHV871EV
URIm2://HHBHV871EV
Kinddefinition
WritingW0 stub
MSC68N18, 68Q55, 03B40
DefinesParametricity
UsesSystem F, Binary relation
Changed3 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.