Theory Relation_Extra
theory Relation_Extra
imports HOL.Relation
begin
lemma [simp]: "transp_on {} R"
by (auto intro: transp_onI)
lemma [simp]: "asymp_on {} R"
by (auto intro: asymp_onI)
lemma :
assumes tot: "totalp_on N R" and x_in: "x ∈ N"
shows "N = {y ∈ N. R y x} ∪ {x} ∪ {y ∈ N. R x y}"
proof (intro Set.equalityI Set.subsetI)
fix z assume "z ∈ N"
hence "R z x ∨ z = x ∨ R x z"
using tot[THEN totalp_onD] x_in by auto
thus "z ∈ {y ∈ N. R y x} ∪ {x} ∪ {y ∈ N. R x y}"
using ‹z ∈ N› by auto
next
fix z assume "z ∈ {y ∈ N. R y x} ∪ {x} ∪ {y ∈ N. R x y}"
hence "z ∈ N ∨ z = x"
by auto
thus "z ∈ N"
using x_in by auto
qed
end