inductive_set
tree :: "['a ==> 'a set,'a] ==> (nat * 'a) set" for subs :: "'a ==> 'a set"and γ :: 'a
―‹This set represents the nodes in a tree which may represent a proof of @{term γ}.
Only storing the annotation and its level.› where
tree0: "(0,γ) ∈ tree subs γ"
| tree1: "[(n,delta) ∈ tree subs γ; sigma ∈ subs delta] ==> (Suc n,sigma) ∈ tree subs γ"
lemma injIncLevel: "inj incLevel" by (simp add: incLevel_def inj_on_def)
lemma treeEquation: "tree subs γ = insert (0,γ) (∪delta∈subs γ. incLevel ` tree subs delta)" proof - have"a = 0 ∧ b = γ" if"(a, b) ∈ tree subs γ" and"∀x∈subs γ. ∀(n, x) ∈tree subs x. (a, b) ≠ (Suc n, x)" for a b using that Zero_not_Suc by (smt (verit) case_prod_conv tree.cases tree1Eq) thenshow ?thesis by (auto simp: incLevel_def image_iff tree1Eq case_prod_unfold) qed
lemma terminalD: "terminal subs Γ ==> x ~: subs Γ" by(simp add: terminal_def)
― ‹not a good dest rule›
lemma terminalI: "x ∈ subs Γ ==>¬ terminal subs Γ" by(auto simp add: terminal_def)
― ‹not a good intro rule›
subsection"Inherited"
definition
inherited :: "['a ==> 'a set,(nat * 'a) set ==> bool] ==> bool"where "inherited subs P ≡ (∀A B. (P A ∧ P B) = P (A Un B)) ∧ (∀A. P A = P (incLevel ` A)) ∧ (∀n Γ A. ¬(terminal subs Γ) ⟶ P A = P (insert (n,Γ) A)) ∧ (P {})"
― ‹FIXME tjr why does it have to be invariant under inserting nonterminal nodes?›
lemma inheritedUn[rule_format]:"inherited subs P ⟶ P A ⟶ P B ⟶ P (A Un B)" by (auto simp add: inherited_def)
lemma inheritedIncLevel[rule_format]: "inherited subs P ⟶ P A ⟶ P (incLevel ` A)" by (auto simp add: inherited_def)
lemma inheritedEmpty[rule_format]: "inherited subs P ⟶ P {}" by (auto simp add: inherited_def)
lemma inheritedInsert[rule_format]: "inherited subs P ⟶ ~(terminal subs Γ) ⟶ P A ⟶ P (insert (n,Γ) A)" by (auto simp add: inherited_def)
lemma inheritedI[rule_format]: "[∀A B . (P A ∧ P B) = P (A Un B); ∀A . P A = P (incLevel ` A); ∀n Γ A . ~(terminal subs Γ) ⟶ P A = P (insert (n,Γ) A); P {}]==> inherited subs P" by (simp add: inherited_def)
(* These only for inherited join, and a few more places... *) lemma inheritedUnEq[rule_format, symmetric]: "inherited subs P ⟶ (P A ∧ P B) = P (A Un B)" by (auto simp add: inherited_def)
lemma inheritedIncLevelEq[rule_format, symmetric]: "inherited subs P ⟶ P A = P (incLevel ` A)" by (auto simp add: inherited_def)
lemma inheritedInsertEq[rule_format, symmetric]: "inherited subs P ⟶ ~(terminal subs Γ) ⟶ P A = P (insert (n,Γ) A)" by (auto simp add: inherited_def)
lemma inheritedUNEq: "finite A ==> inherited subs P ==> (∀x∈A. P (B x)) = P (∪ a∈A. B a)" by (induction rule: finite_induct) (simp_all add: inherited_def)
lemma boundedUn: "bounded (A Un B) ⟷ (bounded A ∧ bounded B)" by (metis boundedByAdd1 boundedByAdd2 boundedByUn bounded_def)
lemma boundedIncLevel: "bounded (incLevel` A) ⟷ (bounded A)" by (meson boundedByIncLevel' boundedBySuc' bounded_def)
lemma boundedInsert: "bounded (insert a B) ⟷ (bounded B)" proof (cases a) case (Pair a b) thenshow ?thesis by (metis Un_insert_left Un_insert_right boundedByEmpty boundedByInsert boundedUn
bounded_def lessI) qed
lemma failingSubSubs: "[inherited subs P; ¬ P (tree subs γ); ¬ terminal subs γ; fans subs] ==> failingSub subs P γ ∈ subs γ" by (simp add: failingSubProps)
primrec path :: "['a ==> 'a set,'a,(nat * 'a) set ==> bool,nat] ==> 'a" where
path0: "path subs γ P 0 = γ"
| pathSuc: "path subs γ P (Suc n) = (if terminal subs (path subs γ P n) then path subs γ P n else failingSub subs P (path subs γ P n))"
lemma pathFailsP: "[inherited subs P; fans subs; ¬ P (tree subs γ)] ==>¬ P (tree subs (path subs γ P n))" by (induction n) (simp_all add: failingSubProps)
lemmas PpathE = pathFailsP[THENnotE]
lemma pathTerminal: "[inherited subs P; fans subs; terminal subs γ] ==> terminal subs (path subs γ P n)" by (induct n, simp_all)
lemma pathStarts: "path subs γ P 0 = γ" by simp
lemma pathSubs: "[inherited subs P; fans subs; ¬ P (tree subs γ); ¬ terminal subs (path subs γ P n)] ==> path subs γ P (Suc n) ∈ subs (path subs γ P n)" by (metis PpathE failingSubSubs pathSuc)
lemma pathStops: "terminal subs (path subs γ P n) ==> path subs γ P (Suc n) = path subs γ P n" by simp
subsection"Branch"
definition
branch :: "['a ==> 'a set,'a,nat ==> 'a] ==> bool"where "branch subs Γ f ⟷ f 0 = Γ ∧ (!n . terminal subs (f n) ⟶ f (Suc n) = f n) ∧ (!n . ¬ terminal subs (f n) ⟶ f (Suc n) ∈ subs (f n))"
lemma branch0: "branch subs Γ f ==> f 0 = Γ" by (simp add: branch_def)
lemma branchStops: "branch subs Γ f ==> terminal subs (f n) ==> f (Suc n) = f n" by (simp add: branch_def)
lemma branchSubs: "branch subs Γ f ==>¬ terminal subs (f n) ==> f (Suc n) ∈ subs (f n)" by (simp add: branch_def)
lemma branchTerminalPropagates: "branch subs Γ f ==> terminal subs (f m) ==> terminal subs (f (m + n))" by (induct n, simp_all add: branchStops)
lemma branchTerminalMono: "branch subs Γ f ==> m < n ==> terminal subs (f m) ==> terminal subs (f n)" by (metis branchTerminalPropagates
canonically_ordered_monoid_add_class.lessE)
― ‹we work hard to use nothing fancier than induction over naturals›
lemma boundedTreeInduction': "[ fans subs; ∀delta. ¬ terminal subs delta ⟶ (∀sigma ∈ subs delta. P sigma) ⟶ P delta ] ==>∀Γ. boundedBy m (tree subs Γ) ⟶ founded subs P (tree subs Γ) ⟶ P Γ" proof (induction m) case0 thenshow ?caseby (metis boundedBy0 empty_iff tree.tree0) next case (Suc m) thenshow ?caseby (metis boundedBySuc foundedD foundedSubs) qed
― ‹tjr tidied and introduced new lemmas›
lemma boundedTreeInduction: "[fans subs; bounded (tree subs Γ); founded subs P (tree subs Γ); ∧delta. [¬ terminal subs delta; (∀sigma ∈ subs delta. P sigma)]==> P delta ]==> P Γ" by (metis boundedTreeInduction' bounded_def)
lemma boundedTreeInduction2: "[fans subs; ∀delta. (∀sigma ∈ subs delta. P sigma) ⟶ P delta] ==> boundedBy m (tree subs Γ) ⟶ P Γ" proof (induction m arbitrary: Γ) case0 thenshow ?caseby (metis boundedBy0 empty_iff tree.tree0) next case (Suc m) thenshow ?caseby (metis boundedBySuc) qed
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.