# HG changeset patch # User paulson # Date 1548081863 0 # Node ID 7a92cbec7030fba1fb9bd4c6df193c5dde216a83 # Parent 82f57315cadeabf25ef8f934d6c3ee7d9ae886b2 new material about summations and powers, along with some tweaks diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Algebra/Divisibility.thy --- a/src/HOL/Algebra/Divisibility.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Algebra/Divisibility.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1991,7 +1991,7 @@ definition somelcm :: "('a,_) monoid_scheme \ 'a \ 'a \ 'a" where "somelcm G a b = (SOME x. x \ carrier G \ x lcmof\<^bsub>G\<^esub> a b)" -definition "SomeGcd G A = inf (division_rel G) A" +definition "SomeGcd G A = Lattice.inf (division_rel G) A" locale gcd_condition_monoid = comm_monoid_cancel + diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Algebra/Group.thy --- a/src/HOL/Algebra/Group.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Algebra/Group.thy Mon Jan 21 14:44:23 2019 +0000 @@ -781,18 +781,13 @@ {h. h \ carrier G \ carrier H \ (\x \ carrier G. \y \ carrier G. h (x \\<^bsub>G\<^esub> y) = h x \\<^bsub>H\<^esub> h y)}" - -(* NEW ========================================================================== *) -lemma hom_trans: +lemma hom_compose: "\ f \ hom G H; g \ hom H I \ \ g \ f \ hom G I" unfolding hom_def by (auto simp add: Pi_iff) -(* ============================================================================== *) -(* NEW ============================================================================ *) lemma (in group) hom_restrict: assumes "h \ hom G H" and "\g. g \ carrier G \ h g = t g" shows "t \ hom G H" using assms unfolding hom_def by (auto simp add: Pi_iff) -(* ============================================================================== *) lemma (in group) hom_compose: "[|h \ hom G H; i \ hom H I|] ==> compose (carrier G) i h \ hom G I" diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Algebra/Lattice.thy --- a/src/HOL/Algebra/Lattice.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Algebra/Lattice.thy Mon Jan 21 14:44:23 2019 +0000 @@ -783,4 +783,7 @@ end +hide_const (open) Lattice.inf +hide_const (open) Lattice.sup + end diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Algebra/Weak_Morphisms.thy --- a/src/HOL/Algebra/Weak_Morphisms.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Algebra/Weak_Morphisms.thy Mon Jan 21 14:44:23 2019 +0000 @@ -220,7 +220,8 @@ have the_elem_hom: "(\x. the_elem (f ` x)) \ hom (G Mod H) (image_group f G)" using weak_group_morphism_is_iso[OF assms] by (simp add: iso_def) have hom: "(\x. the_elem (f ` x)) \ (#>) H \ hom G (image_group f G)" - using hom_trans[OF H.r_coset_hom_Mod the_elem_hom] by simp + using hom_compose[OF H.r_coset_hom_Mod the_elem_hom] + using Group.hom_compose H.r_coset_hom_Mod the_elem_hom by blast have restrict: "\a. a \ carrier G \ ((\x. the_elem (f ` x)) \ (#>) H) a = f a" using weak_group_morphism_range[OF assms] by auto show ?thesis diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Analysis/Bochner_Integration.thy --- a/src/HOL/Analysis/Bochner_Integration.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Analysis/Bochner_Integration.thy Mon Jan 21 14:44:23 2019 +0000 @@ -2127,8 +2127,10 @@ proof - have "r0 n \ n" using \strict_mono r0\ by (simp add: seq_suble) have "(1/2::real)^(r0 n) \ (1/2)^n" by (rule power_decreasing[OF \r0 n \ n\], auto) - then have "(\x. norm(u (r0 (Suc n)) x) \M) < (1/2)^n" using r0(2) less_le_trans by auto - then have "(\x. norm(u (r n) x) \M) < (1/2)^n" unfolding r_def by auto + then have "(\x. norm(u (r0 (Suc n)) x) \M) < (1/2)^n" + using r0(2) less_le_trans by blast + then have "(\x. norm(u (r n) x) \M) < (1/2)^n" + unfolding r_def by auto moreover have "(\\<^sup>+x. norm(u (r n) x) \M) = (\x. norm(u (r n) x) \M)" by (rule nn_integral_eq_integral, auto simp add: integrable_norm[OF assms(1)[of "r n"]]) ultimately show ?thesis by (auto intro: ennreal_lessI) diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Analysis/Brouwer_Fixpoint.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Analysis/Brouwer_Fixpoint.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1770,7 +1770,6 @@ lemmas swap_apply1 = swap_apply(1) lemmas swap_apply2 = swap_apply(2) -lemmas Zero_notin_Suc = zero_notin_Suc_image lemma pointwise_minimal_pointwise_maximal: fixes s :: "(nat \ nat) set" @@ -2273,7 +2272,7 @@ then have "a = enum 0" using \a \ s\ na by (subst enum_0_bot) (auto simp: le_less intro!: less[of a _ n]) then have s_eq: "s - {a} = enum ` Suc ` {.. n}" - using s_eq by (simp add: atMost_Suc_eq_insert_0 insert_ident Zero_notin_Suc in_enum_image subset_eq) + using s_eq by (simp add: atMost_Suc_eq_insert_0 insert_ident zero_notin_Suc_image in_enum_image subset_eq) then have "enum 1 \ s - {a}" by auto then have "upd 0 = n" diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Analysis/Embed_Measure.thy --- a/src/HOL/Analysis/Embed_Measure.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Analysis/Embed_Measure.thy Mon Jan 21 14:44:23 2019 +0000 @@ -149,7 +149,7 @@ assumes [simp]: "inj f" "inj g" shows "embed_measure (embed_measure M f) g = embed_measure M (g \ f)" proof- - have [simp]: "inj (\x. g (f x))" by (subst o_def[symmetric]) (auto intro: inj_comp) + have [simp]: "inj (\x. g (f x))" by (subst o_def[symmetric]) (auto intro: inj_compose) note measurable_embed_measure2[measurable] have "embed_measure (embed_measure M f) g = distr M (embed_measure (embed_measure M f) g) (g \ f)" @@ -158,7 +158,7 @@ also have "... = embed_measure M (g \ f)" by (subst (3) embed_measure_eq_distr, simp add: o_def, rule distr_cong) (auto simp: sets_embed_measure o_def image_image[symmetric] - intro: inj_comp cong: distr_cong) + intro: inj_compose cong: distr_cong) finally show ?thesis . qed diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Fun.thy --- a/src/HOL/Fun.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Fun.thy Mon Jan 21 14:44:23 2019 +0000 @@ -181,7 +181,7 @@ lemma inj_on_strict_subset: "inj_on f B \ A \ B \ f ` A \ f ` B" unfolding inj_on_def by blast -lemma inj_comp: "inj f \ inj g \ inj (f \ g)" +lemma inj_compose: "inj f \ inj g \ inj (f \ g)" by (simp add: inj_def) lemma inj_fun: "inj f \ inj (\x y. f x)" diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Groups_Big.thy --- a/src/HOL/Groups_Big.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Groups_Big.thy Mon Jan 21 14:44:23 2019 +0000 @@ -503,6 +503,26 @@ shows "F g A = F h B" using assms same_carrier [of C A B] by simp +lemma eq_general: + assumes B: "\y. y \ B \ \!x. x \ A \ h x = y" and A: "\x. x \ A \ h x \ B \ \(h x) = \ x" + shows "F \ A = F \ B" +proof - + have eq: "B = h ` A" + by (auto dest: assms) + have h: "inj_on h A" + using assms by (blast intro: inj_onI) + have "F \ A = F (\ \ h) A" + using A by auto + also have "\ = F \ B" + by (simp add: eq reindex h) + finally show ?thesis . +qed + +lemma eq_general_inverses: + assumes B: "\y. y \ B \ k y \ A \ h(k y) = y" and A: "\x. x \ A \ h x \ B \ k(h x) = x \ \(h x) = \ x" + shows "F \ A = F \ B" + by (rule eq_general [where h=h]) (force intro: dest: A B)+ + end diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Int.thy --- a/src/HOL/Int.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Int.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1441,7 +1441,7 @@ apply auto done -lemma infinite_UNIV_int: "\ finite (UNIV::int set)" +lemma infinite_UNIV_int [simp]: "\ finite (UNIV::int set)" proof assume "finite (UNIV::int set)" moreover have "inj (\i::int. 2 * i)" diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Library/FSet.thy --- a/src/HOL/Library/FSet.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Library/FSet.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1302,7 +1302,7 @@ moreover have "inj (inv fset_of_list)" using fset_of_list_surj by (rule surj_imp_inj_inv) ultimately have "inj (to_nat \ inv fset_of_list)" - by (rule inj_comp) + by (rule inj_compose) thus "\to_nat::'a fset \ nat. inj to_nat" by auto qed diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Library/Finite_Map.thy --- a/src/HOL/Library/Finite_Map.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Library/Finite_Map.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1406,7 +1406,7 @@ moreover have "inj (inv fmap_of_list)" using fmap_of_list_surj by (rule surj_imp_inj_inv) ultimately have "inj (to_nat \ inv fmap_of_list)" - by (rule inj_comp) + by (rule inj_compose) thus "\to_nat::('a, 'b) fmap \ nat. inj to_nat" by auto qed diff -r 82f57315cade -r 7a92cbec7030 src/HOL/List.thy --- a/src/HOL/List.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/List.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1517,7 +1517,7 @@ also have "\ = Suc(card(Suc ` ?S))" using fin by (simp add: card_image) also have "\ = card ?S'" using eq fin - by (simp add:card_insert_if) (simp add:image_def) + by (simp add:card_insert_if) finally show ?thesis . next assume "\ p x" diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Nat.thy --- a/src/HOL/Nat.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Nat.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1515,7 +1515,7 @@ assumes "inj f" shows "inj (f^^n)" proof (induction n) - case Suc thus ?case using inj_comp[OF assms Suc.IH] by (simp del: comp_apply) + case Suc thus ?case using inj_compose[OF assms Suc.IH] by (simp del: comp_apply) qed simp lemma surj_fn[simp]: diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Nonstandard_Analysis/StarDef.thy --- a/src/HOL/Nonstandard_Analysis/StarDef.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Nonstandard_Analysis/StarDef.thy Mon Jan 21 14:44:23 2019 +0000 @@ -914,7 +914,7 @@ have "inj (star_of :: 'a \ 'a star)" by (rule injI) simp then have "inj (star_of \ of_nat :: nat \ 'a star)" - using inj_of_nat by (rule inj_comp) + using inj_of_nat by (rule inj_compose) then show "inj (of_nat :: nat \ 'a star)" by (simp add: comp_def) qed diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Power.thy --- a/src/HOL/Power.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Power.thy Mon Jan 21 14:44:23 2019 +0000 @@ -501,6 +501,14 @@ done qed +lemma power_decreasing_iff [simp]: "\0 < b; b < 1\ \ b ^ m \ b ^ n \ n \ m" + using power_strict_decreasing [of m n b] + by (auto intro: power_decreasing ccontr) + +lemma power_strict_decreasing_iff [simp]: "\0 < b; b < 1\ \ b ^ m < b ^ n \ n < m" + using power_decreasing_iff [of b m n] unfolding le_less + by (auto dest: power_strict_decreasing le_neq_implies_less) + lemma power_Suc_less_one: "0 < a \ a < 1 \ a ^ Suc n < 1" using power_strict_decreasing [of 0 "Suc n" a] by simp diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Real_Vector_Spaces.thy --- a/src/HOL/Real_Vector_Spaces.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Real_Vector_Spaces.thy Mon Jan 21 14:44:23 2019 +0000 @@ -322,7 +322,7 @@ instance real_algebra_1 < ring_char_0 proof from inj_of_real inj_of_nat have "inj (of_real \ of_nat)" - by (rule inj_comp) + by (rule inj_compose) then show "inj (of_nat :: nat \ 'a)" by (simp add: comp_def) qed diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Set.thy --- a/src/HOL/Set.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Set.thy Mon Jan 21 14:44:23 2019 +0000 @@ -1857,6 +1857,9 @@ definition pairwise :: "('a \ 'a \ bool) \ 'a set \ bool" where "pairwise R S \ (\x \ S. \y \ S. x \ y \ R x y)" +lemma pairwise_trivial [simp]: "pairwise (\i j. j \ i) I" + by (auto simp: pairwise_def) + lemma pairwiseI [intro?]: "pairwise R S" if "\x y. x \ S \ y \ S \ x \ y \ R x y" using that by (simp add: pairwise_def) diff -r 82f57315cade -r 7a92cbec7030 src/HOL/Set_Interval.thy --- a/src/HOL/Set_Interval.thy Sun Jan 20 17:15:49 2019 +0000 +++ b/src/HOL/Set_Interval.thy Mon Jan 21 14:44:23 2019 +0000 @@ -683,7 +683,7 @@ new elements get indices at the beginning. So it is used to transform \<^term>\{.. to \<^term>\0::nat\ and \<^term>\{..< n}\.\ -lemma zero_notin_Suc_image: "0 \ Suc ` A" +lemma zero_notin_Suc_image [simp]: "0 \ Suc ` A" by auto lemma lessThan_Suc_eq_insert_0: "{..