Documentation

Cslib.Languages.LambdaCalculus.LocallyNameless.Untyped.BetaAt

Redex Positions #

This module defines β-reduction at a given redex position and proves its basic properties.

Reference #

BetaAt i M N reduces the redex at position i of M to obtain N; positions are counted from left to right.

Instances For
    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.appNoAbsL {Var : Type u} {M M' N : Term Var} {i : } (h : BetaAt i M M') (hna : ¬M.IsAbs) :
    BetaAt i (M.app N) (M'.app N)

    Reducing a non-abstraction operator keeps the position.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.appAbsL {Var : Type u} {M M' N : Term Var} {i : } (h : BetaAt i M M') (ha : M.IsAbs) :
    BetaAt (i + 1) (M.app N) (M'.app N)

    Reducing an abstraction operator advances the position by one.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.appNoAbsR {Var : Type u} {M M' N : Term Var} {i : } (h : BetaAt i M M') (hna : ¬N.IsAbs) :
    BetaAt (i + N.countRedexes) (N.app M) (N.app M')

    Reducing the operand adds the redex count of a non-abstraction operator.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.appAbsR {Var : Type u} {M M' N : Term Var} {i : } (h : BetaAt i M M') (ha : N.IsAbs) :
    BetaAt (i + N.countRedexes + 1) (N.app M) (N.app M')

    Reducing the operand adds the redex count of an abstraction operator, plus one.

    Opening with a free variable preserves the number of redexes.

    Opening the outermost binder with a free variable preserves the number of redexes.

    An application has at least as many redexes as its operator and operand combined.

    An application with an abstraction operator has one more redex than its parts.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.isAbs_r {Var : Type u} {M N : Term Var} {i : } (h : BetaAt i M N) (ha : M.IsAbs) :

    Contracting a redex of an abstraction yields an abstraction.

    The source of a Call-by-Name step is never an abstraction.

    A single Call-by-Name step contracts the redex at position 0.

    Renaming a free variable preserves the number of redexes.

    Renaming a free variable preserves being an abstraction.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.to_step {Var : Type u} {M N : Term Var} {i : } [DecidableEq Var] (h : BetaAt i M N) (lc : M.LC) :

    A BetaAt step is a full β-step.

    The position of a contracted redex is at most the redex count of the result.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.rename {Var : Type u} {M M' : Term Var} {i : } [HasFresh Var] [DecidableEq Var] (h : BetaAt i M M') (x y : Var) :
    BetaAt i M[x := fvar y] M'[x := fvar y]

    Renaming a free variable preserves the position of the contracted redex.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.lc_r {Var : Type u} {M M' : Term Var} {i : } [HasFresh Var] [DecidableEq Var] (h : BetaAt i M M') (lc : M.LC) :
    M'.LC

    Contracting a redex preserves local closure.

    theorem Cslib.LambdaCalculus.LocallyNameless.Untyped.Term.BetaAt.abs_close {Var : Type u} {M M' : Term Var} {i : } [HasFresh Var] [DecidableEq Var] {x : Var} (h : BetaAt i M M') (lc : M.LC) :
    BetaAt i (closeRec 0 x M).abs (closeRec 0 x M').abs

    Closing a variable and abstracting preserves the position of the contracted redex.