Documentation

Nominal.Lambda

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 #

Main results #

References #

Raw λ-terms and the permutation action #

Raw (pre-α) λ-terms over atoms.

Instances For
    theorem CatCrypt.Nominal.Lambda.rawAct_mul (π₁ π₂ : FinPerm) (t : Raw) :
    rawAct (π₁ * π₂) t = rawAct π₁ (rawAct π₂ t)
    @[simp]
    @[simp]
    theorem CatCrypt.Nominal.Lambda.smul_app (π : FinPerm) (s t : Raw) :
    π s.app t = (π s).app (π t)
    @[simp]
    theorem CatCrypt.Nominal.Lambda.smul_lam (π : FinPerm) (a : Atom) (t : Raw) :
    π Raw.lam a t = Raw.lam (π.apply a) (π t)

    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
      @[simp]
      theorem CatCrypt.Nominal.Lambda.atoms_smul (π : FinPerm) (t : Raw) :
      atoms (π t) = Finset.image (fun (x : Atom) => π.apply x) (atoms t)
      theorem CatCrypt.Nominal.Lambda.smul_eq_of_atoms_fixed {π : FinPerm} {t : Raw} (h : aatoms t, π.apply a = a) :
      π t = t

      If a permutation fixes every atom of t, it fixes t.

      @[instance_reducible]
      Equations

      Free variables #

      @[simp]
      theorem CatCrypt.Nominal.Lambda.fv_app (s t : Raw) :
      fv (s.app t) = fv s fv t
      @[simp]
      theorem CatCrypt.Nominal.Lambda.fv_lam (a : Atom) (t : Raw) :
      fv (Raw.lam a t) = fv t \ {a}
      theorem CatCrypt.Nominal.Lambda.fv_smul (π : FinPerm) (t : Raw) :
      fv (π t) = Finset.image (fun (x : Atom) => π.apply x) (fv t)

      α-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.

      Instances For
        theorem CatCrypt.Nominal.Lambda.aeq_smul (π : FinPerm) {s t : Raw} (h : AEq s t) :
        AEq (π s) (π t)

        α-equivalence is equivariant.

        theorem CatCrypt.Nominal.Lambda.aeq_fv {s t : Raw} (h : AEq s t) :
        fv s = fv t

        α-equivalent terms have the same free variables.

        The nominal term type Tm := Raw / α #

        Nominal λ-terms: raw terms up to α-equivalence.

        Equations
        Instances For

          The class of a raw term.

          Equations
          Instances For
            theorem CatCrypt.Nominal.Lambda.Tm.mk_eq {s t : Raw} (h : AEq s t) :
            mk s = mk t
            theorem CatCrypt.Nominal.Lambda.Tm.ind {motive : TmProp} (h : ∀ (t : Raw), motive (mk t)) (q : Tm) :
            motive q
            @[instance_reducible]

            The permutation action descends to the quotient.

            Equations
            • One or more equations did not get rendered due to their size.
            @[simp]
            theorem CatCrypt.Nominal.Lambda.Tm.smul_mk (π : FinPerm) (t : Raw) :
            π mk t = mk (π t)

            Free variables, descended to the quotient (α-invariant).

            Equations
            Instances For

              Constructors on Tm, and α-correctness of lam #

              @[simp]
              theorem CatCrypt.Nominal.Lambda.Tm.lam_mk (a : Atom) (t : Raw) :
              lam a (mk t) = mk (Raw.lam a t)
              theorem CatCrypt.Nominal.Lambda.Tm.lam_rename (a b : Atom) (t : Raw) (h : batoms t) :
              lam a (mk t) = lam b (mk (FinPerm.swap a b t))

              α-correctness of lam: lam a t = lam b (swap a b • t) for fresh b, an equality of terms — the defining property of a nominal binder.

              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.

              theorem CatCrypt.Nominal.Lambda.aeq_of_fixes_fv {t : Raw} {π : FinPerm} :
              (∀ afv t, π.apply a = a)AEq (π t) t

              A permutation fixing every free variable of t fixes t up to α.

              @[instance_reducible]

              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.