[STATEMENT]
lemma homeomorphic_convex_lemma:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "convex S" "compact S" "convex T" "compact T"
      and affeq: "aff_dim S = aff_dim T"
    shows "(S - rel_interior S) homeomorphic (T - rel_interior T) \<and>
           S homeomorphic T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
proof (cases "rel_interior S = {} \<or> rel_interior T = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rel_interior S = {} \<or> rel_interior T = {} \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
 2. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
rel_interior S = {} \<or> rel_interior T = {}

goal (2 subgoals):
 1. rel_interior S = {} \<or> rel_interior T = {} \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
 2. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_interior S = {} \<or> rel_interior T = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel_interior S = {} \<or> rel_interior T = {}

goal (1 subgoal):
 1. S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
by (metis Diff_empty affeq \<open>convex S\<close> \<open>convex T\<close> aff_dim_empty homeomorphic_empty rel_interior_eq_empty aff_dim_empty)
[PROOF STATE]
proof (state)
this:
S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (rel_interior S = {} \<or> rel_interior T = {})

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (rel_interior S = {} \<or> rel_interior T = {})
[PROOF STEP]
obtain a b where a: "a \<in> rel_interior S" and b: "b \<in> rel_interior T"
[PROOF STATE]
proof (prove)
using this:
\<not> (rel_interior S = {} \<or> rel_interior T = {})

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> rel_interior S; b \<in> rel_interior T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> rel_interior S
b \<in> rel_interior T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have starS: "\<And>x. x \<in> S \<Longrightarrow> open_segment a x \<subseteq> rel_interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> open_segment a x \<subseteq> rel_interior S
[PROOF STEP]
using rel_interior_closure_convex_segment
          a \<open>convex S\<close> closure_subset subsetCE
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex ?S; ?a \<in> rel_interior ?S; ?b \<in> closure ?S\<rbrakk> \<Longrightarrow> open_segment ?a ?b \<subseteq> rel_interior ?S
a \<in> rel_interior S
convex S
?S \<subseteq> closure ?S
\<lbrakk>?A \<subseteq> ?B; ?c \<notin> ?A \<Longrightarrow> ?P; ?c \<in> ?B \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> open_segment a x \<subseteq> rel_interior S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> open_segment a ?x \<subseteq> rel_interior S

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have starT: "\<And>x. x \<in> T \<Longrightarrow> open_segment b x \<subseteq> rel_interior T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> open_segment b x \<subseteq> rel_interior T
[PROOF STEP]
using rel_interior_closure_convex_segment
          b \<open>convex T\<close> closure_subset subsetCE
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex ?S; ?a \<in> rel_interior ?S; ?b \<in> closure ?S\<rbrakk> \<Longrightarrow> open_segment ?a ?b \<subseteq> rel_interior ?S
b \<in> rel_interior T
convex T
?S \<subseteq> closure ?S
\<lbrakk>?A \<subseteq> ?B; ?c \<notin> ?A \<Longrightarrow> ?P; ?c \<in> ?B \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> open_segment b x \<subseteq> rel_interior T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> T \<Longrightarrow> open_segment b ?x \<subseteq> rel_interior T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
let ?aS = "(+) (-a) ` S" and ?bT = "(+) (-b) ` T"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have 0: "0 \<in> affine hull ?aS" "0 \<in> affine hull ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<in> affine hull (+) (- a) ` S &&& (0::'b) \<in> affine hull (+) (- b) ` T
[PROOF STEP]
by (metis a b subsetD hull_inc image_eqI left_minus rel_interior_subset)+
[PROOF STATE]
proof (state)
this:
(0::'a) \<in> affine hull (+) (- a) ` S
(0::'b) \<in> affine hull (+) (- b) ` T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have subs: "subspace (span ?aS)" "subspace (span ?bT)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace (span ((+) (- a) ` S)) &&& subspace (span ((+) (- b) ` T))
[PROOF STEP]
by (rule subspace_span)+
[PROOF STATE]
proof (state)
this:
subspace (span ((+) (- a) ` S))
subspace (span ((+) (- b) ` T))

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subspace (span ((+) (- a) ` S))
subspace (span ((+) (- b) ` T))

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "dim (span ((+) (- a) ` S)) = dim (span ((+) (- b) ` T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim (span ((+) (- a) ` S)) = dim (span ((+) (- b) ` T))
[PROOF STEP]
by (metis 0 aff_dim_translation_eq aff_dim_zero affeq dim_span nat_int)
[PROOF STATE]
proof (state)
this:
dim (span ((+) (- a) ` S)) = dim (span ((+) (- b) ` T))

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subspace (span ((+) (- a) ` S))
subspace (span ((+) (- b) ` T))
dim (span ((+) (- a) ` S)) = dim (span ((+) (- b) ` T))
[PROOF STEP]
obtain f g where "linear f" "linear g"
                and fim: "f ` span ?aS = span ?bT"
                and gim: "g ` span ?bT = span ?aS"
                and fno: "\<And>x. x \<in> span ?aS \<Longrightarrow> norm(f x) = norm x"
                and gno: "\<And>x. x \<in> span ?bT \<Longrightarrow> norm(g x) = norm x"
                and gf: "\<And>x. x \<in> span ?aS \<Longrightarrow> g(f x) = x"
                and fg: "\<And>x. x \<in> span ?bT \<Longrightarrow> f(g x) = x"
[PROOF STATE]
proof (prove)
using this:
subspace (span ((+) (- a) ` S))
subspace (span ((+) (- b) ` T))
dim (span ((+) (- a) ` S)) = dim (span ((+) (- b) ` T))

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>linear f; linear g; f ` span ((+) (- a) ` S) = span ((+) (- b) ` T); g ` span ((+) (- b) ` T) = span ((+) (- a) ` S); \<And>x. x \<in> span ((+) (- a) ` S) \<Longrightarrow> norm (f x) = norm x; \<And>x. x \<in> span ((+) (- b) ` T) \<Longrightarrow> norm (g x) = norm x; \<And>x. x \<in> span ((+) (- a) ` S) \<Longrightarrow> g (f x) = x; \<And>x. x \<in> span ((+) (- b) ` T) \<Longrightarrow> f (g x) = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule isometries_subspaces) blast
[PROOF STATE]
proof (state)
this:
linear f
linear g
f ` span ((+) (- a) ` S) = span ((+) (- b) ` T)
g ` span ((+) (- b) ` T) = span ((+) (- a) ` S)
?x \<in> span ((+) (- a) ` S) \<Longrightarrow> norm (f ?x) = norm ?x
?x \<in> span ((+) (- b) ` T) \<Longrightarrow> norm (g ?x) = norm ?x
?x \<in> span ((+) (- a) ` S) \<Longrightarrow> g (f ?x) = ?x
?x \<in> span ((+) (- b) ` T) \<Longrightarrow> f (g ?x) = ?x

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have [simp]: "continuous_on A f" for A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A f
[PROOF STEP]
using \<open>linear f\<close> linear_conv_bounded_linear linear_continuous_on
[PROOF STATE]
proof (prove)
using this:
linear f
linear ?f = bounded_linear ?f
bounded_linear ?f \<Longrightarrow> continuous_on ?s ?f

goal (1 subgoal):
 1. continuous_on A f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on ?A f

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have [simp]: "continuous_on B g" for B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on B g
[PROOF STEP]
using \<open>linear g\<close> linear_conv_bounded_linear linear_continuous_on
[PROOF STATE]
proof (prove)
using this:
linear g
linear ?f = bounded_linear ?f
bounded_linear ?f \<Longrightarrow> continuous_on ?s ?f

goal (1 subgoal):
 1. continuous_on B g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on ?B g

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have eqspanS: "affine hull ?aS = span ?aS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull (+) (- a) ` S = span ((+) (- a) ` S)
[PROOF STEP]
by (metis a affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
[PROOF STATE]
proof (state)
this:
affine hull (+) (- a) ` S = span ((+) (- a) ` S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have eqspanT: "affine hull ?bT = span ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull (+) (- b) ` T = span ((+) (- b) ` T)
[PROOF STEP]
by (metis b affine_hull_span_0 subsetD hull_inc image_eqI left_minus rel_interior_subset)
[PROOF STATE]
proof (state)
this:
affine hull (+) (- b) ` T = span ((+) (- b) ` T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "S homeomorphic cball a 1 \<inter> affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S homeomorphic cball a 1 \<inter> affine hull S
[PROOF STEP]
by (rule starlike_compact_projective2 [OF \<open>compact S\<close> a starS])
[PROOF STATE]
proof (state)
this:
S homeomorphic cball a 1 \<inter> affine hull S

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S homeomorphic cball a 1 \<inter> affine hull S

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic (+) (-a) ` (cball a 1 \<inter> affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball a 1 \<inter> affine hull S homeomorphic (+) (- a) ` (cball a 1 \<inter> affine hull S)
[PROOF STEP]
by (metis homeomorphic_translation)
[PROOF STATE]
proof (state)
this:
cball a 1 \<inter> affine hull S homeomorphic (+) (- a) ` (cball a 1 \<inter> affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cball a 1 \<inter> affine hull S homeomorphic (+) (- a) ` (cball a 1 \<inter> affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = cball 0 1 \<inter> (+) (-a) ` (affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- a) ` (cball a 1 \<inter> affine hull S) = cball (0::'a) 1 \<inter> (+) (- a) ` (affine hull S)
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
(+) (- a) ` (cball a 1 \<inter> affine hull S) = cball (0::'a) 1 \<inter> (+) (- a) ` (affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(+) (- a) ` (cball a 1 \<inter> affine hull S) = cball (0::'a) 1 \<inter> (+) (- a) ` (affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = cball 0 1 \<inter> span ?aS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
using eqspanS affine_hull_translation
[PROOF STATE]
proof (prove)
using this:
affine hull (+) (- a) ` S = span ((+) (- a) ` S)
affine hull (+) ?a ` ?S = (+) ?a ` (affine hull ?S)

goal (1 subgoal):
 1. cball (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cball (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cball (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic cball 0 1 \<inter> span ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (0::'a) 1 \<inter> span ((+) (- a) ` S) homeomorphic cball (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
proof (rule homeomorphicI)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. ?f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) = cball (0::'b) 1 \<inter> span ((+) (- b) ` T)
 2. ?g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
 3. continuous_on (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) ?f
 4. continuous_on (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) ?g
 5. \<And>x. x \<in> cball (0::'a) 1 \<inter> span ((+) (- a) ` S) \<Longrightarrow> ?g (?f x) = x
 6. \<And>y. y \<in> cball (0::'b) 1 \<inter> span ((+) (- b) ` T) \<Longrightarrow> ?f (?g y) = y
[PROOF STEP]
show fim1: "f ` (cball 0 1 \<inter> span ?aS) = cball 0 1 \<inter> span ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) = cball (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> cball (0::'b) 1 \<inter> span ((+) (- b) ` T)
 2. cball (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S))
[PROOF STEP]
show "f ` (cball 0 1 \<inter> span ?aS) \<subseteq> cball 0 1 \<inter> span ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> cball (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
using fim fno
[PROOF STATE]
proof (prove)
using this:
f ` span ((+) (- a) ` S) = span ((+) (- b) ` T)
?x \<in> span ((+) (- a) ` S) \<Longrightarrow> norm (f ?x) = norm ?x

goal (1 subgoal):
 1. f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> cball (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> cball (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (1 subgoal):
 1. cball (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S))
[PROOF STEP]
show "cball 0 1 \<inter> span ?bT \<subseteq> f ` (cball 0 1 \<inter> span ?aS)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S))
[PROOF STEP]
by clarify (metis IntI fg gim gno image_eqI mem_cball_0)
[PROOF STATE]
proof (state)
this:
cball (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ` (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) = cball (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (5 subgoals):
 1. ?g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
 2. continuous_on (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) f
 3. continuous_on (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) ?g
 4. \<And>x. x \<in> cball (0::'a) 1 \<inter> span ((+) (- a) ` S) \<Longrightarrow> ?g (f x) = x
 5. \<And>y. y \<in> cball (0::'b) 1 \<inter> span ((+) (- b) ` T) \<Longrightarrow> f (?g y) = y
[PROOF STEP]
show "g ` (cball 0 1 \<inter> span ?bT) = cball 0 1 \<inter> span ?aS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
 2. cball (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T))
[PROOF STEP]
show "g ` (cball 0 1 \<inter> span ?bT) \<subseteq> cball 0 1 \<inter> span ?aS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
using gim gno
[PROOF STATE]
proof (prove)
using this:
g ` span ((+) (- b) ` T) = span ((+) (- a) ` S)
?x \<in> span ((+) (- b) ` T) \<Longrightarrow> norm (g ?x) = norm ?x

goal (1 subgoal):
 1. g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> cball (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> cball (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (1 subgoal):
 1. cball (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T))
[PROOF STEP]
show "cball 0 1 \<inter> span ?aS \<subseteq> g ` (cball 0 1 \<inter> span ?bT)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T))
[PROOF STEP]
by clarify (metis IntI fim1 gf image_eqI)
[PROOF STATE]
proof (state)
this:
cball (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g ` (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) = cball (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (4 subgoals):
 1. continuous_on (cball (0::'a) 1 \<inter> span ((+) (- a) ` S)) f
 2. continuous_on (cball (0::'b) 1 \<inter> span ((+) (- b) ` T)) g
 3. \<And>x. x \<in> cball (0::'a) 1 \<inter> span ((+) (- a) ` S) \<Longrightarrow> g (f x) = x
 4. \<And>y. y \<in> cball (0::'b) 1 \<inter> span ((+) (- b) ` T) \<Longrightarrow> f (g y) = y
[PROOF STEP]
qed (auto simp: fg gf)
[PROOF STATE]
proof (state)
this:
cball (0::'a) 1 \<inter> span ((+) (- a) ` S) homeomorphic cball (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cball (0::'a) 1 \<inter> span ((+) (- a) ` S) homeomorphic cball (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = cball 0 1 \<inter> (+) (-b) ` (affine hull T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (0::'b) 1 \<inter> span ((+) (- b) ` T) = cball (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)
[PROOF STEP]
using eqspanT affine_hull_translation
[PROOF STATE]
proof (prove)
using this:
affine hull (+) (- b) ` T = span ((+) (- b) ` T)
affine hull (+) ?a ` ?S = (+) ?a ` (affine hull ?S)

goal (1 subgoal):
 1. cball (0::'b) 1 \<inter> span ((+) (- b) ` T) = cball (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cball (0::'b) 1 \<inter> span ((+) (- b) ` T) = cball (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cball (0::'b) 1 \<inter> span ((+) (- b) ` T) = cball (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = (+) (-b) ` (cball b 1 \<inter> affine hull T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (0::'b) 1 \<inter> (+) (- b) ` (affine hull T) = (+) (- b) ` (cball b 1 \<inter> affine hull T)
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
cball (0::'b) 1 \<inter> (+) (- b) ` (affine hull T) = (+) (- b) ` (cball b 1 \<inter> affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cball (0::'b) 1 \<inter> (+) (- b) ` (affine hull T) = (+) (- b) ` (cball b 1 \<inter> affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic (cball b 1 \<inter> affine hull T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- b) ` (cball b 1 \<inter> affine hull T) homeomorphic cball b 1 \<inter> affine hull T
[PROOF STEP]
by (metis homeomorphic_translation homeomorphic_sym)
[PROOF STATE]
proof (state)
this:
(+) (- b) ` (cball b 1 \<inter> affine hull T) homeomorphic cball b 1 \<inter> affine hull T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(+) (- b) ` (cball b 1 \<inter> affine hull T) homeomorphic cball b 1 \<inter> affine hull T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball b 1 \<inter> affine hull T homeomorphic T
[PROOF STEP]
by (metis starlike_compact_projective2 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
[PROOF STATE]
proof (state)
this:
cball b 1 \<inter> affine hull T homeomorphic T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S homeomorphic T
[PROOF STEP]
have 1: "S homeomorphic T"
[PROOF STATE]
proof (prove)
using this:
S homeomorphic T

goal (1 subgoal):
 1. S homeomorphic T
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
S homeomorphic T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S
[PROOF STEP]
by (rule starlike_compact_projective1 [OF \<open>compact S\<close> a starS])
[PROOF STATE]
proof (state)
this:
S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S - rel_interior S homeomorphic sphere a 1 \<inter> affine hull S

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic (+) (-a) ` (sphere a 1 \<inter> affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere a 1 \<inter> affine hull S homeomorphic (+) (- a) ` (sphere a 1 \<inter> affine hull S)
[PROOF STEP]
by (metis homeomorphic_translation)
[PROOF STATE]
proof (state)
this:
sphere a 1 \<inter> affine hull S homeomorphic (+) (- a) ` (sphere a 1 \<inter> affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sphere a 1 \<inter> affine hull S homeomorphic (+) (- a) ` (sphere a 1 \<inter> affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = sphere 0 1 \<inter> (+) (-a) ` (affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- a) ` (sphere a 1 \<inter> affine hull S) = sphere (0::'a) 1 \<inter> (+) (- a) ` (affine hull S)
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
(+) (- a) ` (sphere a 1 \<inter> affine hull S) = sphere (0::'a) 1 \<inter> (+) (- a) ` (affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(+) (- a) ` (sphere a 1 \<inter> affine hull S) = sphere (0::'a) 1 \<inter> (+) (- a) ` (affine hull S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = sphere 0 1 \<inter> span ?aS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
using eqspanS affine_hull_translation
[PROOF STATE]
proof (prove)
using this:
affine hull (+) (- a) ` S = span ((+) (- a) ` S)
affine hull (+) ?a ` ?S = (+) ?a ` (affine hull ?S)

goal (1 subgoal):
 1. sphere (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sphere (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sphere (0::'a) 1 \<inter> (+) (- a) ` (affine hull S) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic sphere 0 1 \<inter> span ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) homeomorphic sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
proof (rule homeomorphicI)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. ?f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) = sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)
 2. ?g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
 3. continuous_on (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) ?f
 4. continuous_on (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) ?g
 5. \<And>x. x \<in> sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) \<Longrightarrow> ?g (?f x) = x
 6. \<And>y. y \<in> sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) \<Longrightarrow> ?f (?g y) = y
[PROOF STEP]
show fim1: "f ` (sphere 0 1 \<inter> span ?aS) = sphere 0 1 \<inter> span ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) = sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)
 2. sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S))
[PROOF STEP]
show "f ` (sphere 0 1 \<inter> span ?aS) \<subseteq> sphere 0 1 \<inter> span ?bT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
using fim fno
[PROOF STATE]
proof (prove)
using this:
f ` span ((+) (- a) ` S) = span ((+) (- b) ` T)
?x \<in> span ((+) (- a) ` S) \<Longrightarrow> norm (f ?x) = norm ?x

goal (1 subgoal):
 1. f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) \<subseteq> sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (1 subgoal):
 1. sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S))
[PROOF STEP]
show "sphere 0 1 \<inter> span ?bT \<subseteq> f ` (sphere 0 1 \<inter> span ?aS)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S))
[PROOF STEP]
by clarify (metis IntI fg gim gno image_eqI mem_sphere_0)
[PROOF STATE]
proof (state)
this:
sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) \<subseteq> f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ` (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) = sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (5 subgoals):
 1. ?g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
 2. continuous_on (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) f
 3. continuous_on (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) ?g
 4. \<And>x. x \<in> sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) \<Longrightarrow> ?g (f x) = x
 5. \<And>y. y \<in> sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) \<Longrightarrow> f (?g y) = y
[PROOF STEP]
show "g ` (sphere 0 1 \<inter> span ?bT) = sphere 0 1 \<inter> span ?aS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
 2. sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T))
[PROOF STEP]
show "g ` (sphere 0 1 \<inter> span ?bT) \<subseteq> sphere 0 1 \<inter> span ?aS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
using gim gno
[PROOF STATE]
proof (prove)
using this:
g ` span ((+) (- b) ` T) = span ((+) (- a) ` S)
?x \<in> span ((+) (- b) ` T) \<Longrightarrow> norm (g ?x) = norm ?x

goal (1 subgoal):
 1. g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) \<subseteq> sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (1 subgoal):
 1. sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T))
[PROOF STEP]
show "sphere 0 1 \<inter> span ?aS \<subseteq> g ` (sphere 0 1 \<inter> span ?bT)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T))
[PROOF STEP]
by clarify (metis IntI fim1 gf image_eqI)
[PROOF STATE]
proof (state)
this:
sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) \<subseteq> g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g ` (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) = sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)

goal (4 subgoals):
 1. continuous_on (sphere (0::'a) 1 \<inter> span ((+) (- a) ` S)) f
 2. continuous_on (sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)) g
 3. \<And>x. x \<in> sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) \<Longrightarrow> g (f x) = x
 4. \<And>y. y \<in> sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) \<Longrightarrow> f (g y) = y
[PROOF STEP]
qed (auto simp: fg gf)
[PROOF STATE]
proof (state)
this:
sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) homeomorphic sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sphere (0::'a) 1 \<inter> span ((+) (- a) ` S) homeomorphic sphere (0::'b) 1 \<inter> span ((+) (- b) ` T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = sphere 0 1 \<inter> (+) (-b) ` (affine hull T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) = sphere (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)
[PROOF STEP]
using eqspanT affine_hull_translation
[PROOF STATE]
proof (prove)
using this:
affine hull (+) (- b) ` T = span ((+) (- b) ` T)
affine hull (+) ?a ` ?S = (+) ?a ` (affine hull ?S)

goal (1 subgoal):
 1. sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) = sphere (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) = sphere (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sphere (0::'b) 1 \<inter> span ((+) (- b) ` T) = sphere (0::'b) 1 \<inter> (+) (- b) ` (affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... = (+) (-b) ` (sphere b 1 \<inter> affine hull T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere (0::'b) 1 \<inter> (+) (- b) ` (affine hull T) = (+) (- b) ` (sphere b 1 \<inter> affine hull T)
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
sphere (0::'b) 1 \<inter> (+) (- b) ` (affine hull T) = (+) (- b) ` (sphere b 1 \<inter> affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sphere (0::'b) 1 \<inter> (+) (- b) ` (affine hull T) = (+) (- b) ` (sphere b 1 \<inter> affine hull T)

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic (sphere b 1 \<inter> affine hull T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- b) ` (sphere b 1 \<inter> affine hull T) homeomorphic sphere b 1 \<inter> affine hull T
[PROOF STEP]
by (metis homeomorphic_translation homeomorphic_sym)
[PROOF STATE]
proof (state)
this:
(+) (- b) ` (sphere b 1 \<inter> affine hull T) homeomorphic sphere b 1 \<inter> affine hull T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(+) (- b) ` (sphere b 1 \<inter> affine hull T) homeomorphic sphere b 1 \<inter> affine hull T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
have "... homeomorphic T - rel_interior T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere b 1 \<inter> affine hull T homeomorphic T - rel_interior T
[PROOF STEP]
by (metis starlike_compact_projective1 [OF \<open>compact T\<close> b starT] homeomorphic_sym)
[PROOF STATE]
proof (state)
this:
sphere b 1 \<inter> affine hull T homeomorphic T - rel_interior T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S - rel_interior S homeomorphic T - rel_interior T
[PROOF STEP]
have 2: "S - rel_interior S homeomorphic T - rel_interior T"
[PROOF STATE]
proof (prove)
using this:
S - rel_interior S homeomorphic T - rel_interior T

goal (1 subgoal):
 1. S - rel_interior S homeomorphic T - rel_interior T
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
S - rel_interior S homeomorphic T - rel_interior T

goal (1 subgoal):
 1. \<not> (rel_interior S = {} \<or> rel_interior T = {}) \<Longrightarrow> S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
S homeomorphic T
S - rel_interior S homeomorphic T - rel_interior T

goal (1 subgoal):
 1. S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S - rel_interior S homeomorphic T - rel_interior T \<and> S homeomorphic T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DERIV_compose_FDERIV:\<comment>\<open>TODO: generalize and move from HOL-ODE\<close>
  assumes "DERIV f (g x) :> f'"
  assumes "(g has_derivative g') (at x within s)"
  shows "((\<lambda>x. f (g x)) has_derivative (\<lambda>x. g' x * f')) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_derivative (\<lambda>x. g' x * f')) (at x within s)
[PROOF STEP]
using assms has_derivative_compose[of g g' x s f "(*) f'"]
[PROOF STATE]
proof (prove)
using this:
(f has_field_derivative f') (at (g x))
(g has_derivative g') (at x within s)
\<lbrakk>(g has_derivative g') (at x within s); (f has_derivative (*) f') (at (g x))\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_derivative (\<lambda>x. f' * g' x)) (at x within s)

goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_derivative (\<lambda>x. g' x * f')) (at x within s)
[PROOF STEP]
by (auto simp: has_field_derivative_def ac_simps)


[STATEMENT]
lemma length_keys_to_list: "length (keys_to_list p) = card (keys p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (keys_to_list p) = card (keys p)
[PROOF STEP]
by (simp only: keys_to_list_def length_pps_to_list)


[STATEMENT]
lemma rtrancl_Int_help:
  "(a,b) \<in> (A \<inter> B) ^*  ==> (a,b) \<in> A^* \<and> (a,b) \<in> B^*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, b) \<in> (A \<inter> B)\<^sup>* \<Longrightarrow> (a, b) \<in> A\<^sup>* \<and> (a, b) \<in> B\<^sup>*
[PROOF STEP]
apply (unfold Int_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (a, b) \<in> A\<^sup>* \<and> (a, b) \<in> B\<^sup>*
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (a, b) \<in> A\<^sup>*
 2. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (a, b) \<in> B\<^sup>*
[PROOF STEP]
apply (rule_tac b=b in rtrancl_induct)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (?a1, b) \<in> ?r1\<^sup>*
 2. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (a, ?a1) \<in> A\<^sup>*
 3. \<And>y z. \<lbrakk>(a, b) \<in> {x \<in> A. x \<in> B}\<^sup>*; (?a1, y) \<in> ?r1\<^sup>*; (y, z) \<in> ?r1; (a, y) \<in> A\<^sup>*\<rbrakk> \<Longrightarrow> (a, z) \<in> A\<^sup>*
 4. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (a, b) \<in> B\<^sup>*
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (a, b) \<in> B\<^sup>*
[PROOF STEP]
apply (rule_tac b=b in rtrancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (?a7, b) \<in> ?r7\<^sup>*
 2. (a, b) \<in> {x \<in> A. x \<in> B}\<^sup>* \<Longrightarrow> (a, ?a7) \<in> B\<^sup>*
 3. \<And>y z. \<lbrakk>(a, b) \<in> {x \<in> A. x \<in> B}\<^sup>*; (?a7, y) \<in> ?r7\<^sup>*; (y, z) \<in> ?r7; (a, y) \<in> B\<^sup>*\<rbrakk> \<Longrightarrow> (a, z) \<in> B\<^sup>*
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma orthogonal_complement_kernel_functional:
  fixes f :: \<open>'a::complex_inner \<Rightarrow> complex\<close>
  assumes \<open>bounded_clinear f\<close>
  shows \<open>\<exists>x. orthogonal_complement (f -` {0}) = cspan {x}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
proof (cases \<open>orthogonal_complement (f -` {0}) = {0}\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. orthogonal_complement (f -` {0}) = {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
 2. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
orthogonal_complement (f -` {0}) = {0::'a}

goal (2 subgoals):
 1. orthogonal_complement (f -` {0}) = {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
 2. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
orthogonal_complement (f -` {0}) = {0::'a}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
orthogonal_complement (f -` {0}) = {0::'a}

goal (1 subgoal):
 1. \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
apply (rule_tac x=0 in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) = {0::'a} \<Longrightarrow> orthogonal_complement (f -` {0}) = cspan {0::'a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x. orthogonal_complement (f -` {0}) = cspan {x}

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
orthogonal_complement (f -` {0}) \<noteq> {0::'a}

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
orthogonal_complement (f -` {0}) \<noteq> {0::'a}
[PROOF STEP]
obtain x where xortho: \<open>x \<in> orthogonal_complement (f -` {0})\<close> and xnon0: \<open>x \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
orthogonal_complement (f -` {0}) \<noteq> {0::'a}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> orthogonal_complement (f -` {0}); x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using complex_vector.subspace_def
[PROOF STATE]
proof (prove)
using this:
orthogonal_complement (f -` {0}) \<noteq> {0::'a}
csubspace ?S = ((0::?'a) \<in> ?S \<and> (\<forall>x\<in>?S. \<forall>y\<in>?S. x + y \<in> ?S) \<and> (\<forall>c. \<forall>x\<in>?S. c *\<^sub>C x \<in> ?S))

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> orthogonal_complement (f -` {0}); x \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<in> orthogonal_complement (f -` {0})
x \<noteq> (0::'a)

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
from xnon0 xortho
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> (0::'a)
x \<in> orthogonal_complement (f -` {0})
[PROOF STEP]
have r1: \<open>f x \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)
x \<in> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. f x \<noteq> 0
[PROOF STEP]
by (metis cinner_eq_zero_iff orthogonal_complement_orthoI vimage_singleton_eq)
[PROOF STATE]
proof (state)
this:
f x \<noteq> 0

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
have \<open>\<exists> k. y = k *\<^sub>C x\<close> if \<open>y \<in> orthogonal_complement (f -` {0})\<close> for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
proof (cases \<open>y = 0\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
 2. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
y = (0::'a)

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
 2. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y = (0::'a)

goal (1 subgoal):
 1. \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>k. y = k *\<^sub>C x

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
y \<noteq> (0::'a)

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
y \<in> orthogonal_complement (f -` {0})
y \<noteq> (0::'a)
[PROOF STEP]
have \<open>f y \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> orthogonal_complement (f -` {0})
y \<noteq> (0::'a)

goal (1 subgoal):
 1. f y \<noteq> 0
[PROOF STEP]
by (metis cinner_eq_zero_iff orthogonal_complement_orthoI vimage_singleton_eq)
[PROOF STATE]
proof (state)
this:
f y \<noteq> 0

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f y \<noteq> 0
[PROOF STEP]
obtain k where k_def: \<open>f x = k * f y\<close>
[PROOF STATE]
proof (prove)
using this:
f y \<noteq> 0

goal (1 subgoal):
 1. (\<And>k. f x = k * f y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis add.inverse_inverse minus_divide_eq_eq)
[PROOF STATE]
proof (state)
this:
f x = k * f y

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
bounded_clinear f
f x = k * f y
[PROOF STEP]
have \<open>f x = f (k *\<^sub>C y)\<close>
[PROOF STATE]
proof (prove)
using this:
bounded_clinear f
f x = k * f y

goal (1 subgoal):
 1. f x = f (k *\<^sub>C y)
[PROOF STEP]
by (simp add: bounded_clinear.axioms(1) clinear.scaleC)
[PROOF STATE]
proof (state)
this:
f x = f (k *\<^sub>C y)

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
hence \<open>f x - f (k *\<^sub>C y) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
f x = f (k *\<^sub>C y)

goal (1 subgoal):
 1. f x - f (k *\<^sub>C y) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x - f (k *\<^sub>C y) = 0

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
bounded_clinear f
f x - f (k *\<^sub>C y) = 0
[PROOF STEP]
have s1: \<open>f (x - k *\<^sub>C y) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
bounded_clinear f
f x - f (k *\<^sub>C y) = 0

goal (1 subgoal):
 1. f (x - k *\<^sub>C y) = 0
[PROOF STEP]
by (simp add: bounded_clinear.axioms(1) complex_vector.linear_diff)
[PROOF STATE]
proof (state)
this:
f (x - k *\<^sub>C y) = 0

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
y \<in> orthogonal_complement (f -` {0})
[PROOF STEP]
have \<open>k *\<^sub>C y \<in> orthogonal_complement (f -` {0})\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. k *\<^sub>C y \<in> orthogonal_complement (f -` {0})
[PROOF STEP]
by (simp add: complex_vector.subspace_scale)
[PROOF STATE]
proof (state)
this:
k *\<^sub>C y \<in> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
with xortho
[PROOF STATE]
proof (chain)
picking this:
x \<in> orthogonal_complement (f -` {0})
k *\<^sub>C y \<in> orthogonal_complement (f -` {0})
[PROOF STEP]
have s2: \<open>x - (k *\<^sub>C y) \<in> orthogonal_complement (f -` {0})\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> orthogonal_complement (f -` {0})
k *\<^sub>C y \<in> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. x - k *\<^sub>C y \<in> orthogonal_complement (f -` {0})
[PROOF STEP]
by (simp add: complex_vector.subspace_diff)
[PROOF STATE]
proof (state)
this:
x - k *\<^sub>C y \<in> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
have s3: \<open>(x - (k *\<^sub>C y)) \<in> f -` {0}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - k *\<^sub>C y \<in> f -` {0}
[PROOF STEP]
using s1
[PROOF STATE]
proof (prove)
using this:
f (x - k *\<^sub>C y) = 0

goal (1 subgoal):
 1. x - k *\<^sub>C y \<in> f -` {0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - k *\<^sub>C y \<in> f -` {0}

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x - k *\<^sub>C y \<in> f -` {0}

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
have \<open>(f -` {0}) \<inter> (orthogonal_complement (f -` {0})) = {0}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f -` {0} \<inter> orthogonal_complement (f -` {0}) = {0::'a}
[PROOF STEP]
by (meson assms closed_csubspace_def complex_vector.subspace_def kernel_is_closed_csubspace
          orthogonal_complement_zero_intersection)
[PROOF STATE]
proof (state)
this:
f -` {0} \<inter> orthogonal_complement (f -` {0}) = {0::'a}

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x - k *\<^sub>C y \<in> f -` {0}
f -` {0} \<inter> orthogonal_complement (f -` {0}) = {0::'a}
[PROOF STEP]
have \<open>x - (k *\<^sub>C y) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
x - k *\<^sub>C y \<in> f -` {0}
f -` {0} \<inter> orthogonal_complement (f -` {0}) = {0::'a}

goal (1 subgoal):
 1. x - k *\<^sub>C y = (0::'a)
[PROOF STEP]
using s2
[PROOF STATE]
proof (prove)
using this:
x - k *\<^sub>C y \<in> f -` {0}
f -` {0} \<inter> orthogonal_complement (f -` {0}) = {0::'a}
x - k *\<^sub>C y \<in> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. x - k *\<^sub>C y = (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x - k *\<^sub>C y = (0::'a)

goal (1 subgoal):
 1. y \<noteq> (0::'a) \<Longrightarrow> \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x - k *\<^sub>C y = (0::'a)

goal (1 subgoal):
 1. \<exists>k. y = k *\<^sub>C x
[PROOF STEP]
by (metis ceq_vector_fraction_iff eq_iff_diff_eq_0 k_def r1 scaleC_scaleC)
[PROOF STATE]
proof (state)
this:
\<exists>k. y = k *\<^sub>C x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y \<in> orthogonal_complement (f -` {0}) \<Longrightarrow> \<exists>k. ?y = k *\<^sub>C x

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y \<in> orthogonal_complement (f -` {0}) \<Longrightarrow> \<exists>k. ?y = k *\<^sub>C x
[PROOF STEP]
have \<open>orthogonal_complement (f -` {0}) \<subseteq> cspan {x}\<close>
[PROOF STATE]
proof (prove)
using this:
?y \<in> orthogonal_complement (f -` {0}) \<Longrightarrow> \<exists>k. ?y = k *\<^sub>C x

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<subseteq> cspan {x}
[PROOF STEP]
using complex_vector.span_superset complex_vector.subspace_scale
[PROOF STATE]
proof (prove)
using this:
?y \<in> orthogonal_complement (f -` {0}) \<Longrightarrow> \<exists>k. ?y = k *\<^sub>C x
?S \<subseteq> cspan ?S
\<lbrakk>csubspace ?S; ?x \<in> ?S\<rbrakk> \<Longrightarrow> ?c *\<^sub>C ?x \<in> ?S

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<subseteq> cspan {x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
orthogonal_complement (f -` {0}) \<subseteq> cspan {x}

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
orthogonal_complement (f -` {0}) \<subseteq> cspan {x}

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
from xortho
[PROOF STATE]
proof (chain)
picking this:
x \<in> orthogonal_complement (f -` {0})
[PROOF STEP]
have \<open>orthogonal_complement (f -` {0}) \<supseteq> cspan {x}\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. cspan {x} \<subseteq> orthogonal_complement (f -` {0})
[PROOF STEP]
by (simp add: complex_vector.span_minimal)
[PROOF STATE]
proof (state)
this:
cspan {x} \<subseteq> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. orthogonal_complement (f -` {0}) \<noteq> {0::'a} \<Longrightarrow> \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
orthogonal_complement (f -` {0}) \<subseteq> cspan {x}
cspan {x} \<subseteq> orthogonal_complement (f -` {0})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
orthogonal_complement (f -` {0}) \<subseteq> cspan {x}
cspan {x} \<subseteq> orthogonal_complement (f -` {0})

goal (1 subgoal):
 1. \<exists>x. orthogonal_complement (f -` {0}) = cspan {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x. orthogonal_complement (f -` {0}) = cspan {x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_group_subgroup_generated:
  assumes "\<And>i. i \<in> I \<Longrightarrow> group (G i)" and sg: "\<And>i. i \<in> I \<Longrightarrow> subgroup (H i) (G i)"
  shows "sum_group I (\<lambda>i. subgroup_generated (G i) (H i)) = subgroup_generated (sum_group I G) (PiE I H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_group I (\<lambda>i. subgroup_generated (G i) (H i)) = subgroup_generated (sum_group I G) (Pi\<^sub>E I H)
[PROOF STEP]
proof (rule monoid.equality)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
have "subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (product_group I G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (product_group I G)
[PROOF STEP]
by (rule subgroup_Int) (auto simp: assms carrier_sum_group subgroup_sum_group PiE_subgroup_product_group)
[PROOF STATE]
proof (state)
this:
subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (product_group I G)

goal (4 subgoals):
 1. carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (product_group I G)

goal (4 subgoals):
 1. carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
have "carrier (sum_group I G) \<inter> Pi\<^sub>E I H
              \<subseteq> carrier (subgroup_generated (product_group I G)
                    {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (sum_group I G) \<inter> Pi\<^sub>E I H \<subseteq> carrier (subgroup_generated (product_group I G) {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}})
[PROOF STEP]
by (simp add: assms subgroup_sum_group subgroup.carrier_subgroup_generated_subgroup carrier_sum_group)
[PROOF STATE]
proof (state)
this:
carrier (sum_group I G) \<inter> Pi\<^sub>E I H \<subseteq> carrier (subgroup_generated (product_group I G) {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}})

goal (4 subgoals):
 1. carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (product_group I G)
carrier (sum_group I G) \<inter> Pi\<^sub>E I H \<subseteq> carrier (subgroup_generated (product_group I G) {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}})
[PROOF STEP]
have "subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (sum_group I G)"
[PROOF STATE]
proof (prove)
using this:
subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (product_group I G)
carrier (sum_group I G) \<inter> Pi\<^sub>E I H \<subseteq> carrier (subgroup_generated (product_group I G) {x \<in> \<Pi>\<^sub>E i\<in>I. carrier (G i). finite {i \<in> I. x i \<noteq> \<one>\<^bsub>G i\<^esub>}})

goal (1 subgoal):
 1. subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (sum_group I G)
[PROOF STEP]
by (simp add: assms sum_group_def group.subgroup_subgroup_generated_iff)
[PROOF STATE]
proof (state)
this:
subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (sum_group I G)

goal (4 subgoals):
 1. carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (sum_group I G)
[PROOF STEP]
have *: "{f \<in> \<Pi>\<^sub>E i\<in>I. carrier (subgroup_generated (G i) (H i)). finite {i \<in> I. f i \<noteq> \<one>\<^bsub>G i\<^esub>}}
      = carrier (subgroup_generated (sum_group I G) (carrier (sum_group I G) \<inter> Pi\<^sub>E I H))"
[PROOF STATE]
proof (prove)
using this:
subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (sum_group I G)

goal (1 subgoal):
 1. {f \<in> \<Pi>\<^sub>E i\<in>I. carrier (subgroup_generated (G i) (H i)). finite {i \<in> I. f i \<noteq> \<one>\<^bsub>G i\<^esub>}} = carrier (subgroup_generated (sum_group I G) (carrier (sum_group I G) \<inter> Pi\<^sub>E I H))
[PROOF STEP]
apply (simp only: subgroup.carrier_subgroup_generated_subgroup)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (sum_group I G) \<Longrightarrow> {f \<in> \<Pi>\<^sub>E i\<in>I. carrier (subgroup_generated (G i) (H i)). finite {i \<in> I. f i \<noteq> \<one>\<^bsub>G i\<^esub>}} = carrier (sum_group I G) \<inter> Pi\<^sub>E I H
[PROOF STEP]
using subgroup.subset [OF sg]
[PROOF STATE]
proof (prove)
using this:
?i1 \<in> I \<Longrightarrow> H ?i1 \<subseteq> carrier (G ?i1)

goal (1 subgoal):
 1. subgroup (carrier (sum_group I G) \<inter> Pi\<^sub>E I H) (sum_group I G) \<Longrightarrow> {f \<in> \<Pi>\<^sub>E i\<in>I. carrier (subgroup_generated (G i) (H i)). finite {i \<in> I. f i \<noteq> \<one>\<^bsub>G i\<^esub>}} = carrier (sum_group I G) \<inter> Pi\<^sub>E I H
[PROOF STEP]
apply (auto simp: set_eq_iff PiE_def Pi_def assms carrier_sum_group subgroup.carrier_subgroup_generated_subgroup)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
{f \<in> \<Pi>\<^sub>E i\<in>I. carrier (subgroup_generated (G i) (H i)). finite {i \<in> I. f i \<noteq> \<one>\<^bsub>G i\<^esub>}} = carrier (subgroup_generated (sum_group I G) (carrier (sum_group I G) \<inter> Pi\<^sub>E I H))

goal (4 subgoals):
 1. carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
 2. (\<otimes>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>)
 3. \<one>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>
 4. monoid.more (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{f \<in> \<Pi>\<^sub>E i\<in>I. carrier (subgroup_generated (G i) (H i)). finite {i \<in> I. f i \<noteq> \<one>\<^bsub>G i\<^esub>}} = carrier (subgroup_generated (sum_group I G) (carrier (sum_group I G) \<inter> Pi\<^sub>E I H))
[PROOF STEP]
show "carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) =
        carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))"
[PROOF STATE]
proof (prove)
using this:
{f \<in> \<Pi>\<^sub>E i\<in>I. carrier (subgroup_generated (G i) (H i)). finite {i \<in> I. f i \<noteq> \<one>\<^bsub>G i\<^esub>}} = carrier (subgroup_generated (sum_group I G) (carrier (sum_group I G) \<inter> Pi\<^sub>E I H))

goal (1 subgoal):
 1. carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
by simp (simp add: assms group.subgroupE(1) group.group_subgroup_generated carrier_sum_group)
[PROOF STATE]
proof (state)
this:
carrier (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = carrier (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))

goal (3 subgoals):
 1. (\<otimes>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub>) = (\<otimes>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>)
 2. \<one>\<^bsub>sum_group I (\<lambda>i. subgroup_generated (G i) (H i))\<^esub> = \<one>\<^bsub>subgroup_generated (sum_group I G) (Pi\<^sub>E I H)\<^esub>
 3. monoid.more (sum_group I (\<lambda>i. subgroup_generated (G i) (H i))) = monoid.more (subgroup_generated (sum_group I G) (Pi\<^sub>E I H))
[PROOF STEP]
qed (auto simp: sum_group_def subgroup_generated_def)


[STATEMENT]
lemma "((P \<and> (Q\<longrightarrow>R))\<longrightarrow>S)  =  ((\<not>P \<or> Q \<or> S) \<and> (\<not>P \<or> \<not>R \<or> S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<and> (Q \<longrightarrow> R) \<longrightarrow> S) = ((\<not> P \<or> Q \<or> S) \<and> (\<not> P \<or> \<not> R \<or> S))
[PROOF STEP]
by blast


[STATEMENT]
lemma field_less_half_sum: "x < y \<Longrightarrow> x < (x + y) / 2"
  for x y :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> x < (x + y) / (2::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma totient_prime_power:
  assumes "prime p" "n > 0"
  shows   "totient (p ^ n) = p ^ (n - 1) * (p - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (p ^ n) = p ^ (n - 1) * (p - 1)
[PROOF STEP]
using totient_prime_power_Suc[of p "n - 1"] assms
[PROOF STATE]
proof (prove)
using this:
prime p \<Longrightarrow> totient (p ^ Suc (n - 1)) = p ^ (n - 1) * (p - 1)
prime p
0 < n

goal (1 subgoal):
 1. totient (p ^ n) = p ^ (n - 1) * (p - 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma cosh_square_eq: "cosh x ^ 2 = sinh x ^ 2 + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cosh x)\<^sup>2 = (sinh x)\<^sup>2 + (1::'a)
[PROOF STEP]
by (simp add: cosh_def sinh_def algebra_simps power2_eq_square exp_add [symmetric]
                scaleR_conv_of_real)


[STATEMENT]
lemma empty_set_diff_single : "A - {x} = {} \<Longrightarrow> A = {} \<or> A = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - {x} = {} \<Longrightarrow> A = {} \<or> A = {x}
[PROOF STEP]
by auto


[STATEMENT]
lemma cross7_skew: "(x \<times>\<^sub>7 y) = -(y \<times>\<^sub>7 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<times>\<^sub>7 y = - (y \<times>\<^sub>7 x)
[PROOF STEP]
by (simp add: cross7_simps)


[STATEMENT]
lemma pairs_extensional: "(\<And> r s. P r s \<longleftrightarrow> (\<exists> a b. Q a b \<and> r = fa a \<and> s = fb b)) \<Longrightarrow>  {(r,s). P r s} = {(fa a, fb b) | a b. Q a b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r s. P r s = (\<exists>a b. Q a b \<and> r = fa a \<and> s = fb b)) \<Longrightarrow> {(r, s). P r s} = {(fa a, fb b) |a b. Q a b}
[PROOF STEP]
by auto


[STATEMENT]
lemma has_absolute_integral_change_of_variables_linear:
  fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_"
  assumes "linear g"
  shows "(\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and>
           integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f(g x)) = b
     \<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
proof (cases "det(matrix g) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. det (matrix g) = 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
 2. det (matrix g) \<noteq> 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
det (matrix g) = 0

goal (2 subgoals):
 1. det (matrix g) = 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
 2. det (matrix g) \<noteq> 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
det (matrix g) = 0
[PROOF STEP]
have "negligible(g ` S)"
[PROOF STATE]
proof (prove)
using this:
det (matrix g) = 0

goal (1 subgoal):
 1. negligible (g ` S)
[PROOF STEP]
using assms det_nz_iff_inj negligible_linear_singular_image
[PROOF STATE]
proof (prove)
using this:
det (matrix g) = 0
linear g
linear ?f \<Longrightarrow> (det (matrix ?f) \<noteq> 0) = inj ?f
\<lbrakk>linear ?f; \<not> inj ?f\<rbrakk> \<Longrightarrow> negligible (?f ` ?S)

goal (1 subgoal):
 1. negligible (g ` S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
negligible (g ` S)

goal (2 subgoals):
 1. det (matrix g) = 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
 2. det (matrix g) \<noteq> 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
det (matrix g) = 0
negligible (g ` S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (matrix g) = 0
negligible (g ` S)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
by (auto simp: absolutely_integrable_on_def integrable_negligible integral_negligible)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal (1 subgoal):
 1. det (matrix g) \<noteq> 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (matrix g) \<noteq> 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
det (matrix g) \<noteq> 0

goal (1 subgoal):
 1. det (matrix g) \<noteq> 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
det (matrix g) \<noteq> 0
[PROOF STEP]
obtain h where h: "\<And>x. x \<in> S \<Longrightarrow> h (g x) = x" "linear h"
[PROOF STATE]
proof (prove)
using this:
det (matrix g) \<noteq> 0

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>\<And>x. x \<in> S \<Longrightarrow> h (g x) = x; linear h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms det_nz_iff_inj linear_injective_isomorphism
[PROOF STATE]
proof (prove)
using this:
det (matrix g) \<noteq> 0
linear g
linear ?f \<Longrightarrow> (det (matrix ?f) \<noteq> 0) = inj ?f
\<lbrakk>linear ?f; inj ?f; dim UNIV = dim UNIV\<rbrakk> \<Longrightarrow> \<exists>f'. linear f' \<and> (\<forall>x. f' (?f x) = x) \<and> (\<forall>x. ?f (f' x) = x)

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>\<And>x. x \<in> S \<Longrightarrow> h (g x) = x; linear h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> h (g ?x) = ?x
linear h

goal (1 subgoal):
 1. det (matrix g) \<noteq> 0 \<Longrightarrow> ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
proof (rule has_absolute_integral_change_of_variables_invertible)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> S \<Longrightarrow> (g has_derivative g) (at x within S)
 2. \<And>x. x \<in> S \<Longrightarrow> ?h (g x) = x
 3. continuous_on (g ` S) ?h
[PROOF STEP]
show "(g has_derivative g) (at x within S)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g) (at x within S)
[PROOF STEP]
by (simp add: assms linear_imp_has_derivative)
[PROOF STATE]
proof (state)
this:
(g has_derivative g) (at ?x within S)

goal (2 subgoals):
 1. \<And>x. x \<in> S \<Longrightarrow> ?h (g x) = x
 2. continuous_on (g ` S) ?h
[PROOF STEP]
show "continuous_on (g ` S) h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (g ` S) h
[PROOF STEP]
using continuous_on_eq_continuous_within has_derivative_continuous linear_imp_has_derivative h
[PROOF STATE]
proof (prove)
using this:
continuous_on ?s ?f = (\<forall>x\<in>?s. continuous (at x within ?s) ?f)
(?f has_derivative ?f') (at ?x within ?s) \<Longrightarrow> continuous (at ?x within ?s) ?f
linear ?f \<Longrightarrow> (?f has_derivative ?f) ?net
?x \<in> S \<Longrightarrow> h (g ?x) = ?x
linear h

goal (1 subgoal):
 1. continuous_on (g ` S) h
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on (g ` S) h

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> h (g x) = x
[PROOF STEP]
qed (use h in auto)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix g)\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_mono_monoD:
fixes f :: "'a::order \<Rightarrow> 'b::order"
shows "\<lbrakk>strict_mono f; A \<le> B\<rbrakk> \<Longrightarrow> f A \<le> f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>OrdinalInduct.strict_mono f; A \<le> B\<rbrakk> \<Longrightarrow> f A \<le> f B
[PROOF STEP]
by (rule monoD[OF strict_mono_mono])


[STATEMENT]
lemma abs_summable_on_Sigma_project1:
  assumes "(\<lambda>(x,y). f x y) abs_summable_on Sigma A B"
  assumes [simp]: "countable A" and "\<And>x. x \<in> A \<Longrightarrow> countable (B x)"
  shows   "(\<lambda>x. infsetsum (\<lambda>y. norm (f x y)) (B x)) abs_summable_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>\<^sub>ay\<in>B x. norm (f x y)) abs_summable_on A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(x, y). f x y) abs_summable_on Sigma A B
countable A
?x \<in> A \<Longrightarrow> countable (B ?x)

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>\<^sub>ay\<in>B x. norm (f x y)) abs_summable_on A
[PROOF STEP]
by (subst (asm) abs_summable_on_Sigma_iff) auto


[STATEMENT]
lemma cat_prod_CId_vdomain[cat_cs_simps]:
  "\<D>\<^sub>\<circ> ((\<Prod>\<^sub>Ci\<in>\<^sub>\<circ>I. \<AA> i)\<lparr>CId\<rparr>) = (\<Prod>\<^sub>Ci\<in>\<^sub>\<circ>I. \<AA> i)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (cat_prod I \<AA>\<lparr>CId\<rparr>) = cat_prod I \<AA>\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding cat_prod_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. \<AA> i\<lparr>Obj\<rparr>. \<lambda>i\<in>\<^sub>\<circ>I. \<AA> i\<lparr>CId\<rparr>\<lparr>a\<lparr>i\<rparr>\<rparr>) = (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. \<AA> i\<lparr>Obj\<rparr>)
[PROOF STEP]
by simp


[STATEMENT]
lemma continuous_closed_graph:
  fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector"
  assumes "closed S" and contf: "continuous_on S f"
  shows "closed ((\<lambda>x. Pair x (f x)) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed ((\<lambda>x. (x, f x)) ` S)
[PROOF STEP]
proof (rule closedin_closed_trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. closedin (top_of_set ?T) ((\<lambda>x. (x, f x)) ` S)
 2. closed ?T
[PROOF STEP]
show "closedin (top_of_set (S \<times> UNIV)) ((\<lambda>x. (x, f x)) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set (S \<times> UNIV)) ((\<lambda>x. (x, f x)) ` S)
[PROOF STEP]
by (rule continuous_closed_graph_gen [OF contf subset_UNIV])
[PROOF STATE]
proof (state)
this:
closedin (top_of_set (S \<times> UNIV)) ((\<lambda>x. (x, f x)) ` S)

goal (1 subgoal):
 1. closed (S \<times> UNIV)
[PROOF STEP]
qed (simp add: \<open>closed S\<close> closed_Times)


[STATEMENT]
lemma word_2p_mult_inc:
  assumes x: "2 * 2 ^ n < (2::'a::len word) * 2 ^ m"
  assumes suc_n: "Suc n < LENGTH('a::len)"
  shows "2^n < (2::'a::len word)^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ n < 2 ^ m
[PROOF STEP]
by (smt suc_n le_less_trans lessI nat_less_le nat_mult_less_cancel_disj p2_gt_0
          power_Suc power_Suc unat_power_lower word_less_nat_alt x)


[STATEMENT]
lemma strict_mono_mono:
fixes f :: "'a::order \<Rightarrow> 'b::order"
shows "strict_mono f \<Longrightarrow> mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OrdinalInduct.strict_mono f \<Longrightarrow> mono f
[PROOF STEP]
by (auto intro!: monoI simp add: order_le_less strict_monoD)


[STATEMENT]
lemma pairwise_r_distinguishable_state_sets_from_separators_code[code] :
  "pairwise_r_distinguishable_state_sets_from_separators M = set (pairwise_r_distinguishable_state_sets_from_separators_list M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise_r_distinguishable_state_sets_from_separators M = set (pairwise_r_distinguishable_state_sets_from_separators_list M)
[PROOF STEP]
using pow_list_set[of "states_as_list M"]
[PROOF STATE]
proof (prove)
using this:
set (map set (pow_list (states_as_list M))) = Pow (set (states_as_list M))

goal (1 subgoal):
 1. pairwise_r_distinguishable_state_sets_from_separators M = set (pairwise_r_distinguishable_state_sets_from_separators_list M)
[PROOF STEP]
unfolding states_as_list_set[of M]
            pairwise_r_distinguishable_state_sets_from_separators_def
            pairwise_r_distinguishable_state_sets_from_separators_list_def
[PROOF STATE]
proof (prove)
using this:
set (map set (pow_list (states_as_list M))) = Pow (FSM.states M)

goal (1 subgoal):
 1. {S. S \<subseteq> FSM.states M \<and> (\<forall>q1\<in>S. \<forall>q2\<in>S. q1 \<noteq> q2 \<longrightarrow> (q1, q2) \<in> fst ` r_distinguishable_state_pairs_with_separators M)} = set (let RDS = fst ` r_distinguishable_state_pairs_with_separators M in filter (\<lambda>S. \<forall>q1\<in>S. \<forall>q2\<in>S. q1 \<noteq> q2 \<longrightarrow> (q1, q2) \<in> RDS) (map set (pow_list (states_as_list M))))
[PROOF STEP]
by auto


[STATEMENT]
lemma powreal_less_cancel:
   "\<lbrakk> a pow\<^sub>\<real> r < a pow\<^sub>\<real> s; a \<ge> 1 \<rbrakk> \<Longrightarrow> r < s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a pow\<^sub>\<real> r < a pow\<^sub>\<real> s; 1 \<le> a\<rbrakk> \<Longrightarrow> r < s
[PROOF STEP]
by (metis less_le_not_le linorder_not_less powreal_eq_powa powreal_le_mono)


[STATEMENT]
lemma indexed_Ints_vec_UNIV: "\<int>\<^sub>v = indexed_Ints_vec UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int>\<^sub>v = indexed_Ints_vec UNIV
[PROOF STEP]
unfolding Ints_vec_def indexed_Ints_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<forall>i<dim_vec x. x $ i \<in> \<int>} = {x. \<forall>i<dim_vec x. i \<in> UNIV \<longrightarrow> x $ i \<in> \<int>}
[PROOF STEP]
by auto


[STATEMENT]
lemma crypts_union_1:
 "crypts (H \<union> H') \<subseteq> crypts H \<union> crypts H'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. crypts (H \<union> H') \<subseteq> crypts H \<union> crypts H'
[PROOF STEP]
by (rule subsetI, erule crypts.induct, auto)


[STATEMENT]
lemma one_plus_of_int_in_nonpos_Ints_iff:
  "(1 + of_int n :: 'a :: ring_char_0) \<in> \<int>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> n \<le> -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
have "1 + of_int n = (of_int (n + 1) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + of_int n = of_int (n + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) + of_int n = of_int (n + 1)

goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) + of_int n = of_int (n + 1)

goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
have "\<dots> \<in> \<int>\<^sub>\<le>\<^sub>0 \<longleftrightarrow> n + 1 \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int (n + 1) \<in> \<int>\<^sub>\<le>\<^sub>0) = (n + 1 \<le> 0)
[PROOF STEP]
by (subst of_int_in_nonpos_Ints_iff) simp_all
[PROOF STATE]
proof (state)
this:
(of_int (n + 1) \<in> \<int>\<^sub>\<le>\<^sub>0) = (n + 1 \<le> 0)

goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(of_int (n + 1) \<in> \<int>\<^sub>\<le>\<^sub>0) = (n + 1 \<le> 0)

goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> n \<le> -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n + 1 \<le> 0) = (n \<le> - 1)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(n + 1 \<le> 0) = (n \<le> - 1)

goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)

goal (1 subgoal):
 1. ((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((1::'a) + of_int n \<in> \<int>\<^sub>\<le>\<^sub>0) = (n \<le> - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lead_coeff_prod_mset:
  fixes A :: "'a::{comm_semiring_1, semiring_no_zero_divisors} poly multiset"
  shows "Polynomial.lead_coeff (prod_mset A) = prod_mset (image_mset Polynomial.lead_coeff A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.lead_coeff (\<Prod>\<^sub># A) = \<Prod>\<^sub># (image_mset Polynomial.lead_coeff A)
[PROOF STEP]
by (induction A) (auto simp: Polynomial.lead_coeff_mult)


[STATEMENT]
lemma vsubset_vintersection_right: "A \<subseteq>\<^sub>\<circ> (B \<inter>\<^sub>\<circ> C) = (A \<subseteq>\<^sub>\<circ> B \<and> A \<subseteq>\<^sub>\<circ> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<subseteq>\<^sub>\<circ> B \<inter>\<^sub>\<circ> C) = (A \<subseteq>\<^sub>\<circ> B \<and> A \<subseteq>\<^sub>\<circ> C)
[PROOF STEP]
by clarsimp


[STATEMENT]
lemma iso_relative_homology_of_contractible:
   "\<lbrakk>contractible_space X; topspace X \<inter> S \<noteq> {}\<rbrakk>
  \<Longrightarrow> hom_boundary p X S
      \<in> iso (relative_homology_group p X S) (reduced_homology_group(p - 1) (subtopology X S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>contractible_space X; topspace X \<inter> S \<noteq> {}\<rbrakk> \<Longrightarrow> hom_boundary p X S \<in> Group.iso (relative_homology_group p X S) (reduced_homology_group (p - 1) (subtopology X S))
[PROOF STEP]
using very_short_exact_sequence
    [of "reduced_homology_group (p - 1) X"
        "reduced_homology_group (p - 1) (subtopology X S)"
        "relative_homology_group p X S"
        "reduced_homology_group p X"
        "hom_induced (p - 1) (subtopology X S) {} X {} id"
        "hom_boundary p X S"
        "hom_induced p X {} X S id"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>exact_seq ([reduced_homology_group (p - 1) X, reduced_homology_group (p - 1) (subtopology X S), relative_homology_group p X S, reduced_homology_group p X], [hom_induced (p - 1) (subtopology X S) {} X {} id, hom_boundary p X S, hom_induced p X {} X S id]); trivial_group (reduced_homology_group p X); trivial_group (reduced_homology_group (p - 1) X)\<rbrakk> \<Longrightarrow> hom_boundary p X S \<in> Group.iso (relative_homology_group p X S) (reduced_homology_group (p - 1) (subtopology X S))

goal (1 subgoal):
 1. \<lbrakk>contractible_space X; topspace X \<inter> S \<noteq> {}\<rbrakk> \<Longrightarrow> hom_boundary p X S \<in> Group.iso (relative_homology_group p X S) (reduced_homology_group (p - 1) (subtopology X S))
[PROOF STEP]
by (meson exact_seq_cons_iff homology_exactness_reduced_1 homology_exactness_reduced_2 trivial_reduced_homology_group_contractible_space)


[STATEMENT]
lemma fps_mult_subdegree_ge:
  fixes   f g :: "'a::{comm_monoid_add,mult_zero} fps"
  assumes "f*g \<noteq> 0"
  shows   "subdegree (f*g) \<ge> subdegree f + subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree f + subdegree g \<le> subdegree (f * g)
[PROOF STEP]
using   assms fps_mult_nth_eq0
[PROOF STATE]
proof (prove)
using this:
f * g \<noteq> 0
?n < subdegree ?f + subdegree ?g \<Longrightarrow> (?f * ?g) $ ?n = (0::?'a)

goal (1 subgoal):
 1. subdegree f + subdegree g \<le> subdegree (f * g)
[PROOF STEP]
by      (intro subdegree_geI) simp


[STATEMENT]
lemma Sublists_conc [simp]:
  assumes "A \<noteq> {}" "B \<noteq> {}"
  shows   "Sublists (A @@ B) = Sublists A \<union> Sublists B \<union> Suffixes A @@ Prefixes B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sublists (A @@ B) = Sublists A \<union> Sublists B \<union> Suffixes A @@ Prefixes B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
B \<noteq> {}

goal (1 subgoal):
 1. Sublists (A @@ B) = Sublists A \<union> Sublists B \<union> Suffixes A @@ Prefixes B
[PROOF STEP]
unfolding Sublists_conv_Suffixes
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
B \<noteq> {}

goal (1 subgoal):
 1. Suffixes (Prefixes (A @@ B)) = Suffixes (Prefixes A) \<union> Suffixes (Prefixes B) \<union> Suffixes A @@ Prefixes B
[PROOF STEP]
by auto


[STATEMENT]
lemma square_free_monic_poly: "(poly (square_free_monic_poly p) x = 0) = (poly p x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (square_free_monic_poly p) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (poly (square_free_monic_poly p) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (square_free_monic_poly p) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
unfolding square_free_monic_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
unfolding p_div_gcd_p_pderiv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (\<Prod>(a, i)\<in>as. a) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
unfolding p poly_prod prod_zero_iff[OF fin]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>a\<in>as. poly (case a of (a, i) \<Rightarrow> a) x = (0::'a)) = (\<exists>a\<in>as. poly (case a of (a, i) \<Rightarrow> a ^ Suc i) x = (0::'a))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(poly (square_free_monic_poly p) x = (0::'a)) = (poly p x = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma square_part_even_power: "even n \<Longrightarrow> square_part (x ^ n) = normalize (x ^ (n div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even n \<Longrightarrow> square_part (x ^ n) = normalize (x ^ (n div 2))
[PROOF STEP]
by (subst square_part_even_power' [symmetric]) auto


[STATEMENT]
lemma equivalentFormulaeAppend:
  fixes formula1 :: Formula and formula1' :: Formula and formula2 :: Formula
  assumes "equivalentFormulae formula1 formula1'"
  shows "equivalentFormulae (formula1 @ formula2) (formula1' @ formula2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalentFormulae (formula1 @ formula2) (formula1' @ formula2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
equivalentFormulae formula1 formula1'

goal (1 subgoal):
 1. equivalentFormulae (formula1 @ formula2) (formula1' @ formula2)
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
using this:
\<forall>valuation. model valuation formula1 = model valuation formula1'

goal (1 subgoal):
 1. \<forall>valuation. model valuation (formula1 @ formula2) = model valuation (formula1' @ formula2)
[PROOF STEP]
by (auto simp add: formulaTrueAppend)


[STATEMENT]
lemma  continuous_on_cross:
  fixes f :: "'a::t2_space \<Rightarrow> real^3"
  shows "\<lbrakk>continuous_on S f; continuous_on S g\<rbrakk> \<Longrightarrow> continuous_on S (\<lambda>x. (f x) \<times> (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on S f; continuous_on S g\<rbrakk> \<Longrightarrow> continuous_on S (\<lambda>x. f x \<times> g x)
[PROOF STEP]
by (simp add: continuous_on_eq_continuous_within continuous_cross)


[STATEMENT]
lemma eventually_at_left_1: "(\<And>z::real. 0 < z \<Longrightarrow> z < 1 \<Longrightarrow> P z) \<Longrightarrow> eventually P (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. \<lbrakk>0 < z; z < 1\<rbrakk> \<Longrightarrow> P z) \<Longrightarrow> eventually P (at_left 1)
[PROOF STEP]
by (subst eventually_at_left[of 0]) (auto intro: exI[of _ 0])


[STATEMENT]
lemma divisors_fun_nat: "divisors_fun divisors_nat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisors_fun divisors_nat
[PROOF STEP]
unfolding divisors_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<noteq> 0 \<longrightarrow> set (divisors_nat x) = {d. d dvd x}) \<and> (\<forall>x. distinct (divisors_nat x))
[PROOF STEP]
using divisors_nat
[PROOF STATE]
proof (prove)
using this:
?n \<noteq> 0 \<Longrightarrow> set (divisors_nat ?n) = {p. p dvd ?n}
distinct (divisors_nat ?n)
divisors_nat 0 = []

goal (1 subgoal):
 1. (\<forall>x. x \<noteq> 0 \<longrightarrow> set (divisors_nat x) = {d. d dvd x}) \<and> (\<forall>x. distinct (divisors_nat x))
[PROOF STEP]
by auto


[STATEMENT]
lemma flow_fixed_point:
  assumes t: "t \<in> existence_ivl t0 x0"
  shows "flow t0 x0 t = x0 + ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow t0 x0 t = x0 + ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. flow t0 x0 t = x0 + ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t))
[PROOF STEP]
have "(flow t0 x0 has_vderiv_on (\<lambda>s. f s (flow t0 x0 s))) {t0 -- t}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (flow t0 x0 has_vderiv_on (\<lambda>s. f s (flow t0 x0 s))) {t0--t}
[PROOF STEP]
using closed_segment_subset_existence_ivl[OF t]
[PROOF STATE]
proof (prove)
using this:
{t0--t} \<subseteq> existence_ivl t0 x0

goal (1 subgoal):
 1. (flow t0 x0 has_vderiv_on (\<lambda>s. f s (flow t0 x0 s))) {t0--t}
[PROOF STEP]
by (auto intro!: has_vector_derivative_at_within flow_has_vector_derivative
      simp: has_vderiv_on_def)
[PROOF STATE]
proof (state)
this:
(flow t0 x0 has_vderiv_on (\<lambda>s. f s (flow t0 x0 s))) {t0--t}

goal (1 subgoal):
 1. flow t0 x0 t = x0 + ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t))
[PROOF STEP]
from fundamental_theorem_of_calculus_ivl_integral[OF this]
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>s. f s (flow t0 x0 s)) has_ivl_integral flow t0 x0 t - flow t0 x0 t0) t0 t
[PROOF STEP]
have "((\<lambda>t. f t (flow t0 x0 t)) has_ivl_integral flow t0 x0 t - x0) t0 t"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>s. f s (flow t0 x0 s)) has_ivl_integral flow t0 x0 t - flow t0 x0 t0) t0 t

goal (1 subgoal):
 1. ((\<lambda>t. f t (flow t0 x0 t)) has_ivl_integral flow t0 x0 t - x0) t0 t
[PROOF STEP]
by (simp add: mem_existence_ivl_iv_defined[OF assms])
[PROOF STATE]
proof (state)
this:
((\<lambda>t. f t (flow t0 x0 t)) has_ivl_integral flow t0 x0 t - x0) t0 t

goal (1 subgoal):
 1. flow t0 x0 t = x0 + ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t))
[PROOF STEP]
from this[THEN ivl_integral_unique]
[PROOF STATE]
proof (chain)
picking this:
ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t)) = flow t0 x0 t - x0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t)) = flow t0 x0 t - x0

goal (1 subgoal):
 1. flow t0 x0 t = x0 + ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
flow t0 x0 t = x0 + ivl_integral t0 t (\<lambda>t. f t (flow t0 x0 t))

goal:
No subgoals!
[PROOF STEP]
qed