# HG changeset patch # User paulson # Date 1671575076 0 # Node ID 6969d0ffc576cf5edbb819c46fa3ead6e4881830 # Parent 5364cdc3ec0ed2b5562f989a4150d073b75fa588# Parent b1d57dd345e1b4395ee003d2ff03573a3a5df312 merged diff -r 5364cdc3ec0e -r 6969d0ffc576 src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Tue Dec 20 19:43:55 2022 +0100 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Tue Dec 20 22:24:36 2022 +0000 @@ -1526,6 +1526,47 @@ qed +lemma norm_Ln_le: + fixes z :: complex + assumes "norm z < 1/2" + shows "norm (Ln(1+z)) \ 2 * norm z" +proof - + have sums: "(\n. - ((- z) ^ n) / of_nat n) sums ln (1 + z)" + by (intro Ln_series') (use assms in auto) + have summable: "summable (\n. norm (- ((- z) ^ n / of_nat n)))" + using ln_series'[of "-norm z"] assms + by (simp add: sums_iff summable_minus_iff norm_power norm_divide) + + have "norm (ln (1 + z)) = norm (\n. -((-z) ^ n / of_nat n))" + using sums by (simp add: sums_iff) + also have "\ \ (\n. norm (-((-z) ^ n / of_nat n)))" + using summable by (rule summable_norm) + also have "\ = (\n. norm (-((-z) ^ Suc n / of_nat (Suc n))))" + using summable by (subst suminf_split_head) auto + also have "\ \ (\n. norm z * (1 / 2) ^ n)" + proof (rule suminf_le) + show "summable (\n. norm z * (1 / 2) ^ n)" + by (intro summable_mult summable_geometric) auto + next + show "summable (\n. norm (- ((- z) ^ Suc n / of_nat (Suc n))))" + using summable by (subst summable_Suc_iff) + next + fix n + have "norm (-((-z) ^ Suc n / of_nat (Suc n))) = norm z * (norm z ^ n / real (Suc n))" + by (simp add: norm_power norm_divide norm_mult del: of_nat_Suc) + also have "\ \ norm z * ((1 / 2) ^ n / 1)" + using assms by (intro mult_left_mono frac_le power_mono) auto + finally show "norm (- ((- z) ^ Suc n / of_nat (Suc n))) \ norm z * (1 / 2) ^ n" + by simp + qed + also have "\ = norm z * (\n. (1 / 2) ^ n)" + by (subst suminf_mult) (auto intro: summable_geometric) + also have "(\n. (1 / 2 :: real) ^ n) = 2" + using geometric_sums[of "1 / 2 :: real"] by (simp add: sums_iff) + finally show ?thesis + by (simp add: mult_ac) +qed + subsection\<^marker>\tag unimportant\\Quadrant-type results for Ln\ lemma cos_lt_zero_pi: "pi/2 < x \ x < 3*pi/2 \ cos x < 0" @@ -1796,6 +1837,218 @@ finally show ?thesis . qed +lemma norm_Ln_times_le: + assumes "w \ 0" "z \ 0" + shows "cmod (Ln(w * z)) \ cmod (Ln(w) + Ln(z))" +proof (cases "- pi < Im(Ln w + Ln z) \ Im(Ln w + Ln z) \ pi") + case True + then show ?thesis + by (simp add: Ln_times_simple assms) +next + case False + then show ?thesis + by (smt (verit) Im_Ln_le_pi assms cmod_Im_le_iff exp_Ln exp_add ln_unique mpi_less_Im_Ln mult_eq_0_iff norm_exp_eq_Re) +qed + +corollary norm_Ln_prod_le: + fixes f :: "'a \ complex" + assumes "\x. x \ A \ f x \ 0" + shows "cmod (Ln (prod f A)) \ (\x \ A. cmod (Ln (f x)))" + using assms +proof (induction A rule: infinite_finite_induct) + case (insert x A) + then show ?case + by simp (smt (verit) norm_Ln_times_le norm_triangle_ineq prod_zero_iff) +qed auto + +lemma norm_Ln_exp_le: "norm (Ln (exp z)) \ norm z" + by (smt (verit) Im_Ln_le_pi Ln_exp Re_Ln cmod_Im_le_iff exp_not_eq_zero ln_exp mpi_less_Im_Ln norm_exp_eq_Re) + +subsection\<^marker>\tag unimportant\\Uniform convergence and products\ + +(* TODO: could be generalised perhaps, but then one would have to do without the ln *) +lemma uniformly_convergent_on_prod_aux: + fixes f :: "nat \ complex \ complex" + assumes norm_f: "\n x. x \ A \ norm (f n x) < 1" + assumes cont: "\n. continuous_on A (f n)" + assumes conv: "uniformly_convergent_on A (\N x. \nN x. \nN x. \n \\<^sub>\\<^sub>0" if "x \ A" for n x + proof + assume "f n x + 1 \ \\<^sub>\\<^sub>0" + then obtain t where t: "t \ 0" "f n x + 1 = of_real t" + by (auto elim!: nonpos_Reals_cases) + hence "f n x = of_real (t - 1)" + by (simp add: algebra_simps) + also have "norm \ \ 1" + using t by (subst norm_of_real) auto + finally show False + using norm_f[of x n] that by auto + qed + thus "\\<^sub>F n in sequentially. continuous_on A (\x. \n S ` A \ y \ cball 0 1}" + have "compact B" + unfolding B_def by (intro compact_sums compact_continuous_image cont' A) auto + + have "uniformly_convergent_on A (\N x. exp ((\ncompact B\ by (auto dest: compact_imp_closed) + show "uniformly_continuous_on B exp" + by (intro compact_uniformly_continuous continuous_intros \compact B\) + + have "eventually (\N. \x\A. dist (\nN. \x\A. (\n B) sequentially" + proof eventually_elim + case (elim N) + show "\x\A. (\n B" + proof safe + fix x assume x: "x \ A" + have "(\nnn ball 0 1" + using elim x by (auto simp: dist_norm norm_minus_commute) + ultimately show "(\n B" + unfolding B_def using x by fastforce + qed + qed + qed + also have "?this \ uniformly_convergent_on A (\N x. \n A" + have "exp (\nn = (\n {.. -1" + using norm_f[of x n] x by auto + thus "exp (ln (1 + f n x)) = 1 + f n x" + by (simp add: add_eq_0_iff) + qed auto + finally show "exp (\nn complex \ complex" + assumes cont: "\n. continuous_on A (f n)" + assumes A: "compact A" + assumes conv_sum: "uniformly_convergent_on A (\N x. \nN x. \nn x. n \ M \ x \ A \ norm (f n x) < 1 / 2" + proof - + from conv_sum have "uniformly_Cauchy_on A (\N x. \n 0" + by simp + ultimately obtain M where M: + "\x m n. x \ A \ m \ M \ n \ M \ dist (\kk M" "x \ A" + have "dist (\kkkkN x. \n 2 * norm (f (n + M) x)" if "x \ A" for n x + by (rule norm_Ln_le) (use M[of "n + M" x] that in auto) + have *: "filterlim (\n. n + M) at_top at_top" + by (rule filterlim_add_const_nat_at_top) + have "uniformly_convergent_on A (\N x. 2 * ((\nnN x. 2 * ((\nnN x. \nnnn\{.. = (\nn. n + M" "\n. n - M"]) auto + finally show "?lhs N x = ?rhs N x" + by (simp add: sum_distrib_left) + qed + finally show "uniformly_convergent_on A (\N x. \nN x. \n A" for n x + using M[of "n + M" x] that by simp + qed (use M assms conv in auto) + + then obtain S where S: "uniform_limit A (\N x. \nN x. (\nnx. (\nx. \nN x. (\nnN x. (\nnN x. (\nnn\{M..n. n - M" "\n. n + M"]) auto + also have "(\n = (\n\{..{M.. {M..nnnN x. \nN x. \n ?thesis" + proof (rule uniformly_convergent_cong) + show "eventually (\x. \y\A. (\nn complex \ complex" + assumes cont: "\n. continuous_on A (f n)" + assumes A: "compact A" + assumes conv_sum: "uniformly_convergent_on A (\N x. \nN x. \nN x. \nauto intro!: continuous_intros\) + thus ?thesis + by simp +qed + subsection\The Argument of a Complex Number\ text\Unlike in HOL Light, it's defined for the same interval as the complex logarithm: \(-\,\]\.\ @@ -2623,7 +2876,6 @@ qed qed - subsection\<^marker>\tag unimportant\\Some Limits involving Logarithms\ lemma lim_Ln_over_power: diff -r 5364cdc3ec0e -r 6969d0ffc576 src/HOL/Analysis/Infinite_Products.thy --- a/src/HOL/Analysis/Infinite_Products.thy Tue Dec 20 19:43:55 2022 +0100 +++ b/src/HOL/Analysis/Infinite_Products.thy Tue Dec 20 22:24:36 2022 +0000 @@ -118,6 +118,48 @@ shows "f has_prod s \ s = prodinf f" by (simp add: has_prod_unique2 prodinf_def the_equality) +lemma has_prod_eq_0_iff: + fixes f :: "nat \ 'a :: {semidom, comm_semiring_1, t2_space}" + assumes "f has_prod P" + shows "P = 0 \ 0 \ range f" +proof + assume "0 \ range f" + then obtain N where N: "f N = 0" + by auto + have "eventually (\n. n > N) at_top" + by (rule eventually_gt_at_top) + hence "eventually (\n. (\kn. \k 0" + by (simp add: tendsto_eventually) + moreover have "(\n. \k P" + using assms by (metis N calculation prod_defs(2) raw_has_prod_eq_0 zero_le) + ultimately show "P = 0" + using tendsto_unique by force +qed (use assms in \auto simp: has_prod_def\) + +lemma has_prod_0D: + fixes f :: "nat \ 'a :: {semidom, comm_semiring_1, t2_space}" + shows "f has_prod 0 \ 0 \ range f" + using has_prod_eq_0_iff[of f 0] by auto + +lemma has_prod_zeroI: + fixes f :: "nat \ 'a :: {semidom, comm_semiring_1, t2_space}" + assumes "f has_prod P" "f n = 0" + shows "P = 0" + using assms by (auto simp: has_prod_eq_0_iff) + +lemma raw_has_prod_in_Reals: + assumes "raw_has_prod (complex_of_real \ z) M p" + shows "p \ \" + using assms by (auto simp: raw_has_prod_def real_lim_sequentially) + +lemma raw_has_prod_of_real_iff: "raw_has_prod (complex_of_real \ z) M (of_real p) \ raw_has_prod z M p" + by (auto simp: raw_has_prod_def tendsto_of_real_iff simp flip: of_real_prod) + +lemma convergent_prod_of_real_iff: "convergent_prod (complex_of_real \ z) \ convergent_prod z" + by (smt (verit, best) Reals_cases convergent_prod_def raw_has_prod_in_Reals raw_has_prod_of_real_iff) + lemma convergent_prod_altdef: fixes f :: "nat \ 'a :: {t2_space,comm_semiring_1}" shows "convergent_prod f \ (\M L. (\n\M. f n \ 0) \ (\n. \i\n. f (i+M)) \ L \ L \ 0)" @@ -1394,6 +1436,25 @@ shows "(\n. f (Suc n)) = prodinf f / f 0" using prodinf_split_initial_segment[of 1] assms by simp +lemma has_prod_ignore_initial_segment': + assumes "convergent_prod f" + shows "f has_prod ((\kk. f (k + n)))" +proof (cases "\kki. f (i + n)) has_prod (prodinf f / prod f {..k. f (k + n))" + using False by (simp add: has_prod_iff divide_simps mult_ac) + thus ?thesis + using assms by (simp add: convergent_prod_has_prod_iff) +qed + end context @@ -1745,53 +1806,29 @@ assumes z: "summable (\k. norm (z k))" and non0: "\k. z k \ -1" shows "convergent_prod (\k. 1 + z k)" proof - - note if_cong [cong] power_Suc [simp del] - obtain N where N: "\k. k\N \ norm (z k) < 1/2" + obtain N where "\k. k\N \ norm (z k) < 1/2" using summable_LIMSEQ_zero [OF z] by (metis diff_zero dist_norm half_gt_zero_iff less_numeral_extra(1) lim_sequentially tendsto_norm_zero_iff) - have "norm (Ln (1 + z k)) \ 2 * norm (z k)" if "k \ N" for k - proof (cases "z k = 0") - case False - let ?f = "\i. cmod ((- 1) ^ i * z k ^ i / of_nat (Suc i))" - have normf: "norm (?f n) \ (1 / 2) ^ n" for n - proof - - have "norm (?f n) = cmod (z k) ^ n / cmod (1 + of_nat n)" - by (auto simp: norm_divide norm_mult norm_power) - also have "\ \ cmod (z k) ^ n" - by (auto simp: field_split_simps mult_le_cancel_left1 in_Reals_norm) - also have "\ \ (1 / 2) ^ n" - using N [OF that] by (simp add: power_mono) - finally show "norm (?f n) \ (1 / 2) ^ n" . - qed - have summablef: "summable ?f" - by (intro normf summable_comparison_test' [OF summable_geometric [of "1/2"]]) auto - have "(\n. (- 1) ^ Suc n / of_nat n * z k ^ n) sums Ln (1 + z k)" - using Ln_series [of "z k"] N that by fastforce - then have *: "(\i. z k * (((- 1) ^ i * z k ^ i) / (Suc i))) sums Ln (1 + z k)" - using sums_split_initial_segment [where n= 1] by (force simp: power_Suc mult_ac) - then have "norm (Ln (1 + z k)) = norm (suminf (\i. z k * (((- 1) ^ i * z k ^ i) / (Suc i))))" - using sums_unique by force - also have "\ = norm (z k * suminf (\i. ((- 1) ^ i * z k ^ i) / (Suc i)))" - apply (subst suminf_mult) - using * False - by (auto simp: sums_summable intro: summable_mult_D [of "z k"]) - also have "\ = norm (z k) * norm (suminf (\i. ((- 1) ^ i * z k ^ i) / (Suc i)))" - by (simp add: norm_mult) - also have "\ \ norm (z k) * suminf (\i. norm (((- 1) ^ i * z k ^ i) / (Suc i)))" - by (intro mult_left_mono summable_norm summablef) auto - also have "\ \ norm (z k) * suminf (\i. (1/2) ^ i)" - by (intro mult_left_mono suminf_le) (use summable_geometric [of "1/2"] summablef normf in auto) - also have "\ \ norm (z k) * 2" - using suminf_geometric [of "1/2::real"] by simp - finally show ?thesis - by (simp add: mult_ac) - qed simp then have "summable (\k. Ln (1 + z k))" - by (metis summable_comparison_test summable_mult z) + by (metis norm_Ln_le summable_comparison_test summable_mult z) with non0 show ?thesis by (simp add: add_eq_0_iff convergent_prod_iff_summable_complex) qed +corollary summable_imp_convergent_prod_real: + fixes z :: "nat \ real" + assumes z: "summable (\k. \z k\)" and non0: "\k. z k \ -1" + shows "convergent_prod (\k. 1 + z k)" +proof - + have "\k. (complex_of_real \ z) k \ - 1" + by (metis non0 o_apply of_real_1 of_real_eq_iff of_real_minus) + with z + have "convergent_prod (\k. 1 + (complex_of_real \ z) k)" + by (auto intro: summable_imp_convergent_prod_complex) + then show ?thesis + using convergent_prod_of_real_iff [of "\k. 1 + z k"] by (simp add: o_def) +qed + lemma summable_Ln_complex: fixes z :: "nat \ complex" assumes "convergent_prod z" "\k. z k \ 0" diff -r 5364cdc3ec0e -r 6969d0ffc576 src/HOL/Analysis/Uniform_Limit.thy --- a/src/HOL/Analysis/Uniform_Limit.thy Tue Dec 20 19:43:55 2022 +0100 +++ b/src/HOL/Analysis/Uniform_Limit.thy Tue Dec 20 22:24:36 2022 +0000 @@ -198,6 +198,19 @@ unfolding uniformly_convergent_on_def assms(2) [symmetric] by (intro iff_exI uniform_limit_cong eventually_mono [OF assms(1)]) auto +lemma uniformly_convergent_on_compose: + assumes "uniformly_convergent_on A f" + assumes "filterlim g sequentially sequentially" + shows "uniformly_convergent_on A (\n. f (g n))" +proof - + from assms(1) obtain f' where "uniform_limit A f f' sequentially" + by (auto simp: uniformly_convergent_on_def) + hence "uniform_limit A (\n. f (g n)) f' sequentially" + by (rule filterlim_compose) fact + thus ?thesis + by (auto simp: uniformly_convergent_on_def) +qed + lemma uniformly_convergent_uniform_limit_iff: "uniformly_convergent_on X f \ uniform_limit X f (\x. lim (\n. f n x)) sequentially" proof @@ -308,6 +321,46 @@ ultimately show ?thesis by auto qed +lemma uniformly_convergent_on_sum_E: + fixes \::real and f :: "nat \ 'a \ 'b::{complete_space,real_normed_vector}" + assumes uconv: "uniformly_convergent_on K (\n z. \k>0" + obtains N where "\m n z. \N \ m; m \ n; z\K\ \ norm(\k=m.." +proof - + obtain N where N: "\m n z. \N \ m; N \ n; z\K\ \ dist (\kk" + using uconv \\>0\ unfolding uniformly_Cauchy_on_def uniformly_convergent_eq_Cauchy by meson + show thesis + proof + fix m n z + assume "N \ m" "m \ n" "z \ K" + moreover have "(\k = m..kkm \ n\) + ultimately show "norm(\k = m.." + using N by (simp add: dist_norm) + qed +qed + +lemma uniformly_convergent_on_sum_iff: + fixes f :: "nat \ 'a \ 'b::{complete_space,real_normed_vector}" + shows "uniformly_convergent_on K (\n z. \k (\\>0. \N. \m n z. N\m \ m\n \ z\K \ norm (\k=m..)" (is "?lhs=?rhs") +proof + assume R: ?rhs + show ?lhs + unfolding uniformly_Cauchy_on_def uniformly_convergent_eq_Cauchy + proof (intro strip) + fix \::real + assume "\>0" + then obtain N where "\m n z. \N \ m; m \ n; z\K\ \ norm(\k = m.." + using R by blast + then have "\x\K. \m\N. \n\m. norm ((\kk" + by (metis atLeast0LessThan le0 sum_diff_nat_ivl norm_minus_commute) + then have "\x\K. \m\N. \n\N. norm ((\kk" + by (metis linorder_le_cases norm_minus_commute) + then show "\M. \x\K. \m\M. \n\M. dist (\kk" + by (metis dist_norm) + qed +qed (metis uniformly_convergent_on_sum_E) + text \TODO: remove explicit formulations @{thm uniformly_convergent_eq_cauchy uniformly_cauchy_imp_uniformly_convergent}?!\ @@ -316,6 +369,102 @@ unfolding uniformly_convergent_on_def convergent_def by (auto dest: tendsto_uniform_limitI) +subsection \Comparison Test\ + +lemma uniformly_summable_comparison_test: + fixes f :: "nat \ 'a \ 'b :: banach" + assumes "uniformly_convergent_on A (\N x. \nn x. x \ A \ norm (f n x) \ g n x" + shows "uniformly_convergent_on A (\N x. \nN x. \n 0" + obtain M where M: "\x m n. x \ A \ m \ M \ n \ M \ dist (\kkM. \x\A. \m\M. \n>m. dist (\kk A" "m \ M" "m < n" + have nonneg: "g k x \ 0" for k + by (rule order.trans[OF _ assms(2)]) (use xmn in auto) + have "dist (\kkk\{..k\{m.. (\k\{m.. \ (\k\{m.. = \\k\{m.." + by (subst abs_of_nonneg) (auto simp: nonneg intro!: sum_nonneg) + also have "{m..\k\\. g k x\ = dist (\kk < e" + by (rule M) (use xmn in auto) + finally show "dist (\kk 'b :: metric_space" + assumes lim: "uniform_limit A g g' F" + assumes cont: "uniformly_continuous_on B f" + assumes ev: "eventually (\x. \y\A. g x y \ B) F" and "closed B" + shows "uniform_limit A (\x y. f (g x y)) (\y. f (g' y)) F" +proof (cases "F = bot") + case [simp]: False + show ?thesis + unfolding uniform_limit_iff + proof safe + fix e :: real assume e: "e > 0" + + have g'_in_B: "g' y \ B" if "y \ A" for y + proof (rule Lim_in_closed_set) + show "eventually (\x. g x y \ B) F" + using ev by eventually_elim (use that in auto) + show "((\x. g x y) \ g' y) F" + using lim that by (metis tendsto_uniform_limitI) + qed (use \closed B\ in auto) + + obtain d where d: "d > 0" "\x y. x \ B \ y \ B \ dist x y < d \ dist (f x) (f y) < e" + using e cont unfolding uniformly_continuous_on_def by metis + from lim have "eventually (\x. \y\A. dist (g x y) (g' y) < d) F" + unfolding uniform_limit_iff using \d > 0\ by meson + thus "eventually (\x. \y\A. dist (f (g x y)) (f (g' y)) < e) F" + using assms(3) + proof eventually_elim + case (elim x) + show "\y\A. dist (f (g x y)) (f (g' y)) < e" + proof safe + fix y assume y: "y \ A" + show "dist (f (g x y)) (f (g' y)) < e" + proof (rule d) + show "dist (g x y) (g' y) < d" + using elim y by blast + qed (use y elim g'_in_B in auto) + qed + qed + qed +qed (auto simp: filterlim_def) + +lemma uniformly_convergent_on_compose_uniformly_continuous_on: + fixes f :: "'a :: metric_space \ 'b :: metric_space" + assumes lim: "uniformly_convergent_on A g" + assumes cont: "uniformly_continuous_on B f" + assumes ev: "eventually (\x. \y\A. g x y \ B) sequentially" and "closed B" + shows "uniformly_convergent_on A (\x y. f (g x y))" +proof - + from lim obtain g' where g': "uniform_limit A g g' sequentially" + by (auto simp: uniformly_convergent_on_def) + thus ?thesis + using uniform_limit_compose_uniformly_continuous_on[OF g' cont ev \closed B\] + by (auto simp: uniformly_convergent_on_def) +qed subsection \Weierstrass M-Test\ diff -r 5364cdc3ec0e -r 6969d0ffc576 src/HOL/Complex.thy --- a/src/HOL/Complex.thy Tue Dec 20 19:43:55 2022 +0100 +++ b/src/HOL/Complex.thy Tue Dec 20 22:24:36 2022 +0000 @@ -6,7 +6,7 @@ section \Complex Numbers: Rectangular and Polar Representations\ theory Complex -imports Transcendental +imports Transcendental Real_Vector_Spaces begin text \ @@ -196,6 +196,12 @@ lemma Im_divide_of_nat [simp]: "Im (z / of_nat n) = Im z / of_nat n" by (cases n) (simp_all add: Im_divide field_split_simps power2_eq_square del: of_nat_Suc) +lemma Re_inverse [simp]: "r \ \ \ Re (inverse r) = inverse (Re r)" + by (metis Re_complex_of_real Reals_cases of_real_inverse) + +lemma Im_inverse [simp]: "r \ \ \ Im (inverse r) = 0" + by (metis Im_complex_of_real Reals_cases of_real_inverse) + lemma of_real_Re [simp]: "z \ \ \ of_real (Re z) = z" by (auto simp: Reals_def) diff -r 5364cdc3ec0e -r 6969d0ffc576 src/HOL/Filter.thy --- a/src/HOL/Filter.thy Tue Dec 20 19:43:55 2022 +0100 +++ b/src/HOL/Filter.thy Tue Dec 20 22:24:36 2022 +0000 @@ -1519,6 +1519,24 @@ by eventually_elim (insert n, auto) qed +lemma filterlim_minus_const_nat_at_top: + "filterlim (\n. n - c) sequentially sequentially" + unfolding filterlim_at_top +proof + fix a :: nat + show "eventually (\n. n - c \ a) at_top" + using eventually_ge_at_top[of "a + c"] by eventually_elim auto +qed + +lemma filterlim_add_const_nat_at_top: + "filterlim (\n. n + c) sequentially sequentially" + unfolding filterlim_at_top +proof + fix a :: nat + show "eventually (\n. n + c \ a) at_top" + using eventually_ge_at_top[of a] by eventually_elim auto +qed + subsection \Setup \<^typ>\'a filter\ for lifting and transfer\ lemma filtermap_id [simp, id_simps]: "filtermap id = id" diff -r 5364cdc3ec0e -r 6969d0ffc576 src/HOL/Fun.thy --- a/src/HOL/Fun.thy Tue Dec 20 19:43:55 2022 +0100 +++ b/src/HOL/Fun.thy Tue Dec 20 22:24:36 2022 +0000 @@ -300,11 +300,17 @@ using lin [of x y] ne by (force simp: dual_order.order_iff_strict) qed +lemma linorder_inj_onI': + fixes A :: "'a :: linorder set" + assumes "\i j. i \ A \ j \ A \ i < j \ f i \ f j" + shows "inj_on f A" + by (intro linorder_inj_onI) (auto simp add: assms) + lemma linorder_injI: assumes "\x y::'a::linorder. x < y \ f x \ f y" shows "inj f" \ \Courtesy of Stephan Merz\ -using assms by (auto intro: linorder_inj_onI linear) +using assms by (simp add: linorder_inj_onI') lemma inj_on_image_Pow: "inj_on f A \inj_on (image f) (Pow A)" unfolding Pow_def inj_on_def by blast