definition
ntree_rec :: "[[i, i, i] → i, i] → i"where "ntree_rec(b) ≡ Vrecursor(λpr. ntree_case(λx h. b(x, h, λi ∈ domain(h). pr`(h`i))))"
definition
ntree_copy :: "i → i"where "ntree_copy(z) ≡ ntree_rec(λx h r. Branch(x,r), z)"
text‹ \medskip‹ntree› ›
lemma ntree_unfold: "ntree(A) = A × (∪n ∈ nat. n -> ntree(A))" by (blast intro: ntree.intros [unfolded ntree.con_defs]
elim: ntree.cases [unfolded ntree.con_defs])
lemma ntree_induct [consumes 1, case_names Branch, induct set: ntree]: assumes t: "t ∈ ntree(A)" and step: "∧x n h. [x ∈ A; n ∈ nat; h ∈ n -> ntree(A); ∀i ∈ n. P(h`i) \<rbrakk> ==> P(Branch(x,h))" shows"P(t)" ―‹A nicer induction rule than the standard one.› using t apply induct apply (erule UN_E) apply (assumption | rule step)+ apply (fast elim: fun_weaken_type) apply (fast dest: apply_type) done
lemma ntree_induct_eqn [consumes 1]: assumes t: "t ∈ ntree(A)" and f: "f ∈ ntree(A)->B" and g: "g ∈ ntree(A)->B" and step: "∧x n h. [x ∈ A; n ∈ nat; h ∈ n -> ntree(A); f O h = g O h]==> f ` Branch(x,h) = g ` Branch(x,h)" shows"f`t=g`t" ―‹Induction on term‹ntree(A)› to prove an equation› using t apply induct apply (assumption | rule step)+ apply (insert f g) apply (rule fun_extension) apply (assumption | rule comp_fun)+ apply (simp add: comp_fun_apply) done
text‹ \medskip Lemmas to justify using ‹Ntree› in other recursive
type definitions. ›
lemma ntree_copy_is_ident: "z ∈ ntree(A) ==> ntree_copy(z) = z" by (induct z set: ntree)
(auto simp add: domain_of_fun Pi_Collect_iff fun_is_function)
text‹ \medskip‹maptree› ›
lemma maptree_unfold: "maptree(A) = A × (maptree(A) -||> maptree(A))" by (fast intro!: maptree.intros [unfolded maptree.con_defs]
elim: maptree.cases [unfolded maptree.con_defs])
lemma maptree_induct [consumes 1, induct set: maptree]: assumes t: "t ∈ maptree(A)" and step: "∧x n h. [x ∈ A; h ∈ maptree(A) -||> maptree(A); ∀y ∈ field(h). P(y) \<rbrakk> ==> P(Sons(x,h))" shows"P(t)" ―‹A nicer induction rule than the standard one.› using t apply induct apply (assumption | rule step)+ apply (erule Collect_subset [THEN FiniteFun_mono1, THEN subsetD]) apply (drule FiniteFun.dom_subset [THEN subsetD]) apply (drule Fin.dom_subset [THEN subsetD]) apply fast done
text‹ \medskip‹maptree2› ›
lemma maptree2_unfold: "maptree2(A, B) = A × (B -||> maptree2(A, B))" by (fast intro!: maptree2.intros [unfolded maptree2.con_defs]
elim: maptree2.cases [unfolded maptree2.con_defs])
lemma maptree2_induct [consumes 1, induct set: maptree2]: assumes t: "t ∈ maptree2(A, B)" and step: "∧x n h. [x ∈ A; h ∈ B -||> maptree2(A,B); ∀y ∈ range(h). P(y) \<rbrakk> ==> P(Sons2(x,h))" shows"P(t)" using t apply induct apply (assumption | rule step)+ apply (erule FiniteFun_mono [OF subset_refl Collect_subset, THEN subsetD]) apply (drule FiniteFun.dom_subset [THEN subsetD]) apply (drule Fin.dom_subset [THEN subsetD]) apply fast done
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-06-30)
¤
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.