# HG changeset patch # User paulson # Date 1584201531 0 # Node ID 66bc4b668d6ed078ffa16c97e5ae987c17588381 # Parent 317e9ebbc3e1ef90c8fb992ec4d488a9f97ea623 tidied up a few little proofs diff -r 317e9ebbc3e1 -r 66bc4b668d6e src/HOL/Hilbert_Choice.thy --- a/src/HOL/Hilbert_Choice.thy Thu Mar 12 23:05:11 2020 +0100 +++ b/src/HOL/Hilbert_Choice.thy Sat Mar 14 15:58:51 2020 +0000 @@ -57,6 +57,10 @@ apply (erule someI) done +lemma some_eq_imp: + assumes "Eps P = a" "P b" shows "P a" + using assms someI_ex by force + text \ Easier to apply than \someI\ because the conclusion has only one occurrence of \<^term>\P\. diff -r 317e9ebbc3e1 -r 66bc4b668d6e src/HOL/Real_Vector_Spaces.thy --- a/src/HOL/Real_Vector_Spaces.thy Thu Mar 12 23:05:11 2020 +0100 +++ b/src/HOL/Real_Vector_Spaces.thy Sat Mar 14 15:58:51 2020 +0000 @@ -277,7 +277,7 @@ by (simp add: of_real_def scaleR_left_diff_distrib) lemma of_real_mult [simp]: "of_real (x * y) = of_real x * of_real y" - by (simp add: of_real_def mult.commute) + by (simp add: of_real_def) lemma of_real_sum[simp]: "of_real (sum f s) = (\x\s. of_real (f x))" by (induct s rule: infinite_finite_induct) auto @@ -1365,7 +1365,7 @@ lemma sgn_mult: "sgn (x * y) = sgn x * sgn y" for x y :: "'a::real_normed_div_algebra" - by (simp add: sgn_div_norm norm_mult mult.commute) + by (simp add: sgn_div_norm norm_mult) hide_fact (open) sgn_mult diff -r 317e9ebbc3e1 -r 66bc4b668d6e src/HOL/Wellfounded.thy --- a/src/HOL/Wellfounded.thy Thu Mar 12 23:05:11 2020 +0100 +++ b/src/HOL/Wellfounded.thy Sat Mar 14 15:58:51 2020 +0000 @@ -724,17 +724,20 @@ text \Inverse Image\ -lemma wf_inv_image [simp,intro!]: "wf r \ wf (inv_image r f)" - for f :: "'a \ 'b" - apply (simp add: inv_image_def wf_eq_minimal) - apply clarify - apply (subgoal_tac "\w::'b. w \ {w. \x::'a. x \ Q \ f x = w}") - prefer 2 - apply (blast del: allE) - apply (erule allE) - apply (erule (1) notE impE) - apply blast - done +lemma wf_inv_image [simp,intro!]: + fixes f :: "'a \ 'b" + assumes "wf r" + shows "wf (inv_image r f)" +proof (clarsimp simp: inv_image_def wf_eq_minimal) + fix P and x::'a + assume "x \ P" + then obtain w where w: "w \ {w. \x::'a. x \ P \ f x = w}" + by auto + have *: "\Q u. u \ Q \ \z\Q. \y. (y, z) \ r \ y \ Q" + using assms by (auto simp add: wf_eq_minimal) + show "\z\P. \y. (f y, f z) \ r \ y \ P" + using * [OF w] by auto +qed text \Measure functions into \<^typ>\nat\\ diff -r 317e9ebbc3e1 -r 66bc4b668d6e src/HOL/Wfrec.thy --- a/src/HOL/Wfrec.thy Thu Mar 12 23:05:11 2020 +0100 +++ b/src/HOL/Wfrec.thy Sat Mar 14 15:58:51 2020 +0000 @@ -96,15 +96,17 @@ by (simp add: same_fst_def) lemma wf_same_fst: - assumes prem: "\x. P x \ wf (R x)" + assumes "\x. P x \ wf (R x)" shows "wf (same_fst P R)" - apply (simp cong del: imp_cong add: wf_def same_fst_def) - apply (intro strip) - apply (rename_tac a b) - apply (case_tac "wf (R a)") - apply (erule_tac a = b in wf_induct) - apply blast - apply (blast intro: prem) - done +proof (clarsimp simp add: wf_def same_fst_def) + fix Q a b + assume *: "\a b. (\x. P a \ (x,b) \ R a \ Q (a,x)) \ Q (a,b)" + show "Q(a,b)" + proof (cases "wf (R a)") + case True + then show ?thesis + by (induction b rule: wf_induct_rule) (use * in blast) + qed (use * assms in blast) +qed end