[STATEMENT]
lemma spheremap_lemma3:
  assumes "bounded S" "convex S" "subspace U" and affSU: "aff_dim S \<le> dim U"
  obtains T where "subspace T" "T \<subseteq> U" "S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S"
                  "(rel_frontier S) homeomorphic (sphere 0 1 \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with \<open>subspace U\<close> subspace_0
[PROOF STATE]
proof (chain)
picking this:
subspace U
subspace ?S \<Longrightarrow> (0::?'a) \<in> ?S
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subspace U
subspace ?S \<Longrightarrow> (0::?'a) \<in> ?S
S = {}

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule_tac T = "{0}" in that) auto
[PROOF STATE]
proof (state)
this:
thesis

goal (1 subgoal):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain a where "a \<in> S"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

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

goal (1 subgoal):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> S
[PROOF STEP]
have affS: "aff_dim S = int (dim ((\<lambda>x. -a+x) ` S))"
[PROOF STATE]
proof (prove)
using this:
a \<in> S

goal (1 subgoal):
 1. aff_dim S = int (dim ((+) (- a) ` S))
[PROOF STEP]
by (metis hull_inc aff_dim_eq_dim)
[PROOF STATE]
proof (state)
this:
aff_dim S = int (dim ((+) (- a) ` S))

goal (1 subgoal):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with affSU
[PROOF STATE]
proof (chain)
picking this:
aff_dim S \<le> int (dim U)
aff_dim S = int (dim ((+) (- a) ` S))
[PROOF STEP]
have "dim ((\<lambda>x. -a+x) ` S) \<le> dim U"
[PROOF STATE]
proof (prove)
using this:
aff_dim S \<le> int (dim U)
aff_dim S = int (dim ((+) (- a) ` S))

goal (1 subgoal):
 1. dim ((+) (- a) ` S) \<le> dim U
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
dim ((+) (- a) ` S) \<le> dim U

goal (1 subgoal):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with choose_subspace_of_subspace
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?n \<le> dim ?S; \<And>T. \<lbrakk>subspace T; T \<subseteq> span ?S; dim T = ?n\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
dim ((+) (- a) ` S) \<le> dim U
[PROOF STEP]
obtain T where "subspace T" "T \<subseteq> span U" and dimT: "dim T = dim ((\<lambda>x. -a+x) ` S)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?n \<le> dim ?S; \<And>T. \<lbrakk>subspace T; T \<subseteq> span ?S; dim T = ?n\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
dim ((+) (- a) ` S) \<le> dim U

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>subspace T; T \<subseteq> span U; dim T = dim ((+) (- a) ` S)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
subspace T
T \<subseteq> span U
dim T = dim ((+) (- a) ` S)

goal (1 subgoal):
 1. \<lbrakk>\<And>T. \<lbrakk>subspace T; T \<subseteq> U; S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S; rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T\<rbrakk> \<Longrightarrow> thesis; S \<noteq> {}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof (rule that [OF \<open>subspace T\<close>])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. T \<subseteq> U
 2. S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S
 3. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
show "T \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<subseteq> U
[PROOF STEP]
using span_eq_iff \<open>subspace U\<close> \<open>T \<subseteq> span U\<close>
[PROOF STATE]
proof (prove)
using this:
(span ?s = ?s) = subspace ?s
subspace U
T \<subseteq> span U

goal (1 subgoal):
 1. T \<subseteq> U
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
T \<subseteq> U

goal (2 subgoals):
 1. S \<noteq> {} \<Longrightarrow> aff_dim T = aff_dim S
 2. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
show "aff_dim T = aff_dim S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim T = aff_dim S
[PROOF STEP]
using dimT \<open>subspace T\<close> affS aff_dim_subspace
[PROOF STATE]
proof (prove)
using this:
dim T = dim ((+) (- a) ` S)
subspace T
aff_dim S = int (dim ((+) (- a) ` S))
subspace ?S \<Longrightarrow> aff_dim ?S = int (dim ?S)

goal (1 subgoal):
 1. aff_dim T = aff_dim S
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
aff_dim T = aff_dim S

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
show "rel_frontier S homeomorphic sphere 0 1 \<inter> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
have "aff_dim (ball 0 1 \<inter> T) = aff_dim (T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim (ball (0::'b) 1 \<inter> T) = aff_dim T
[PROOF STEP]
by (metis IntI interior_ball \<open>subspace T\<close> aff_dim_convex_Int_nonempty_interior centre_in_ball empty_iff inf_commute subspace_0 subspace_imp_convex zero_less_one)
[PROOF STATE]
proof (state)
this:
aff_dim (ball (0::'b) 1 \<inter> T) = aff_dim T

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim (ball (0::'b) 1 \<inter> T) = aff_dim T
[PROOF STEP]
have affS_eq: "aff_dim S = aff_dim (ball 0 1 \<inter> T)"
[PROOF STATE]
proof (prove)
using this:
aff_dim (ball (0::'b) 1 \<inter> T) = aff_dim T

goal (1 subgoal):
 1. aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
using \<open>aff_dim T = aff_dim S\<close>
[PROOF STATE]
proof (prove)
using this:
aff_dim (ball (0::'b) 1 \<inter> T) = aff_dim T
aff_dim T = aff_dim S

goal (1 subgoal):
 1. aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
have "rel_frontier S homeomorphic rel_frontier(ball 0 1 \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier S homeomorphic rel_frontier (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
proof (rule homeomorphic_rel_frontiers_convex_bounded_sets [OF \<open>convex S\<close> \<open>bounded S\<close>])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. convex (ball (0::'b) 1 \<inter> T)
 2. bounded (ball (0::'b) 1 \<inter> T)
 3. aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
show "convex (ball 0 1 \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
by (simp add: \<open>subspace T\<close> convex_Int subspace_imp_convex)
[PROOF STATE]
proof (state)
this:
convex (ball (0::'b) 1 \<inter> T)

goal (2 subgoals):
 1. bounded (ball (0::'b) 1 \<inter> T)
 2. aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
show "bounded (ball 0 1 \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
by (simp add: bounded_Int)
[PROOF STATE]
proof (state)
this:
bounded (ball (0::'b) 1 \<inter> T)

goal (1 subgoal):
 1. aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
show "aff_dim S = aff_dim (ball 0 1 \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)
[PROOF STEP]
by (rule affS_eq)
[PROOF STATE]
proof (state)
this:
aff_dim S = aff_dim (ball (0::'b) 1 \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rel_frontier S homeomorphic rel_frontier (ball (0::'b) 1 \<inter> T)

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rel_frontier S homeomorphic rel_frontier (ball (0::'b) 1 \<inter> T)

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
have "... = frontier (ball 0 1) \<inter> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier (ball (0::'b) 1 \<inter> T) = frontier (ball (0::'b) 1) \<inter> T
[PROOF STEP]
proof (rule convex_affine_rel_frontier_Int [OF convex_ball])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. affine T
 2. interior (ball (0::'b) 1) \<inter> T \<noteq> {}
[PROOF STEP]
show "affine T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine T
[PROOF STEP]
by (simp add: \<open>subspace T\<close> subspace_imp_affine)
[PROOF STATE]
proof (state)
this:
affine T

goal (1 subgoal):
 1. interior (ball (0::'b) 1) \<inter> T \<noteq> {}
[PROOF STEP]
show "interior (ball 0 1) \<inter> T \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (ball (0::'b) 1) \<inter> T \<noteq> {}
[PROOF STEP]
using \<open>subspace T\<close> subspace_0
[PROOF STATE]
proof (prove)
using this:
subspace T
subspace ?S \<Longrightarrow> (0::?'a) \<in> ?S

goal (1 subgoal):
 1. interior (ball (0::'b) 1) \<inter> T \<noteq> {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
interior (ball (0::'b) 1) \<inter> T \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rel_frontier (ball (0::'b) 1 \<inter> T) = frontier (ball (0::'b) 1) \<inter> T

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rel_frontier (ball (0::'b) 1 \<inter> T) = frontier (ball (0::'b) 1) \<inter> T

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
have "... = sphere 0 1 \<inter> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (ball (0::'b) 1) \<inter> T = sphere (0::'b) 1 \<inter> T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
frontier (ball (0::'b) 1) \<inter> T = sphere (0::'b) 1 \<inter> T

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T

goal (1 subgoal):
 1. rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rel_frontier S homeomorphic sphere (0::'b) 1 \<inter> T

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefixBeforeElementDoesNotContainTrailElement:
  assumes "e \<in> set (elements M)"
  shows "e \<notin> set (elements (prefixBeforeElement e M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e \<notin> set (elements (prefixBeforeElement e M))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
e \<in> set (elements M)

goal (1 subgoal):
 1. e \<notin> set (elements (prefixBeforeElement e M))
[PROOF STEP]
by (induct M) auto


[STATEMENT]
lemma row_one[simp]:
  "i < n \<Longrightarrow> row (1\<^sub>m n) i = unit_vec n i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> row (1\<^sub>m n) i = unit_vec n i
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma index_distinct_group_num_alt_def: "ps \<subseteq> \<V> \<Longrightarrow> card ps = 2 \<Longrightarrow>
    size {#b \<in>#  mset_set \<G> . ps \<subseteq> b#} = 0 \<Longrightarrow> \<B> index ps = \<Lambda>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ps \<subseteq> \<V>; card ps = 2; size (filter_mset ((\<subseteq>) ps) (mset_set \<G>)) = 0\<rbrakk> \<Longrightarrow> int (\<B> index ps) = \<Lambda>
[PROOF STEP]
by (metis gdd_index_options index_zero_implies_one_group numeral_One zero_neq_numeral)


[STATEMENT]
lemma register_eqI: \<open>separating TYPE('b::domain) A \<Longrightarrow> preregister F \<Longrightarrow> preregister G \<Longrightarrow> (\<And>x. x\<in>A \<Longrightarrow> F x = G x) \<Longrightarrow> F = (G::_ \<Rightarrow> 'b update)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>separating TYPE('b) A; preregister F; preregister G; \<And>x. x \<in> A \<Longrightarrow> F x = G x\<rbrakk> \<Longrightarrow> F = G
[PROOF STEP]
unfolding separating_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>F G. preregister F \<longrightarrow> preregister G \<longrightarrow> (\<forall>x\<in>A. F x = G x) \<longrightarrow> F = G; preregister F; preregister G; \<And>x. x \<in> A \<Longrightarrow> F x = G x\<rbrakk> \<Longrightarrow> F = G
[PROOF STEP]
by auto


[STATEMENT]
lemma gbinomial_index_swap:
  "((-1) ^ k) * ((- (of_nat n) - 1) gchoose k) = ((-1) ^ n) * ((- (of_nat k) - 1) gchoose n)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "?lhs = (of_nat (k + n) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k
[PROOF STEP]
by (subst gbinomial_negated_upper) (simp add: power_mult_distrib [symmetric])
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = of_nat (k + n) gchoose k

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = (of_nat (k + n) gchoose n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose k = of_nat (k + n) gchoose n
[PROOF STEP]
by (subst gbinomial_of_nat_symmetric) simp_all
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose k = of_nat (k + n) gchoose n

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
by (subst gbinomial_negated_upper) simp
[PROOF STATE]
proof (state)
this:
of_nat (k + n) gchoose n = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal (1 subgoal):
 1. (- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ k * (- of_nat n - (1::'a) gchoose k) = (- (1::'a)) ^ n * (- of_nat k - (1::'a) gchoose n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iMODb_inter: "
  \<lbrakk> r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c' \<rbrakk> \<Longrightarrow>
  [r, mod m, c] \<inter> [r', mod m, c'] = [r', mod m, c - (r'-r) div m]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> [ r, mod m, c ] \<inter> [ r', mod m, c' ] = [ r', mod m, c - (r' - r) div m ]
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x \<in> [ r, mod m, c ] \<inter> [ r', mod m, c' ]) = (x \<in> [ r', mod m, c - (r' - r) div m ])
[PROOF STEP]
apply (simp add: iMODb_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x mod m = r' mod m \<and> r \<le> x \<and> x \<le> r + m * c \<and> x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + m * c') = (x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + m * (c - (r' - r) div m))
[PROOF STEP]
apply (simp add: diff_mult_distrib2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x mod m = r' mod m \<and> r \<le> x \<and> x \<le> r + m * c \<and> x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + m * c') = (x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + (m * c - m * ((r' - r) div m)))
[PROOF STEP]
apply (simp add: mult.commute[of _ "(r' - r) div m"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x mod m = r' mod m \<and> r \<le> x \<and> x \<le> r + m * c \<and> x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + m * c') = (x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + (m * c - (r' - r) div m * m))
[PROOF STEP]
apply (simp add: mod_0_div_mult_cancel[THEN iffD1, OF mod_eq_imp_diff_mod_0])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x mod m = r' mod m \<and> r \<le> x \<and> x \<le> r + m * c \<and> x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + m * c') = (x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> m * c + r)
[PROOF STEP]
apply (simp add: add.commute[of _ r])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> r'; r mod m = r' mod m; r' \<le> r + m * c; r + m * c \<le> r' + m * c'\<rbrakk> \<Longrightarrow> (x mod m = r' mod m \<and> r \<le> x \<and> x \<le> r + m * c \<and> x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r' + m * c') = (x mod m = r' mod m \<and> r' \<le> x \<and> x \<le> r + m * c)
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Map_graph_lookup: "Map.graph (RBT.lookup t) = set (RBT.entries t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Map.graph (RBT.lookup t) = set (RBT.entries t)
[PROOF STEP]
by (metis RBT.distinct_entries RBT.map_of_entries graph_map_of_if_distinct_dom)


[STATEMENT]
lemma iso_relative_homology_group_lower_hemisphere:
  "hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. x k \<ge> 0} id
  \<in> iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0})
        (relative_homology_group p (nsphere n) {x. x k \<ge> 0})" (is "?k \<in> iso ?G ?H")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
define r where "r \<equiv> \<lambda>x i. if i = k then -x i else (x i::real)"
[PROOF STATE]
proof (state)
this:
r \<equiv> \<lambda>x i. if i = k then - x i else x i

goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<equiv> \<lambda>x i. if i = k then - x i else x i
[PROOF STEP]
have [simp]: "r \<circ> r = id"
[PROOF STATE]
proof (prove)
using this:
r \<equiv> \<lambda>x i. if i = k then - x i else x i

goal (1 subgoal):
 1. r \<circ> r = id
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
r \<circ> r = id

goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
have cmr: "continuous_map (subtopology (nsphere n) S) (nsphere n) r" for S
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (subtopology (nsphere n) S) (nsphere n) r
[PROOF STEP]
using continuous_map_nsphere_reflection [of n k]
[PROOF STATE]
proof (prove)
using this:
continuous_map (nsphere n) (nsphere n) (\<lambda>x i. if i = k then - x i else x i)

goal (1 subgoal):
 1. continuous_map (subtopology (nsphere n) S) (nsphere n) r
[PROOF STEP]
by (simp add: continuous_map_from_subtopology r_def)
[PROOF STATE]
proof (state)
this:
continuous_map (subtopology (nsphere n) ?S) (nsphere n) r

goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
let ?f = "hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}
                          (subtopology (nsphere n) {x. x k \<ge> 0}) {x. x k = 0} r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
let ?g = "hom_induced p (subtopology (nsphere n) {x. x k \<ge> 0}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
let ?h = "hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. x k \<ge> 0} r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
obtain f h where
        f: "f \<in> iso ?G (relative_homology_group p (subtopology (nsphere n) {x. x k \<ge> 0}) {x. x k = 0})"
    and h: "h \<in> iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) ?H"
    and eq: "h \<circ> ?g \<circ> f = ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?f2 \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
 2. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
 3. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> ?f2 = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
have hmr: "homeomorphic_map (nsphere n) (nsphere n) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map (nsphere n) (nsphere n) r
[PROOF STEP]
unfolding homeomorphic_map_maps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ex (homeomorphic_maps (nsphere n) (nsphere n) r)
[PROOF STEP]
by (metis \<open>r \<circ> r = id\<close> cmr homeomorphic_maps_involution pointfree_idE subtopology_topspace)
[PROOF STATE]
proof (state)
this:
homeomorphic_map (nsphere n) (nsphere n) r

goal (3 subgoals):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?f2 \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
 2. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
 3. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> ?f2 = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_map (nsphere n) (nsphere n) r
[PROOF STEP]
have hmrs: "homeomorphic_map (subtopology (nsphere n) {x. x k \<le> 0}) (subtopology (nsphere n) {x. x k \<ge> 0}) r"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map (nsphere n) (nsphere n) r

goal (1 subgoal):
 1. homeomorphic_map (subtopology (nsphere n) {x. x k \<le> 0}) (subtopology (nsphere n) {x. 0 \<le> x k}) r
[PROOF STEP]
by (simp add: homeomorphic_map_subtopologies_alt r_def)
[PROOF STATE]
proof (state)
this:
homeomorphic_map (subtopology (nsphere n) {x. x k \<le> 0}) (subtopology (nsphere n) {x. 0 \<le> x k}) r

goal (3 subgoals):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?f2 \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
 2. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
 3. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> ?f2 = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
have rimeq: "r ` (topspace (subtopology (nsphere n) {x. x k \<le> 0}) \<inter> {x. x k = 0})
               = topspace (subtopology (nsphere n) {x. 0 \<le> x k}) \<inter> {x. x k = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r ` (topspace (subtopology (nsphere n) {x. x k \<le> 0}) \<inter> {x. x k = 0}) = topspace (subtopology (nsphere n) {x. 0 \<le> x k}) \<inter> {x. x k = 0}
[PROOF STEP]
using continuous_map_eq_topcontinuous_at continuous_map_nsphere_reflection topcontinuous_at_atin
[PROOF STATE]
proof (prove)
using this:
continuous_map ?X ?Y ?f = (\<forall>x\<in>topspace ?X. topcontinuous_at ?X ?Y ?f x)
continuous_map (nsphere ?n) (nsphere ?n) (\<lambda>x i. if i = ?k then - x i else x i)
topcontinuous_at ?X ?Y ?f ?x = (?x \<in> topspace ?X \<and> (\<forall>x\<in>topspace ?X. ?f x \<in> topspace ?Y) \<and> limitin ?Y ?f (?f ?x) (atin ?X ?x))

goal (1 subgoal):
 1. r ` (topspace (subtopology (nsphere n) {x. x k \<le> 0}) \<inter> {x. x k = 0}) = topspace (subtopology (nsphere n) {x. 0 \<le> x k}) \<inter> {x. x k = 0}
[PROOF STEP]
by (fastforce simp: r_def)
[PROOF STATE]
proof (state)
this:
r ` (topspace (subtopology (nsphere n) {x. x k \<le> 0}) \<inter> {x. x k = 0}) = topspace (subtopology (nsphere n) {x. 0 \<le> x k}) \<inter> {x. x k = 0}

goal (3 subgoals):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?f2 \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
 2. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
 3. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> ?f2 = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
show "?f \<in> iso ?G (relative_homology_group p (subtopology (nsphere n) {x. x k \<ge> 0}) {x. x k = 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
[PROOF STEP]
using homeomorphic_map_relative_homology_iso [OF hmrs Int_lower1 rimeq]
[PROOF STATE]
proof (prove)
using this:
hom_induced ?p (subtopology (nsphere n) {x. x k \<le> 0}) (topspace (subtopology (nsphere n) {x. x k \<le> 0}) \<inter> {x. x k = 0}) (subtopology (nsphere n) {x. 0 \<le> x k}) (topspace (subtopology (nsphere n) {x. 0 \<le> x k}) \<inter> {x. x k = 0}) r \<in> Group.iso (relative_homology_group ?p (subtopology (nsphere n) {x. x k \<le> 0}) (topspace (subtopology (nsphere n) {x. x k \<le> 0}) \<inter> {x. x k = 0})) (relative_homology_group ?p (subtopology (nsphere n) {x. 0 \<le> x k}) (topspace (subtopology (nsphere n) {x. 0 \<le> x k}) \<inter> {x. x k = 0}))

goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
[PROOF STEP]
by (metis hom_induced_restrict relative_homology_group_restrict)
[PROOF STATE]
proof (state)
this:
hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})

goal (2 subgoals):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
 2. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
have rimeq: "r ` (topspace (nsphere n) \<inter> {x. x k \<le> 0}) = topspace (nsphere n) \<inter> {x. 0 \<le> x k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r ` (topspace (nsphere n) \<inter> {x. x k \<le> 0}) = topspace (nsphere n) \<inter> {x. 0 \<le> x k}
[PROOF STEP]
by (metis hmrs homeomorphic_imp_surjective_map topspace_subtopology)
[PROOF STATE]
proof (state)
this:
r ` (topspace (nsphere n) \<inter> {x. x k \<le> 0}) = topspace (nsphere n) \<inter> {x. 0 \<le> x k}

goal (2 subgoals):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
 2. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?h2 \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
show "?h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) ?H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
using homeomorphic_map_relative_homology_iso [OF hmr Int_lower1 rimeq]
[PROOF STATE]
proof (prove)
using this:
hom_induced ?p (nsphere n) (topspace (nsphere n) \<inter> {x. x k \<le> 0}) (nsphere n) (topspace (nsphere n) \<inter> {x. 0 \<le> x k}) r \<in> Group.iso (relative_homology_group ?p (nsphere n) (topspace (nsphere n) \<inter> {x. x k \<le> 0})) (relative_homology_group ?p (nsphere n) (topspace (nsphere n) \<inter> {x. 0 \<le> x k}))

goal (1 subgoal):
 1. hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})

goal (1 subgoal):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
have [simp]: "\<And>x. x k = 0 \<Longrightarrow> r x k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x k = 0 \<Longrightarrow> r x k = 0
[PROOF STEP]
by (auto simp: r_def)
[PROOF STATE]
proof (state)
this:
?x k = 0 \<Longrightarrow> r ?x k = 0

goal (1 subgoal):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
have "?h \<circ> ?g \<circ> ?f
        = hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ>
          hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r
[PROOF STEP]
apply (subst hom_induced_compose [symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. continuous_map (subtopology (nsphere n) {x. 0 \<le> x k}) (nsphere n) id
 2. id ` {x. x k = 0} \<subseteq> {x. x k \<le> 0}
 3. continuous_map (nsphere n) (nsphere n) r
 4. r ` {x. x k \<le> 0} \<subseteq> {x. 0 \<le> x k}
 5. hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} (r \<circ> id) \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r
[PROOF STEP]
using continuous_map_nsphere_reflection
[PROOF STATE]
proof (prove)
using this:
continuous_map (nsphere ?n) (nsphere ?n) (\<lambda>x i. if i = ?k then - x i else x i)

goal (5 subgoals):
 1. continuous_map (subtopology (nsphere n) {x. 0 \<le> x k}) (nsphere n) id
 2. id ` {x. x k = 0} \<subseteq> {x. x k \<le> 0}
 3. continuous_map (nsphere n) (nsphere n) r
 4. r ` {x. x k \<le> 0} \<subseteq> {x. 0 \<le> x k}
 5. hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} (r \<circ> id) \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r
[PROOF STEP]
apply (force simp: r_def)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r

goal (1 subgoal):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r

goal (1 subgoal):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
have "\<dots> = ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
apply (subst hom_induced_compose [symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. continuous_map (subtopology (nsphere n) {x. x k \<le> 0}) (subtopology (nsphere n) {x. 0 \<le> x k}) r
 2. r ` {x. x k = 0} \<subseteq> {x. x k = 0}
 3. continuous_map (subtopology (nsphere n) {x. 0 \<le> x k}) (nsphere n) r
 4. r ` {x. x k = 0} \<subseteq> {x. 0 \<le> x k}
 5. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} (r \<circ> r) = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
apply (simp_all add: image_subset_iff cmr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (subtopology (nsphere n) {x. x k \<le> 0}) (subtopology (nsphere n) {x. 0 \<le> x k}) r
[PROOF STEP]
using hmrs homeomorphic_imp_continuous_map
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map (subtopology (nsphere n) {x. x k \<le> 0}) (subtopology (nsphere n) {x. 0 \<le> x k}) r
homeomorphic_map ?X ?Y ?f \<Longrightarrow> continuous_map ?X ?Y ?f

goal (1 subgoal):
 1. continuous_map (subtopology (nsphere n) {x. x k \<le> 0}) (subtopology (nsphere n) {x. 0 \<le> x k}) r
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id

goal (1 subgoal):
 1. (\<And>f h. \<lbrakk>f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}); h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k}); h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
show "?h \<circ> ?g \<circ> ?f = ?k"
[PROOF STATE]
proof (prove)
using this:
hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id

goal (1 subgoal):
 1. hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
hom_induced p (nsphere n) {x. x k \<le> 0} (nsphere n) {x. 0 \<le> x k} r \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} r = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id

goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
with iso_relative_homology_group_upper_hemisphere [of p n k]
[PROOF STATE]
proof (chain)
picking this:
hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. x k \<le> 0})
f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
[PROOF STEP]
have "h \<circ> hom_induced p (subtopology (nsphere n) {f. 0 \<le> f k}) {f. f k = 0} (nsphere n) {f. f k \<le> 0} id \<circ> f
  \<in> Group.iso ?G (relative_homology_group p (nsphere n) {f. 0 \<le> f k})"
[PROOF STATE]
proof (prove)
using this:
hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. x k \<le> 0})
f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id

goal (1 subgoal):
 1. h \<circ> hom_induced p (subtopology (nsphere n) {f. 0 \<le> f k}) {f. f k = 0} (nsphere n) {f. f k \<le> 0} id \<circ> f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {f. 0 \<le> f k})
[PROOF STEP]
using f h iso_set_trans
[PROOF STATE]
proof (prove)
using this:
hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. x k \<le> 0})
f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
h \<circ> hom_induced p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0} (nsphere n) {x. x k \<le> 0} id \<circ> f = hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id
f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (subtopology (nsphere n) {x. 0 \<le> x k}) {x. x k = 0})
h \<in> Group.iso (relative_homology_group p (nsphere n) {x. x k \<le> 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
\<lbrakk>?h \<in> Group.iso ?G ?H; ?i \<in> Group.iso ?H ?I\<rbrakk> \<Longrightarrow> ?i \<circ> ?h \<in> Group.iso ?G ?I

goal (1 subgoal):
 1. h \<circ> hom_induced p (subtopology (nsphere n) {f. 0 \<le> f k}) {f. f k = 0} (nsphere n) {f. f k \<le> 0} id \<circ> f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {f. 0 \<le> f k})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h \<circ> hom_induced p (subtopology (nsphere n) {f. 0 \<le> f k}) {f. f k = 0} (nsphere n) {f. f k \<le> 0} id \<circ> f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {f. 0 \<le> f k})

goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h \<circ> hom_induced p (subtopology (nsphere n) {f. 0 \<le> f k}) {f. f k = 0} (nsphere n) {f. f k \<le> 0} id \<circ> f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {f. 0 \<le> f k})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h \<circ> hom_induced p (subtopology (nsphere n) {f. 0 \<le> f k}) {f. f k = 0} (nsphere n) {f. f k \<le> 0} id \<circ> f \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {f. 0 \<le> f k})

goal (1 subgoal):
 1. hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})
[PROOF STEP]
by (simp add: eq)
[PROOF STATE]
proof (state)
this:
hom_induced p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0} (nsphere n) {x. 0 \<le> x k} id \<in> Group.iso (relative_homology_group p (subtopology (nsphere n) {x. x k \<le> 0}) {x. x k = 0}) (relative_homology_group p (nsphere n) {x. 0 \<le> x k})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unsatisfiable_false: "\<not> satisfiable (Bc False)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> satisfiable (Bc False)
[PROOF STEP]
by (simp add: satisfiable_def)


[STATEMENT]
lemma gval_fold_rev_true:
  "gval (fold gAnd (rev G) (Bc True)) s = true \<Longrightarrow>
   gval (fold gAnd G (Bc True)) s = true"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gval (fold gAnd (rev G) (Bc True)) s = true \<Longrightarrow> gval (fold gAnd G (Bc True)) s = true
[PROOF STEP]
by (metis foldr_conv_fold gval_foldr_true rev_rev_ident set_rev)


[STATEMENT]
lemma out_ocircline_ounit_circle_conjugate [simp]:
  assumes "out_ocircline ounit_circle z"
  shows "out_ocircline ounit_circle (conjugate z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_ocircline ounit_circle (conjugate z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
out_ocircline ounit_circle z

goal (1 subgoal):
 1. out_ocircline ounit_circle (conjugate z)
[PROOF STEP]
by (transfer, transfer, auto simp add: vec_cnj_def)


[STATEMENT]
lemma (in group) cyclic_group_epimorphic_image:
  assumes "h \<in> epi G H" "cyclic_group G" "group H"
  shows "cyclic_group H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
interpret h: group_hom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_hom G H h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h \<in> epi G H
cyclic_group G
Group.group H

goal (1 subgoal):
 1. group_hom G H h
[PROOF STEP]
by (simp add: group_hom_def group_hom_axioms_def is_group epi_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
obtain x where "x \<in> carrier G" and x: "carrier G = range (\<lambda>n::int. x [^] n)" and eq: "carrier H = h ` carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> carrier G; carrier G = range (([^]) x); carrier H = h ` carrier G\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h \<in> epi G H
cyclic_group G
Group.group H

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> carrier G; carrier G = range (([^]) x); carrier H = h ` carrier G\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: cyclic_group epi_def)
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
carrier G = range (([^]) x)
carrier H = h ` carrier G

goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
have "h ` carrier G = range (\<lambda>n::int. h x [^]\<^bsub>H\<^esub> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))
[PROOF STEP]
by (metis (no_types, lifting) \<open>x \<in> carrier G\<close> h.hom_int_pow image_cong image_image x)
[PROOF STATE]
proof (state)
this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))

goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))

goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
using \<open>x \<in> carrier G\<close> eq h.cyclic_group
[PROOF STATE]
proof (prove)
using this:
h ` carrier G = range (([^]\<^bsub>H\<^esub>) (h x))
x \<in> carrier G
carrier H = h ` carrier G
cyclic_group H = (\<exists>x\<in>carrier H. carrier H = range (([^]\<^bsub>H\<^esub>) x))

goal (1 subgoal):
 1. cyclic_group H
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cyclic_group H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linepath_cnj': "cnj \<circ> linepath a b = linepath (cnj a) (cnj b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj \<circ> linepath a b = linepath (cnj a) (cnj b)
[PROOF STEP]
by (simp add: linepath_def fun_eq_iff)


[STATEMENT]
lemma integral_discrete_difference:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  assumes X: "countable X"
  assumes null: "\<And>x. x \<in> X \<Longrightarrow> emeasure M {x} = 0"
  assumes sets: "\<And>x. x \<in> X \<Longrightarrow> {x} \<in> sets M"
  assumes eq: "\<And>x. x \<in> space M \<Longrightarrow> x \<notin> X \<Longrightarrow> f x = g x"
  shows "integral\<^sup>L M f = integral\<^sup>L M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
proof (rule integral_eq_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integrable M f = integrable M g
 2. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
show eq: "integrable M f \<longleftrightarrow> integrable M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M f = integrable M g
[PROOF STEP]
by (rule integrable_discrete_difference[where X=X]) fact+
[PROOF STATE]
proof (state)
this:
integrable M f = integrable M g

goal (1 subgoal):
 1. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
assume f: "integrable M f"
[PROOF STATE]
proof (state)
this:
integrable M f

goal (1 subgoal):
 1. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
show "integral\<^sup>L M f = integral\<^sup>L M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M f = integral\<^sup>L M g
[PROOF STEP]
proof (rule integral_cong_AE)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f \<in> borel_measurable M
 2. g \<in> borel_measurable M
 3. AE x in M. f x = g x
[PROOF STEP]
show "f \<in> borel_measurable M" "g \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M &&& g \<in> borel_measurable M
[PROOF STEP]
using f eq
[PROOF STATE]
proof (prove)
using this:
integrable M f
integrable M f = integrable M g

goal (1 subgoal):
 1. f \<in> borel_measurable M &&& g \<in> borel_measurable M
[PROOF STEP]
by (auto intro: borel_measurable_integrable)
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. AE x in M. f x = g x
[PROOF STEP]
have "AE x in M. x \<notin> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. x \<notin> X
[PROOF STEP]
by (rule AE_discrete_difference) fact+
[PROOF STATE]
proof (state)
this:
AE x in M. x \<notin> X

goal (1 subgoal):
 1. AE x in M. f x = g x
[PROOF STEP]
with AE_space
[PROOF STATE]
proof (chain)
picking this:
AE x in ?M. x \<in> space ?M
AE x in M. x \<notin> X
[PROOF STEP]
show "AE x in M. f x = g x"
[PROOF STATE]
proof (prove)
using this:
AE x in ?M. x \<in> space ?M
AE x in M. x \<notin> X

goal (1 subgoal):
 1. AE x in M. f x = g x
[PROOF STEP]
by eventually_elim fact
[PROOF STATE]
proof (state)
this:
AE x in M. f x = g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M f = integral\<^sup>L M g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HInfiniteI: "(\<And>r. r \<in> \<real> \<Longrightarrow> r < hnorm x) \<Longrightarrow> x \<in> HInfinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. r \<in> \<real> \<Longrightarrow> r < hnorm x) \<Longrightarrow> x \<in> HInfinite
[PROOF STEP]
by (simp add: HInfinite_def)


[STATEMENT]
lemma inner_minus_left [simp]: "inner (- x) y = - inner x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (- x) y = - inner x y
[PROOF STEP]
using inner_add_left [of x "- x" y]
[PROOF STATE]
proof (prove)
using this:
inner (x + - x) y = inner x y + inner (- x) y

goal (1 subgoal):
 1. inner (- x) y = - inner x y
[PROOF STEP]
using add_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
inner (x + - x) y = inner x y + inner (- x) y
(?a + ?b = (0::?'a)) = (?b = - ?a)

goal (1 subgoal):
 1. inner (- x) y = - inner x y
[PROOF STEP]
by force


[STATEMENT]
lemma size_bubble_min: "size(bubble_min xs) = size xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (bubble_min xs) = length xs
[PROOF STEP]
by(induction xs rule: bubble_min.induct) (auto split: list.split)


[STATEMENT]
lemma take_bit_push_bit:
  "take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
proof (cases "m \<le> n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
 2. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m \<le> n

goal (2 subgoals):
 1. m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
 2. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
apply (simp add:)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = (0::'a)
[PROOF STEP]
apply (simp_all add: push_bit_eq_mult take_bit_eq_mod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> a * (2::'a) ^ n mod (2::'a) ^ m = (0::'a)
[PROOF STEP]
apply (auto dest!: le_Suc_ex simp add: power_add ac_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. n = na + m \<Longrightarrow> a * ((2::'a) ^ na * (2::'a) ^ m) mod (2::'a) ^ m = (0::'a)
[PROOF STEP]
using mult_exp_mod_exp_eq [of m m \<open>a * 2 ^ n\<close> for n]
[PROOF STATE]
proof (prove)
using this:
m \<le> m \<Longrightarrow> a * (2::'a) ^ ?na3 * (2::'a) ^ m mod (2::'a) ^ m = a * (2::'a) ^ ?na3 mod (2::'a) ^ (m - m) * (2::'a) ^ m

goal (1 subgoal):
 1. \<And>na. n = na + m \<Longrightarrow> a * ((2::'a) ^ na * (2::'a) ^ m) mod (2::'a) ^ m = (0::'a)
[PROOF STEP]
apply (simp add: ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)

goal (1 subgoal):
 1. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> m \<le> n

goal (1 subgoal):
 1. \<not> m \<le> n \<Longrightarrow> take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> m \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> m \<le> n

goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
using push_bit_take_bit [of n "m - n" a]
[PROOF STATE]
proof (prove)
using this:
\<not> m \<le> n
push_bit n (take_bit (m - n) a) = take_bit (n + (m - n)) (push_bit n a)

goal (1 subgoal):
 1. take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
take_bit m (push_bit n a) = push_bit n (take_bit (m - n) a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma correctCompositionOut_prop1:
assumes "subcomponents PQ = {P,Q}"
       and "correctCompositionOut PQ"
       and "x \<in> (out PQ)"
shows    "(x \<in> (out P)) \<or> (x \<in> (out Q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> out P \<or> x \<in> out Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subcomponents PQ = {P, Q}
correctCompositionOut PQ
x \<in> out PQ

goal (1 subgoal):
 1. x \<in> out P \<or> x \<in> out Q
[PROOF STEP]
by (simp add: correctCompositionOut_def)


[STATEMENT]
lemma irreducibleI:
  "p \<noteq> 0 \<Longrightarrow> \<not>p dvd 1 \<Longrightarrow> (\<And>a b. p = a * b \<Longrightarrow> a dvd 1 \<or> b dvd 1) \<Longrightarrow> irreducible p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<noteq> (0::'a); \<not> p dvd (1::'a); \<And>a b. p = a * b \<Longrightarrow> a dvd (1::'a) \<or> b dvd (1::'a)\<rbrakk> \<Longrightarrow> irreducible p
[PROOF STEP]
by (simp add: irreducible_def)


[STATEMENT]
lemma singular_simplex_chain_map_id:
  assumes "singular_simplex p X f"
  shows "chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
have "(restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p)) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f
[PROOF STEP]
by (rule ext) (metis assms comp_apply extensional_arb id_apply restrict_apply singular_simplex_def)
[PROOF STATE]
proof (state)
this:
restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f

goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
restrict (f \<circ> restrict id (standard_simplex p)) (standard_simplex p) = f

goal (1 subgoal):
 1. chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f
[PROOF STEP]
by (simp add: simplex_map_def)
[PROOF STATE]
proof (state)
this:
chain_map p f (frag_of (restrict id (standard_simplex p))) = frag_of f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_map_upt: "length (map f [a..<b]) = b - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
have "length [a..<b] = b - a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [a..<b] = b - a
[PROOF STEP]
using length_upt
[PROOF STATE]
proof (prove)
using this:
length [?i..<?j] = ?j - ?i

goal (1 subgoal):
 1. length [a..<b] = b - a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length [a..<b] = b - a

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length [a..<b] = b - a

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
have "length (map f [a..<b]) = length [a..<b]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map f [a..<b]) = length [a..<b]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (map f [a..<b]) = length [a..<b]

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length [a..<b] = b - a
length (map f [a..<b]) = length [a..<b]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length [a..<b] = b - a
length (map f [a..<b]) = length [a..<b]

goal (1 subgoal):
 1. length (map f [a..<b]) = b - a
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
length (map f [a..<b]) = b - a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma carrier_lucas_lehmer_ring [simp]: "carrier lucas_lehmer_ring = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier lucas_lehmer_ring = UNIV
[PROOF STEP]
by (simp add: lucas_lehmer_ring_def)


[STATEMENT]
lemma homeomorphismI [intro?]:
  assumes "continuous_on S f" "continuous_on T g"
          "f ` S \<subseteq> T" "g ` T \<subseteq> S" "\<And>x. x \<in> S \<Longrightarrow> g(f x) = x" "\<And>y. y \<in> T \<Longrightarrow> f(g y) = y"
    shows "homeomorphism S T f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism S T f g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
continuous_on T g
f ` S \<subseteq> T
g ` T \<subseteq> S
?x \<in> S \<Longrightarrow> g (f ?x) = ?x
?y \<in> T \<Longrightarrow> f (g ?y) = ?y

goal (1 subgoal):
 1. homeomorphism S T f g
[PROOF STEP]
by (force simp: homeomorphism_def)


[STATEMENT]
lemma compose_map1: "map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)"
  for S1 :: "('a, 'b) dds" and S2 :: "('b, 'c) dds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
using compose_parametric[of "(Grp UNIV f)\<inverse>\<inverse>" "Grp UNIV g" "Grp UNIV id :: 'c \<Rightarrow> 'c \<Rightarrow> bool"]
[PROOF STATE]
proof (prove)
using this:
(rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV g) (Grp UNIV id) ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV id)) (\<bullet>) (\<bullet>)

goal (1 subgoal):
 1. map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(rewrite in "_ ===> rel_dds \<hole> _ ===> _" in asm conversep_conversep[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV g)\<inverse>\<inverse>\<inverse>\<inverse> (Grp UNIV id) ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV id)) (\<bullet>) (\<bullet>) \<Longrightarrow> map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(rewrite in "_ ===> rel_dds _ \<hole> ===> _" in asm conversep_Grp_id[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV g)\<inverse>\<inverse>\<inverse>\<inverse> (Grp UNIV id)\<inverse>\<inverse> ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV id)) (\<bullet>) (\<bullet>) \<Longrightarrow> map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(simp only: rel_dds_conversep rel_dds_Grp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Grp UNIV (map_dds f g) ===> (Grp UNIV (map_dds g id))\<inverse>\<inverse> ===> Grp UNIV (map_dds f id)) (\<bullet>) (\<bullet>) \<Longrightarrow> map_dds f g S1 \<bullet> S2 = map_dds f id (S1 \<bullet> map_dds g id S2)
[PROOF STEP]
apply(simp add: rel_fun_def Grp_apply)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma map_of_assoc_list_of_array:
  "map_of (assoc_list_of_array a) k = (if k < array_length a then Some (array_get a k) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (assoc_list_of_array a) k = (if k < array_length a then Some (array_get a k) else None)
[PROOF STEP]
by(cases a, cases "k < array_length a")(force simp add: set_zip)+


[STATEMENT]
lemma set_of_l_bal: "height l = height r + 2 \<Longrightarrow>
  set_of (l_bal\<^sub>0 x l r) = insert x (set_of l \<union> set_of r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height l = height r + 2 \<Longrightarrow> set_of (l_bal\<^sub>0 x l r) = insert x (set_of l \<union> set_of r)
[PROOF STEP]
by (cases l) (auto split: tree\<^sub>0.splits)


[STATEMENT]
lemma ennreal_suminf_cmult[simp]: "(\<Sum>i. r * f i) = r * (\<Sum>i. f i::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. r * f i) = r * (\<Sum>i. f i)
[PROOF STEP]
by transfer (auto intro!: suminf_cmult_ereal)


[STATEMENT]
lemma leftmost_Derives1_propagate:
  assumes leftmost: "leftmost i a"
      and Derives1: "Derives1 a j r b"
    shows "(is_word b \<and> i = j) \<or> (\<exists> k. leftmost k b \<and> i \<le> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
from leftmost_Derives1[OF leftmost Derives1]
[PROOF STATE]
proof (chain)
picking this:
i \<le> j
[PROOF STEP]
have ij: "i \<le> j"
[PROOF STATE]
proof (prove)
using this:
i \<le> j

goal (1 subgoal):
 1. i \<le> j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<le> j

goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
proof (cases "is_word b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
 2. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
is_word b

goal (2 subgoals):
 1. is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
 2. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
by (metis Derives1 True ij le_neq_implies_less leftmost
          leftmost_unaffected_Derives1 order_refl)
[PROOF STATE]
proof (state)
this:
is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)

goal (1 subgoal):
 1. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> is_word b

goal (1 subgoal):
 1. \<not> is_word b \<Longrightarrow> is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)
[PROOF STEP]
by (metis (no_types, opaque_lifting) Derives1 Derives1_bound Derives1_sentence2
          Derives1_take append_take_drop_id ij le_neq_implies_less leftmost
          leftmost_append leftmost_cons_less leftmost_def length_take
          min.absorb2 nat_le_linear nonword_leftmost_exists not_le)
[PROOF STATE]
proof (state)
this:
is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_word b \<and> i = j \<or> (\<exists>k. leftmost k b \<and> i \<le> k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_abs_leI:
  fixes x y :: ereal
  shows "\<lbrakk> x \<le> y; -x \<le> y \<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; - x \<le> y\<rbrakk> \<Longrightarrow> \<bar>x\<bar> \<le> y
[PROOF STEP]
by(cases x y rule: ereal2_cases)(simp_all)


[STATEMENT]
lemma path_component_of_subset: "S \<subseteq> T \<Longrightarrow> path_component S x y \<Longrightarrow> path_component T x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; path_component S x y\<rbrakk> \<Longrightarrow> path_component T x y
[PROOF STEP]
unfolding path_component_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> T; \<exists>g. path g \<and> path_image g \<subseteq> S \<and> pathstart g = x \<and> pathfinish g = y\<rbrakk> \<Longrightarrow> \<exists>g. path g \<and> path_image g \<subseteq> T \<and> pathstart g = x \<and> pathfinish g = y
[PROOF STEP]
by auto


[STATEMENT]
lemma dm_eq: assumes i:"irrefl r" and t: "trans r" shows "dm r M = dm r (M -s dm r M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<down>m M = r \<down>m (M -s r \<down>m M)
[PROOF STEP]
using dm_subset[OF assms]
[PROOF STATE]
proof (prove)
using this:
r \<down>m ?M \<subseteq> r \<down>m (?M -s r \<down>m ?M)

goal (1 subgoal):
 1. r \<down>m M = r \<down>m (M -s r \<down>m M)
[PROOF STEP]
unfolding dm_def ds_def diff_def
[PROOF STATE]
proof (prove)
using this:
{y. \<exists>x\<in>#?M. (y, x) \<in> r} \<subseteq> {y. \<exists>x\<in>#{#x \<in># ?M. x \<notin> {y. \<exists>x\<in>#?M. (y, x) \<in> r}#}. (y, x) \<in> r}

goal (1 subgoal):
 1. {y. \<exists>x\<in>#M. (y, x) \<in> r} = {y. \<exists>x\<in>#{#x \<in># M. x \<notin> {y. \<exists>x\<in>#M. (y, x) \<in> r}#}. (y, x) \<in> r}
[PROOF STEP]
by auto


[STATEMENT]
lemma finsum_scalar_prod_sum:
  assumes f: "f : U \<rightarrow> carrier_vec n"
      and w: "w: carrier_vec n"
  shows "finsum V f U \<bullet> w = sum (\<lambda>u. f u \<bullet> w) U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
[PROOF STEP]
using w f
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
f \<in> U \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
[PROOF STEP]
proof (induct U rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>w \<in> carrier_vec n; f \<in> F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f F \<bullet> w = (\<Sum>u\<in>F. f u \<bullet> w); w \<in> carrier_vec n; f \<in> insert x F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f (insert x F) \<bullet> w = (\<Sum>u\<in>insert x F. f u \<bullet> w)
[PROOF STEP]
case (insert u U)
[PROOF STATE]
proof (state)
this:
finite U
u \<notin> U
\<lbrakk>w \<in> carrier_vec n; f \<in> U \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
w \<in> carrier_vec n
f \<in> insert u U \<rightarrow> carrier_vec n

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>w \<in> carrier_vec n; f \<in> F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f F \<bullet> w = (\<Sum>u\<in>F. f u \<bullet> w); w \<in> carrier_vec n; f \<in> insert x F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f (insert x F) \<bullet> w = (\<Sum>u\<in>insert x F. f u \<bullet> w)
[PROOF STEP]
hence f: "f : U \<rightarrow> carrier_vec n" "f u : carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
finite U
u \<notin> U
\<lbrakk>w \<in> carrier_vec n; f \<in> U \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
w \<in> carrier_vec n
f \<in> insert u U \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. f \<in> U \<rightarrow> carrier_vec n &&& f u \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> U \<rightarrow> carrier_vec n
f u \<in> carrier_vec n

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>w \<in> carrier_vec n; f \<in> F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f F \<bullet> w = (\<Sum>u\<in>F. f u \<bullet> w); w \<in> carrier_vec n; f \<in> insert x F \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f (insert x F) \<bullet> w = (\<Sum>u\<in>insert x F. f u \<bullet> w)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finsum V f (insert u U) \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
unfolding finsum_insert[OF insert(1) insert(2) f]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f u + finsum V f U) \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
apply (subst add_scalar_prod_distrib)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. f u \<in> carrier_vec ?n1
 2. finsum V f U \<in> carrier_vec ?n1
 3. w \<in> carrier_vec ?n1
 4. f u \<bullet> w + finsum V f U \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite U
u \<notin> U
\<lbrakk>w \<in> carrier_vec n; f \<in> U \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f U \<bullet> w = (\<Sum>u\<in>U. f u \<bullet> w)
w \<in> carrier_vec n
f \<in> insert u U \<rightarrow> carrier_vec n

goal (4 subgoals):
 1. f u \<in> carrier_vec ?n1
 2. finsum V f U \<in> carrier_vec ?n1
 3. w \<in> carrier_vec ?n1
 4. f u \<bullet> w + finsum V f U \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finsum V f (insert u U) \<bullet> w = (\<Sum>u\<in>insert u U. f u \<bullet> w)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; w \<in> carrier_vec n; f \<in> A \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f A \<bullet> w = (\<Sum>u\<in>A. f u \<bullet> w)
 2. \<lbrakk>w \<in> carrier_vec n; f \<in> {} \<rightarrow> carrier_vec n\<rbrakk> \<Longrightarrow> finsum V f {} \<bullet> w = (\<Sum>u\<in>{}. f u \<bullet> w)
[PROOF STEP]
qed auto


[STATEMENT]
lemma bifunctor_proj_fst_ObjMap_vsv[cat_cs_intros]:
  assumes "\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<DD>" and "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>"
  shows "vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
interpret \<SS>: is_functor \<alpha> \<AA> \<DD> \<open>\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F : \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<DD>
[PROOF STEP]
by (rule bifunctor_proj_fst_is_functor[OF assms])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)
[PROOF STEP]
by (rule \<SS>.cf_ObjMap_vsv)
[PROOF STATE]
proof (state)
this:
vsv ((\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(-,b)\<^sub>C\<^sub>F)\<lparr>ObjMap\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed