[STATEMENT]
lemma reduced_homology_group_nsphere_step:
   "\<exists>f \<in> iso(reduced_homology_group p (nsphere n))
            (reduced_homology_group (1 + p) (nsphere (Suc n))).
        \<forall>c \<in> carrier(reduced_homology_group p (nsphere n)).
             hom_induced (1 + p) (nsphere(Suc n)) {} (nsphere(Suc n)) {}
                         (\<lambda>x i. if i = 0 then -x i else x i) (f c)
           = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then -x i else x i) c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
define r where "r \<equiv> \<lambda>x::nat\<Rightarrow>real. \<lambda>i. if i = 0 then -x i else x i"
[PROOF STATE]
proof (state)
this:
r \<equiv> \<lambda>x i. if i = 0 then - x i else x i

goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
have cmr: "continuous_map (nsphere n) (nsphere n) r" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (nsphere n) (nsphere n) r
[PROOF STEP]
unfolding r_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (nsphere n) (nsphere n) (\<lambda>x i. if i = 0 then - x i else x i)
[PROOF STEP]
by (rule continuous_map_nsphere_reflection)
[PROOF STATE]
proof (state)
this:
continuous_map (nsphere ?n) (nsphere ?n) r

goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
have rsub: "r ` {x. 0 \<le> x (Suc n)} \<subseteq> {x. 0 \<le> x (Suc n)}" "r ` {x. x (Suc n) \<le> 0} \<subseteq> {x. x (Suc n) \<le> 0}" "r ` {x. x (Suc n) = 0} \<subseteq> {x. x (Suc n) = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r ` {x. 0 \<le> x (Suc n)} \<subseteq> {x. 0 \<le> x (Suc n)} &&& r ` {x. x (Suc n) \<le> 0} \<subseteq> {x. x (Suc n) \<le> 0} &&& r ` {x. x (Suc n) = 0} \<subseteq> {x. x (Suc n) = 0}
[PROOF STEP]
by (force simp: r_def)+
[PROOF STATE]
proof (state)
this:
r ` {x. 0 \<le> x (Suc n)} \<subseteq> {x. 0 \<le> x (Suc n)}
r ` {x. x (Suc n) \<le> 0} \<subseteq> {x. x (Suc n) \<le> 0}
r ` {x. x (Suc n) = 0} \<subseteq> {x. x (Suc n) = 0}

goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
let ?sub = "subtopology (nsphere (Suc n)) {x. x (Suc n) \<ge> 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
let ?G2 = "relative_homology_group (1 + p) ?sub {x. x (Suc n) = 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
let ?r2 = "hom_induced (1 + p) ?sub {x. x (Suc n) = 0} ?sub {x. x (Suc n) = 0} r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
let ?j = "\<lambda>p n. hom_induced p (nsphere n) {} (nsphere n) {} r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)
[PROOF STEP]
unfolding r_def [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} r c)
[PROOF STEP]
proof (rule isomorphism_trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) ?G2.0. \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). ?r2.0 (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} r c)
 2. \<exists>f\<in>Group.iso ?G2.0 (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier ?G2.0. hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (?r2.0 c)
[PROOF STEP]
let ?f = "hom_boundary (1 + p) ?sub {x. x (Suc n) = 0}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) ?G2.0. \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). ?r2.0 (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} r c)
 2. \<exists>f\<in>Group.iso ?G2.0 (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier ?G2.0. hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (?r2.0 c)
[PROOF STEP]
show "\<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) ?G2.
           \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). ?r2 (f c) = f (?j p n c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} r c)
[PROOF STEP]
proof (rule isomorphism_sym)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. ?f \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group p (nsphere n))
 2. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced p (nsphere n) {} (nsphere n) {} r (?f c) = ?f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 3. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 4. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 5. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
show "?f \<in> Group.iso ?G2 (reduced_homology_group p (nsphere n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group p (nsphere n))
[PROOF STEP]
using iso_upper_hemisphere_reduced_homology_group
[PROOF STATE]
proof (prove)
using this:
hom_boundary (1 + ?p) (subtopology (nsphere (Suc ?n)) {x. 0 \<le> x (Suc ?n)}) {x. x (Suc ?n) = 0} \<in> Group.iso (relative_homology_group (1 + ?p) (subtopology (nsphere (Suc ?n)) {x. 0 \<le> x (Suc ?n)}) {x. x (Suc ?n) = 0}) (reduced_homology_group ?p (nsphere ?n))

goal (1 subgoal):
 1. hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group p (nsphere n))
[PROOF STEP]
by (metis add.commute)
[PROOF STATE]
proof (state)
this:
hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group p (nsphere n))

goal (4 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 4. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 4. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 4. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
assume "c \<in> carrier ?G2"
[PROOF STATE]
proof (state)
this:
c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})

goal (4 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 4. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
have cmrs: "continuous_map ?sub ?sub r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) r
[PROOF STEP]
by (metis (mono_tags, lifting) IntE cmr continuous_map_from_subtopology continuous_map_in_subtopology image_subset_iff rsub(1) topspace_subtopology)
[PROOF STATE]
proof (state)
this:
continuous_map (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) r

goal (4 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 4. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
have "hom_induced p (nsphere n) {} (nsphere n) {} r \<circ> hom_boundary (1 + p) ?sub {x. x (Suc n) = 0}
          = hom_boundary (1 + p) ?sub {x. x (Suc n) = 0} \<circ>
            hom_induced (1 + p) ?sub {x. x (Suc n) = 0} ?sub {x. x (Suc n) = 0} r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced p (nsphere n) {} (nsphere n) {} r \<circ> hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<circ> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r
[PROOF STEP]
using naturality_hom_induced [OF cmrs rsub(3), symmetric, of "1+p", simplified]
[PROOF STATE]
proof (prove)
using this:
hom_induced p (subtopology (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) {} (subtopology (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) {} r \<circ> hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<circ> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r

goal (1 subgoal):
 1. hom_induced p (nsphere n) {} (nsphere n) {} r \<circ> hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<circ> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r
[PROOF STEP]
by (simp add: subtopology_subtopology subtopology_nsphere_equator flip: Collect_conj_eq cong: rev_conj_cong)
[PROOF STATE]
proof (state)
this:
hom_induced p (nsphere n) {} (nsphere n) {} r \<circ> hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<circ> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r

goal (4 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 4. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hom_induced p (nsphere n) {} (nsphere n) {} r \<circ> hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<circ> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r
[PROOF STEP]
show "?j p n (?f c) = ?f (hom_induced (1 + p) ?sub {x. x (Suc n) = 0} ?sub {x. x (Suc n) = 0} r c)"
[PROOF STATE]
proof (prove)
using this:
hom_induced p (nsphere n) {} (nsphere n) {} r \<circ> hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} \<circ> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r

goal (1 subgoal):
 1. hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
by (metis comp_def)
[PROOF STATE]
proof (state)
this:
hom_induced p (nsphere n) {} (nsphere n) {} r (hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} c) = hom_boundary (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)

goal (3 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 2. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 2. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 2. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
assume "c \<in> carrier ?G2"
[PROOF STATE]
proof (state)
this:
c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})

goal (3 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 2. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 3. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
show "hom_induced (1 + p) ?sub {x. x (Suc n) = 0} ?sub {x. x (Suc n) = 0} r c \<in> carrier ?G2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
[PROOF STEP]
using hom_induced_carrier
[PROOF STATE]
proof (prove)
using this:
hom_induced ?p ?X ?S ?Y ?T ?f ?c \<in> carrier (relative_homology_group ?p ?Y ?T)

goal (1 subgoal):
 1. hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})

goal (2 subgoals):
 1. Group.group (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})
 2. Group.group (reduced_homology_group p (nsphere n))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} r c)

goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
let ?H2 = "relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
let ?s2 = "hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
show "\<exists>f\<in>Group.iso ?G2 (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier ?G2. ?j (1 + p) (Suc n) (f c)
            = f (?r2 c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
proof (rule isomorphism_trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) ?G2.0. \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). ?r2.0 (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. \<exists>f\<in>Group.iso ?G2.0 (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier ?G2.0. hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (?r2.0 c)
[PROOF STEP]
show "\<exists>f\<in>Group.iso ?G2 ?H2.
                 \<forall>c\<in>carrier ?G2.
                    ?s2 (f c) = f (hom_induced (1 + p) ?sub {x. x (Suc n) = 0} ?sub {x. x (Suc n) = 0} r c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
proof (intro ballI bexI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (?f c) = ?f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. ?f \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (?f c) = ?f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. ?f \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
assume "c \<in> carrier (relative_homology_group (1 + p) ?sub {x. x (Suc n) = 0})"
[PROOF STATE]
proof (state)
this:
c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0})

goal (2 subgoals):
 1. \<And>c. c \<in> carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (?f c) = ?f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
 2. ?f \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
show "?s2 (hom_induced (1 + p) ?sub {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c)
            = hom_induced (1 + p) ?sub {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (?r2 c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
apply (simp add: rsub hom_induced_compose' Collect_mono_iff cmr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r c = hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)
[PROOF STEP]
apply (subst hom_induced_compose')
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. continuous_map (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) r
 2. r ` {x. x (Suc n) = 0} \<subseteq> {x. x (Suc n) = 0}
 3. continuous_map (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) (nsphere (Suc n)) id
 4. id ` {x. x (Suc n) = 0} \<subseteq> {x. x (Suc n) \<le> 0}
 5. hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r c = hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (id \<circ> r) c
[PROOF STEP]
apply (simp_all add: continuous_map_in_subtopology continuous_map_from_subtopology [OF cmr] rsub)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. r ` (topspace (nsphere (Suc n)) \<inter> {x. 0 \<le> x (Suc n)}) \<subseteq> {x. 0 \<le> x (Suc n)}
 2. {x. x (Suc n) = 0} \<subseteq> {x. x (Suc n) \<le> 0}
[PROOF STEP]
apply (auto simp: r_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)

goal (1 subgoal):
 1. hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id \<in> Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
qed (simp add: iso_relative_homology_group_upper_hemisphere)
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)

goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r c)
[PROOF STEP]
let ?h = "hom_induced (1 + p) (nsphere(Suc n)) {} (nsphere (Suc n)) {x. x(Suc n) \<le> 0} id"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r c)
[PROOF STEP]
show "\<exists>f\<in>Group.iso ?H2 (reduced_homology_group (1 + p) (nsphere (Suc n))).
               \<forall>c\<in>carrier ?H2. ?j (1 + p) (Suc n) (f c) = f (?s2 c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>Group.iso (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r c)
[PROOF STEP]
proof (rule isomorphism_sym)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. ?f \<in> Group.iso (reduced_homology_group (1 + p) (nsphere (Suc n))) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
 2. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (?f c) = ?f (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c)
 3. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 4. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 5. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
show "?h \<in> Group.iso (reduced_homology_group (1 + p) (nsphere (Suc n)))
               (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id \<in> Group.iso (reduced_homology_group (1 + p) (nsphere (Suc n))) (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
using iso_reduced_homology_group_lower_hemisphere
[PROOF STATE]
proof (prove)
using this:
?k \<le> ?n \<Longrightarrow> hom_induced ?p (nsphere ?n) {} (nsphere ?n) {x. x ?k \<le> 0} id \<in> Group.iso (reduced_homology_group ?p (nsphere ?n)) (relative_homology_group ?p (nsphere ?n) {x. x ?k \<le> 0})

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

goal (4 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c)
 2. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 4. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c)
 2. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 4. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c)
 2. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 4. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
assume "c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))"
[PROOF STATE]
proof (state)
this:
c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))

goal (4 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c)
 2. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 4. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
show "?s2 (?h c) = ?h (?j (1 + p) (Suc n)  c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c)
[PROOF STEP]
by (simp add: hom_induced_compose' cmr rsub)
[PROOF STATE]
proof (state)
this:
hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id c) = hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} id (hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c)

goal (3 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 2. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 2. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 2. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
assume "c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))"
[PROOF STATE]
proof (state)
this:
c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))

goal (3 subgoals):
 1. \<And>c. c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n))) \<Longrightarrow> hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
 2. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 3. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
[PROOF STEP]
show "hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c
        \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))"
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))

goal (1 subgoal):
 1. hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))
[PROOF STEP]
by (simp add: hom_induced_reduced)
[PROOF STATE]
proof (state)
this:
hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r c \<in> carrier (reduced_homology_group (1 + p) (nsphere (Suc n)))

goal (2 subgoals):
 1. Group.group (reduced_homology_group (1 + p) (nsphere (Suc n)))
 2. Group.group (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0})
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>Group.iso (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (nsphere (Suc n)) {x. x (Suc n) \<le> 0} (nsphere (Suc n)) {x. x (Suc n) \<le> 0} r c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>Group.iso (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (relative_homology_group (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0}). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} r (f c) = f (hom_induced (1 + p) (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} (subtopology (nsphere (Suc n)) {x. 0 \<le> x (Suc n)}) {x. x (Suc n) = 0} r c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>Group.iso (reduced_homology_group p (nsphere n)) (reduced_homology_group (1 + p) (nsphere (Suc n))). \<forall>c\<in>carrier (reduced_homology_group p (nsphere n)). hom_induced (1 + p) (nsphere (Suc n)) {} (nsphere (Suc n)) {} (\<lambda>x i. if i = 0 then - x i else x i) (f c) = f (hom_induced p (nsphere n) {} (nsphere n) {} (\<lambda>x i. if i = 0 then - x i else x i) c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_to_iarray_scaleR:
  "vec_to_iarray (a *\<^sub>R x) = a *\<^sub>R (vec_to_iarray x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (a *\<^sub>R x) = a *\<^sub>R vec_to_iarray x
[PROOF STEP]
unfolding scaleR_vec_def scaleR_iarray_def vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (\<chi>i. a *\<^sub>R x $ i) $ mod_type_class.from_nat i) CARD('b) = IArray.of_fun (\<lambda>i. a *\<^sub>R IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('b) !! i) (IArray.length (IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('b)))
[PROOF STEP]
by auto


[STATEMENT]
lemma add_node_wf: "wf_list_graph G \<Longrightarrow> wf_list_graph (add_node v G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_list_graph G \<Longrightarrow> wf_list_graph (FiniteListGraph.add_node v G)
[PROOF STEP]
unfolding wf_list_graph_def wf_list_graph_axioms_def add_node_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (nodesL G) \<and> distinct (edgesL G) \<and> fst ` set (edgesL G) \<subseteq> set (nodesL G) \<and> snd ` set (edgesL G) \<subseteq> set (nodesL G) \<Longrightarrow> distinct (nodesL \<lparr>nodesL = if v \<in> set (nodesL G) then nodesL G else v # nodesL G, edgesL = edgesL G\<rparr>) \<and> distinct (edgesL \<lparr>nodesL = if v \<in> set (nodesL G) then nodesL G else v # nodesL G, edgesL = edgesL G\<rparr>) \<and> fst ` set (edgesL \<lparr>nodesL = if v \<in> set (nodesL G) then nodesL G else v # nodesL G, edgesL = edgesL G\<rparr>) \<subseteq> set (nodesL \<lparr>nodesL = if v \<in> set (nodesL G) then nodesL G else v # nodesL G, edgesL = edgesL G\<rparr>) \<and> snd ` set (edgesL \<lparr>nodesL = if v \<in> set (nodesL G) then nodesL G else v # nodesL G, edgesL = edgesL G\<rparr>) \<subseteq> set (nodesL \<lparr>nodesL = if v \<in> set (nodesL G) then nodesL G else v # nodesL G, edgesL = edgesL G\<rparr>)
[PROOF STEP]
by auto


[STATEMENT]
lemma lemma_real_divide_sqrt_less: "0 < u \<Longrightarrow> u / sqrt 2 < u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < u \<Longrightarrow> u / sqrt 2 < u
[PROOF STEP]
by (simp add: divide_less_eq)


[STATEMENT]
lemma p_not_div_choose:
  assumes "k < K" and "k \<le> n"
      and eeq: "\<And>j. \<lbrakk>0<j; j<K\<rbrakk> \<Longrightarrow> multiplicity p (n - k + (K - j)) = multiplicity p (K - j)" "prime p"
    shows "multiplicity p (n choose k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (n choose k) = 0
[PROOF STEP]
apply (rule p_not_div_choose_lemma [of K p "n-k" k, simplified assms nat_minus_add_max max_absorb1])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. Suc i < K \<Longrightarrow> multiplicity p (Suc i) = multiplicity p (Suc (n - k + i))
 2. True
 3. True
[PROOF STEP]
apply (metis add_Suc_right eeq diff_diff_cancel order_less_imp_le zero_less_Suc zero_less_diff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. True
 2. True
[PROOF STEP]
apply (rule TrueI)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_UB: "finite(UB f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (UB f xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (UB f xs)
[PROOF STEP]
have "UB f xs = (\<lambda>(r,cs). r + \<langle>cs,xs\<rangle>) ` set(ubounds(R.atoms\<^sub>0 f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UB f xs = (\<lambda>(r, cs). r + \<langle>cs,xs\<rangle>) ` set (ubounds (atoms\<^sub>0 f))
[PROOF STEP]
by (force simp:set_ubounds image_def field_simps)
[PROOF STATE]
proof (state)
this:
UB f xs = (\<lambda>(r, cs). r + \<langle>cs,xs\<rangle>) ` set (ubounds (atoms\<^sub>0 f))

goal (1 subgoal):
 1. finite (UB f xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
UB f xs = (\<lambda>(r, cs). r + \<langle>cs,xs\<rangle>) ` set (ubounds (atoms\<^sub>0 f))

goal (1 subgoal):
 1. finite (UB f xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (UB f xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_nat_iff'': "prime (p::nat) \<longleftrightarrow> p \<noteq> 0 \<and> p \<noteq> 1 \<and> (\<forall>m. 0 < m \<and> m < p \<longrightarrow> coprime p m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p = (p \<noteq> 0 \<and> p \<noteq> 1 \<and> (\<forall>m. 0 < m \<and> m < p \<longrightarrow> coprime p m))
[PROOF STEP]
apply (auto simp add: prime_nat_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m. \<lbrakk>\<forall>m. m dvd p \<longrightarrow> m = Suc 0 \<or> m = p; 0 < m; m < p\<rbrakk> \<Longrightarrow> coprime p m
 2. \<And>m. \<lbrakk>0 < p; p \<noteq> Suc 0; \<forall>m. 0 < m \<and> m < p \<longrightarrow> coprime p m; m dvd p; m \<noteq> p\<rbrakk> \<Longrightarrow> m = Suc 0
[PROOF STEP]
apply (rule coprimeI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m c. \<lbrakk>\<forall>m. m dvd p \<longrightarrow> m = Suc 0 \<or> m = p; 0 < m; m < p; c dvd p; c dvd m\<rbrakk> \<Longrightarrow> is_unit c
 2. \<And>m. \<lbrakk>0 < p; p \<noteq> Suc 0; \<forall>m. 0 < m \<and> m < p \<longrightarrow> coprime p m; m dvd p; m \<noteq> p\<rbrakk> \<Longrightarrow> m = Suc 0
[PROOF STEP]
apply (auto dest: nat_dvd_not_less simp add: ac_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>0 < p; p \<noteq> Suc 0; \<forall>m. m < p \<and> 0 < m \<longrightarrow> coprime m p; m dvd p; m \<noteq> p\<rbrakk> \<Longrightarrow> m = Suc 0
[PROOF STEP]
apply (metis One_nat_def dvd_1_iff_1 dvd_pos_nat gcd_nat.order_iff is_unit_gcd linorder_neqE_nat nat_dvd_not_less)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma states_index_io_target :
  assumes "i < length xs"
  and     "path M (xs || tr) q"
  and     "length xs = length tr"
  and     "length xs > 0"
shows "(states (xs || tr) q) ! i \<in> io_targets M q (take (Suc i) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
have "(states (xs || tr) q) ! i = last (take (Suc i) (states (xs || tr) q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. states (xs || tr) q ! i = last (take (Suc i) (states (xs || tr) q))
[PROOF STEP]
by (metis assms(1) assms(3) map_snd_zip states_alt_def index_last_take)
[PROOF STATE]
proof (state)
this:
states (xs || tr) q ! i = last (take (Suc i) (states (xs || tr) q))

goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
states (xs || tr) q ! i = last (take (Suc i) (states (xs || tr) q))
[PROOF STEP]
have "(states (xs || tr) q) ! i = last (states (take (Suc i) xs || take (Suc i) tr) q)"
[PROOF STATE]
proof (prove)
using this:
states (xs || tr) q ! i = last (take (Suc i) (states (xs || tr) q))

goal (1 subgoal):
 1. states (xs || tr) q ! i = last (states (take (Suc i) xs || take (Suc i) tr) q)
[PROOF STEP]
by (simp add: take_zip)
[PROOF STATE]
proof (state)
this:
states (xs || tr) q ! i = last (states (take (Suc i) xs || take (Suc i) tr) q)

goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
states (xs || tr) q ! i = last (states (take (Suc i) xs || take (Suc i) tr) q)
[PROOF STEP]
have "(states (xs || tr) q) ! i = last (take (Suc i) tr)"
[PROOF STATE]
proof (prove)
using this:
states (xs || tr) q ! i = last (states (take (Suc i) xs || take (Suc i) tr) q)

goal (1 subgoal):
 1. states (xs || tr) q ! i = last (take (Suc i) tr)
[PROOF STEP]
by (simp add: assms(3) states_alt_def)
[PROOF STATE]
proof (state)
this:
states (xs || tr) q ! i = last (take (Suc i) tr)

goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
states (xs || tr) q ! i = last (take (Suc i) tr)

goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
have "last (take (Suc i) tr) \<in> io_targets M q (take (Suc i) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last (take (Suc i) tr) \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
by (meson assms(2) assms(3) assms(4) path_prefix_io_targets)
[PROOF STATE]
proof (state)
this:
last (take (Suc i) tr) \<in> io_targets M q (take (Suc i) xs)

goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
states (xs || tr) q ! i = last (take (Suc i) tr)
last (take (Suc i) tr) \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
states (xs || tr) q ! i = last (take (Suc i) tr)
last (take (Suc i) tr) \<in> io_targets M q (take (Suc i) xs)

goal (1 subgoal):
 1. states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
states (xs || tr) q ! i \<in> io_targets M q (take (Suc i) xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary11_orientation:
  assumes "unitary11_gen M" and "M = (A, B, C, D)"
  shows "\<exists> k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re ((A*D)/(B*C)) - 1)) \<and> congruence M (1, 0, 0, -1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, -1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
from \<open>unitary11_gen M\<close>
[PROOF STATE]
proof (chain)
picking this:
unitary11_gen M
[PROOF STEP]
obtain k a b where *: "k \<noteq> 0" "mat_det (a, b, cnj b, cnj a) \<noteq> 0" "M = k*\<^sub>s\<^sub>m (a, b, cnj b, cnj a)"
[PROOF STATE]
proof (prove)
using this:
unitary11_gen M

goal (1 subgoal):
 1. (\<And>k a b. \<lbrakk>k \<noteq> 0; mat_det (a, b, cnj b, cnj a) \<noteq> 0; M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using unitary11_gen_iff[of M]
[PROOF STATE]
proof (prove)
using this:
unitary11_gen M
unitary11_gen M = (\<exists>k a b. k \<noteq> 0 \<and> mat_det (a, b, cnj b, cnj a) \<noteq> 0 \<and> M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a))

goal (1 subgoal):
 1. (\<And>k a b. \<lbrakk>k \<noteq> 0; mat_det (a, b, cnj b, cnj a) \<noteq> 0; M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)

goal (1 subgoal):
 1. \<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)

goal (1 subgoal):
 1. \<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
have "b = 0 \<longleftrightarrow> B = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b = 0) = (B = 0)
[PROOF STEP]
using \<open>M = (A, B, C, D)\<close> *
[PROOF STATE]
proof (prove)
using this:
M = (A, B, C, D)
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)

goal (1 subgoal):
 1. (b = 0) = (B = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(b = 0) = (B = 0)

goal (1 subgoal):
 1. \<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)
(b = 0) = (B = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)
(b = 0) = (B = 0)

goal (1 subgoal):
 1. \<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
using unitary11_sgn_det_orientation[OF *] unitary11_sgn_det[OF * \<open>M = (A, B, C, D)\<close>]
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)
(b = 0) = (B = 0)
\<exists>k'. sgn k' = sgn (Re (mat_det (a, b, cnj b, cnj a))) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
sgn (Re (mat_det (a, b, cnj b, cnj a))) = (if b = 0 then 1 else sgn (Re (A * D / (B * C)) - 1))

goal (1 subgoal):
 1. \<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>k'. sgn k' = sgn (if B = 0 then 1 else sgn (Re (A * D / (B * C)) - 1)) \<and> congruence M (1, 0, 0, - 1) = cor k' *\<^sub>s\<^sub>m (1, 0, 0, - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_Abs_subst_Var_fresh[simp]:
assumes "wls s X" and "fresh xs x' X"
shows "Abs xs x' (subst xs (Var xs x') x X) = Abs xs x X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs xs x' (X #[Var xs x' / x]_xs) = Abs xs x X
[PROOF STEP]
using assms wls_Abs_vsubst_fresh
[PROOF STATE]
proof (prove)
using this:
wls s X
fresh xs x' X
\<lbrakk>wls ?s ?X; fresh ?xs ?x' ?X\<rbrakk> \<Longrightarrow> Abs ?xs ?x' (?X #[?x' // ?x]_?xs) = Abs ?xs ?x ?X

goal (1 subgoal):
 1. Abs xs x' (X #[Var xs x' / x]_xs) = Abs xs x X
[PROOF STEP]
unfolding vsubst_def
[PROOF STATE]
proof (prove)
using this:
wls s X
fresh xs x' X
\<lbrakk>wls ?s ?X; fresh ?xs ?x' ?X\<rbrakk> \<Longrightarrow> Abs ?xs ?x' (?X #[Var ?xs ?x' / ?x]_?xs) = Abs ?xs ?x ?X

goal (1 subgoal):
 1. Abs xs x' (X #[Var xs x' / x]_xs) = Abs xs x X
[PROOF STEP]
by simp


[STATEMENT]
lemma trans_ile_iadd2: "i \<le> (j::enat) \<Longrightarrow> i \<le> m + j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<le> j \<Longrightarrow> i \<le> m + j
[PROOF STEP]
by (rule order_trans[OF _ ile_add2])


[STATEMENT]
lemma mult_assoc:
  fixes A B:: "rat mat"
  fixes v:: "rat vec"
  fixes n:: "nat"
  assumes "A \<in> carrier_mat n n"
  assumes "B \<in> carrier_mat n n"
  assumes "dim_vec v = n"
  shows "A *\<^sub>v (mult_mat_vec B v) =  (A*B)*\<^sub>v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v (B *\<^sub>v v) = A * B *\<^sub>v v
[PROOF STEP]
using assms(1) assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
dim_vec v = n

goal (1 subgoal):
 1. A *\<^sub>v (B *\<^sub>v v) = A * B *\<^sub>v v
[PROOF STEP]
by auto


[STATEMENT]
lemma line_convex_combination1: "(1 - u) *\<^sub>R line a b i + u *\<^sub>R b = line a b (i + u - i * u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - u) *\<^sub>R {a -- b}\<^bsub>i\<^esub> + u *\<^sub>R b = {a -- b}\<^bsub>i + u - i * u\<^esub>
[PROOF STEP]
by (auto simp: line_def algebra_simps)


[STATEMENT]
lemma divmod_nat_code [code]: \<^marker>\<open>contributor \<open>Ren? Thiemann\<close>\<close> \<^marker>\<open>contributor \<open>Akihisa Yamada\<close>\<close>
  "Euclidean_Division.divmod_nat m n = (
     let k = integer_of_nat m; l = integer_of_nat n
     in map_prod nat_of_integer nat_of_integer
       (if k = 0 then (0, 0)
        else if l = 0 then (0, k) else
          Code_Numeral.divmod_abs k l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Euclidean_Division.divmod_nat m n = (let k = integer_of_nat m; l = integer_of_nat n in map_prod nat_of_integer nat_of_integer (if k = 0 then (0, 0) else if l = 0 then (0, k) else Code_Numeral.divmod_abs k l))
[PROOF STEP]
by (simp add: prod_eq_iff Let_def Euclidean_Division.divmod_nat_def; transfer)
    (simp add: nat_div_distrib nat_mod_distrib)


[STATEMENT]
lemma reaches_induct[consumes 1, case_names refl step, induct set: reaches]:
  assumes "(x reaches y) s"
  assumes "\<And>x. P x x"
  assumes "\<And>x y z. \<lbrakk>(x reaches y) s; P x y; (y points_to z) s\<rbrakk> \<Longrightarrow> P x z"
  shows "P x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P x y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(x reaches y) s
P ?x ?x
\<lbrakk>(?x reaches ?y) s; P ?x ?y; (?y points_to ?z) s\<rbrakk> \<Longrightarrow> P ?x ?z

goal (1 subgoal):
 1. P x y
[PROOF STEP]
unfolding reaches_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* x y
P ?x ?x
\<lbrakk>(\<lambda>x y. (x points_to y) s)\<^sup>*\<^sup>* ?x ?y; P ?x ?y; (?y points_to ?z) s\<rbrakk> \<Longrightarrow> P ?x ?z

goal (1 subgoal):
 1. P x y
[PROOF STEP]
by (rule rtranclp.induct)


[STATEMENT]
lemma (in Ring) nsDistrL:  "\<lbrakk>x \<in> carrier R; y \<in> carrier R \<rbrakk>
        \<Longrightarrow> (nscal R x n) \<plusminus> (nscal R y n) = nscal R (x \<plusminus> y) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow>  0 \<times>\<^bsub>R\<^esub> x \<plusminus>  0 \<times>\<^bsub>R\<^esub> y =  0 \<times>\<^bsub>R\<^esub> (x \<plusminus> y)
 2. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)\<rbrakk> \<Longrightarrow>  Suc n \<times>\<^bsub>R\<^esub> x \<plusminus>  Suc n \<times>\<^bsub>R\<^esub> y =  Suc n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> \<zero> \<plusminus> \<zero> = \<zero>
 2. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)\<rbrakk> \<Longrightarrow>  Suc n \<times>\<^bsub>R\<^esub> x \<plusminus>  Suc n \<times>\<^bsub>R\<^esub> y =  Suc n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)
[PROOF STEP]
apply (cut_tac ring_zero,
         simp add:aGroup.ag_l_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)\<rbrakk> \<Longrightarrow>  Suc n \<times>\<^bsub>R\<^esub> x \<plusminus>  Suc n \<times>\<^bsub>R\<^esub> y =  Suc n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y)\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> x \<plusminus> ( n \<times>\<^bsub>R\<^esub> y \<plusminus> y) =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y) \<plusminus> (x \<plusminus> y)
[PROOF STEP]
apply (frule_tac x = x and n = n in nsClose,
         frule_tac x = y and n = n in nsClose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y);  n \<times>\<^bsub>R\<^esub> x \<in> carrier R;  n \<times>\<^bsub>R\<^esub> y \<in> carrier R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> x \<plusminus> ( n \<times>\<^bsub>R\<^esub> y \<plusminus> y) =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y) \<plusminus> (x \<plusminus> y)
[PROOF STEP]
apply (subst aGroup.pOp_assocTr43[of R _ x _ y], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y);  n \<times>\<^bsub>R\<^esub> x \<in> carrier R;  n \<times>\<^bsub>R\<^esub> y \<in> carrier R\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> (x \<plusminus>  n \<times>\<^bsub>R\<^esub> y) \<plusminus> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y) \<plusminus> (x \<plusminus> y)
[PROOF STEP]
apply (frule_tac x = x and y = "n \<times>\<^bsub>R\<^esub> y" in aGroup.ag_pOp_commute[of "R"],
         assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y);  n \<times>\<^bsub>R\<^esub> x \<in> carrier R;  n \<times>\<^bsub>R\<^esub> y \<in> carrier R; x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> y \<plusminus> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> (x \<plusminus>  n \<times>\<^bsub>R\<^esub> y) \<plusminus> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y) \<plusminus> (x \<plusminus> y)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y);  n \<times>\<^bsub>R\<^esub> x \<in> carrier R;  n \<times>\<^bsub>R\<^esub> y \<in> carrier R; x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> y \<plusminus> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus> ( n \<times>\<^bsub>R\<^esub> y \<plusminus> x) \<plusminus> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y) \<plusminus> (x \<plusminus> y)
[PROOF STEP]
apply (subst aGroup.pOp_assocTr43[THEN sym, of R _ _ x y], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>x \<in> carrier R; y \<in> carrier R; aGroup R;  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y);  n \<times>\<^bsub>R\<^esub> x \<in> carrier R;  n \<times>\<^bsub>R\<^esub> y \<in> carrier R; x \<plusminus>  n \<times>\<^bsub>R\<^esub> y =  n \<times>\<^bsub>R\<^esub> y \<plusminus> x\<rbrakk> \<Longrightarrow>  n \<times>\<^bsub>R\<^esub> x \<plusminus>  n \<times>\<^bsub>R\<^esub> y \<plusminus> (x \<plusminus> y) =  n \<times>\<^bsub>R\<^esub> (x \<plusminus> y) \<plusminus> (x \<plusminus> y)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma convert_semantics:
  shows "fml_sem fml x = lookup_sem (fst (convert fml)) (map (\<lambda>p. rpoly p x) (snd (convert fml)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fml_sem fml x = lookup_sem (fst (convert fml)) (map (\<lambda>p. rpoly p x) (snd (convert fml)))
[PROOF STEP]
unfolding convert_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fml_sem fml x = lookup_sem (fst (map_fml (index_of (remdups (poly_list fml))) fml, remdups (poly_list fml))) (map (\<lambda>p. rpoly p x) (snd (map_fml (index_of (remdups (poly_list fml))) fml, remdups (poly_list fml))))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fml_sem fml x = lookup_sem (map_fml (index_of (remdups (poly_list fml))) fml) (map (\<lambda>p. rpoly p x) (remdups (poly_list fml)))
[PROOF STEP]
apply (intro convert_semantics_lem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> set (poly_list fml) \<Longrightarrow> map (\<lambda>p. rpoly p x) (remdups (poly_list fml)) ! index_of (remdups (poly_list fml)) p = rpoly p x
[PROOF STEP]
by (simp add: index_of_lookup(1) index_of_lookup(2))


[STATEMENT]
lemma UNIV_eq: "(UNIV :: 'a set) = Abs ` {0..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = Abs ` {0..<n}
[PROOF STEP]
using type type_definition.univ
[PROOF STATE]
proof (prove)
using this:
type_definition Rep Abs {0..<n}
type_definition ?Rep ?Abs ?A \<Longrightarrow> UNIV = ?Abs ` ?A

goal (1 subgoal):
 1. UNIV = Abs ` {0..<n}
[PROOF STEP]
by blast


[STATEMENT]
lemma set_restriction_card_le: "
  \<lbrakk> set_restriction f; finite A \<rbrakk> \<Longrightarrow> card (f A) \<le> card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set_restriction f; finite A\<rbrakk> \<Longrightarrow> card (f A) \<le> card A
[PROOF STEP]
by (simp add: set_restriction_card)


[STATEMENT]
theorem Hset1_bd: "|Hset1 (x :: ('p1, 'p2, 'p3, 'p, 'a1, 'a2) H )| <o
  (Hbd :: ('p1, 'p2, 'p3, 'p) Hbd_type rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Hset1 x| <o Hbd
[PROOF STEP]
by (tactic \<open>BNF_Comp_Tactics.mk_comp_set_bd_tac @{context} @{thm refl} NONE @{thm Hset1_alt}
      @{thms comp_single_set_bd_strict[OF F1.bd_Cinfinite F1.bd_regularCard G.bd_Cinfinite
               G.bd_regularCard F1.set_bd(1) G.set_bd(1)]
             comp_single_set_bd_strict[OF F2.bd_Cinfinite F2.bd_regularCard G.bd_Cinfinite
               G.bd_regularCard F2.set_bd(1) G.set_bd(2)]
             comp_single_set_bd_strict[OF F3.bd_Cinfinite F3.bd_regularCard G.bd_Cinfinite
               G.bd_regularCard F3.set_bd(1) G.set_bd(3)]}
      @{thms Cinfinite_cprod2[OF Cinfinite_Cnotzero[OF G.bd_Cinfinite] F1.bd_Cinfinite]
             Cinfinite_cprod2[OF Cinfinite_Cnotzero[OF G.bd_Cinfinite] F2.bd_Cinfinite]
             Cinfinite_cprod2[OF Cinfinite_Cnotzero[OF G.bd_Cinfinite] F3.bd_Cinfinite]}\<close>)


[STATEMENT]
lemma is_expansion_map:
  fixes f :: "'a :: multiseries \<Rightarrow> 'b :: multiseries"
    and F :: "'a ms"
  assumes "is_expansion G (b # basis)"
  assumes "\<And>C. is_expansion C basis \<Longrightarrow> is_expansion (f C) basis'"
  assumes "\<And>C. eval (f C) = eval C"
  assumes "length basis' = expansion_level TYPE('b)"
  shows   "is_expansion (map_ms f G) (b # basis')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_expansion (map_ms f G) (b # basis')
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_expansion G (b # basis)
is_expansion ?C basis \<Longrightarrow> is_expansion (f ?C) basis'
eval (f ?C) = eval ?C
length basis' = expansion_level TYPE('b)

goal (1 subgoal):
 1. is_expansion (map_ms f G) (b # basis')
[PROOF STEP]
by (cases G, simp only: map_ms_altdef) (auto intro!: is_expansion_map_aux)


[STATEMENT]
lemma neg_one_in_nonpos_Ints [simp,intro]: "-1 \<in> \<int>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (1::'a) \<in> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
unfolding nonpos_Ints_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (1::'a) \<in> {of_int n |n. n \<le> 0}
[PROOF STEP]
by (auto intro!: exI[of _ "-1::int"])


[STATEMENT]
lemma subseteq_mset_zmsetE:
  assumes "M \<subseteq>#\<^sub>z N"
  obtains A B C where
    "M = zmset_of A + C" and "N = zmset_of B + C" and "A \<subseteq># B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A C B. \<lbrakk>M = zmset_of A + C; N = zmset_of B + C; A \<subseteq># B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms add.commute add.right_neutral subset_mset.order_refl subset_mset_def
    subset_mset_zmsetE subset_zmset_def zmset_of_empty)


[STATEMENT]
lemma Taylor_exp_field:
  fixes z::"'a::{banach,real_normed_field}"
  shows "norm (exp z - (\<Sum>i\<le>n. z ^ i / fact i)) \<le> exp (norm z) * (norm z ^ Suc n) / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (exp z - (\<Sum>i\<le>n. z ^ i / fact i)) \<le> exp (norm z) * norm z ^ Suc n / fact n
[PROOF STEP]
proof (rule field_Taylor[of _ n "\<lambda>k. exp" "exp (norm z)" 0 z, simplified])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. convex ?S
 2. \<And>i x. \<lbrakk>x \<in> ?S; i \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within ?S)
 3. \<And>x. x \<in> ?S \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 4. (0::'a) \<in> ?S
 5. z \<in> ?S
[PROOF STEP]
show "convex (closed_segment 0 z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (closed_segment (0::'a) z)
[PROOF STEP]
by (rule convex_closed_segment [of 0 z])
[PROOF STATE]
proof (state)
this:
convex (closed_segment (0::'a) z)

goal (4 subgoals):
 1. \<And>i x. \<lbrakk>x \<in> closed_segment (0::'a) z; i \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment (0::'a) z)
 2. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 3. (0::'a) \<in> closed_segment (0::'a) z
 4. z \<in> closed_segment (0::'a) z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>i x. \<lbrakk>x \<in> closed_segment (0::'a) z; i \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment (0::'a) z)
 2. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 3. (0::'a) \<in> closed_segment (0::'a) z
 4. z \<in> closed_segment (0::'a) z
[PROOF STEP]
fix k x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>i x. \<lbrakk>x \<in> closed_segment (0::'a) z; i \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment (0::'a) z)
 2. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 3. (0::'a) \<in> closed_segment (0::'a) z
 4. z \<in> closed_segment (0::'a) z
[PROOF STEP]
assume "x \<in> closed_segment 0 z" "k \<le> n"
[PROOF STATE]
proof (state)
this:
x \<in> closed_segment (0::'a) z
k \<le> n

goal (4 subgoals):
 1. \<And>i x. \<lbrakk>x \<in> closed_segment (0::'a) z; i \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment (0::'a) z)
 2. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 3. (0::'a) \<in> closed_segment (0::'a) z
 4. z \<in> closed_segment (0::'a) z
[PROOF STEP]
show "(exp has_field_derivative exp x) (at x within closed_segment 0 z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp has_field_derivative exp x) (at x within closed_segment (0::'a) z)
[PROOF STEP]
using DERIV_exp DERIV_subset
[PROOF STATE]
proof (prove)
using this:
(exp has_field_derivative exp ?x) (at ?x)
\<lbrakk>(?f has_field_derivative ?f') (at ?x within ?s); ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> (?f has_field_derivative ?f') (at ?x within ?t)

goal (1 subgoal):
 1. (exp has_field_derivative exp x) (at x within closed_segment (0::'a) z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(exp has_field_derivative exp x) (at x within closed_segment (0::'a) z)

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 2. (0::'a) \<in> closed_segment (0::'a) z
 3. z \<in> closed_segment (0::'a) z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 2. (0::'a) \<in> closed_segment (0::'a) z
 3. z \<in> closed_segment (0::'a) z
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 2. (0::'a) \<in> closed_segment (0::'a) z
 3. z \<in> closed_segment (0::'a) z
[PROOF STEP]
assume x: "x \<in> closed_segment 0 z"
[PROOF STATE]
proof (state)
this:
x \<in> closed_segment (0::'a) z

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 2. (0::'a) \<in> closed_segment (0::'a) z
 3. z \<in> closed_segment (0::'a) z
[PROOF STEP]
have "norm (exp x) \<le> exp (norm x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm x)
[PROOF STEP]
by (rule norm_exp)
[PROOF STATE]
proof (state)
this:
norm (exp x) \<le> exp (norm x)

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 2. (0::'a) \<in> closed_segment (0::'a) z
 3. z \<in> closed_segment (0::'a) z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (exp x) \<le> exp (norm x)

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 2. (0::'a) \<in> closed_segment (0::'a) z
 3. z \<in> closed_segment (0::'a) z
[PROOF STEP]
have "norm x \<le> norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> norm z
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> closed_segment (0::'a) z

goal (1 subgoal):
 1. norm x \<le> norm z
[PROOF STEP]
by (auto simp: closed_segment_def intro!: mult_left_le_one_le)
[PROOF STATE]
proof (state)
this:
norm x \<le> norm z

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment (0::'a) z \<Longrightarrow> norm (exp x) \<le> exp (norm z)
 2. (0::'a) \<in> closed_segment (0::'a) z
 3. z \<in> closed_segment (0::'a) z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> exp x \<le> exp y) \<Longrightarrow> norm (exp x) \<le> exp (norm z)
[PROOF STEP]
show "norm (exp x) \<le> exp (norm z)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> exp x \<le> exp y) \<Longrightarrow> norm (exp x) \<le> exp (norm z)

goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (exp x) \<le> exp (norm z)

goal (2 subgoals):
 1. (0::'a) \<in> closed_segment (0::'a) z
 2. z \<in> closed_segment (0::'a) z
[PROOF STEP]
qed auto


[STATEMENT]
lemma representation_eqI:
  assumes basis: "independent basis" and b: "v \<in> span basis"
    and ne_zero: "\<And>b. f b \<noteq> 0 \<Longrightarrow> b \<in> basis"
    and finite: "finite {b. f b \<noteq> 0}"
    and eq: "(\<Sum>b | f b \<noteq> 0. f b *s b) = v"
  shows "representation basis v = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. representation basis v = f
[PROOF STEP]
by (rule unique_representation[OF basis])
     (auto simp: representation_ne_zero finite_representation
       sum_nonzero_representation_eq[OF basis b] ne_zero finite eq)


[STATEMENT]
lemma DEP_REFL:
  fixes PROB
  shows "reflexive (\<lambda>v v'. dep PROB v v')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflexive (dep PROB)
[PROOF STEP]
unfolding dep_def reflexive_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<exists>a. a \<in> PROB \<and> (x \<in> fmdom' (fst a) \<and> x \<in> fmdom' (snd a) \<or> x \<in> fmdom' (snd a) \<and> x \<in> fmdom' (snd a))) \<or> x = x
[PROOF STEP]
by presburger

\<comment> \<open>NOTE added lemma.\<close>


[STATEMENT]
lemma connected_component_nonoverlap:
  "connected_component_set S a \<inter> connected_component_set S b = {} \<longleftrightarrow>
    a \<notin> S \<or> b \<notin> S \<or> connected_component_set S a \<noteq> connected_component_set S b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_component_set S a \<inter> connected_component_set S b = {}) = (a \<notin> S \<or> b \<notin> S \<or> connected_component_set S a \<noteq> connected_component_set S b)
[PROOF STEP]
apply (auto simp: connected_component_in)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<forall>x. \<not> connected_component S b x; b \<in> S; a \<in> S; connected_component_set S a = connected_component_set S b\<rbrakk> \<Longrightarrow> False
 2. \<And>x xa. \<lbrakk>connected_component S a x; connected_component S b x; connected_component S a xa\<rbrakk> \<Longrightarrow> connected_component S b xa
 3. \<And>x xa. \<lbrakk>connected_component S a x; connected_component S b x; connected_component S b xa\<rbrakk> \<Longrightarrow> connected_component S a xa
[PROOF STEP]
using connected_component_refl_eq
[PROOF STATE]
proof (prove)
using this:
connected_component ?S ?x ?x = (?x \<in> ?S)

goal (3 subgoals):
 1. \<lbrakk>\<forall>x. \<not> connected_component S b x; b \<in> S; a \<in> S; connected_component_set S a = connected_component_set S b\<rbrakk> \<Longrightarrow> False
 2. \<And>x xa. \<lbrakk>connected_component S a x; connected_component S b x; connected_component S a xa\<rbrakk> \<Longrightarrow> connected_component S b xa
 3. \<And>x xa. \<lbrakk>connected_component S a x; connected_component S b x; connected_component S b xa\<rbrakk> \<Longrightarrow> connected_component S a xa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>connected_component S a x; connected_component S b x; connected_component S a xa\<rbrakk> \<Longrightarrow> connected_component S b xa
 2. \<And>x xa. \<lbrakk>connected_component S a x; connected_component S b x; connected_component S b xa\<rbrakk> \<Longrightarrow> connected_component S a xa
[PROOF STEP]
apply (metis connected_component_eq mem_Collect_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>connected_component S a x; connected_component S b x; connected_component S b xa\<rbrakk> \<Longrightarrow> connected_component S a xa
[PROOF STEP]
apply (metis connected_component_eq mem_Collect_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ereal_INF_not_infty:
  fixes f :: "_ \<Rightarrow> ereal"
  shows "A \<noteq> {} \<Longrightarrow> l \<noteq> -\<infinity> \<Longrightarrow> u \<noteq> \<infinity> \<Longrightarrow> \<forall>a\<in>A. l \<le> f a \<and> f a \<le> u \<Longrightarrow> \<bar>Inf (f ` A)\<bar> \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; l \<noteq> - \<infinity>; u \<noteq> \<infinity>; \<forall>a\<in>A. l \<le> f a \<and> f a \<le> u\<rbrakk> \<Longrightarrow> \<bar>Inf (f ` A)\<bar> \<noteq> \<infinity>
[PROOF STEP]
using INF_lower2[of _ A f u] INF_greatest[of A l f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> A; f ?i \<le> u\<rbrakk> \<Longrightarrow> Inf (f ` A) \<le> u
(\<And>i. i \<in> A \<Longrightarrow> l \<le> f i) \<Longrightarrow> l \<le> Inf (f ` A)

goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; l \<noteq> - \<infinity>; u \<noteq> \<infinity>; \<forall>a\<in>A. l \<le> f a \<and> f a \<le> u\<rbrakk> \<Longrightarrow> \<bar>Inf (f ` A)\<bar> \<noteq> \<infinity>
[PROOF STEP]
by (cases "Inf (f ` A)") auto


[STATEMENT]
lemma HMA_diagonal_to_Smith_i_PQ[transfer_rule]:
  "((=)
  ===> (HMA_M3 :: (_ \<Rightarrow> (_\<times>('a :: bezout_ring ^ 'nc :: mod_type ^ 'nr :: mod_type) \<times> _) \<Rightarrow>_))
  ===> HMA_M3) (diagonal_to_Smith_i_PQ_JNF xs i) (diagonal_to_Smith_i_PQ xs i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((=) ===> HMA_M3 ===> HMA_M3) (diagonal_to_Smith_i_PQ_JNF xs i) (diagonal_to_Smith_i_PQ xs i)
[PROOF STEP]
proof (intro rel_funI, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y xa ya. \<lbrakk>x = y; HMA_M3 xa ya\<rbrakk> \<Longrightarrow> HMA_M3 (diagonal_to_Smith_i_PQ_JNF xs i x xa) (diagonal_to_Smith_i_PQ xs i y ya)
[PROOF STEP]
case (1 x y bezout bezout')
[PROOF STATE]
proof (state)
this:
x = y
HMA_M3 bezout bezout'

goal (1 subgoal):
 1. \<And>x y xa ya. \<lbrakk>x = y; HMA_M3 xa ya\<rbrakk> \<Longrightarrow> HMA_M3 (diagonal_to_Smith_i_PQ_JNF xs i x xa) (diagonal_to_Smith_i_PQ xs i y ya)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = y
HMA_M3 bezout bezout'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x = y
HMA_M3 bezout bezout'

goal (1 subgoal):
 1. HMA_M3 (diagonal_to_Smith_i_PQ_JNF xs i x bezout) (diagonal_to_Smith_i_PQ xs i y bezout')
[PROOF STEP]
using HMA_diagonal_to_Smith_i_PQ_aux
[PROOF STATE]
proof (prove)
using this:
x = y
HMA_M3 bezout bezout'
HMA_M3 (?P, ?A, ?Q) (?P', ?A', ?Q') \<Longrightarrow> HMA_M3 (diagonal_to_Smith_i_PQ_JNF xs i ?bezout (?P, ?A, ?Q)) (diagonal_to_Smith_i_PQ xs i ?bezout (?P', ?A', ?Q'))

goal (1 subgoal):
 1. HMA_M3 (diagonal_to_Smith_i_PQ_JNF xs i x bezout) (diagonal_to_Smith_i_PQ xs i y bezout')
[PROOF STEP]
by (auto, smt HMA_M3.elims(2))
[PROOF STATE]
proof (state)
this:
HMA_M3 (diagonal_to_Smith_i_PQ_JNF xs i x bezout) (diagonal_to_Smith_i_PQ xs i y bezout')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eigvals_poly_length:
  assumes "(M::complex Matrix.mat) \<in> carrier_mat n n"
  shows "char_poly M = (\<Prod>a\<leftarrow>(eigvals M). [:- a, 1:]) \<and> length (eigvals M) = dim_row M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly M = (\<Prod>a\<leftarrow>eigvals M. [:- a, 1:]) \<and> length (eigvals M) = dim_row M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. char_poly M = (\<Prod>a\<leftarrow>eigvals M. [:- a, 1:]) \<and> length (eigvals M) = dim_row M
[PROOF STEP]
let ?V = "SOME as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. char_poly M = (\<Prod>a\<leftarrow>eigvals M. [:- a, 1:]) \<and> length (eigvals M) = dim_row M
[PROOF STEP]
have vprop: "char_poly M = (\<Prod>a\<leftarrow>?V. [:- a, 1:]) \<and> length ?V = dim_row M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly M = (\<Prod>a\<leftarrow>(SOME as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M). [:- a, 1:]) \<and> length (SOME as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M) = dim_row M
[PROOF STEP]
using
      someI_ex[of "\<lambda>as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M"]
     complex_mat_char_poly_factorizable assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x. char_poly M = (\<Prod>a\<leftarrow>x. [:- a, 1:]) \<and> length x = dim_row M \<Longrightarrow> char_poly M = (\<Prod>a\<leftarrow>(SOME x. char_poly M = (\<Prod>a\<leftarrow>x. [:- a, 1:]) \<and> length x = dim_row M). [:- a, 1:]) \<and> length (SOME x. char_poly M = (\<Prod>a\<leftarrow>x. [:- a, 1:]) \<and> length x = dim_row M) = dim_row M
?A \<in> carrier_mat ?n ?n \<Longrightarrow> \<exists>as. char_poly ?A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = ?n
M \<in> carrier_mat n n

goal (1 subgoal):
 1. char_poly M = (\<Prod>a\<leftarrow>(SOME as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M). [:- a, 1:]) \<and> length (SOME as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M) = dim_row M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
char_poly M = (\<Prod>a\<leftarrow>(SOME as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M). [:- a, 1:]) \<and> length (SOME as. char_poly M = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = dim_row M) = dim_row M

goal (1 subgoal):
 1. char_poly M = (\<Prod>a\<leftarrow>eigvals M. [:- a, 1:]) \<and> length (eigvals M) = dim_row M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly M = (\<Prod>a\<leftarrow>eigvals M. [:- a, 1:]) \<and> length (eigvals M) = dim_row M
[PROOF STEP]
by (metis (no_types) eigvals_def vprop)
[PROOF STATE]
proof (state)
this:
char_poly M = (\<Prod>a\<leftarrow>eigvals M. [:- a, 1:]) \<and> length (eigvals M) = dim_row M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eqExcNth_trans:
assumes "eqExcNth xs xs1 n" and "eqExcNth xs1 xs2 n"
shows "eqExcNth xs xs2 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqExcNth xs xs2 n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
eqExcNth xs xs1 n
eqExcNth xs1 xs2 n

goal (1 subgoal):
 1. eqExcNth xs xs2 n
[PROOF STEP]
unfolding eqExcNth_def
[PROOF STATE]
proof (prove)
using this:
length xs = length xs1 \<and> (\<forall>i<length xs. i \<noteq> n \<longrightarrow> xs ! i = xs1 ! i)
length xs1 = length xs2 \<and> (\<forall>i<length xs1. i \<noteq> n \<longrightarrow> xs1 ! i = xs2 ! i)

goal (1 subgoal):
 1. length xs = length xs2 \<and> (\<forall>i<length xs. i \<noteq> n \<longrightarrow> xs ! i = xs2 ! i)
[PROOF STEP]
by auto


[STATEMENT]
lemma wary_num_args_le_arity_head: "wary s \<Longrightarrow> num_args s \<le> arity_hd (head s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wary s \<Longrightarrow> enat (num_args s) \<le> arity_hd (head s)
[PROOF STEP]
by (induct rule: wary.induct) (auto simp: zero_enat_def[symmetric] Suc_ile_eq)