section‹Transitive Closure of Successor List Function›
theory RTranCl imports Main begin
text‹The reflexive transitive closure of a relation induced by a
of type @{typ"'a → 'a list"}. Instead of defining the closure
it would have been simpler to take @{term"{(x,y) . y ∈ set(f x)}*"}.›
lemma RTranCl_induct(*<*) [induct set: RTranCl, consumes 1, case_names refl succs] (*>*): "(h, h') ∈ RTranCl succs ==> P h ==> (∧g g'. g' ∈ set (succs g) ==> P g ==> P g') ==> P h'" proof - assume s: "∧g g'. g' ∈ set (succs g) ==> P g ==> P g'" assume"(h, h') ∈ RTranCl succs""P h" thenshow"P h'" proof (induct rule: RTranCl.induct) fix g assume"P g"thenshow"P g" . next fix g g' g'' assume IH: "P g' ==> P g''" assume"g' ∈ set(succs g)""P g" thenhave"P g'"by (rule s) thenshow"P g''"by (rule IH) qed qed
definition invariant :: "('a → bool) → ('a → 'a list) → bool" where "invariant P succs ≡∀g g'. g' ∈ set(succs g) ⟶ P g ⟶ P g'"
lemma invariantE: "invariant P succs ==> g [succs]→ g' ==> P g ==> P g'" by(simp add:invariant_def)
lemma inv_subset: "invariant P f ==> (∧g. P g ==> set(f' g) ⊆ set(f g)) ==> invariant P f'" by(auto simp:invariant_def)
lemma RTranCl_inv: "invariant P succs ==> (g,g') ∈ RTranCl succs ==> P g ==> P g'" by (erule RTranCl_induct)(auto simp:invariant_def)
lemma RTranCl_subset2: assumes a: "(s,g) : RTranCl f" shows"(∧g. (s,g) ∈ RTranCl f ==> set(f g) ⊆ set(h g)) ==> (s,g) : RTranCl h" using a proof (induct rule: RTranCl.induct) case refl show ?caseby(rule RTranCl.intros) next case succs thus ?caseby(blast intro: RTranCl.intros) qed
end
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet am 2026-09-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.