[STATEMENT]
lemma univ_second_countable_sequence:
  obtains B :: "nat \<Rightarrow> 'a::euclidean_space set"
    where "inj B" "\<And>n. open(B n)" "\<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union>{B n |n. n \<in> k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union> {B n |n. n \<in> k}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union> {B n |n. n \<in> k}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain \<B> :: "'a set set"
  where "countable \<B>"
    and opn: "\<And>C. C \<in> \<B> \<Longrightarrow> open C"
    and Un: "\<And>S. open S \<Longrightarrow> \<exists>U. U \<subseteq> \<B> \<and> S = \<Union>U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<B>. \<lbrakk>countable \<B>; \<And>C. C \<in> \<B> \<Longrightarrow> open C; \<And>S. open S \<Longrightarrow> \<exists>U\<subseteq>\<B>. S = \<Union> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using univ_second_countable
[PROOF STATE]
proof (prove)
using this:
(\<And>\<B>. \<lbrakk>countable \<B>; \<And>C. C \<in> \<B> \<Longrightarrow> open C; \<And>S. open S \<Longrightarrow> \<exists>U\<subseteq>\<B>. S = \<Union> U\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>\<B>. \<lbrakk>countable \<B>; \<And>C. C \<in> \<B> \<Longrightarrow> open C; \<And>S. open S \<Longrightarrow> \<exists>U\<subseteq>\<B>. S = \<Union> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
countable \<B>
?C \<in> \<B> \<Longrightarrow> open ?C
open ?S \<Longrightarrow> \<exists>U\<subseteq>\<B>. ?S = \<Union> U

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union> {B n |n. n \<in> k}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have *: "infinite (range (\<lambda>n. ball (0::'a) (inverse(Suc n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))
[PROOF STEP]
apply (rule Infinite_Set.range_inj_infinite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj (\<lambda>n. ball (0::'a) (inverse (real (Suc n))))
[PROOF STEP]
apply (simp add: inj_on_def ball_eq_ball_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
infinite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union> {B n |n. n \<in> k}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "infinite \<B>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite \<B>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite \<B> \<Longrightarrow> False
[PROOF STEP]
assume "finite \<B>"
[PROOF STATE]
proof (state)
this:
finite \<B>

goal (1 subgoal):
 1. finite \<B> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite \<B>
[PROOF STEP]
have "finite (Union ` (Pow \<B>))"
[PROOF STATE]
proof (prove)
using this:
finite \<B>

goal (1 subgoal):
 1. finite (\<Union> ` Pow \<B>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (\<Union> ` Pow \<B>)

goal (1 subgoal):
 1. finite \<B> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (\<Union> ` Pow \<B>)
[PROOF STEP]
have "finite (range (\<lambda>n. ball (0::'a) (inverse(Suc n))))"
[PROOF STATE]
proof (prove)
using this:
finite (\<Union> ` Pow \<B>)

goal (1 subgoal):
 1. finite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))
[PROOF STEP]
apply (rule rev_finite_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))) \<subseteq> \<Union> ` Pow \<B>
[PROOF STEP]
by (metis (no_types, lifting) PowI image_eqI image_subset_iff Un [OF open_ball])
[PROOF STATE]
proof (state)
this:
finite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))

goal (1 subgoal):
 1. finite \<B> \<Longrightarrow> False
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
infinite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))
finite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
infinite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))
finite (range (\<lambda>n. ball (0::'a) (inverse (real (Suc n)))))

goal (1 subgoal):
 1. False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
infinite \<B>

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union> {B n |n. n \<in> k}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain f :: "nat \<Rightarrow> 'a set" where "\<B> = range f" "inj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>\<B> = range f; inj f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: countable_as_injective_image [OF \<open>countable \<B>\<close> \<open>infinite \<B>\<close>])
[PROOF STATE]
proof (state)
this:
\<B> = range f
inj f

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union> {B n |n. n \<in> k}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have *: "\<exists>k. S = \<Union>{f n |n. n \<in> k}" if "open S" for S
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. S = \<Union> {f n |n. n \<in> k}
[PROOF STEP]
using Un [OF that]
[PROOF STATE]
proof (prove)
using this:
\<exists>U\<subseteq>\<B>. S = \<Union> U

goal (1 subgoal):
 1. \<exists>k. S = \<Union> {f n |n. n \<in> k}
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U. \<lbrakk>U \<subseteq> \<B>; S = \<Union> U\<rbrakk> \<Longrightarrow> \<exists>k. \<Union> U = \<Union> {f n |n. n \<in> k}
[PROOF STEP]
apply (rule_tac x="f-`U" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U. \<lbrakk>U \<subseteq> \<B>; S = \<Union> U\<rbrakk> \<Longrightarrow> \<Union> U = \<Union> {f n |n. n \<in> f -` U}
[PROOF STEP]
using \<open>inj f\<close> \<open>\<B> = range f\<close>
[PROOF STATE]
proof (prove)
using this:
inj f
\<B> = range f

goal (1 subgoal):
 1. \<And>U. \<lbrakk>U \<subseteq> \<B>; S = \<Union> U\<rbrakk> \<Longrightarrow> \<Union> U = \<Union> {f n |n. n \<in> f -` U}
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
open ?S \<Longrightarrow> \<exists>k. ?S = \<Union> {f n |n. n \<in> k}

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>inj B; \<And>n. open (B n); \<And>S. open S \<Longrightarrow> \<exists>k. S = \<Union> {B n |n. n \<in> k}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply (rule that [OF \<open>inj f\<close> _ *])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. open (f n)
 2. \<And>S. open S \<Longrightarrow> open S
[PROOF STEP]
apply (auto simp: \<open>\<B> = range f\<close> opn)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma last_psums:
  "(xs :: 'a :: monoid_add list) \<noteq> [] \<Longrightarrow> last (psums xs) = sum_list xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> last (psums xs) = sum_list xs
[PROOF STEP]
by (induction xs rule: psums.induct)
     (auto simp add: add.assoc [symmetric] psums_Cons o_def)


[STATEMENT]
lemma homeomorphic_map_compose:
  assumes "homeomorphic_map X Y f" "homeomorphic_map Y X'' g"
  shows "homeomorphic_map X X'' (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X X'' (g \<circ> f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homeomorphic_map X X'' (g \<circ> f)
[PROOF STEP]
have "inj_on g (f ` topspace X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on g (f ` topspace X)
[PROOF STEP]
by (metis (no_types) assms homeomorphic_map_def quotient_imp_surjective_map)
[PROOF STATE]
proof (state)
this:
inj_on g (f ` topspace X)

goal (1 subgoal):
 1. homeomorphic_map X X'' (g \<circ> f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on g (f ` topspace X)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on g (f ` topspace X)

goal (1 subgoal):
 1. homeomorphic_map X X'' (g \<circ> f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on g (f ` topspace X)
homeomorphic_map X Y f
homeomorphic_map Y X'' g

goal (1 subgoal):
 1. homeomorphic_map X X'' (g \<circ> f)
[PROOF STEP]
by (meson comp_inj_on homeomorphic_map_def quotient_map_compose_eq)
[PROOF STATE]
proof (state)
this:
homeomorphic_map X X'' (g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma two_bin_code_morphs_nonerasing_morphs: "binary_code_morphism g \<Longrightarrow> binary_code_morphism h \<Longrightarrow> two_nonerasing_morphisms g h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>binary_code_morphism g; binary_code_morphism h\<rbrakk> \<Longrightarrow> two_nonerasing_morphisms g h
[PROOF STEP]
by (simp add: binary_code_morphism.nonerasing binary_code_morphism_def code_morphism.axioms(1) nonerasing_morphism.intro nonerasing_morphism_axioms.intro two_morphisms_def two_nonerasing_morphisms.intro)


[STATEMENT]
lemma Union_disjoint_sets:
  assumes "\<forall>A\<in>C. finite A" and "disjoint C"
  shows "F g (\<Union>C) = (F \<circ> F) g C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g (\<Union> C) = (F \<circ> F) g C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>A\<in>C. finite A
disjoint C

goal (1 subgoal):
 1. F g (\<Union> C) = (F \<circ> F) g C
[PROOF STEP]
unfolding disjoint_def
[PROOF STATE]
proof (prove)
using this:
\<forall>A\<in>C. finite A
\<forall>a\<in>C. \<forall>b\<in>C. a \<noteq> b \<longrightarrow> a \<inter> b = {}

goal (1 subgoal):
 1. F g (\<Union> C) = (F \<circ> F) g C
[PROOF STEP]
by (rule Union_disjoint)


[STATEMENT]
lemma powreal_power_eq:
  "a > 0 \<Longrightarrow> a pow\<^sub>\<real> (of_nat n) = a ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> a pow\<^sub>\<real> real n = a ^ n
[PROOF STEP]
unfolding powreal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (if 0 < a \<and> a < 1 then inverse a powa - real n else if 1 \<le> a then a powa real n else 0) = a ^ n
[PROOF STEP]
by (simp add: powa_minus powa_power_eq power_inverse real_inverse_ge_one_lemma)


[STATEMENT]
lemma cos_periodic_int [simp]:
  fixes i :: int
  shows "cos (x + i * (2 * pi)) = cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x + real_of_int i * (2 * pi)) = cos x
[PROOF STEP]
by (metis cos_add cos_int_2pin diff_zero mult.commute mult.right_neutral mult_zero_right sin_int_2pin)


[STATEMENT]
lemma starfun_ln_gt_zero [simp]: "\<And>x .1 < x \<Longrightarrow> 0 < ( *f* real_ln) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 1 < x \<Longrightarrow> 0 < (*f* real_ln) x
[PROOF STEP]
by transfer (rule ln_gt_zero)


[STATEMENT]
lemma eq_onp_swap : "eq_onp (\<lambda>f. finite {x. f x \<noteq> 0}) (\<lambda>x. lookup m (swap b i x))
   (\<lambda>x. lookup m (swap b i x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_onp (\<lambda>f. finite {x. f x \<noteq> (0::'b)}) (\<lambda>x. lookup m (swap b i x)) (\<lambda>x. lookup m (swap b i x))
[PROOF STEP]
unfolding eq_onp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. lookup m (swap b i x) \<noteq> (0::'b)} \<and> (\<lambda>x. lookup m (swap b i x)) = (\<lambda>x. lookup m (swap b i x))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. lookup m (swap b i x) \<noteq> (0::'b)}
[PROOF STEP]
apply(rule finite_swap_ne)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. lookup m x \<noteq> (0::'b)}
[PROOF STEP]
by auto


[STATEMENT]
lemma wordinterval_union_set_eq[simp]:
    "wordinterval_to_set (wordinterval_union r1 r2) = wordinterval_to_set r1 \<union> wordinterval_to_set r2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (wordinterval_union r1 r2) = wordinterval_to_set r1 \<union> wordinterval_to_set r2
[PROOF STEP]
unfolding wordinterval_union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_to_set (RangeUnion r1 r2) = wordinterval_to_set r1 \<union> wordinterval_to_set r2
[PROOF STEP]
by simp


[STATEMENT]
lemma norm_eq_norm_transpose[simp]: "\<parallel>A\<^sup>\<dagger>\<parallel> = \<parallel>A\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A\<^sup>\<dagger>\<parallel> = \<parallel>A\<parallel>
[PROOF STEP]
using norm_le_transpose[of A] and norm_le_transpose[of "A\<^sup>\<dagger>"]
[PROOF STATE]
proof (prove)
using this:
\<parallel>A\<parallel> \<le> \<parallel>A\<^sup>\<dagger>\<parallel>
\<parallel>A\<^sup>\<dagger>\<parallel> \<le> \<parallel>A\<^sup>\<dagger>\<^sup>\<dagger>\<parallel>

goal (1 subgoal):
 1. \<parallel>A\<^sup>\<dagger>\<parallel> = \<parallel>A\<parallel>
[PROOF STEP]
by simp


[STATEMENT]
lemma llength_ltakeWhile_all: "llength (ltakeWhile P xs) = llength xs \<longleftrightarrow> ltakeWhile P xs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (llength (ltakeWhile P xs) = llength xs) = (ltakeWhile P xs = xs)
[PROOF STEP]
by(auto intro: lprefix_llength_eq_imp_eq lprefix_ltakeWhile)


[STATEMENT]
lemma polyhedron_negations:
  fixes S :: "'a :: euclidean_space set"
  shows   "polyhedron S \<Longrightarrow> polyhedron(image uminus S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polyhedron S \<Longrightarrow> polyhedron (uminus ` S)
[PROOF STEP]
by (subst polyhedron_linear_image_eq) (auto simp: bij_uminus intro!: linear_uminus)


[STATEMENT]
lemma filterlim_realpow_sequentially_at_top:
  "(x::real) > 1 \<Longrightarrow> filterlim (power x) at_top sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < x \<Longrightarrow> filterlim ((^) x) at_top sequentially
[PROOF STEP]
apply (rule LIMSEQ_divide_realpow_zero[THEN filterlim_inverse_at_top,of _ 1,simplified])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 1 < x \<Longrightarrow> 1 < x
 2. 1 < x \<Longrightarrow> \<forall>\<^sub>F xa in sequentially. 0 < x ^ xa
[PROOF STEP]
by auto


[STATEMENT]
lemma enat_minus_mono1: "x \<le> y \<Longrightarrow> x - m \<le> y - (m :: enat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x - m \<le> y - m
[PROOF STEP]
by(cases m x y rule: enat.exhaust[case_product enat.exhaust[case_product enat.exhaust]]) simp_all


[STATEMENT]
lemma ket_one_to_mat_of_cols_list [simp]: "|one\<rangle> = mat_of_cols_list 2 [[0, 1]]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Deutsch.one\<rangle> = Tensor.mat_of_cols_list 2 [[0, 1]]
[PROOF STEP]
apply (auto simp add: ket_vec_def unit_vec_def mat_of_cols_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat 2 (Suc 0) (\<lambda>(i, j). Matrix.vec 2 (\<lambda>j. if j = Suc 0 then 1 else 0) $ i) = Matrix.mat 2 (Suc 0) (\<lambda>(i, j). [[0, 1]] ! j ! i)
[PROOF STEP]
using less_2_cases
[PROOF STATE]
proof (prove)
using this:
?n < 2 \<Longrightarrow> ?n = 0 \<or> ?n = Suc 0

goal (1 subgoal):
 1. Matrix.mat 2 (Suc 0) (\<lambda>(i, j). Matrix.vec 2 (\<lambda>j. if j = Suc 0 then 1 else 0) $ i) = Matrix.mat 2 (Suc 0) (\<lambda>(i, j). [[0, 1]] ! j ! i)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma reduce_below_preserves_dimensions:
 shows [simp]: "dim_row (reduce_below a xs D A) = dim_row A"
    and [simp]: "dim_col (reduce_below a xs D A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (reduce_below a xs D A) = dim_row A &&& dim_col (reduce_below a xs D A) = dim_col A
[PROOF STEP]
using reduce_below[of A "dim_row A" "dim_col A"]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_row A) (dim_col A) \<Longrightarrow> reduce_below ?a ?xs ?D A \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. dim_row (reduce_below a xs D A) = dim_row A &&& dim_col (reduce_below a xs D A) = dim_col A
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_set_id:
  assumes "is_mset_set X"
  shows "mset_set (set_mset X) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set (set_mset X) = X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct_mset X

goal (1 subgoal):
 1. mset_set (set_mset X) = X
[PROOF STEP]
by (fact distinct_mset_set_mset_ident)


[STATEMENT]
lemma closure_bounded_linear_image_subset_eq:
  assumes f: "bounded_linear f"
  shows "closure (f ` closure S) = closure (f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (f ` closure S) = closure (f ` S)
[PROOF STEP]
by (meson closed_closure closure_bounded_linear_image_subset closure_minimal closure_mono closure_subset f image_mono subset_antisym)


[STATEMENT]
lemma times_fun_canc: "(f * g) x = \<Squnion>{f y * g (rquot x y) | y. y \<preceq>\<^sub>R x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<oplus> g) x = \<Squnion>{f y \<oplus> g (rquot x y) |y. y \<preceq>\<^sub>R x}
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f \<oplus> g) x \<le> \<Squnion>{f y \<oplus> g (rquot x y) |y. y \<preceq>\<^sub>R x}
 2. \<Squnion>{f y \<oplus> g (rquot x y) |y. y \<preceq>\<^sub>R x} \<le> (f \<oplus> g) x
[PROOF STEP]
apply (simp add: times_fun_var, intro Sup_subset_mono, simp add: Collect_mono_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>xa. (\<exists>y z. xa = f y \<oplus> g z \<and> D y z \<and> x = y \<oplus> z) \<longrightarrow> (\<exists>y. xa = f y \<oplus> g (rquot x y) \<and> y \<preceq>\<^sub>R x)
 2. \<Squnion>{f y \<oplus> g (rquot x y) |y. y \<preceq>\<^sub>R x} \<le> (f \<oplus> g) x
[PROOF STEP]
using gR_rel_mult add_canc1
[PROOF STATE]
proof (prove)
using this:
D ?x ?y \<Longrightarrow> ?x \<preceq>\<^sub>R ?x \<oplus> ?y
D ?x ?y \<Longrightarrow> rquot (?x \<oplus> ?y) ?x = ?y

goal (2 subgoals):
 1. \<forall>xa. (\<exists>y z. xa = f y \<oplus> g z \<and> D y z \<and> x = y \<oplus> z) \<longrightarrow> (\<exists>y. xa = f y \<oplus> g (rquot x y) \<and> y \<preceq>\<^sub>R x)
 2. \<Squnion>{f y \<oplus> g (rquot x y) |y. y \<preceq>\<^sub>R x} \<le> (f \<oplus> g) x
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{f y \<oplus> g (rquot x y) |y. y \<preceq>\<^sub>R x} \<le> (f \<oplus> g) x
[PROOF STEP]
apply (simp add: times_fun_var, intro Sup_subset_mono, simp add: Collect_mono_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xa. (\<exists>y. xa = f y \<oplus> g (rquot x y) \<and> y \<preceq>\<^sub>R x) \<longrightarrow> (\<exists>y z. xa = f y \<oplus> g z \<and> D y z \<and> x = y \<oplus> z)
[PROOF STEP]
using gR_rel_defined add_canc2
[PROOF STATE]
proof (prove)
using this:
?x \<preceq>\<^sub>R ?y \<Longrightarrow> D ?x (rquot ?y ?x)
?x \<preceq>\<^sub>R ?y \<Longrightarrow> ?x \<oplus> rquot ?y ?x = ?y

goal (1 subgoal):
 1. \<forall>xa. (\<exists>y. xa = f y \<oplus> g (rquot x y) \<and> y \<preceq>\<^sub>R x) \<longrightarrow> (\<exists>y z. xa = f y \<oplus> g z \<and> D y z \<and> x = y \<oplus> z)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma GDERIV_minus:
    "GDERIV f x :> df \<Longrightarrow> GDERIV (\<lambda>x. - f x) x :> - df"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GDERIV f x :> df \<Longrightarrow> GDERIV (\<lambda>x. - f x) x :> - df
[PROOF STEP]
unfolding gderiv_def inner_minus_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative (\<lambda>h. inner h df)) (at x) \<Longrightarrow> ((\<lambda>x. - f x) has_derivative (\<lambda>h. - inner h df)) (at x)
[PROOF STEP]
by (rule has_derivative_minus)


[STATEMENT]
lemma zeroth_root_nat [simp]: "nth_root_nat 0 n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_root_nat 0 n = 0
[PROOF STEP]
by (simp add: nth_root_nat_def)


[STATEMENT]
lemma sublist_append:
  "sublist xs (ys @ zs) \<longleftrightarrow>
     sublist xs ys \<or> sublist xs zs \<or> (\<exists>xs1 xs2. xs = xs1 @ xs2 \<and> suffix xs1 ys \<and> prefix xs2 zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sublist xs (ys @ zs) = (sublist xs ys \<or> sublist xs zs \<or> (\<exists>xs1 xs2. xs = xs1 @ xs2 \<and> suffix xs1 ys \<and> prefix xs2 zs))
[PROOF STEP]
by (auto simp: sublist_altdef prefix_append suffix_append)