# HG changeset patch # User paulson # Date 1589192141 -3600 # Node ID 5e315defb0383d2c0654c02606d27b008005cd35 # Parent f424e164d75217584b0af76cb5a349cc0b04798f the Uniq quantifier diff -r f424e164d752 -r 5e315defb038 src/HOL/Analysis/Infinite_Products.thy --- a/src/HOL/Analysis/Infinite_Products.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Analysis/Infinite_Products.thy Mon May 11 11:15:41 2020 +0100 @@ -1185,7 +1185,7 @@ lemma raw_has_prod_Suc_iff: "raw_has_prod f M (a * f M) \ raw_has_prod (\n. f (Suc n)) M a \ f M \ 0" proof - have "raw_has_prod f M (a * f M) \ (\i. \j\Suc i. f (j+M)) \ a * f M \ a * f M \ 0" - by (subst LIMSEQ_Suc_iff) (simp add: raw_has_prod_def) + by (subst filterlim_sequentially_Suc) (simp add: raw_has_prod_def) also have "\ \ (\i. (\j\i. f (Suc j + M)) * f M) \ a * f M \ a * f M \ 0" by (simp add: ac_simps atMost_Suc_eq_insert_0 image_Suc_atMost prod.atLeast1_atMost_eq lessThan_Suc_atMost del: prod.cl_ivl_Suc) @@ -1238,7 +1238,7 @@ proof - have "(\n. \i\{0..Suc n}. f (i + M)) \ L" using M_L - apply (subst (asm) LIMSEQ_Suc_iff[symmetric]) + apply (subst (asm) filterlim_sequentially_Suc[symmetric]) using atLeast0AtMost by auto then have "(\n. f M * (\i\{0..n}. f (Suc (i + M)))) \ L" apply (subst (asm) prod.atLeast0_atMost_Suc_shift) diff -r f424e164d752 -r 5e315defb038 src/HOL/Analysis/Interval_Integral.thy --- a/src/HOL/Analysis/Interval_Integral.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Analysis/Interval_Integral.thy Mon May 11 11:15:41 2020 +0100 @@ -47,9 +47,9 @@ with \a < b\ have "a = -\ \ (\r. a = ereal r)" by (cases a) auto moreover have "(\x. ereal (real (Suc x))) \ \" - by (simp add: Lim_PInfty LIMSEQ_Suc_iff) (metis le_SucI of_nat_Suc of_nat_mono order_trans real_arch_simple) + by (simp add: Lim_PInfty filterlim_sequentially_Suc) (metis le_SucI of_nat_Suc of_nat_mono order_trans real_arch_simple) moreover have "\r. (\x. ereal (r + real (Suc x))) \ \" - by (simp add: LIMSEQ_Suc_iff Lim_PInfty) (metis add.commute diff_le_eq nat_ceiling_le_eq) + by (simp add: filterlim_sequentially_Suc Lim_PInfty) (metis add.commute diff_le_eq nat_ceiling_le_eq) ultimately show thesis by (intro that[of "\i. real_of_ereal a + Suc i"]) (auto simp: incseq_def PInf) diff -r f424e164d752 -r 5e315defb038 src/HOL/Deriv.thy --- a/src/HOL/Deriv.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Deriv.thy Mon May 11 11:15:41 2020 +0100 @@ -572,6 +572,7 @@ bounded_linear f' \ ((\y. (1 / (norm(y - x))) *\<^sub>R (f y - (f x + f' (y - x)))) \ 0) (at x)" using has_derivative_within [of f f' x UNIV] by simp + lemma has_derivative_zero_unique: assumes "((\x. 0) has_derivative F) (at x)" shows "F = (\h. 0)" @@ -618,6 +619,9 @@ unfolding fun_eq_iff right_minus_eq . qed +lemma has_derivative_Uniq: "\\<^sub>\\<^sub>1F. (f has_derivative F) (at x)" + by (simp add: Uniq_def has_derivative_unique) + subsection \Differentiability predicate\ @@ -970,6 +974,9 @@ lemma DERIV_unique: "DERIV f x :> D \ DERIV f x :> E \ D = E" unfolding DERIV_def by (rule LIM_unique) +lemma DERIV_Uniq: "\\<^sub>\\<^sub>1D. DERIV f x :> D" + by (simp add: DERIV_unique Uniq_def) + lemma DERIV_sum[derivative_intros]: "(\ n. n \ S \ ((\x. f x n) has_field_derivative (f' x n)) F) \ ((\x. sum (f x) S) has_field_derivative sum (f' x) S) F" diff -r f424e164d752 -r 5e315defb038 src/HOL/Fun.thy --- a/src/HOL/Fun.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Fun.thy Mon May 11 11:15:41 2020 +0100 @@ -190,6 +190,9 @@ lemma inj_eq: "inj f \ f x = f y \ x = y" by (simp add: inj_on_eq_iff) +lemma inj_on_iff_Uniq: "inj_on f A \ (\x\A. \\<^sub>\\<^sub>1y. y\A \ f x = f y)" + by (auto simp: Uniq_def inj_on_def) + lemma inj_on_id[simp]: "inj_on id A" by (simp add: inj_on_def) diff -r f424e164d752 -r 5e315defb038 src/HOL/HOL.thy --- a/src/HOL/HOL.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/HOL.thy Mon May 11 11:15:41 2020 +0100 @@ -117,12 +117,24 @@ definition disj :: "[bool, bool] \ bool" (infixr "\" 30) where or_def: "P \ Q \ \R. (P \ R) \ (Q \ R) \ R" +definition Uniq :: "('a \ bool) \ bool" + where "Uniq P \ (\x y. P x \ P y \ y = x)" + definition Ex1 :: "('a \ bool) \ bool" where "Ex1 P \ \x. P x \ (\y. P y \ y = x)" subsubsection \Additional concrete syntax\ +syntax (ASCII) "_Uniq" :: "pttrn \ bool \ bool" ("(4?< _./ _)" [0, 10] 10) +syntax "_Uniq" :: "pttrn \ bool \ bool" ("(2\\<^sub>\\<^sub>1 _./ _)" [0, 10] 10) +translations "\\<^sub>\\<^sub>1x. P" \ "CONST Uniq (\x. P)" + +print_translation \ + [Syntax_Trans.preserve_binder_abs_tr' \<^const_syntax>\Uniq\ \<^syntax_const>\_Uniq\] +\ \ \to avoid eta-contraction of body\ + + syntax (ASCII) "_Ex1" :: "pttrn \ bool \ bool" ("(3EX! _./ _)" [0, 10] 10) syntax (input) @@ -539,6 +551,14 @@ subsubsection \Unique existence\ +lemma Uniq_I [intro?]: + assumes "\x y. \P x; P y\ \ y = x" + shows "Uniq P" + unfolding Uniq_def by (iprover intro: assms allI impI) + +lemma Uniq_D [dest?]: "\Uniq P; P a; P b\ \ a=b" + unfolding Uniq_def by (iprover dest: spec mp) + lemma ex1I: assumes "P a" "\x. P x \ x = a" shows "\!x. P x" @@ -562,7 +582,6 @@ lemma ex1_implies_ex: "\!x. P x \ \x. P x" by (iprover intro: exI elim: ex1E) - subsubsection \Classical intro rules for disjunction and existential quantifiers\ lemma disjCI: @@ -854,6 +873,15 @@ using \P x\ \
\
by fast qed assumption +text \And again using Uniq\ +lemma alt_ex1E': + assumes "\!x. P x" "\x. \P x; \\<^sub>\\<^sub>1x. P x\ \ R" + shows R + using assms unfolding Uniq_def by fast + +lemma ex1_iff_ex_Uniq: "(\!x. P x) \ (\x. P x) \ (\\<^sub>\\<^sub>1x. P x)" + unfolding Uniq_def by fast + ML \ structure Blast = Blast @@ -901,6 +929,9 @@ lemma the1_equality [elim?]: "\\!x. P x; P a\ \ (THE x. P x) = a" by blast +lemma the1_equality': "\\\<^sub>\\<^sub>1x. P x; P a\ \ (THE x. P x) = a" + unfolding Uniq_def by blast + lemma the_sym_eq_trivial: "(THE y. x = y) = x" by blast diff -r f424e164d752 -r 5e315defb038 src/HOL/Hilbert_Choice.thy --- a/src/HOL/Hilbert_Choice.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Hilbert_Choice.thy Mon May 11 11:15:41 2020 +0100 @@ -223,6 +223,9 @@ lemma inj_on_inv_into: "B \ f`A \ inj_on (inv_into A f) B" by (blast intro: inj_onI dest: inv_into_injective injD) +lemma inj_imp_bij_betw_inv: "inj f \ bij_betw (inv f) (f ` M) M" + by (simp add: bij_betw_def image_subsetI inj_on_inv_into) + lemma bij_betw_inv_into: "bij_betw f A B \ bij_betw (inv_into A f) B A" by (auto simp add: bij_betw_def inj_on_inv_into) @@ -373,6 +376,17 @@ qed qed +lemma strict_mono_inv_on_range: + fixes f :: "'a::linorder \ 'b::order" + assumes "strict_mono f" + shows "strict_mono_on (inv f) (range f)" +proof (clarsimp simp: strict_mono_on_def) + fix x y + assume "f x < f y" + then show "inv f (f x) < inv f (f y)" + using assms strict_mono_imp_inj_on strict_mono_less by fastforce +qed + lemma mono_bij_Inf: fixes f :: "'a::complete_linorder \ 'b::complete_linorder" assumes "mono f" "bij f" diff -r f424e164d752 -r 5e315defb038 src/HOL/Library/Infinite_Set.thy --- a/src/HOL/Library/Infinite_Set.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Library/Infinite_Set.thy Mon May 11 11:15:41 2020 +0100 @@ -399,4 +399,189 @@ qed qed +subsection \Properties of @{term enumerate} on finite sets\ + +lemma finite_enumerate_in_set: "\finite S; n < card S\ \ enumerate S n \ S" +proof (induction n arbitrary: S) + case 0 + then show ?case + by (metis all_not_in_conv card_empty enumerate.simps(1) not_less0 wellorder_Least_lemma(1)) +next + case (Suc n) + show ?case + using Suc.prems Suc.IH [of "S - {LEAST n. n \ S}"] + apply (simp add: enumerate.simps) + by (metis Diff_empty Diff_insert0 Suc_lessD card.remove less_Suc_eq) +qed + +lemma finite_enumerate_step: "\finite S; Suc n < card S\ \ enumerate S n < enumerate S (Suc n)" +proof (induction n arbitrary: S) + case 0 + then have "enumerate S 0 \ enumerate S (Suc 0)" + by (simp add: Least_le enumerate.simps(1) finite_enumerate_in_set) + moreover have "enumerate (S - {enumerate S 0}) 0 \ S - {enumerate S 0}" + by (metis 0 Suc_lessD Suc_less_eq card_Suc_Diff1 enumerate_in_set finite_enumerate_in_set) + then have "enumerate S 0 \ enumerate (S - {enumerate S 0}) 0" + by auto + ultimately show ?case + by (simp add: enumerate_Suc') +next + case (Suc n) + then show ?case + by (simp add: enumerate_Suc' finite_enumerate_in_set) +qed + +lemma finite_enumerate_mono: "\m < n; finite S; n < card S\ \ enumerate S m < enumerate S n" + by (induct m n rule: less_Suc_induct) (auto intro: finite_enumerate_step) + + +lemma finite_le_enumerate: + assumes "finite S" "n < card S" + shows "n \ enumerate S n" + using assms +proof (induction n) + case 0 + then show ?case by simp +next + case (Suc n) + then have "n \ enumerate S n" by simp + also note finite_enumerate_mono[of n "Suc n", OF _ \finite S\] + finally show ?case + using Suc.prems(2) Suc_leI by blast +qed + +lemma finite_enumerate: + assumes fS: "finite S" + shows "\r::nat\nat. strict_mono_on r {.. (\n S)" + unfolding strict_mono_def + using finite_enumerate_in_set[OF fS] finite_enumerate_mono[of _ _ S] fS + by (metis lessThan_iff strict_mono_on_def) + +lemma finite_enumerate_Suc'': + fixes S :: "'a::wellorder set" + assumes "finite S" "Suc n < card S" + shows "enumerate S (Suc n) = (LEAST s. s \ S \ enumerate S n < s)" + using assms +proof (induction n arbitrary: S) + case 0 + then have "\s \ S. enumerate S 0 \ s" + by (auto simp: enumerate.simps intro: Least_le) + then show ?case + unfolding enumerate_Suc' enumerate_0[of "S - {enumerate S 0}"] + by (metis Diff_iff dual_order.strict_iff_order singletonD singletonI) +next + case (Suc n S) + then have "Suc n < card (S - {enumerate S 0})" + using Suc.prems(2) finite_enumerate_in_set by force + then show ?case + apply (subst (1 2) enumerate_Suc') + apply (simp add: Suc) + apply (intro arg_cong[where f = Least] HOL.ext) + using finite_enumerate_mono[OF zero_less_Suc \finite S\, of n] Suc.prems + by (auto simp flip: enumerate_Suc') +qed + +lemma finite_enumerate_initial_segment: + fixes S :: "'a::wellorder set" + assumes "finite S" "s \ S" and n: "n < card (S \ {.. {.. S \ n < s) = (LEAST n. n \ S)" + proof (rule Least_equality) + have "\t. t \ S \ t < s" + by (metis "0" card_gt_0_iff disjoint_iff_not_equal lessThan_iff) + then show "(LEAST n. n \ S) \ S \ (LEAST n. n \ S) < s" + by (meson LeastI Least_le le_less_trans) + qed (simp add: Least_le) + then show ?case + by (auto simp: enumerate_0) +next + case (Suc n) + then have less_card: "Suc n < card S" + by (meson assms(1) card_mono inf_sup_ord(1) leD le_less_linear order.trans) + obtain t where t: "t \ {s \ S. enumerate S n < s}" + by (metis Infinite_Set.enumerate_step enumerate_in_set finite_enumerate_in_set finite_enumerate_step less_card mem_Collect_eq) + have "(LEAST x. x \ S \ x < s \ enumerate S n < x) = (LEAST s. s \ S \ enumerate S n < s)" + (is "_ = ?r") + proof (intro Least_equality conjI) + show "?r \ S" + by (metis (mono_tags, lifting) LeastI mem_Collect_eq t) + show "?r < s" + using not_less_Least [of _ "\t. t \ S \ enumerate S n < t"] Suc assms + by (metis (no_types, lifting) Int_Collect Suc_lessD finite_Int finite_enumerate_in_set finite_enumerate_step lessThan_def linorder_cases) + show "enumerate S n < ?r" + by (metis (no_types, lifting) LeastI mem_Collect_eq t) + qed (auto simp: Least_le) + then show ?case + using Suc assms by (simp add: finite_enumerate_Suc'' less_card) +qed + +lemma finite_enumerate_Ex: + fixes S :: "'a::wellorder set" + assumes S: "finite S" + and s: "s \ S" + shows "\ny\S. y < s") + case True + let ?T = "S \ {..finite S\]) + from True have y: "\x. Max ?T < x \ (\s'\S. s' < s \ s' < x)" + by (subst Max_less_iff) (auto simp: \finite ?T\) + then have y_in: "Max ?T \ {s'\S. s' < s}" + using Max_in \finite ?T\ by fastforce + with less.IH[of "Max ?T" ?T] obtain n where n: "enumerate ?T n = Max ?T" "n < card ?T" + using \finite ?T\ by blast + then have "Suc n < card S" + using TS less_trans_Suc by blast + with S n have "enumerate S (Suc n) = s" + by (subst finite_enumerate_Suc'') (auto simp: y finite_enumerate_initial_segment less finite_enumerate_Suc'' intro!: Least_equality) + then show ?thesis + using \Suc n < card S\ by blast + next + case False + then have "\t\S. s \ t" by auto + moreover have "0 < card S" + using card_0_eq less.prems by blast + ultimately show ?thesis + using \s \ S\ + by (auto intro!: exI[of _ 0] Least_equality simp: enumerate_0) + qed +qed + +lemma finite_bij_enumerate: + fixes S :: "'a::wellorder set" + assumes S: "finite S" + shows "bij_betw (enumerate S) {..n m. \n \ m; n < card S; m < card S\ \ enumerate S n \ enumerate S m" + using finite_enumerate_mono[OF _ \finite S\] by (auto simp: neq_iff) + then have "inj_on (enumerate S) {..s \ S. \ifinite S\ + ultimately show ?thesis + unfolding bij_betw_def by (auto intro: finite_enumerate_in_set) +qed + +lemma ex_bij_betw_strict_mono_card: + fixes M :: "'a::wellorder set" + assumes "finite M" + obtains h where "bij_betw h {..n. f (Suc n)) \ convergent f" - by (auto simp: convergent_def LIMSEQ_Suc_iff) + by (auto simp: convergent_def filterlim_sequentially_Suc) lemma convergent_ignore_initial_segment: "convergent (\n. f (n + m)) = convergent f" proof (induct m arbitrary: f) diff -r f424e164d752 -r 5e315defb038 src/HOL/List.thy --- a/src/HOL/List.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/List.thy Mon May 11 11:15:41 2020 +0100 @@ -1707,6 +1707,9 @@ else \xss1 xs xs' xss2. xss = xss1 @ (xs @ xs') # xss2 \ ys = concat xss1 @ xs \ zs = xs' @ concat xss2)" by(auto dest: concat_eq_appendD) +lemma hd_concat: "\xs \ []; hd xs \ []\ \ hd (concat xs) = hd (hd xs)" + by (metis concat.simps(2) hd_Cons_tl hd_append2) + subsubsection \\<^const>\nth\\ @@ -6084,6 +6087,33 @@ obtains l where "strict_sorted l" "List.set l = A" "length l = card A" by (metis assms distinct_card distinct_sorted_list_of_set set_sorted_list_of_set strict_sorted_list_of_set) +lemma strict_sorted_equal: + assumes "strict_sorted xs" + and "strict_sorted ys" + and "list.set ys = list.set xs" + shows "ys = xs" + using assms +proof (induction xs arbitrary: ys) + case (Cons x xs) + show ?case + proof (cases ys) + case Nil + then show ?thesis + using Cons.prems by auto + next + case (Cons y ys') + then have "xs = ys'" + by (metis Cons.prems list.inject sorted_distinct_set_unique strict_sorted_iff) + moreover have "x = y" + using Cons.prems \xs = ys'\ local.Cons by fastforce + ultimately show ?thesis + using local.Cons by blast + qed +qed auto + +lemma strict_sorted_equal_Uniq: "\\<^sub>\\<^sub>1xs. strict_sorted xs \ list.set xs = A" + by (simp add: Uniq_def strict_sorted_equal) + subsubsection \\lists\: the list-forming operator over sets\ diff -r f424e164d752 -r 5e315defb038 src/HOL/Real_Vector_Spaces.thy --- a/src/HOL/Real_Vector_Spaces.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Real_Vector_Spaces.thy Mon May 11 11:15:41 2020 +0100 @@ -2095,7 +2095,7 @@ have "eventually (\y. dist y x < e) F" if "0 < e" for e :: real proof - from that have "(\n. 1 / Suc n :: real) \ 0 \ 0 < e / 2" - by (subst LIMSEQ_Suc_iff) (auto intro!: lim_1_over_n) + by (subst filterlim_sequentially_Suc) (auto intro!: lim_1_over_n) then have "\\<^sub>F n in sequentially. dist (X n) x < e / 2 \ 1 / Suc n < e / 2" using \X \ x\ unfolding tendsto_iff order_tendsto_iff[where 'a=real] eventually_conj_iff diff -r f424e164d752 -r 5e315defb038 src/HOL/Relation.thy --- a/src/HOL/Relation.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Relation.thy Mon May 11 11:15:41 2020 +0100 @@ -485,6 +485,10 @@ "single_valuedp (\x y. (x, y) \ r) \ single_valued r" by (simp add: single_valued_def single_valuedp_def) +lemma single_valuedp_iff_Uniq: + "single_valuedp r \ (\x. \\<^sub>\\<^sub>1y. r x y)" + unfolding Uniq_def single_valuedp_def by auto + lemma single_valuedI: "(\x y. (x, y) \ r \ (\z. (x, z) \ r \ y = z)) \ single_valued r" unfolding single_valued_def by blast diff -r f424e164d752 -r 5e315defb038 src/HOL/Series.thy --- a/src/HOL/Series.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Series.thy Mon May 11 11:15:41 2020 +0100 @@ -29,7 +29,7 @@ text\Variants of the definition\ lemma sums_def': "f sums s \ (\n. \i = 0..n. f i) \ s" unfolding sums_def - apply (subst LIMSEQ_Suc_iff [symmetric]) + apply (subst filterlim_sequentially_Suc [symmetric]) apply (simp only: lessThan_Suc_atMost atLeast0AtMost) done @@ -68,7 +68,7 @@ lemma summable_iff_convergent': "summable f \ convergent (\n. sum f {..n})" by (simp_all only: summable_iff_convergent convergent_def - lessThan_Suc_atMost [symmetric] LIMSEQ_Suc_iff[of "\n. sum f {..n. sum f {..n. \i\<^sub>\\<^sub>1a. f sums a" + for a b :: 'a + by (simp add: sums_unique2 Uniq_def) + lemma suminf_finite: assumes N: "finite N" and f: "\n. n \ N \ f n = 0" @@ -305,7 +309,7 @@ unfolding lessThan_Suc_eq_insert_0 by (simp add: ac_simps sum.atLeast1_atMost_eq image_Suc_lessThan) ultimately show ?thesis - by (auto simp: sums_def simp del: sum.lessThan_Suc intro: LIMSEQ_Suc_iff[THEN iffD1]) + by (auto simp: sums_def simp del: sum.lessThan_Suc intro: filterlim_sequentially_Suc[THEN iffD1]) qed lemma sums_add: "f sums a \ g sums b \ (\n. f n + g n) sums (a + b)" @@ -356,7 +360,7 @@ lemma sums_Suc_iff: "(\n. f (Suc n)) sums s \ f sums (s + f 0)" proof - have "f sums (s + f 0) \ (\i. \j s + f 0" - by (subst LIMSEQ_Suc_iff) (simp add: sums_def) + by (subst filterlim_sequentially_Suc) (simp add: sums_def) also have "\ \ (\i. (\j s + f 0" by (simp add: ac_simps lessThan_Suc_eq_insert_0 image_Suc_lessThan sum.atLeast1_atMost_eq) also have "\ \ (\n. f (Suc n)) sums s" @@ -635,7 +639,7 @@ assumes "f \ c" shows "(\n. f (Suc n) - f n) sums (c - f 0)" unfolding sums_def -proof (subst LIMSEQ_Suc_iff [symmetric]) +proof (subst filterlim_sequentially_Suc [symmetric]) have "(\n. \kn. f (Suc n) - f 0)" by (simp add: lessThan_Suc_atMost atLeast0AtMost [symmetric] sum_Suc_diff) also have "\ \ c - f 0" diff -r f424e164d752 -r 5e315defb038 src/HOL/Set.thy --- a/src/HOL/Set.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Set.thy Mon May 11 11:15:41 2020 +0100 @@ -819,6 +819,9 @@ lemma subset_singleton_iff: "X \ {a} \ X = {} \ X = {a}" by blast +lemma subset_singleton_iff_Uniq: "(\a. A \ {a}) \ (\\<^sub>\\<^sub>1x. x \ A)" + unfolding Uniq_def by blast + lemma singleton_conv [simp]: "{x. x = a} = {a}" by blast @@ -1938,6 +1941,9 @@ lemma disjoint_image_subset: "\pairwise disjnt \; \X. X \ \ \ f X \ X\ \ pairwise disjnt (f `\)" unfolding disjnt_def pairwise_def by fast +lemma pairwise_disjnt_iff: "pairwise disjnt \ \ (\x. \\<^sub>\\<^sub>1 X. X \ \ \ x \ X)" + by (auto simp: Uniq_def disjnt_iff pairwise_def) + lemma Int_emptyI: "(\x. x \ A \ x \ B \ False) \ A \ B = {}" by blast diff -r f424e164d752 -r 5e315defb038 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Topological_Spaces.thy Mon May 11 11:15:41 2020 +0100 @@ -891,6 +891,11 @@ shows "((\x. a) \ b) F \ a = b" by (auto intro!: tendsto_unique [OF assms tendsto_const]) +lemma (in t2_space) tendsto_unique': + assumes "F \ bot" + shows "\\<^sub>\\<^sub>1l. (f \ l) F" + using Uniq_def assms local.tendsto_unique by fastforce + lemma Lim_in_closed_set: assumes "closed S" "eventually (\x. f(x) \ S) F" "F \ bot" "(f \ l) F" shows "l \ S" @@ -1394,17 +1399,16 @@ lemma LIMSEQ_imp_Suc: "(\n. f (Suc n)) \ l \ f \ l" by (rule LIMSEQ_offset [where k="Suc 0"]) simp -lemma LIMSEQ_Suc_iff: "(\n. f (Suc n)) \ l = f \ l" - by (rule filterlim_sequentially_Suc) - lemma LIMSEQ_lessThan_iff_atMost: shows "(\n. f {.. x \ (\n. f {..n}) \ x" - apply (subst LIMSEQ_Suc_iff [symmetric]) + apply (subst filterlim_sequentially_Suc [symmetric]) apply (simp only: lessThan_Suc_atMost) done -lemma LIMSEQ_unique: "X \ a \ X \ b \ a = b" - for a b :: "'a::t2_space" +lemma (in t2_space) LIMSEQ_Uniq: "\\<^sub>\\<^sub>1l. X \ l" + by (simp add: tendsto_unique') + +lemma (in t2_space) LIMSEQ_unique: "X \ a \ X \ b \ a = b" using trivial_limit_sequentially by (rule tendsto_unique) lemma LIMSEQ_le_const: "X \ x \ \N. \n\N. a \ X n \ a \ x" @@ -1741,6 +1745,10 @@ for a :: "'a::perfect_space" and L M :: "'b::t2_space" using at_neq_bot by (rule tendsto_unique) +lemma LIM_Uniq: "\\<^sub>\\<^sub>1L::'b::t2_space. f \a\ L" + for a :: "'a::perfect_space" + by (auto simp add: Uniq_def LIM_unique) + text \Limits are equal for functions equal except at limit point.\ lemma LIM_equal: "\x. x \ a \ f x = g x \ (f \a\ l) \ (g \a\ l)" @@ -3824,4 +3832,5 @@ then show ?thesis using open_subdiagonal closed_Diff by auto qed + end diff -r f424e164d752 -r 5e315defb038 src/HOL/Transfer.thy --- a/src/HOL/Transfer.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Transfer.thy Mon May 11 11:15:41 2020 +0100 @@ -126,6 +126,9 @@ (\x y z. R x y \ R x z \ y = z) \ (\x y z. R x z \ R y z \ x = y)" +lemma left_unique_iff: "left_unique R \ (\z. \\<^sub>\\<^sub>1x. R x z)" + unfolding Uniq_def left_unique_def by force + lemma left_uniqueI: "(\x y z. \ A x z; A y z \ \ x = y) \ left_unique A" unfolding left_unique_def by blast @@ -142,10 +145,16 @@ using assms unfolding left_total_def by blast lemma bi_uniqueDr: "\ bi_unique A; A x y; A x z \ \ y = z" -by(simp add: bi_unique_def) + by(simp add: bi_unique_def) lemma bi_uniqueDl: "\ bi_unique A; A x y; A z y \ \ x = z" -by(simp add: bi_unique_def) + by(simp add: bi_unique_def) + +lemma bi_unique_iff: "bi_unique R \ (\z. \\<^sub>\\<^sub>1x. R x z) \ (\z. \\<^sub>\\<^sub>1x. R z x)" + unfolding Uniq_def bi_unique_def by force + +lemma right_unique_iff: "right_unique R \ (\z. \\<^sub>\\<^sub>1x. R z x)" + unfolding Uniq_def right_unique_def by force lemma right_uniqueI: "(\x y z. \ A x y; A x z \ \ y = z) \ right_unique A" unfolding right_unique_def by fast diff -r f424e164d752 -r 5e315defb038 src/HOL/Wellfounded.thy --- a/src/HOL/Wellfounded.thy Sat May 09 17:20:04 2020 +0000 +++ b/src/HOL/Wellfounded.thy Mon May 11 11:15:41 2020 +0100 @@ -580,6 +580,9 @@ lemma less_than_iff [iff]: "((x,y) \ less_than) = (x