Documentation

Cslib.Languages.LambdaCalculus.LocallyNameless.Stlc.StrongNorm

A set of terms is called saturated if it

  1. only contains locally closed terms,
  2. only contains strongly normalizing terms,
  3. contains all neutral locally closed terms, and
  4. is closed under top-level β-reduction of the form (Ī» M) N P₁ … Pā‚™ → M ^ N P₁ … Pā‚™.
Instances For
    def Cslib.LambdaCalculus.LocallyNameless.Stlc.semanticMap {Var : Type u} {Base : Type v} :
    Ty Base → Set (Untyped.Term Var)

    The semantic map maps each type to a corresponding saturated set of terms. For the strong normalization proof to work, we must ensure that Ī“ ⊢ t ∶ Ļ„ implies that t is in the set of terms corresponding to Ļ„.

    Strong normalization later follows from the fact that terms in saturated sets are strongly normalizing.

    Equations
    Instances For
      theorem Cslib.LambdaCalculus.LocallyNameless.Stlc.semanticMap_saturated {Var : Type u} {Base : Type v} [DecidableEq Var] [HasFresh Var] (Ļ„ : Ty Base) :

      The sets constructed by semanticMap are saturated

      @[reducible, inline]
      abbrev Cslib.LambdaCalculus.LocallyNameless.Stlc.entails_context {Var : Type u} {Base : Type v} [DecidableEq Var] (E : Untyped.Term.Env Var) (Ī“ : Context Var (Ty Base)) :

      The entails_context predicate ensures that each variable in the context is mapped to a term in the corresponding semantic map.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Cslib.LambdaCalculus.LocallyNameless.Stlc.entails_context_empty {Var : Type u} {Base : Type v} [DecidableEq Var] [HasFresh Var] {Ī“ : Context Var (Ty Base)} :

        The empty context is entailed by any environment.

        theorem Cslib.LambdaCalculus.LocallyNameless.Stlc.entails_context_cons {Var : Type u} {Base : Type v} [DecidableEq Var] (E : Untyped.Term.Env Var) (Ī“ : Context Var (Ty Base)) (x : Var) (Ļ„ : Ty Base) (sub : Untyped.Term Var) (h_fresh : x āˆ‰ Context.dom E ∪ E.fv ∪ Ī“.dom) (h_mem : sub ∈ semanticMap Ļ„) :
        entails_context E Ī“ → entails_context (⟨x, sub⟩ :: E) (⟨x, Ļ„āŸ© :: Ī“)

        The entails_context predicate is preserved when extending the context with a new variable, provided the new variable is fresh and its substitution is in the corresponding semantic map.

        @[reducible, inline]
        abbrev Cslib.LambdaCalculus.LocallyNameless.Stlc.entails {Var : Type u} {Base : Type v} [DecidableEq Var] (Ī“ : Context Var (Ty Base)) (t : Untyped.Term Var) (Ļ„ : Ty Base) :

        The entails predicate states that a term t is semantically valid with respect to a context Ī“ and a type Ļ„

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Cslib.LambdaCalculus.LocallyNameless.Stlc.soundness {Var : Type u} {Base : Type v} [DecidableEq Var] [HasFresh Var] {t : Untyped.Term Var} {Ļ„ : Ty Base} {Ī“ : Context Var (Ty Base)} (derivation_t : Typing Ī“ t Ļ„) :
          entails Ī“ t Ļ„

          The soundness lemma states that if a term t has type Ļ„ in context Ī“, then t is semantically valid with respect to Ī“ and Ļ„

          theorem Cslib.LambdaCalculus.LocallyNameless.Stlc.strong_norm {Var : Type u} {Base : Type v} [DecidableEq Var] [HasFresh Var] {Ī“ : Context Var (Ty Base)} {t : Untyped.Term Var} {Ļ„ : Ty Base} (der : Typing Ī“ t Ļ„) :
          t.SN

          Using soundness and the fact that the empty context is entailed by any environment, we can conclude that a well-typed term is strongly normalizing.