diff --git a/src/HOL/Analysis/Metric_Arith.thy b/src/HOL/Analysis/Metric_Arith.thy --- a/src/HOL/Analysis/Metric_Arith.thy +++ b/src/HOL/Analysis/Metric_Arith.thy @@ -1,103 +1,109 @@ (* Title: Metric_Arith.thy Author: Maximilian Schäffeler (port from HOL Light) *) section \A decision procedure for metric spaces\ theory Metric_Arith imports HOL.Real_Vector_Spaces begin +text \ +A port of the decision procedure ``Formalization of metric spaces in HOL Light'' +@{cite "DBLP:journals/jar/Maggesi18"} for the type class @{class metric_space}, +with the \Argo\ solver as backend. +\ + named_theorems metric_prenex named_theorems metric_nnf named_theorems metric_unfold named_theorems metric_pre_arith lemmas pre_arith_simps = max.bounded_iff max_less_iff_conj le_max_iff_disj less_max_iff_disj simp_thms HOL.eq_commute declare pre_arith_simps [metric_pre_arith] lemmas unfold_simps = Un_iff subset_iff disjoint_iff_not_equal Ball_def Bex_def declare unfold_simps [metric_unfold] declare HOL.nnf_simps(4) [metric_prenex] lemma imp_prenex [metric_prenex]: "\P Q. (\x. P x) \ Q \ \x. (P x \ Q)" "\P Q. P \ (\x. Q x) \ \x. (P \ Q x)" "\P Q. (\x. P x) \ Q \ \x. (P x \ Q)" "\P Q. P \ (\x. Q x) \ \x. (P \ Q x)" by simp_all lemma ex_prenex [metric_prenex]: "\P Q. (\x. P x) \ Q \ \x. (P x \ Q)" "\P Q. P \ (\x. Q x) \ \x. (P \ Q x)" "\P Q. (\x. P x) \ Q \ \x. (P x \ Q)" "\P Q. P \ (\x. Q x) \ \x. (P \ Q x)" "\P. \(\x. P x) \ \x. \P x" by simp_all lemma all_prenex [metric_prenex]: "\P Q. (\x. P x) \ Q \ \x. (P x \ Q)" "\P Q. P \ (\x. Q x) \ \x. (P \ Q x)" "\P Q. (\x. P x) \ Q \ \x. (P x \ Q)" "\P Q. P \ (\x. Q x) \ \x. (P \ Q x)" "\P. \(\x. P x) \ \x. \P x" by simp_all lemma nnf_thms [metric_nnf]: "(\ (P \ Q)) = (\ P \ \ Q)" "(\ (P \ Q)) = (\ P \ \ Q)" "(P \ Q) = (\ P \ Q)" "(P = Q) \ (P \ \ Q) \ (\ P \ Q)" "(\ (P = Q)) \ (\ P \ \ Q) \ (P \ Q)" "(\ \ P) = P" by blast+ lemmas nnf_simps = nnf_thms linorder_not_less linorder_not_le declare nnf_simps[metric_nnf] lemma Sup_insert_insert: fixes a::real shows "Sup (insert a (insert b s)) = Sup (insert (max a b) s)" by (simp add: Sup_real_def) lemma real_abs_dist: "\dist x y\ = dist x y" by simp lemma maxdist_thm [THEN HOL.eq_reflection]: assumes "finite s" "x \ s" "y \ s" defines "\a. f a \ \dist x a - dist a y\" shows "dist x y = Sup (f ` s)" proof - have "dist x y \ Sup (f ` s)" proof - have "finite (f ` s)" by (simp add: \finite s\) moreover have "\dist x y - dist y y\ \ f ` s" by (metis \y \ s\ f_def imageI) ultimately show ?thesis using le_cSup_finite by simp qed also have "Sup (f ` s) \ dist x y" using \x \ s\ cSUP_least[of s f] abs_dist_diff_le unfolding f_def by blast finally show ?thesis . qed theorem metric_eq_thm [THEN HOL.eq_reflection]: "x \ s \ y \ s \ x = y \ (\a\s. dist x a = dist y a)" by auto ML_file "metricarith.ml" method_setup metric = \ Scan.succeed (SIMPLE_METHOD' o MetricArith.metric_arith_tac) \ "prove simple linear statements in metric spaces (\\\<^sub>p fragment)" end \ No newline at end of file diff --git a/src/HOL/Analysis/document/root.bib b/src/HOL/Analysis/document/root.bib --- a/src/HOL/Analysis/document/root.bib +++ b/src/HOL/Analysis/document/root.bib @@ -1,11 +1,26 @@ @article{dugundji, author = {J. Dugundji}, title = {An extension of {Tietze's} theorem}, journal = {Pacific J. Math.}, pages = {353-367}, volume = 1, number = 3, year = 1951, url = {https://projecteuclid.org/euclid.pjm/1103052106}} +@article{DBLP:journals/jar/Maggesi18, + author = {Marco Maggesi}, + title = {A Formalization of Metric Spaces in {HOL} Light}, + journal = {J. Autom. Reasoning}, + volume = {60}, + number = {2}, + pages = {237--254}, + year = {2018}, + url = {https://doi.org/10.1007/s10817-017-9412-x}, + doi = {10.1007/s10817-017-9412-x}, + timestamp = {Thu, 25 Jan 2018 11:13:11 +0100}, + biburl = {https://dblp.org/rec/bib/journals/jar/Maggesi18}, + bibsource = {dblp computer science bibliography, https://dblp.org} +} + @misc{dummy}