Documentation

Cslib.Foundations.Relation.Confluence

Relations: Confluence #

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

We prove most results first for two relations, where Confluent r becomes Commute r₁ r₂, then specialize to the classical case where r₁ = r₂.

References #

theorem Relation.Commute.to_confluent {α : Type u_1} {r : ααProp} :
@[deprecated Relation.Commute.to_confluent (since := "2026-09-03")]
theorem Relation.Commute.toConfluent {α : Type u_1} {r : ααProp} :

Alias of Relation.Commute.to_confluent.

@[deprecated Relation.StronglyCommute.to_stronglyConfluent (since := "2026-09-03")]

Alias of Relation.StronglyCommute.to_stronglyConfluent.

@[simp]
theorem Relation.DiamondCommute.to_diamond {α : Type u_1} {r : ααProp} :
@[deprecated Relation.DiamondCommute.to_diamond (since := "2026-09-03")]
theorem Relation.DiamondCommute.toDiamond {α : Type u_1} {r : ααProp} :

Alias of Relation.DiamondCommute.to_diamond.

@[simp]
theorem Relation.SemiCommute.to_semiConfluent {α : Type u_1} {r : ααProp} :
@[simp]
theorem Relation.DiamondCommute.diamond_commute_reflTransGen_right {α : Type u_1} {r₁ r₂ : ααProp} (h : DiamondCommute r₁ r₂) :
theorem Relation.DiamondCommute.diamond_commute_reflTransGen_left {α : Type u_1} {r₁ r₂ : ααProp} (h : DiamondCommute r₁ r₂) :
theorem Relation.DiamondCommute.to_semiCommute {α : Type u_1} {r₁ r₂ : ααProp} (h : DiamondCommute r₁ r₂) :
SemiCommute r₁ r₂
theorem Relation.Diamond.to_semiConfluent {α : Type u_1} {r : ααProp} (h : Diamond r) :

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

@[deprecated Relation.Diamond.to_semiConfluent (since := "2026-09-12")]
theorem Relation.Diamond.extend {α : Type u_1} {r : ααProp} (h : Diamond r) :

Alias of Relation.Diamond.to_semiConfluent.


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

theorem Relation.Commute.isTrans_join₂_reflTransGen {α : Type u_1} {r₁ r₂ : ααProp} (h : Commute r₁ r₂) :
theorem Relation.Confluent.isTrans_join_reflTransGen {α : Type u_1} {r : ααProp} (h : Confluent r) :
theorem Relation.SemiCommute.to_commute {α : Type u_1} {r₁ r₂ : ααProp} (h : SemiCommute r₁ r₂) :
Commute r₁ r₂
theorem Relation.SemiConfluent.to_confluent {α : Type u_1} {r : ααProp} (h : SemiConfluent r) :
@[deprecated Relation.SemiConfluent.to_confluent (since := "2026-09-03")]
theorem Relation.SemiConfluent.toConfluent {α : Type u_1} {r : ααProp} (h : SemiConfluent r) :

Alias of Relation.SemiConfluent.to_confluent.

theorem Relation.commute_equivalents {α : Type u_1} {r₁ r₂ : ααProp} :
theorem Relation.semiCommute_iff_commute {α : Type u_1} {r₁ r₂ : ααProp} :
SemiCommute r₁ r₂ Commute r₁ r₂
theorem Relation.DiamondCommute.to_commute {α : Type u_1} {r₁ r₂ : ααProp} (h : DiamondCommute r₁ r₂) :
Commute r₁ r₂
@[deprecated Relation.semiConfluent_iff_churchRosser (since := "2026-09-03")]

Alias of Relation.semiConfluent_iff_churchRosser.

theorem Relation.confluent_iff_churchRosser {α : Type u_1} {r : ααProp} :
theorem Relation.Confluent.to_churchRosser {α : Type u_1} {r : ααProp} :

Alias of the forward direction of Relation.confluent_iff_churchRosser.

@[deprecated Relation.confluent_iff_churchRosser (since := "2026-09-03")]
theorem Relation.Confluent_iff_ChurchRosser {α : Type u_1} {r : ααProp} :

Alias of Relation.confluent_iff_churchRosser.

@[deprecated Relation.confluent_iff_semiConfluent (since := "2026-09-03")]
theorem Relation.Confluent_iff_SemiConfluent {α : Type u_1} {r : ααProp} :

Alias of Relation.confluent_iff_semiConfluent.

theorem Relation.Diamond.to_confluent {α : Type u_1} {r : ααProp} (h : Diamond r) :
@[deprecated Relation.Diamond.to_confluent (since := "2026-09-03")]
theorem Relation.Diamond.toConfluent {α : Type u_1} {r : ααProp} (h : Diamond r) :

Alias of Relation.Diamond.to_confluent.

theorem Relation.confluent_of_unique_end {α : Type u_1} {r : ααProp} {x : α} (h : ∀ (y : α), ReflTransGen r y x) :
@[deprecated Relation.confluent_of_unique_end (since := "2026-09-03")]
theorem Relation.Confluent_of_unique_end {α : Type u_1} {r : ααProp} {x : α} (h : ∀ (y : α), ReflTransGen r y x) :

Alias of Relation.confluent_of_unique_end.

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.Normalizing.confluent_iff_forall_unique_normal {α : Type u_1} {r : ααProp} (hn : Normalizing r) :
Confluent r ∀ (a : α), ∃! n : α, ReflTransGen r a n Normal r n
theorem Relation.Terminating.confluent_iff_forall_unique_normal {α : Type u_1} {r : ααProp} (ht : Terminating r) :
Confluent r ∀ (a : α), ∃! n : α, ReflTransGen r a n Normal r n
@[deprecated Relation.Terminating.confluent_iff_forall_unique_normal (since := "2026-09-03")]
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

Alias of Relation.Terminating.confluent_iff_forall_unique_normal.

theorem Relation.Convergent.to_terminating {α : Type u_1} {r : ααProp} (h : Convergent r) :
@[deprecated Relation.Convergent.to_terminating (since := "2026-09-03")]
theorem Relation.Convergent.isTerminating {α : Type u_1} {r : ααProp} (h : Convergent r) :

Alias of Relation.Convergent.to_terminating.

theorem Relation.Convergent.to_confluent {α : Type u_1} {r : ααProp} (h : Convergent r) :
@[deprecated Relation.Convergent.to_confluent (since := "2026-09-03")]
theorem Relation.Convergent.isConfluent {α : Type u_1} {r : ααProp} (h : Convergent r) :

Alias of Relation.Convergent.to_confluent.

theorem Relation.Convergent.to_normalizing {α : Type u_1} {r : ααProp} (h : Convergent r) :
@[deprecated Relation.Convergent.to_normalizing (since := "2026-09-03")]
theorem Relation.Convergent.isNormalizing {α : Type u_1} {r : ααProp} (h : Convergent r) :

Alias of Relation.Convergent.to_normalizing.

theorem Relation.Convergent.unique_normal {α : Type u_1} {r : ααProp} (h : Convergent r) (a : α) :
∃! n : α, ReflTransGen r a n Normal r n
@[deprecated Relation.Convergent.unique_normal (since := "2026-09-03")]
theorem Relation.Convergent.unique_Normal {α : Type u_1} {r : ααProp} (h : Convergent r) (a : α) :
∃! n : α, ReflTransGen r a n Normal r n

Alias of Relation.Convergent.unique_normal.

theorem Relation.Confluent.to_locallyConfluent {α : Type u_1} {r : ααProp} (h : Confluent r) :
@[deprecated Relation.Confluent.to_locallyConfluent (since := "2026-09-03")]
theorem Relation.Confluent.toLocallyConfluent {α : Type u_1} {r : ααProp} (h : Confluent r) :

Alias of Relation.Confluent.to_locallyConfluent.

theorem Relation.LocallyCommute.commute_of_terminating_sup {α : Type u_1} {r₁ r₂ : ααProp} (hlc : LocallyCommute r₁ r₂) (ht : Terminating (r₁r₂)) :
Commute r₁ 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.

@[deprecated Relation.LocallyConfluent.terminating_toConfluent (since := "2026-09-03")]
theorem Relation.LocallyConfluent.Terminating_toConfluent {α : Type u_1} {r : ααProp} (hlc : LocallyConfluent r) (ht : Terminating r) :

Alias of Relation.LocallyConfluent.terminating_toConfluent.


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

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.to_commute {α : Type u_1} {r₁ r₂ : ααProp} (h : StronglyCommute r₁ r₂) :
Commute r₁ r₂
@[deprecated Relation.StronglyCommute.to_commute (since := "2026-09-03")]
theorem Relation.StronglyCommute.toCommute {α : Type u_1} {r₁ r₂ : ααProp} (h : StronglyCommute r₁ r₂) :
Commute r₁ r₂

Alias of Relation.StronglyCommute.to_commute.

theorem Relation.StronglyConfluent.to_confluent {α : Type u_1} {r : ααProp} (h : StronglyConfluent r) :
@[deprecated Relation.StronglyConfluent.to_confluent (since := "2026-09-03")]
theorem Relation.StronglyConfluent.toConfluent {α : Type u_1} {r : ααProp} (h : StronglyConfluent r) :

Alias of Relation.StronglyConfluent.to_confluent.

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.RightUnique.to_confluent {α : 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.)

@[deprecated Relation.RightUnique.to_confluent (since := "2026-09-03")]
theorem Relation.RightUnique.toConfluent {α : Type u_1} {r : ααProp} (hr : Relator.RightUnique r) :

Alias of Relation.RightUnique.to_confluent.


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.)

theorem Relation.Reducible.sup_iff {α : Type u_1} {r₁ r₂ : ααProp} (x : α) :
Reducible (r₁r₂) x Reducible r₁ x Reducible r₂ x
theorem Relation.Normal.sup_iff {α : Type u_1} {r₁ r₂ : ααProp} (x : α) :
Normal (r₁r₂) x Normal r₁ x Normal r₂ x