[STATEMENT]
lemma "subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
let "?P t" = ?thesis
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
let ?Q = "\<lambda>ts. subst_term_list (subst_term f1 \<circ> f2) ts =
    subst_term_list f1 (subst_term_list f2 ts)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
[PROOF STEP]
proof (induct t rule: subst_term.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. subst_term (subst_term f1 \<circ> f2) (Var x) = subst_term f1 (subst_term f2 (Var x))
 2. \<And>x1 x2. ?P2.0 x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1 x2) = subst_term f1 (subst_term f2 (App x1 x2))
 3. ?P2.0 []
 4. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); ?P2.0 x2\<rbrakk> \<Longrightarrow> ?P2.0 (x1 # x2)
[PROOF STEP]
show "?P (Var a)" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (Var a) = subst_term f1 (subst_term f2 (Var a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subst_term (subst_term f1 \<circ> f2) (Var ?a) = subst_term f1 (subst_term f2 (Var ?a))

goal (3 subgoals):
 1. \<And>x1 x2. ?P2.0 x2 \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App x1 x2) = subst_term f1 (subst_term f2 (App x1 x2))
 2. ?P2.0 []
 3. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); ?P2.0 x2\<rbrakk> \<Longrightarrow> ?P2.0 (x1 # x2)
[PROOF STEP]
show "?P (App b ts)" if "?Q ts" for b ts
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (App b ts) = subst_term f1 (subst_term f2 (App b ts))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
subst_term_list (subst_term f1 \<circ> f2) ts = subst_term_list f1 (subst_term_list f2 ts)

goal (1 subgoal):
 1. subst_term (subst_term f1 \<circ> f2) (App b ts) = subst_term f1 (subst_term f2 (App b ts))
[PROOF STEP]
by (simp only: subst_simps)
[PROOF STATE]
proof (state)
this:
subst_term_list (subst_term f1 \<circ> f2) ?ts = subst_term_list f1 (subst_term_list f2 ?ts) \<Longrightarrow> subst_term (subst_term f1 \<circ> f2) (App ?b ?ts) = subst_term f1 (subst_term f2 (App ?b ?ts))

goal (2 subgoals):
 1. subst_term_list (subst_term f1 \<circ> f2) [] = subst_term_list f1 (subst_term_list f2 [])
 2. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); subst_term_list (subst_term f1 \<circ> f2) x2 = subst_term_list f1 (subst_term_list f2 x2)\<rbrakk> \<Longrightarrow> subst_term_list (subst_term f1 \<circ> f2) (x1 # x2) = subst_term_list f1 (subst_term_list f2 (x1 # x2))
[PROOF STEP]
show "?Q []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term_list (subst_term f1 \<circ> f2) [] = subst_term_list f1 (subst_term_list f2 [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subst_term_list (subst_term f1 \<circ> f2) [] = subst_term_list f1 (subst_term_list f2 [])

goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>subst_term (subst_term f1 \<circ> f2) x1 = subst_term f1 (subst_term f2 x1); subst_term_list (subst_term f1 \<circ> f2) x2 = subst_term_list f1 (subst_term_list f2 x2)\<rbrakk> \<Longrightarrow> subst_term_list (subst_term f1 \<circ> f2) (x1 # x2) = subst_term_list f1 (subst_term_list f2 (x1 # x2))
[PROOF STEP]
show "?Q (t # ts)" if "?P t" "?Q ts" for t ts
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_term_list (subst_term f1 \<circ> f2) (t # ts) = subst_term_list f1 (subst_term_list f2 (t # ts))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)
subst_term_list (subst_term f1 \<circ> f2) ts = subst_term_list f1 (subst_term_list f2 ts)

goal (1 subgoal):
 1. subst_term_list (subst_term f1 \<circ> f2) (t # ts) = subst_term_list f1 (subst_term_list f2 (t # ts))
[PROOF STEP]
by (simp only: subst_simps)
[PROOF STATE]
proof (state)
this:
\<lbrakk>subst_term (subst_term f1 \<circ> f2) ?t = subst_term f1 (subst_term f2 ?t); subst_term_list (subst_term f1 \<circ> f2) ?ts = subst_term_list f1 (subst_term_list f2 ?ts)\<rbrakk> \<Longrightarrow> subst_term_list (subst_term f1 \<circ> f2) (?t # ?ts) = subst_term_list f1 (subst_term_list f2 (?t # ?ts))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
subst_term (subst_term f1 \<circ> f2) t = subst_term f1 (subst_term f2 t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_poly_append[simp]: "eval_poly \<alpha> (mc1 @ mc2) = eval_poly \<alpha> mc1 + eval_poly \<alpha> mc2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly \<alpha> (mc1 @ mc2) = eval_poly \<alpha> mc1 + eval_poly \<alpha> mc2
[PROOF STEP]
by (induct mc1, auto simp: field_simps)


[STATEMENT]
lemma mult_float_interval_mono:
  "mult_float_interval prec A B \<le> mult_float_interval prec X Y"
  if "A \<le> X" "B \<le> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_float_interval prec A B \<le> mult_float_interval prec X Y
[PROOF STEP]
using mult_float_interval_mono'[of A X B Y prec] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set_of A \<subseteq> set_of X; set_of B \<subseteq> set_of Y\<rbrakk> \<Longrightarrow> set_of (mult_float_interval prec A B) \<subseteq> set_of (mult_float_interval prec X Y)
A \<le> X
B \<le> Y

goal (1 subgoal):
 1. mult_float_interval prec A B \<le> mult_float_interval prec X Y
[PROOF STEP]
by (simp add: set_of_subset_iff')


[STATEMENT]
lemma (in bounded_bilinear) tendsto_right_zero:
  "(f \<longlongrightarrow> 0) F \<Longrightarrow> ((\<lambda>x. c ** f x) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> (0::'b)) F \<Longrightarrow> ((\<lambda>x. c ** f x) \<longlongrightarrow> (0::'c)) F
[PROOF STEP]
by (rule bounded_linear.tendsto_zero [OF bounded_linear_right])


[STATEMENT]
lemma uprod_mono: "[| A<=A';  B<=B' |] ==> uprod A B <= uprod A' B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> A'; B \<subseteq> B'\<rbrakk> \<Longrightarrow> uprod A B \<subseteq> uprod A' B'
[PROOF STEP]
by (simp add: uprod_def, blast)


[STATEMENT]
lemma (in equivalence) set_eq_sym [sym]:
  assumes "A \<subseteq> carrier S" "B \<subseteq> carrier S"
  shows "A {.=} B \<Longrightarrow> B {.=} A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A {.=} B \<Longrightarrow> B {.=} A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier S
B \<subseteq> carrier S

goal (1 subgoal):
 1. A {.=} B \<Longrightarrow> B {.=} A
[PROOF STEP]
unfolding set_eq_def elem_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier S
B \<subseteq> carrier S

goal (1 subgoal):
 1. (\<forall>x\<in>A. Bex B ((.=) x)) \<and> (\<forall>x\<in>B. Bex A ((.=) x)) \<Longrightarrow> (\<forall>x\<in>B. Bex A ((.=) x)) \<and> (\<forall>x\<in>A. Bex B ((.=) x))
[PROOF STEP]
by auto


[STATEMENT]
lemma lepoll_funcset_right:
   "B \<lesssim> B' \<Longrightarrow> A \<rightarrow>\<^sub>E B \<lesssim> A \<rightarrow>\<^sub>E B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<lesssim> B' \<Longrightarrow> A \<rightarrow>\<^sub>E B \<lesssim> A \<rightarrow>\<^sub>E B'
[PROOF STEP]
apply (auto simp: lepoll_def inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'\<rbrakk> \<Longrightarrow> \<exists>f. (\<forall>x\<in>A \<rightarrow>\<^sub>E B. \<forall>y\<in>A \<rightarrow>\<^sub>E B. f x = f y \<longrightarrow> x = y) \<and> f ` (A \<rightarrow>\<^sub>E B) \<subseteq> A \<rightarrow>\<^sub>E B'
[PROOF STEP]
apply (rule_tac x = "\<lambda>g. \<lambda>z \<in> A. f(g z)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'\<rbrakk> \<Longrightarrow> (\<forall>x\<in>A \<rightarrow>\<^sub>E B. \<forall>y\<in>A \<rightarrow>\<^sub>E B. (\<lambda>z\<in>A. f (x z)) = (\<lambda>z\<in>A. f (y z)) \<longrightarrow> x = y) \<and> (\<lambda>x. \<lambda>z\<in>A. f (x z)) ` (A \<rightarrow>\<^sub>E B) \<subseteq> A \<rightarrow>\<^sub>E B'
[PROOF STEP]
apply (auto simp: fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f x y xa. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'; x \<in> A \<rightarrow>\<^sub>E B; y \<in> A \<rightarrow>\<^sub>E B; \<forall>xa. xa \<in> A \<longrightarrow> f (x xa) = f (y xa)\<rbrakk> \<Longrightarrow> x xa = y xa
 2. \<And>f xa xb. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'; xa \<in> A \<rightarrow>\<^sub>E B; xb \<in> A\<rbrakk> \<Longrightarrow> f (xa xb) \<in> B'
[PROOF STEP]
apply (metis PiE_E)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f xa xb. \<lbrakk>\<forall>x\<in>B. \<forall>y\<in>B. f x = f y \<longrightarrow> x = y; f ` B \<subseteq> B'; xa \<in> A \<rightarrow>\<^sub>E B; xb \<in> A\<rbrakk> \<Longrightarrow> f (xa xb) \<in> B'
[PROOF STEP]
by blast


[STATEMENT]
lemma subpath_translation: "subpath u v ((\<lambda>x. a + x) \<circ> g) = (\<lambda>x. a + x) \<circ> subpath u v g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subpath u v ((+) a \<circ> g) = (+) a \<circ> subpath u v g
[PROOF STEP]
by (rule ext) (simp add: subpath_def)


[STATEMENT]
lemma vinsert_compr: "vinsert y A = set {x. x = y \<or> x \<in>\<^sub>\<circ> A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vinsert y A = set {x. x = y \<or> x \<in>\<^sub>\<circ> A}
[PROOF STEP]
unfolding vunion_def vinsert_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set {x. x \<in>\<^sub>\<circ> set {x. x = y} \<or> x \<in>\<^sub>\<circ> A} = set {x. x = y \<or> x \<in>\<^sub>\<circ> A}
[PROOF STEP]
by simp_all


[STATEMENT]
lemma iT_Mult_iWeakSince_conv: "0 < k \<Longrightarrow> (P t1. t1 \<B> t2 (I \<otimes> k). Q t2) = (P (t1 * k). t1 \<B> t2 I. Q (t2 * k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (P t1. t1 \<B> t2 I \<otimes> k. Q t2) = (P (t1 * k). t1 \<B> t2 I. Q (t2 * k))
[PROOF STEP]
by (simp add: iWeakSince_iSince_conv iT_Mult_iSince_conv iT_Mult_iAll_conv)


[STATEMENT]
lemma (in prisoner) J_is_gate:
  shows "gate 2 J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gate 2 (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
 2. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
 3. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
show "dim_row J = 2\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2

goal (2 subgoals):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
 2. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2

goal (2 subgoals):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
 2. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
show "square_mat J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])

goal (1 subgoal):
 1. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
show "unitary J"
[PROOF STATE]
proof (prove)
using this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])

goal (1 subgoal):
 1. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
using mat_of_cols_list_def unitary_def J_cnj_times_J J_times_J_cnj
[PROOF STATE]
proof (prove)
using this:
dim_row (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]) = 2\<^sup>2
square_mat (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)
unitary ?M \<equiv> ?M\<^sup>\<dagger> * ?M = 1\<^sub>m (dim_col ?M) \<and> ?M * ?M\<^sup>\<dagger> = 1\<^sub>m (dim_row ?M)
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] = 1\<^sub>m 4
Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]] * Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]]\<^sup>\<dagger> = 1\<^sub>m 4

goal (1 subgoal):
 1. unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unitary (Tensor.mat_of_cols_list 4 [[complex_of_real (cos (\<gamma> / 2)), 0, 0, \<i> * complex_of_real (sin (\<gamma> / 2))], [0, complex_of_real (cos (\<gamma> / 2)), - \<i> * complex_of_real (sin (\<gamma> / 2)), 0], 0 # - \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [cos (\<gamma> / 2), 0], \<i> * complex_of_real (sin (\<gamma> / 2)) # map complex_of_real [0, 0, cos (\<gamma> / 2)]])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wf_wellorderI2:
  assumes wf: "wf {(x::'a::ord, y). y < x}"
  assumes lin: "class.linorder (\<lambda>(x::'a) y::'a. y \<le> x) (\<lambda>(x::'a) y::'a. y < x)"
  shows "class.wellorder (\<lambda>(x::'a) y::'a. y \<le> x) (\<lambda>(x::'a) y::'a. y < x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.wellorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)
[PROOF STEP]
using lin
[PROOF STATE]
proof (prove)
using this:
class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)

goal (1 subgoal):
 1. class.wellorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)
[PROOF STEP]
unfolding class.wellorder_def
[PROOF STATE]
proof (prove)
using this:
class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)

goal (1 subgoal):
 1. class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x) \<and> class.wellorder_axioms (\<lambda>x y. y < x)
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.wellorder_axioms (\<lambda>x y. y < x)
[PROOF STEP]
apply (rule class.wellorder_axioms.intro)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P a. (\<And>x. (\<And>y. x < y \<Longrightarrow> P y) \<Longrightarrow> P x) \<Longrightarrow> P a
[PROOF STEP]
by (blast intro: wf_induct_rule [OF wf])


[STATEMENT]
lemma lookup_monom_mult_eq_zero:
  assumes "s \<oplus> lt p \<prec>\<^sub>t v"
  shows "lookup (monom_mult (c::'b::semiring_no_zero_divisors) s p) v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (monom_mult c s p) v = (0::'b)
[PROOF STEP]
by (metis assms aux lt_gr lt_monom_mult monom_mult_zero_left monom_mult_zero_right
      ord_term_lin.order.strict_implies_not_eq)


[STATEMENT]
lemma "is_succ_in_set S x y \<longleftrightarrow> min_in_set {s . s \<in> S \<and> s > x} y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_succ_in_set S x y = min_in_set {s \<in> S. x < s} y
[PROOF STEP]
using is_succ_in_set_def min_in_set_def
[PROOF STATE]
proof (prove)
using this:
is_succ_in_set ?xs ?x ?y = (?y \<in> ?xs \<and> ?x < ?y \<and> (\<forall>z\<in>?xs. ?x < z \<longrightarrow> ?y \<le> z))
min_in_set ?xs ?x = (?x \<in> ?xs \<and> (\<forall>y\<in>?xs. ?x \<le> y))

goal (1 subgoal):
 1. is_succ_in_set S x y = min_in_set {s \<in> S. x < s} y
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in group) rcosets_part_G:
  assumes "subgroup H G"
  shows "\<Union>(rcosets H) = carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
interpret subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (rcosets H) = carrier G
[PROOF STEP]
unfolding RCOSETS_def r_coset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (\<Union>a\<in>carrier G. {\<Union>h\<in>H. {h \<otimes> a}}) = carrier G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (rcosets H) = carrier G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nset_pre:"\<lbrakk> (x::nat) \<in> {i. i \<le> (Suc n)}; x \<noteq> Suc n \<rbrakk> \<Longrightarrow> x \<in> {i. i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> {i. i \<le> Suc n}; x \<noteq> Suc n\<rbrakk> \<Longrightarrow> x \<in> {i. i \<le> n}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma positive_Real: "cauchy X \<Longrightarrow> positive (Real X) \<longleftrightarrow> (\<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy X \<Longrightarrow> positive (Real X) = (\<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n)
[PROOF STEP]
using positive.transfer
[PROOF STATE]
proof (prove)
using this:
rel_fun pcr_real (=) (\<lambda>X. \<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n) positive

goal (1 subgoal):
 1. cauchy X \<Longrightarrow> positive (Real X) = (\<exists>r>0. \<exists>k. \<forall>n\<ge>k. r < X n)
[PROOF STEP]
by (simp add: cr_real_eq rel_fun_def)


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

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

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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_factors_size_bound:
  assumes "n \<in> mset_factors m"
  shows "size n \<le> size m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size n \<le> size m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<in> mset_factors m

goal (1 subgoal):
 1. size n \<le> size m
[PROOF STEP]
unfolding mset_factors_def
[PROOF STATE]
proof (prove)
using this:
n \<in> {n. n \<subseteq># m}

goal (1 subgoal):
 1. size n \<le> size m
[PROOF STEP]
by (simp add: size_mset_mono)


[STATEMENT]
lemma sum_in_Rats [intro]: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> \<rat>) \<Longrightarrow> sum f A \<in> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> f x \<in> \<rat>) \<Longrightarrow> sum f A \<in> \<rat>
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma stirling_sum_complex_of_real:
  "stirling_sum j m (complex_of_real x) = complex_of_real (stirling_sum j m x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stirling_sum j m (complex_of_real x) = complex_of_real (stirling_sum j m x)
[PROOF STEP]
by (simp add: stirling_sum_def pochhammer_of_real [symmetric] del: of_nat_Suc)


[STATEMENT]
lemma echelon_form_of_column_k_efficient[code]:
  "(echelon_form_of_column_k bezout) (A,i) k
    = (echelon_form_of_column_k_efficient bezout) (A,i) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. echelon_form_of_column_k bezout (A, i) k = echelon_form_of_column_k_efficient bezout (A, i) k
[PROOF STEP]
unfolding echelon_form_of_column_k_def echelon_form_of_column_k_efficient_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let (A, i) = (A, i) in if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (A, i) else if \<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a) then (A, i + 1) else let n = LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n; interchange_A = interchange_rows A (mod_type_class.from_nat i) n in (bezout_iterate interchange_A (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) bezout, i + 1)) = (let (A, i) = (A, i); from_nat_k = mod_type_class.from_nat k; from_nat_i = mod_type_class.from_nat i; all_zero_below_i = \<forall>m>from_nat_i. A $ m $ from_nat_k = (0::'a) in if i = nrows A \<or> A $ from_nat_i $ from_nat_k = (0::'a) \<and> all_zero_below_i then (A, i) else if all_zero_below_i then (A, i + 1) else let n = LEAST n. A $ n $ from_nat_k \<noteq> (0::'a) \<and> from_nat_i \<le> n; interchange_A = interchange_rows A from_nat_i n in (bezout_iterate interchange_A (nrows A - 1) from_nat_i from_nat_k bezout, i + 1))
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (A, i) of (A, i) \<Rightarrow> if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (A, i) else if \<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a) then (A, i + 1) else (bezout_iterate (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) bezout, i + 1)) = (case (A, i) of (A, i) \<Rightarrow> if i = nrows A \<or> A $ mod_type_class.from_nat i $ mod_type_class.from_nat k = (0::'a) \<and> (\<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) then (A, i) else if \<forall>m>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a) then (A, i + 1) else (bezout_iterate (interchange_rows A (mod_type_class.from_nat i) (LEAST n. A $ n $ mod_type_class.from_nat k \<noteq> (0::'a) \<and> mod_type_class.from_nat i \<le> n)) (nrows A - 1) (mod_type_class.from_nat i) (mod_type_class.from_nat k) bezout, i + 1))
[PROOF STEP]
by force


[STATEMENT]
theorem t3_1_4_2:
"((P1 \<turnstile> Q1) \<triangleleft> b \<triangleright> (P2 \<turnstile> Q2)) = ((P1 \<triangleleft> b \<triangleright> P2) \<turnstile> (Q1 \<triangleleft> b \<triangleright> Q2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((P1 \<turnstile> Q1) \<triangleleft> b \<triangleright>  (P2 \<turnstile> Q2)) = (P1 \<triangleleft> b \<triangleright>  P2 \<turnstile> Q1 \<triangleleft> b \<triangleright>  Q2)
[PROOF STEP]
by (auto simp: fun_eq_iff design_defs split: cond_splits)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


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


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


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


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


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