Documentation

Cslib.Foundations.Relation.Confluence

Relations: Confluence and Termination #

This module proves some properties regarding confluence and termination that are used for both lambda calculi and combinatory logic. Some notable theorems:

References #

theorem WellFounded.ofTransGen {α : Type u_1} {r : ααProp} (trans_wf : WellFounded (Relation.TransGen r)) :
@[simp]
theorem WellFounded.iff_transGen {α : Type u_1} {r : ααProp} :
theorem Relation.ReflGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : ReflGen r a b) :
EqvGen r a b
theorem Relation.TransGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : TransGen r a b) :
EqvGen r a b
theorem Relation.ReflTransGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : ReflTransGen r a b) :
EqvGen r a b
theorem Relation.SymmGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : SymmGen r a b) :
EqvGen r a b
theorem Relation.MJoin.refl {α : Type u_1} {r : ααProp} (a : α) :
MJoin r a a
theorem Relation.MJoin.single {α : Type u_1} {r : ααProp} {a b : α} (h : ReflTransGen r a b) :
MJoin r a b
theorem Relation.Diamond.extend {α : Type u_1} {r : ααProp} {a b c : α} (h : Diamond r) :
ReflTransGen r a br a cJoin (ReflTransGen r) b c

Extending a multistep reduction by a single step preserves multi-joinability.

theorem Relation.Diamond.toConfluent {α : Type u_1} {r : ααProp} (h : Diamond r) :

The diamond property implies confluence.

theorem Relation.Confluent.toChurchRosser {α : Type u_1} {r : ααProp} (h : Confluent r) :
theorem Relation.SemiConfluent.toConfluent {α : Type u_1} {r : ααProp} (h : SemiConfluent r) :
theorem Relation.Confluent_iff_ChurchRosser {α : Type u_1} {r : ααProp} :
theorem Relation.Confluent_of_unique_end {α : Type u_1} {r : ααProp} {x : α} (h : ∀ (y : α), ReflTransGen r y x) :
theorem Relation.Normal_iff {α : Type u_1} (r : ααProp) (x : α) :
Normal r x ∀ (y : α), ¬r x y
theorem Relation.Normal.reflTransGen_eq {α : Type u_1} {r : ααProp} {x y : α} (h : Normal r x) (xy : ReflTransGen r x y) :
x = y

A multi-step from a normal form must be reflexive.

theorem Relation.ChurchRosser.normal_eqvGen_reflTransGen {α : Type u_1} {r : ααProp} {x y : α} (cr : ChurchRosser r) (norm : Normal r x) (xy : EqvGen r y x) :

For a Church-Rosser relation, elements in an equivalence class must be multi-step related.

theorem Relation.ChurchRosser.normal_eq {α : Type u_1} {r : ααProp} {x y : α} (cr : ChurchRosser r) (nx : Normal r x) (ny : Normal r y) (xy : EqvGen r x y) :
x = y

For a Church-Rosser relation there is one normal form in each equivalence class.

Confluence implies that multi-step joinability is an equivalence.

theorem Relation.SN_iff_SN_of_rel {α : Type u_1} {r : ααProp} (x : α) :
SN r x ∀ (y : α), r x ySN r y
theorem Relation.SN.intro {α : Type u_1} {r : ααProp} {x : α} (h : ∀ (y : α), r x ySN r y) :
SN r x
theorem Relation.SN.of_rel {α : Type u_1} {r : ααProp} {x y : α} (hx : SN r x) (h : r x y) :
SN r y
theorem Relation.SN.of_rel_reflTransGen {α : Type u_1} {r : ααProp} {x y : α} (hx : SN r x) (h : ReflTransGen r x y) :
SN r y
theorem Relation.SN.transGen {α : Type u_1} {r : ααProp} {x : α} (hx : SN r x) :
SN (TransGen r) x
theorem Relation.SN.of_le {α : Type u_1} {r : ααProp} {x : α} {r' : ααProp} (hx : SN r x) (h : r' r) :
SN r' x
@[simp]
theorem Relation.SN.iff_transGen {α : Type u_1} {r : ααProp} (x : α) :
SN (TransGen r) x SN r x
theorem Relation.SN.iff_isEmpty_chain {α : Type u_1} {r : ααProp} {x : α} :
SN r x IsEmpty {f : α | f 0 = x ∀ (n : ), r (f n) (f (n + 1))}

SN r x is equivalent to the more elementary definition, that there is no infinite sequence of reductions starting with x.

theorem Relation.SN.onFun_of_image {α : Type u_1} {β : Sort u_2} {x : α} {r : ββProp} {f : αβ} (hx : SN r (f x)) :
theorem Relation.SN.of_normal {α : Type u_1} {r : ααProp} {x : α} (hx : Normal r x) :
SN r x
theorem Relation.Terminating.apply {α : Type u_1} {r : ααProp} (hr : Terminating r) (x : α) :
SN r x
theorem Relation.Terminating.iff_forall_sn {α : Type u_1} {r : ααProp} :
Terminating r ∀ (x : α), SN r x
theorem Relation.Terminating.toTransGen {α : Type u_1} {r : ααProp} (ht : Terminating r) :
theorem Relation.Terminating.ofTransGen {α : Type u_1} {r : ααProp} :
theorem Relation.Terminating.iff_isEmpty_chain {α : Type u_1} {r : ααProp} :
Terminating r IsEmpty { f : α // ∀ (n : ), r (f n) (f (n + 1)) }
theorem Relation.Terminating.of_le {α : Type u_1} {r r' : ααProp} (hr : Terminating r) (h : r' r) :
theorem Relation.Terminating.subtype_sn {α : Type u_1} (r : ααProp) :
Terminating fun (a b : { x : α // SN r x }) => r a b
theorem Relation.SN.isNormalizable {α : Type u_1} {r : ααProp} {x : α} (hx : SN r x) :
theorem Relation.Terminating.isNormalizing {α : Type u_1} {r : ααProp} (hr : Terminating r) :
theorem Relation.Terminating.isConfluent_iff_all_unique_Normal {α : Type u_1} {r : ααProp} (ht : Terminating r) :
Confluent r ∀ (a : α), ∃! n : α, ReflTransGen r a n Normal r n
theorem Relation.Convergent.isTerminating {α : Type u_1} {r : ααProp} (h : Convergent r) :
theorem Relation.Convergent.isConfluent {α : Type u_1} {r : ααProp} (h : Convergent r) :
theorem Relation.Convergent.isNormalizing {α : Type u_1} {r : ααProp} (h : Convergent r) :
theorem Relation.Convergent.unique_Normal {α : Type u_1} {r : ααProp} (h : Convergent r) (a : α) :
∃! n : α, ReflTransGen r a n Normal r n
theorem Relation.Confluent.toLocallyConfluent {α : Type u_1} {r : ααProp} (h : Confluent r) :
theorem Relation.LocallyConfluent.Terminating_toConfluent {α : Type u_1} {r : ααProp} (hlc : LocallyConfluent r) (ht : Terminating r) :

Newman's lemma: a terminating, locally confluent relation is confluent.

theorem Relation.Commute.toConfluent {α : Type u_1} {r : ααProp} :
theorem Relation.DiamondCommute.toDiamond {α : Type u_1} {r : ααProp} :
theorem Relation.StronglyCommute.extend {α : Type u_1} {r₁ r₂ : ααProp} {x y z : α} (h : StronglyCommute r₁ r₂) (xy : ReflTransGen r₁ x y) (xz : r₂ x z) :
(w : α), ReflGen r₂ y w ReflTransGen r₁ z w
theorem Relation.StronglyCommute.toCommute {α : Type u_1} {r₁ r₂ : ααProp} (h : StronglyCommute r₁ r₂) :
Commute r₁ r₂
theorem Relation.StronglyConfluent.toConfluent {α : Type u_1} {r : ααProp} (h : StronglyConfluent r) :
theorem Relation.join_inl {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₁_ab : r₁ a b) :
(r₁r₂) a b
theorem Relation.join_inr {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₂_ab : r₂ a b) :
(r₁r₂) a b
theorem Relation.join_inl_reflTransGen {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₁_ab : ReflTransGen r₁ a b) :
ReflTransGen (r₁r₂) a b
theorem Relation.join_inr_reflTransGen {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₂_ab : ReflTransGen r₂ a b) :
ReflTransGen (r₁r₂) a b
theorem Relation.Commute.join_left {α : Type u_1} {r₁ r₂ r₃ : ααProp} (c₁ : Commute r₁ r₃) (c₂ : Commute r₂ r₃) :
Commute (r₁r₂) r₃
theorem Relation.Commute.join_confluent {α : Type u_1} {r₁ r₂ : ααProp} (c₁ : Confluent r₁) (c₂ : Confluent r₂) (comm : Commute r₁ r₂) :
Confluent (r₁r₂)
theorem Relation.reflTransGen_mono_closed {α : Type u_1} {r₁ r₂ : ααProp} (h₁ : r₁ r₂) (h₂ : r₂ ReflTransGen r₁) :

If a relation is squeezed by a relation and its multi-step closure, they are multi-step equal

theorem Relation.ReflGen.compRel_symm {α : Type u_1} {r : ααProp} {a b : α} :
ReflGen (SymmGen r) a bReflGen (SymmGen r) b a
@[simp]
theorem Relation.reflTransGen_compRel {α : Type u_1} {r : ααProp} :
theorem Relation.RightUnique.toConfluent {α : Type u_1} {r : ααProp} (hr : Relator.RightUnique r) :

Relator.RightUnique corresponds to deterministic reductions, which are confluent, as all multi-reductions with a common origin start the same (this fact is Relation.ReflTransGen.total_of_right_unique.)