Name Abstraction #
This file defines name abstraction [𝔸]α from Pitts' nominal sets (Chapter 4).
Name abstraction quotients Atom × α by "same up to fresh renaming", providing
the nominal analogue of alpha-equivalence for binders.
Main definitions #
AbsRel- The equivalence relation:(a, x) ~ (b, y)iff for some freshc,swap a c • x = swap b c • yNameAbs α- The quotient type[𝔸]α = (Atom × α) / AbsRelabs a x- The abstraction constructorconcretize- Open an abstraction at a given fresh name
Main results #
abs_rename- Key computation rule:abs a x = abs b (swap a b • x)whenb # xinstMulActionNameAbs- Permutation action:π • abs a x = abs (π a) (π • x)instNomSetNameAbs- Name abstraction forms a nominal setconcretize_abs- Concretion inverts abstraction
References #
- Pitts, Nominal Sets: Names and Symmetry in Computer Science, Cambridge University Press, 2013, Chapter 4.
- Larsen and Schürmann, Nominal State-Separating Proofs, IACR ePrint 2025/598 — the SSProve
Nominal/layer this development ports.
Support-agreement and swap-conjugation lemmas #
Conjugation identity for swaps through a permutation:
swap (π a) (π b) * π = π * swap a b.
Conjugation of swap through a permutation on NomSet actions:
swap (π a) (π b) • (π • x) = π • (swap a b • x).
Swap conjugation #
The abstraction equivalence relation #
The name abstraction equivalence relation.
Two pairs (a, x) and (b, y) are related if for some atom c fresh for both,
swap a c • x = swap b c • y.
Equations
- CatCrypt.Nominal.AbsRel p q = ∃ (c : CatCrypt.Nominal.Atom), CatCrypt.Nominal.Fresh c (p, q) ∧ CatCrypt.Nominal.FinPerm.swap p.1 c • p.2 = CatCrypt.Nominal.FinPerm.swap q.1 c • q.2
Instances For
AbsRel is transitive. Uses swap_fresh_conj to unify witnesses.
The setoid for name abstraction.
Equations
- CatCrypt.Nominal.absRelSetoid α = { r := CatCrypt.Nominal.AbsRel, iseqv := ⋯ }
Instances For
The quotient type #
Name abstraction: the quotient of Atom × α by the equivalence
"same up to fresh renaming". This is the nominal analogue of
alpha-equivalence classes for binders (Pitts, Chapter 4).
Defined as abbrev so instance search can see through it.
Equations
Instances For
Equations
- CatCrypt.Nominal.«term[𝔸]_» = Lean.ParserDescr.node `CatCrypt.Nominal.«term[𝔸]_» 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "[𝔸]") (Lean.ParserDescr.cat `term 0))
Instances For
The renaming rule #
The permutation action #
The nominal-set instance #
The some-any property and concretion #
Concretize a name abstraction at atom a: open abs b x as swap a b • x.
Uses Quotient.out for the definition; meaningful when a # nabs.
Equations
- CatCrypt.Nominal.concretize a nabs = CatCrypt.Nominal.FinPerm.swap a (Quotient.out nabs).1 • (Quotient.out nabs).2
Instances For
Equivariance and the functorial map #
An equivariant function preserves the permutation action.
Equations
- CatCrypt.Nominal.Equivariant f = ∀ (π : CatCrypt.Nominal.FinPerm) (x : α), f (π • x) = π • f x
Instances For
Support inclusion for equivariant functions.
Functorial map on name abstractions: lift an equivariant function.
Equations
- CatCrypt.Nominal.NameAbs.map f hf = Quotient.map (fun (p : CatCrypt.Nominal.Atom × α) => (p.1, f p.2)) ⋯
Instances For
Computation rule for NameAbs.map: it acts as f under the abstraction.
The elimination principle (nominal recursion) #
Pitts, Nominal Sets, Chapter 8: to define a function out of [𝔸]α one
needs a derived eliminator. NameAbs.lift is the underlying Quotient.lift:
given an atom-indexed f : Atom → α → β that respects the α-equivalence
relation AbsRel, it produces NameAbs.lift f h : [𝔸]α → β together with the
computation (β-)rule NameAbs.lift f h (abs a x) = f a x.
NameAbs.liftFCB packages the standard freshness condition for binders
(FCB): rather than requiring compatibility on all AbsRel-related inputs
directly, it derives it from equivariance of f together with a freshness
witness a # f a x (Pitts' "some atom is fresh for its own image"). This is
the honest nominal recursor with a genuine freshness side-condition.
Nominal elimination principle (Pitts, Ch. 8). Lift an atom-indexed
function f : Atom → α → β that respects the α-equivalence relation AbsRel
to a total function [𝔸]α → β out of the abstraction. This is Quotient.lift
over AbsRel, with compatibility supplied by h. See NameAbs.lift_abs for
the computation rule.
Equations
- CatCrypt.Nominal.NameAbs.lift f h = Quotient.lift (fun (p : CatCrypt.Nominal.Atom × α) => f p.1 p.2) ⋯
Instances For
The FCB compatibility lemma: for an equivariant f (in each fixed atom
argument reindexed by the permutation) satisfying the freshness condition
"some atom fresh for f's output is also fresh for the abstracted atom",
α-equivalent inputs get equal images. Concretely: if f is compatible with
swapping the bound name away to any sufficiently fresh atom, then it respects
AbsRel.
Here the side condition is packaged as hswap: f commutes with renaming the
bound atom by a swap through a fresh c — the derived form of Pitts' FCB
∀ a x, ∃ c, c # (a, x, f a x) ∧ …. Given this, AbsRel (a,x) (a',x')
forces f a x = f a' x'.