relational-parametricity-prover

Prove relational parametricity and derive free theorems for polymorphic functions.

17|2|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/rainoftime/pl-skills --skill relational-parametricity-prover
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: relational-parametricity-prover
Source: https://github.com/rainoftime/pl-skills/tree/main/relational-parametricity-prover
Command: npx skills add https://github.com/rainoftime/pl-skills --skill relational-parametricity-prover

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of proving relational parametricity and deriving free theorems, which are crucial for understanding polymorphism and abstraction in programming languages.

Core Features & Use Cases

  • Relational Interpretation: Defines and interprets types as relations.
  • Parametricity Proofs: Proves that terms respect the relational interpretation of their types.
  • Free Theorem Derivation: Automatically derives properties (free theorems) that hold for polymorphic functions.
  • Use Case: When developing a new polymorphic function in Coq or Agda, use this Skill to automatically generate its free theorem, ensuring its behavior is well-defined across all possible instantiations.

Quick Start

Use the relational-parametricity-prover skill to derive the free theorem for the function type forall a b. a -> b.

Frequently Asked Questions about relational-parametricity-prover

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I derive free theorems for polymorphic functions in Coq or Agda?

To derive free theorems for polymorphic functions in Coq or Agda, you use type-indexed relations and abstraction theorems to prove that terms respect the relational interpretation of their types, automatically generating properties that hold across all instantiations.

What is relational parametricity in type theory and programming language metatheory?

Relational parametricity in type theory is the principle that polymorphic terms respect the relational interpretation of their types, ensuring uniform behavior across type instantiations and enabling the derivation of free theorems for abstract data types.

Can I use this to formally verify abstract data types and reason about generic programming?

Yes, you can formally verify abstract data types and reason about generic programming by applying relational parametricity proofs to ensure polymorphic functions behave uniformly across all possible type instantiations within formal proof assistants.

How do I prove that a term respects the relational interpretation of its type?

You prove a term respects its relational interpretation by defining types as relations and applying abstraction theorems within formal proof assistants like Coq or Agda, demonstrating the term adheres to parametricity constraints.

Do I need a formal proof assistant to automate parametricity proofs and free theorem derivation?

Yes, you need a formal proof assistant like Coq or Agda to define type-indexed relations and prove parametricity properties, as the process requires formal metatheory environments to automate abstraction theorem application and free theorem generation.

What is the best way to prove parametricity for a function type like forall a b. a -> b?

The best way to prove parametricity for a function type like forall a b. a -> b is to apply a relational interpretation to the types, using abstraction theorems to automatically derive the free theorem governing the function's behavior.