(* Title: Example_Metric.thy Author: Maximilian Schäffeler *) theory Example_Metric imports"HOL-Analysis.Metric_Arith""HOL-Eisbach.Eisbach_Tools" begin
text‹An Eisbach implementation of the method @{method metric}. Slower than the Isabelle/ML implementation but arguably more readable.›
method rewr_maxdist for ps::"'a::metric_space set"uses pos_thms =
match conclusion in "?P (dist x y)" (cut) for x y::'a ==>‹ simp only: maxdist_thm[where s=ps and x=x and y=y] simp_thms finite.emptyI finite_insert empty_iff insert_iff; rewr_maxdist ps pos_thms: pos_thms zero_le_dist[of x y]› ∣ _ ==>‹ ball_simp?; dist_refl_sym?; elim_sup?; pre_arith argo_thms: pos_thms›
lemmas metric_eq_thm = metric_eq_thm🍋‹normalizes indexnames›
method rewr_metric_eq for ps::"'a::metric_space set" =
match conclusion in "?P (x = y)" (cut) for x y::'a ==>‹ simp only: metric_eq_thm[where s=ps and x=x and y=y] simp_thms empty_iff insert_iff; rewr_metric_eq ps› ∣ _ ==>‹-›
method find_points for ps::"'a::metric_space set"and t::bool =
match (t) in "Q p" (cut) for p::'a and Q::"'a==>bool"==>‹ find_points ‹insert p ps›‹∀p. Q p›\› ∣ _ ==>‹ rewr_metric_eq ps; rewr_maxdist ps›
method basic_metric_arith for p::"'a::metric_space" =
dist_refl_sym?;
match conclusion in "Q q" (cut) for q::'a and Q ==>‹ find_points ‹{q}›‹∀p. Q p›\› ∣ _ ==>‹ rewr_metric_eq ‹{}::'a set›; rewr_maxdist ‹{}::'a set›\›
method elim_exists for p::"'a::metric_space" =
elim_exists_loop p;
basic_metric_arith p
method find_type =
match conclusion in (* exists in front *) "∃x::'a::metric_space. ?P x"==>‹ match conclusion in "?Q x" (cut) for x::"'a::metric_space" ==>‹elim_exists x› ∣ _ ==>‹ rule exI; match conclusion in "?Q x" (cut) for x::"'a::metric_space" ==>‹elim_exists x›\›\ (* no exists *) ∣"?P (λy. (dist x y))" (cut) for x::"'a::metric_space"==>‹elim_exists x› ∣"?P (λx. (dist x y))" (cut) for y::"'a::metric_space"==>‹elim_exists y› ∣"?P (λy. (x = y))" (cut) for x::"'a::metric_space"==>‹elim_exists x› ∣"?P (λx. (x = y))" (cut) for y::"'a::metric_space"==>‹elim_exists y› ∣ _ ==>‹ rule exI; find_type›
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.