Documentation

CslibFrontier.Foundations.Relation.FiniteClosure

Computing the reflexive-transitive closure on a finite type #

For a decidable relation r on a finite type, Relation.reflTransGenFinset r is the finite set of pairs related by Relation.ReflTransGen r. It applies the closure rules (a reflexive pair, or an r-step followed by a pair already found) to the empty set once for each pair, which reaches the least fixed point (OrderHom.iterate_card_bot_eq_lfp).

Main definitions #

Main results #

def Relation.reflTransGenRule {α : Type u_1} (r : α → α → Prop) :
Set (α × α) →o Set (α × α)

The closure rules of ReflTransGen r: a reflexive pair, or an r-step followed by R.

theorem Relation.lfp_reflTransGenRule {α : Type u_1} (r : α → α → Prop) :
def Relation.reflTransGenStep {α : Type u_1} (r : α → α → Prop) [Fintype α] [DecidableEq α] [DecidableRel r] (R : Finset (α × α)) :
Finset (α × α)

One application of the closure rules of ReflTransGen r to a finite relation.

def Relation.reflTransGenFinset {α : Type u_1} (r : α → α → Prop) [Fintype α] [DecidableEq α] [DecidableRel r] :
Finset (α × α)

The reflexive-transitive closure of a decidable relation on a finite type, as a Finset.

theorem Relation.coe_iterate_reflTransGenStep {α : Type u_1} (r : α → α → Prop) [Fintype α] [DecidableEq α] [DecidableRel r] (k : ℕ) :
theorem Relation.mem_reflTransGenFinset {α : Type u_1} (r : α → α → Prop) [Fintype α] [DecidableEq α] [DecidableRel r] {a b : α} :