The λ-calculus as a nominal set #
The λ-calculus with terms defined nominally from the start, over the
Atom / FinPerm / NomSet framework. Raw terms carry the FinPerm action and
form a NomSet; quotienting by α-equivalence yields Tm, the genuine nominal
term type. Changing the bound name of lam to any fresh atom leaves the term
equal (Tm.lam_rename) — an equality of terms, not a separate α-relation.
Main definitions #
Raw,atoms,fv— raw terms, their atoms, and free variables.AEq— α-equivalence as a generated congruence (refl/symm/transare constructors, so it is an equivalence relation by construction).Tm := Raw / AEq— nominal λ-terms;Tm.var/Tm.app/Tm.lam.
Main results #
instance : NomSet Raw— raw terms as a nominal set (support = all atoms).instance : NomSet Tm— nominal λ-terms as a nominal set (support =fv), whose support-minimality isaeq_of_fixes_fv.Tm.lam_rename— α-correctness of the binder.
References #
- A. M. Pitts, Nominal Sets: Names and Symmetry in Computer Science, CUP 2013.
Raw λ-terms and the permutation action #
Equations
- One or more equations did not get rendered due to their size.
- CatCrypt.Nominal.Lambda.instDecidableEqRaw.decEq (CatCrypt.Nominal.Lambda.Raw.var a) (CatCrypt.Nominal.Lambda.Raw.var b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- CatCrypt.Nominal.Lambda.instDecidableEqRaw.decEq (CatCrypt.Nominal.Lambda.Raw.var a) (a_1.app a_2) = isFalse ⋯
- CatCrypt.Nominal.Lambda.instDecidableEqRaw.decEq (CatCrypt.Nominal.Lambda.Raw.var a) (CatCrypt.Nominal.Lambda.Raw.lam a_1 a_2) = isFalse ⋯
- CatCrypt.Nominal.Lambda.instDecidableEqRaw.decEq (a.app a_1) (CatCrypt.Nominal.Lambda.Raw.var a_2) = isFalse ⋯
- CatCrypt.Nominal.Lambda.instDecidableEqRaw.decEq (a.app a_1) (CatCrypt.Nominal.Lambda.Raw.lam a_2 a_3) = isFalse ⋯
- CatCrypt.Nominal.Lambda.instDecidableEqRaw.decEq (CatCrypt.Nominal.Lambda.Raw.lam a a_1) (CatCrypt.Nominal.Lambda.Raw.var a_2) = isFalse ⋯
- CatCrypt.Nominal.Lambda.instDecidableEqRaw.decEq (CatCrypt.Nominal.Lambda.Raw.lam a a_1) (a_2.app a_3) = isFalse ⋯
Instances For
The FinPerm action on raw terms: rename every atom (free and bound).
Equations
- CatCrypt.Nominal.Lambda.rawAct π (CatCrypt.Nominal.Lambda.Raw.var a) = CatCrypt.Nominal.Lambda.Raw.var (π.apply a)
- CatCrypt.Nominal.Lambda.rawAct π (s.app t) = (CatCrypt.Nominal.Lambda.rawAct π s).app (CatCrypt.Nominal.Lambda.rawAct π t)
- CatCrypt.Nominal.Lambda.rawAct π (CatCrypt.Nominal.Lambda.Raw.lam a t) = CatCrypt.Nominal.Lambda.Raw.lam (π.apply a) (CatCrypt.Nominal.Lambda.rawAct π t)
Instances For
Equations
- CatCrypt.Nominal.Lambda.instMulActionFinPermRaw = { smul := CatCrypt.Nominal.Lambda.rawAct, mul_smul := CatCrypt.Nominal.Lambda.rawAct_mul, one_smul := CatCrypt.Nominal.Lambda.rawAct_one }
Atoms of a term and the NomSet structure #
Every atom occurring in a term (free or bound) — the support of the raw term (raw terms are not yet α-quotiented, so bound names count).
Equations
Instances For
Equations
- CatCrypt.Nominal.Lambda.instNomSetRaw = { toMulAction := CatCrypt.Nominal.Lambda.instMulActionFinPermRaw, supp := CatCrypt.Nominal.Lambda.atoms, supp_supports := ⋯, supp_equivariant := ⋯ }
Free variables #
α-equivalence (generated congruence) and the quotient #
AEq is the least congruence identifying lam a t with lam b (swap a b • t)
for a fresh b. Taking refl/symm/trans as constructors makes it an
equivalence relation by construction — no hand proof of α-transitivity.
α-equivalence of raw terms.
- rfl (t : Raw) : AEq t t
- symm {s t : Raw} : AEq s t → AEq t s
- trans {s t u : Raw} : AEq s t → AEq t u → AEq s u
- app {s s' t t' : Raw} : AEq s s' → AEq t t' → AEq (s.app t) (s'.app t')
- lam {a : Atom} {s t : Raw} : AEq s t → AEq (Raw.lam a s) (Raw.lam a t)
- rename (a b : Atom) (t : Raw) (h : b ∉ atoms t) : AEq (Raw.lam a t) (Raw.lam b (FinPerm.swap a b • t))
Instances For
The α-equivalence setoid.
Equations
Instances For
Nominal λ-terms: raw terms up to α-equivalence.
Instances For
The class of a raw term.
Equations
Instances For
The permutation action descends to the quotient.
Equations
- One or more equations did not get rendered due to their size.
Free variables, descended to the quotient (α-invariant).
Instances For
Variable.
Equations
Instances For
Application.
Equations
Instances For
Abstraction (binding).
Equations
Instances For
Support minimality: Tm is a nominal set with supp = fv #
The nontrivial half: a permutation fixing the free variables of a term acts α-trivially on it.
Tm is a nominal set over Atom/FinPerm, with support the free
variables.
Equations
- One or more equations did not get rendered due to their size.