Module docstring
{"# Relation closures
This file defines the reflexive, transitive, reflexive transitive and equivalence closures of relations and proves some basic results on them.
Note that this is about unbundled relations, that is terms of types of the form α → β → Prop. For
the bundled version, see Rel.
Definitions
Relation.ReflGen: Reflexive closure.ReflGen rrelates everythingrrelated, plus for allait relatesawith itself. SoReflGen r a b ↔ r a b ∨ a = b.Relation.TransGen: Transitive closure.TransGen rrelates everythingrrelated transitively. SoTransGen r a b ↔ ∃ x₀ ... xₙ, r a x₀ ∧ r x₀ x₁ ∧ ... ∧ r xₙ b.Relation.ReflTransGen: Reflexive transitive closure.ReflTransGen rrelates everythingrrelated transitively, plus for allait relatesawith itself. SoReflTransGen r a b ↔ (∃ x₀ ... xₙ, r a x₀ ∧ r x₀ x₁ ∧ ... ∧ r xₙ b) ∨ a = b. It is the same as the reflexive closure of the transitive closure, or the transitive closure of the reflexive closure. In terms of rewriting systems, this means thatacan be rewritten tobin a number of rewrites.Relation.EqvGen: Equivalence closure.EqvGen rrelates everythingReflTransGen rrelates, plus for all related pairs it relates them in the opposite order.Relation.Comp: Relation composition. We provide notation∘r. Forr : α → β → Propands : β → γ → Prop,r ∘r srelatesa : αandc : γiff there existsb : βthat's related to both.Relation.Map: Image of a relation under a pair of maps. Forr : α → β → Prop,f : α → γ,g : β → δ,Map r f gis the relationγ → δ → Proprelatingf aandg bfor alla,brelated byr.Relation.Join: Join of a relation. Forr : α → α → Prop,Join r a b ↔ ∃ c, r a c ∧ r b c. In terms of rewriting systems, this means thataandbcan be rewritten to the same term. "}