Documentation

Cslib.Languages.CombinatoryLogic.Confluence

SKI reduction is confluent #

This file proves the Church-Rosser theorem for the SKI calculus, that is, if a ↠ b and a ↠ c, b ↠ d and c ↠ d for some term d. More strongly (though equivalently), we show that the relation of having a common reduct is transitive — in the above situation, a and b, and a and c have common reducts, so the result implies the same of b and c. Note that MJoin Red is symmetric (trivially) and reflexive (since is), so we in fact show that MJoin Red is an equivalence.

Our proof follows the method of Tait and Martin-Löf for the lambda calculus, as presented for instance in Chapter 4 of Peter Selinger's notes: https://www.mscs.dal.ca/~selinger/papers/papers/lambdanotes.pdf.

Main definitions #

Main results #

A reduction step allowing simultaneous reduction of disjoint redexes

Instances For
    def Cslib.SKI.«term_↠ₚ_» :
    Lean.TrailingParserDescr
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Cslib.SKI.«term_⭢ₚ_» :
      Lean.TrailingParserDescr
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Cslib.SKI.mRed_of_parallelReduction {a a' : SKI} (h : a.ParallelReduction a') :
        Relation.ReflTransGen Red a a'

        The inclusion ⭢ₚ ⊆ ↠

        The inclusion ⭢ ⊆ ⭢ₚ

        theorem Cslib.SKI.reflTransGen_parallelReduction_mRed :
        Relation.ReflTransGen ParallelReduction = Relation.ReflTransGen Red

        The inclusions of mRed_of_parallelReduction and parallelReduction_of_red imply that and ⭢ₚ have the same reflexive-transitive closure.

        Irreducibility for the (partially applied) primitive combinators.

        TODO: possibly these should be proven more generally (in another file) for .

        theorem Cslib.SKI.Ka_irreducible (a c : SKI) (h : (K.app a).ParallelReduction c) :
        ∃ (a' : SKI), a.ParallelReduction a' c = K.app a'
        theorem Cslib.SKI.Sa_irreducible (a c : SKI) (h : (S.app a).ParallelReduction c) :
        ∃ (a' : SKI), a.ParallelReduction a' c = S.app a'
        theorem Cslib.SKI.Sab_irreducible (a b c : SKI) (h : ((S.app a).app b).ParallelReduction c) :
        ∃ (a' : SKI) (b' : SKI), a.ParallelReduction a' b.ParallelReduction b' c = (S.app a').app b'

        The key result: the Church-Rosser property holds for ⭢ₚ. The proof is a lengthy case analysis on the reductions a ⭢ₚ a₁ and a ⭢ₚ a₂, but is entirely mechanical.

        The Church-Rosser theorem in its general form.

        The Church-Rosser theorem in the form it is usually stated.