Documentation

Cslib.Computability.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 CommonReduct is symmetric (trivially) and reflexive (since ⇒* is), so we in fact show that CommonReduct 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 #

inductive SKI.ParallelReduction :
SKISKIProp

A reduction step allowing simultaneous reduction of disjoint redexes

Instances For

    Notation for parallel reduction

    Equations
    Instances For
      theorem SKI.mRed_of_parallelReduction {a a' : SKI} (h : a.ParallelReduction a') :
      a.MRed a'

      The inclusion ⇒ₚ ⊆ ⇒*

      theorem SKI.parallelReduction_of_red {a a' : SKI} (h : a.Red a') :

      The inclusion ⇒ ⊆ ⇒ₚ

      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 SKI.Sab_irreducible (a b c : SKI) (h : ((S.app a).app b).ParallelReduction c) :
      theorem SKI.parallelReduction_diamond (a a₁ a₂ : SKI) (h₁ : a.ParallelReduction a₁) (h₂ : a.ParallelReduction a₂) :

      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.

      theorem SKI.MRed.diamond (a b c : SKI) (hab : a.MRed b) (hac : a.MRed c) :

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