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 #
Relation.reflTransGenFinset: the reflexive-transitive closure as a computableFinset.
Main results #
Relation.mem_reflTransGenFinset: membership isRelation.ReflTransGen r.
def Relation.reflTransGenStep {α : Type u_1} (r : α → α → Prop) [Fintype α] [DecidableEq α] [DecidableRel r] (R : 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] :
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 : α} :