[STATEMENT]
lemma isomorphic_relative_contractible_space_imp_homology_groups:
  assumes "contractible_space X" "contractible_space Y" "S \<subseteq> topspace X" "T \<subseteq> topspace Y"
     and ST: "S = {} \<longleftrightarrow> T = {}"
     and iso: "\<And>p. relative_homology_group p X S \<cong> relative_homology_group p Y T"
  shows "homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
proof (cases "T = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. T = {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. T \<noteq> {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
T = {}

goal (2 subgoals):
 1. T = {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. T \<noteq> {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
have "homology_group p (subtopology X {}) \<cong> homology_group p (subtopology Y {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homology_group p (subtopology X {}) \<cong> homology_group p (subtopology Y {})
[PROOF STEP]
by (simp add: homeomorphic_empty_space_eq homeomorphic_space_imp_isomorphic_homology_groups)
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X {}) \<cong> homology_group p (subtopology Y {})

goal (2 subgoals):
 1. T = {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. T \<noteq> {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homology_group p (subtopology X {}) \<cong> homology_group p (subtopology Y {})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homology_group p (subtopology X {}) \<cong> homology_group p (subtopology Y {})

goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
using ST True
[PROOF STATE]
proof (prove)
using this:
homology_group p (subtopology X {}) \<cong> homology_group p (subtopology Y {})
(S = {}) = (T = {})
T = {}

goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)

goal (1 subgoal):
 1. T \<noteq> {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T \<noteq> {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
T \<noteq> {}

goal (1 subgoal):
 1. T \<noteq> {} \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
have "homology_group p (subtopology X S) \<cong> integer_group \<times>\<times> relative_homology_group 1 X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> integer_group \<times>\<times> relative_homology_group 1 X S
[PROOF STEP]
using assms True \<open>T \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
contractible_space X
contractible_space Y
S \<subseteq> topspace X
T \<subseteq> topspace Y
(S = {}) = (T = {})
relative_homology_group ?p X S \<cong> relative_homology_group ?p Y T
p = 0
T \<noteq> {}

goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> integer_group \<times>\<times> relative_homology_group 1 X S
[PROOF STEP]
by (simp add: iso_homology_contractible_space_subtopology1)
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> integer_group \<times>\<times> relative_homology_group 1 X S

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> integer_group \<times>\<times> relative_homology_group 1 X S

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
have "\<dots>  \<cong> integer_group \<times>\<times> relative_homology_group 1 Y T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_group \<times>\<times> relative_homology_group 1 X S \<cong> integer_group \<times>\<times> relative_homology_group 1 Y T
[PROOF STEP]
by (simp add: assms group.DirProd_iso_trans iso_refl)
[PROOF STATE]
proof (state)
this:
integer_group \<times>\<times> relative_homology_group 1 X S \<cong> integer_group \<times>\<times> relative_homology_group 1 Y T

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integer_group \<times>\<times> relative_homology_group 1 X S \<cong> integer_group \<times>\<times> relative_homology_group 1 Y T

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
have "\<dots> \<cong> homology_group p (subtopology Y T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_group \<times>\<times> relative_homology_group 1 Y T \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
by (simp add: True \<open>T \<noteq> {}\<close> assms group.iso_sym iso_homology_contractible_space_subtopology1)
[PROOF STATE]
proof (state)
this:
integer_group \<times>\<times> relative_homology_group 1 Y T \<cong> homology_group p (subtopology Y T)

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
 2. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)

goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
have "homology_group p (subtopology X S) \<cong> relative_homology_group (p+1) X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> relative_homology_group (p + 1) X S
[PROOF STEP]
using assms False \<open>T \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
contractible_space X
contractible_space Y
S \<subseteq> topspace X
T \<subseteq> topspace Y
(S = {}) = (T = {})
relative_homology_group ?p X S \<cong> relative_homology_group ?p Y T
p \<noteq> 0
T \<noteq> {}

goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> relative_homology_group (p + 1) X S
[PROOF STEP]
by (simp add: iso_homology_contractible_space_subtopology2)
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> relative_homology_group (p + 1) X S

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> relative_homology_group (p + 1) X S

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
have "\<dots>  \<cong> relative_homology_group (p+1) Y T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relative_homology_group (p + 1) X S \<cong> relative_homology_group (p + 1) Y T
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
relative_homology_group (p + 1) X S \<cong> relative_homology_group (p + 1) Y T

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
relative_homology_group (p + 1) X S \<cong> relative_homology_group (p + 1) Y T

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
have "\<dots> \<cong> homology_group p (subtopology Y T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relative_homology_group (p + 1) Y T \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
by (simp add: False \<open>T \<noteq> {}\<close> assms group.iso_sym iso_homology_contractible_space_subtopology2)
[PROOF STATE]
proof (state)
this:
relative_homology_group (p + 1) Y T \<cong> homology_group p (subtopology Y T)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)

goal (1 subgoal):
 1. homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
homology_group p (subtopology X S) \<cong> homology_group p (subtopology Y T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_not_subset_finite: "\<lbrakk> infinite A; finite B \<rbrakk> \<Longrightarrow> \<not> A \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite A; finite B\<rbrakk> \<Longrightarrow> \<not> A \<subseteq> B
[PROOF STEP]
by (blast intro: subset_finite_imp_finite)


[STATEMENT]
lemma prod_uminus: "(\<Prod>x\<in>A. -f x :: 'a :: comm_ring_1) = (-1) ^ card A * (\<Prod>x\<in>A. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x\<in>A. - f x) = (- (1::'a)) ^ card A * prod f A
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (auto simp: algebra_simps)


[STATEMENT]
theorem Right_Coset_cardinality:
  "x \<in> G \<Longrightarrow> card (H |\<cdot> x) = card H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> G \<Longrightarrow> card (H |\<cdot> x) = card H
[PROOF STEP]
using Right_Coset_unit Right_Cosets_cardinality unit_closed
[PROOF STATE]
proof (prove)
using this:
H |\<cdot> \<one> = H
\<lbrakk>?x \<in> G; ?y \<in> G\<rbrakk> \<Longrightarrow> card (H |\<cdot> ?x) = card (H |\<cdot> ?y)
\<one> \<in> G

goal (1 subgoal):
 1. x \<in> G \<Longrightarrow> card (H |\<cdot> x) = card H
[PROOF STEP]
by presburger


[STATEMENT]
lemma monic_degree_m_lift: assumes "monic f" "k > 1" "m > 1"
  shows "monic (poly_mod.Mp (m * k) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (poly_mod.Mp (m * k) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monic (poly_mod.Mp (m * k) f)
[PROOF STEP]
have deg: "degree (poly_mod.Mp (m * k) f) = degree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_mod.Mp (m * k) f) = degree f
[PROOF STEP]
by (rule poly_mod.degree_m_eq_monic[of f "m * k"], insert assms, auto simp: less_1_mult)
[PROOF STATE]
proof (state)
this:
degree (poly_mod.Mp (m * k) f) = degree f

goal (1 subgoal):
 1. monic (poly_mod.Mp (m * k) f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (poly_mod.Mp (m * k) f)
[PROOF STEP]
unfolding poly_mod.Mp_coeff deg assms poly_mod.M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 mod (m * k) = 1
[PROOF STEP]
using assms(2-)
[PROOF STATE]
proof (prove)
using this:
1 < k
1 < m

goal (1 subgoal):
 1. 1 mod (m * k) = 1
[PROOF STEP]
by (simp add: less_1_mult)
[PROOF STATE]
proof (state)
this:
monic (poly_mod.Mp (m * k) f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mid_preserves_col:
  assumes "Col A B C" and
    "M Midpoint A A'" and
    "M Midpoint B B'" and
    "M Midpoint C C'"
  shows "Col A' B' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Col A' B' C'
[PROOF STEP]
using Col_def assms(1) assms(2) assms(3) assms(4) l7_15
[PROOF STATE]
proof (prove)
using this:
Col ?A ?B ?C \<equiv> Bet ?A ?B ?C \<or> Bet ?B ?C ?A \<or> Bet ?C ?A ?B
Col A B C
M Midpoint A A'
M Midpoint B B'
M Midpoint C C'
\<lbrakk>?A Midpoint ?P ?P'; ?A Midpoint ?Q ?Q'; ?A Midpoint ?R ?R'; Bet ?P ?Q ?R\<rbrakk> \<Longrightarrow> Bet ?P' ?Q' ?R'

goal (1 subgoal):
 1. Col A' B' C'
[PROOF STEP]
by auto


[STATEMENT]
lemma mult_pred_right: "m * (n - Suc 0) = m * n - m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m * (n - Suc 0) = m * n - m
[PROOF STEP]
by (simp add: diff_mult_distrib2)


[STATEMENT]
lemma pochhammer_minus':
  "pochhammer (b - of_nat k + 1) k = ((- 1) ^ k :: 'a::comm_ring_1) * pochhammer (- b) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (b - of_nat k + (1::'a)) k = (- (1::'a)) ^ k * pochhammer (- b) k
[PROOF STEP]
by (simp add: pochhammer_minus)


[STATEMENT]
lemma sum_Basis_sum_nth_Basis_list:
  "(\<Sum>i\<in>Basis. f i) = (\<Sum>i<DIM('a::executable_euclidean_space). f ((Basis_list::'a list) ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f Basis = (\<Sum>i<DIM('a). f (Basis_list ! i))
[PROOF STEP]
apply (rule sum.reindex_cong[OF _ _ refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj_on ((!) Basis_list) {..<DIM('a)}
 2. Basis = (!) Basis_list ` {..<DIM('a)}
[PROOF STEP]
apply (auto intro!: inj_on_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> Basis \<Longrightarrow> x \<in> (!) Basis_list ` {..<DIM('a)}
[PROOF STEP]
by (metis Basis_list image_iff in_Basis_index_Basis_list index_less_size_conv length_Basis_list lessThan_iff)


[STATEMENT]
lemma length_filter_conv_size_filter_mset: "length (filter P xs) = size (filter_mset P (mset xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter P xs) = size (filter_mset P (mset xs))
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma winding_eq_intro:
  "finite_ReZ_segments g z \<Longrightarrow>
  valid_path g \<Longrightarrow>
  z \<notin> path_image g \<Longrightarrow>
  pathfinish g = pathstart g \<Longrightarrow>
  - of_real(cindex_pathE g z) =2*n \<Longrightarrow>
  winding_number g z = (n::complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite_ReZ_segments g z; valid_path g; z \<notin> path_image g; pathfinish g = pathstart g; - complex_of_real (cindex_pathE g z) = 2 * n\<rbrakk> \<Longrightarrow> winding_number g z = n
[PROOF STEP]
apply (subst winding_number_cindex_pathE[of g z])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>finite_ReZ_segments g z; valid_path g; z \<notin> path_image g; pathfinish g = pathstart g; - complex_of_real (cindex_pathE g z) = 2 * n\<rbrakk> \<Longrightarrow> finite_ReZ_segments g z
 2. \<lbrakk>finite_ReZ_segments g z; valid_path g; z \<notin> path_image g; pathfinish g = pathstart g; - complex_of_real (cindex_pathE g z) = 2 * n\<rbrakk> \<Longrightarrow> valid_path g
 3. \<lbrakk>finite_ReZ_segments g z; valid_path g; z \<notin> path_image g; pathfinish g = pathstart g; - complex_of_real (cindex_pathE g z) = 2 * n\<rbrakk> \<Longrightarrow> z \<notin> path_image g
 4. \<lbrakk>finite_ReZ_segments g z; valid_path g; z \<notin> path_image g; pathfinish g = pathstart g; - complex_of_real (cindex_pathE g z) = 2 * n\<rbrakk> \<Longrightarrow> pathfinish g = pathstart g
 5. \<lbrakk>finite_ReZ_segments g z; valid_path g; z \<notin> path_image g; pathfinish g = pathstart g; - complex_of_real (cindex_pathE g z) = 2 * n\<rbrakk> \<Longrightarrow> complex_of_real (- cindex_pathE g z / 2) = n
[PROOF STEP]
by (auto simp add:field_simps)


[STATEMENT]
lemma set_2: "{..<2::nat} = {0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<2} = {0, 1}
[PROOF STEP]
by auto


[STATEMENT]
lemma shifted_transitions_for_alt_def :
  "shifted_transitions_for M q1 q2 = {(Inl (q1',q2'), x, y, (Inl (q1'',q2''))) | q1' q2' x y q1'' q2'' . ((q1',q2'), x, y, (q1'',q2'')) \<in> transitions (product (from_FSM M q1) (from_FSM M q2))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shifted_transitions_for M q1 q2 = {(Inl (q1', q2'), x, y, Inl (q1'', q2'')) |q1' q2' x y q1'' q2''. ((q1', q2'), x, y, q1'', q2'') \<in> FSM.transitions (Product_FSM.product (from_FSM M q1) (from_FSM M q2))}
[PROOF STEP]
unfolding shifted_transitions_for_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {shift_Inl t |t. t \<in> FSM.transitions (Product_FSM.product (from_FSM M q1) (from_FSM M q2))} = {(Inl (q1', q2'), x, y, Inl (q1'', q2'')) |q1' q2' x y q1'' q2''. ((q1', q2'), x, y, q1'', q2'') \<in> FSM.transitions (Product_FSM.product (from_FSM M q1) (from_FSM M q2))}
[PROOF STEP]
by auto


[STATEMENT]
lemma numeral_octo_sel [simp]:
  "Ree (numeral n) = numeral n" "Im1 (numeral n) = 0" "Im2 (numeral n) = 0"
  "Im3 (numeral n) = 0" "Im4 (numeral n) = 0" "Im5 (numeral n) = 0"
  "Im6 (numeral n) = 0" "Im7 (numeral n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Ree (numeral n) = numeral n &&& Im1 (numeral n) = 0) &&& Im2 (numeral n) = 0 &&& Im3 (numeral n) = 0) &&& (Im4 (numeral n) = 0 &&& Im5 (numeral n) = 0) &&& Im6 (numeral n) = 0 &&& Im7 (numeral n) = 0
[PROOF STEP]
by (simp_all add: numeral_octo_conv_of_nat)


[STATEMENT]
lemma of_nat_monomial: "of_nat p = monomial p 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat p = monomial p (0::'a)
[PROOF STEP]
by (auto simp: poly_mapping_eq_iff lookup_of_nat fun_eq_iff lookup_single)


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


[STATEMENT]
lemma prime_power_iff:
  "prime (p ^ n) \<longleftrightarrow> prime p \<and> n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime (p ^ n) = (prime p \<and> n = 1)
[PROOF STEP]
by (auto simp: prime_def prime_elem_power_iff)


[STATEMENT]
lemma int_nat_p_pow_minus:
"int (nat (p ^ k - 1)) = p ^ k - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (nat (p ^ k - 1)) = p ^ k - 1
[PROOF STEP]
by (simp add: prime prime_gt_0_int)


[STATEMENT]
lemma fpxs_supp_of_fls: "fpxs_supp (fpxs_of_fls f) = of_int ` supp (fls_nth f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fpxs_supp (fpxs_of_fls f) = rat_of_int ` supp (fls_nth f)
[PROOF STEP]
by (force simp: fpxs_supp_def fpxs_nth_of_fls supp_def elim!: Ints_cases)


[STATEMENT]
lemma min_set_iff:
  "x \<in> min_set X \<longleftrightarrow> x \<in> X \<and> (\<forall>y \<in> X. y \<le> x \<longrightarrow> y = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> min_set X) = (x \<in> X \<and> (\<forall>y\<in>X. y \<le> x \<longrightarrow> y = x))
[PROOF STEP]
unfolding min_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {y \<in> X. \<forall>x\<in>X. x \<le> y \<longrightarrow> x = y}) = (x \<in> X \<and> (\<forall>y\<in>X. y \<le> x \<longrightarrow> y = x))
[PROOF STEP]
by blast


[STATEMENT]
lemma funcsetI: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> B) \<Longrightarrow> f \<in> A \<rightarrow> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> f x \<in> B) \<Longrightarrow> f \<in> A \<rightarrow> B
[PROOF STEP]
by (simp add: Pi_def)


[STATEMENT]
lemma set_case_simp_insert2 [simp] :
assumes x12_neq: "x1 \<noteq> x2"
shows "set_case (insert x1 (insert x2 xs))  c_empty c_sing c_else = c_else"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
proof (cases "finite xs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
 2. infinite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite xs

goal (2 subgoals):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
 2. infinite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite xs

goal (1 subgoal):
 1. set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else

goal (1 subgoal):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite xs

goal (1 subgoal):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
note fin_xs = this
[PROOF STATE]
proof (state)
this:
finite xs

goal (1 subgoal):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
have "card {x1,x2} \<le> card (insert x1 (insert x2 xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x1, x2} \<le> card (insert x1 (insert x2 xs))
[PROOF STEP]
by (rule card_mono) (auto simp add: fin_xs)
[PROOF STATE]
proof (state)
this:
card {x1, x2} \<le> card (insert x1 (insert x2 xs))

goal (1 subgoal):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
with x12_neq
[PROOF STATE]
proof (chain)
picking this:
x1 \<noteq> x2
card {x1, x2} \<le> card (insert x1 (insert x2 xs))
[PROOF STEP]
have "1 < card (insert x1 (insert x2 xs))"
[PROOF STATE]
proof (prove)
using this:
x1 \<noteq> x2
card {x1, x2} \<le> card (insert x1 (insert x2 xs))

goal (1 subgoal):
 1. 1 < card (insert x1 (insert x2 xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 < card (insert x1 (insert x2 xs))

goal (1 subgoal):
 1. finite xs \<Longrightarrow> set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < card (insert x1 (insert x2 xs))

goal (1 subgoal):
 1. set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_case (insert x1 (insert x2 xs)) c_empty c_sing c_else = c_else

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ord_trans: "\<lbrakk> i \<in> elts j;  j \<in> elts k;  Ord k \<rbrakk>  \<Longrightarrow> i \<in> elts k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<in> elts j; j \<in> elts k; Ord k\<rbrakk> \<Longrightarrow> i \<in> elts k
[PROOF STEP]
using Ord_def Transset_def
[PROOF STATE]
proof (prove)
using this:
Ord ?x \<equiv> Transset ?x \<and> (\<forall>y\<in>elts ?x. Transset y)
Transset ?x \<equiv> \<forall>y\<in>elts ?x. y \<le> ?x

goal (1 subgoal):
 1. \<lbrakk>i \<in> elts j; j \<in> elts k; Ord k\<rbrakk> \<Longrightarrow> i \<in> elts k
[PROOF STEP]
by blast


[STATEMENT]
lemma monoseq_iff: "monoseq X \<longleftrightarrow> incseq X \<or> decseq X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoseq X = (incseq X \<or> decseq X)
[PROOF STEP]
unfolding monoseq_def incseq_def decseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n) \<or> (\<forall>m n. m \<le> n \<longrightarrow> X n \<le> X m)) = ((\<forall>m n. m \<le> n \<longrightarrow> X m \<le> X n) \<or> (\<forall>m n. m \<le> n \<longrightarrow> X n \<le> X m))
[PROOF STEP]
..


[STATEMENT]
lemma psubset_card_fset_mono:
  shows "xs |\<subset>| ys \<Longrightarrow> card_fset xs < card_fset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs |\<subset>| ys \<Longrightarrow> card_fset xs < card_fset ys
[PROOF STEP]
unfolding card_fset subset_fset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs |\<subset>| ys \<Longrightarrow> card (fset xs) < card (fset ys)
[PROOF STEP]
by (metis finite_fset psubset_fset psubset_card_mono)


[STATEMENT]
lemma nth_acc_lengths [simp]:
  "\<lbrakk>ls \<noteq> []; k < length ls\<rbrakk> \<Longrightarrow> acc_lengths acc ls ! k = acc + sum_list (map length (take (Suc k) ls))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ls \<noteq> []; k < length ls\<rbrakk> \<Longrightarrow> acc_lengths acc ls ! k = acc + sum_list (map length (take (Suc k) ls))
[PROOF STEP]
by (induction acc ls arbitrary: k rule: acc_lengths.induct) (fastforce simp: less_Suc_eq nth_Cons')+


[STATEMENT]
lemma card_cartesian_product_singleton_right: "card (A \<times> {x}) = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A \<times> {x}) = card A
[PROOF STEP]
by (simp add: card_cartesian_product)


[STATEMENT]
lemma lcm_proj1_iff_int [simp]: "lcm m n = \<bar>m\<bar> \<longleftrightarrow> n dvd m"
  for m n :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lcm m n = \<bar>m\<bar>) = (n dvd m)
[PROOF STEP]
by (metis dvd_abs_iff lcm_proj1_if_dvd_int lcm_unique_int)


[STATEMENT]
lemma pi_approx2:
  fixes n :: nat assumes n: "even n" and "n > 0"
  shows   "\<bar>pi - pi_approx2 n\<bar> \<le> inverse (2^(46*n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
even n
[PROOF STEP]
have n': "even (6*n)" "even (4*n)" "even (3*n)"
[PROOF STATE]
proof (prove)
using this:
even n

goal (1 subgoal):
 1. even (6 * n) &&& even (4 * n) &&& even (3 * n)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
even (6 * n)
even (4 * n)
even (3 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from machin'
[PROOF STATE]
proof (chain)
picking this:
pi / 4 = 12 * arctan (1 / 18) + 8 * arctan (1 / 57) - 5 * arctan (1 / 239)
[PROOF STEP]
have "pi = 48 * arctan (1/18) + 32 * arctan (1/57) - 20 * arctan (1/239::real)"
[PROOF STATE]
proof (prove)
using this:
pi / 4 = 12 * arctan (1 / 18) + 8 * arctan (1 / 57) - 5 * arctan (1 / 239)

goal (1 subgoal):
 1. pi = 48 * arctan (1 / 18) + 32 * arctan (1 / 57) - 20 * arctan (1 / 239)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pi = 48 * arctan (1 / 18) + 32 * arctan (1 / 57) - 20 * arctan (1 / 239)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
hence "pi - pi_approx2 n = 48 * (arctan (1/18) - arctan_approx (6*n) (1/18)) +
                                 32 * (arctan (1/57) - arctan_approx (4*n) (1/57)) -
                                 20 * (arctan (1/239) - arctan_approx (3*n) (1/239))"
[PROOF STATE]
proof (prove)
using this:
pi = 48 * arctan (1 / 18) + 32 * arctan (1 / 57) - 20 * arctan (1 / 239)

goal (1 subgoal):
 1. pi - pi_approx2 n = 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239))
[PROOF STEP]
by (simp add: pi_approx2_def)
[PROOF STATE]
proof (state)
this:
pi - pi_approx2 n = 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239))

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
pi - pi_approx2 n = 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239))

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "\<dots> \<in> {-((20/239/(1-(1/239)^4)) * (1/239)^(6*n))..
              (48/18 / (1-(1/18)^4))*(1/18)^(12*n) + (32/57/(1-(1/57)^4)) * (1/57)^(8*n)}"
    (is "_ \<in> {-?l..?u1 + ?u2}")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}
[PROOF STEP]
apply ((rule combine_bounds(1,2))+; (rule combine_bounds(3); (rule arctan_approx)?)?)
[PROOF STATE]
proof (prove)
goal (16 subgoals):
 1. 0 \<le> 48
 2. 0 \<le> 1 / 18
 3. 1 / 18 < 1
 4. even (6 * n)
 5. 0 \<le> 32
 6. 0 \<le> 1 / 57
 7. 1 / 57 < 1
 8. even (4 * n)
 9. ?a1.1 = 48 * 0 + 32 * 0
 10. ?b1.1 = 48 * ((1 / 18) ^ (2 * (6 * n) + 1) / (1 - (1 / 18) ^ 4)) + 32 * ((1 / 57) ^ (2 * (4 * n) + 1) / (1 - (1 / 57) ^ 4))
A total of 16 subgoals...
[PROOF STEP]
apply (simp_all add: n)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 8 * (1 / 18) ^ (12 * n) / (3 - 3 * (1 / 18) ^ 4) = 48 * (1 / 18) ^ (12 * n) / (18 - 18 * (1 / 18) ^ 4)
[PROOF STEP]
apply (simp_all add: field_split_simps)?
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
48 * (arctan (1 / 18) - arctan_approx (6 * n) (1 / 18)) + 32 * (arctan (1 / 57) - arctan_approx (4 * n) (1 / 57)) - 20 * (arctan (1 / 239) - arctan_approx (3 * n) (1 / 239)) \<in> {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "?l \<le> (1/8) * (1/2)^(46*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> 1 / 8 * (1 / 2) ^ (46 * n)
[PROOF STEP]
unfolding power_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 20 / 239 / (1 - (1 / 239) ^ 4) * ((1 / 239) ^ 6) ^ n \<le> 1 / 8 * ((1 / 2) ^ 46) ^ n
[PROOF STEP]
by (intro mult_mono power_mono) (simp_all add: field_split_simps)
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> 1 / 8 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> 1 / 8 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "\<dots> \<le> (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 8 * (1 / 2) ^ (46 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by (cases n; simp_all add: power_add field_split_simps)
[PROOF STATE]
proof (state)
this:
1 / 8 * (1 / 2) ^ (46 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
have "?l \<le> (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
using this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. 20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
have "?u1 + ?u2 \<le> 4 * (1/2)^(48*n) + 1 * (1/2)^(46*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> 4 * (1 / 2) ^ (48 * n) + 1 * (1 / 2) ^ (46 * n)
[PROOF STEP]
unfolding power_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 48 / 18 / (1 - (1 / 18) ^ 4) * ((1 / 18) ^ 12) ^ n + 32 / 57 / (1 - (1 / 57) ^ 4) * ((1 / 57) ^ 8) ^ n \<le> 4 * ((1 / 2) ^ 48) ^ n + 1 * ((1 / 2) ^ 46) ^ n
[PROOF STEP]
by (intro add_mono mult_mono power_mono) (simp_all add: field_split_simps)
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> 4 * (1 / 2) ^ (48 * n) + 1 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> 4 * (1 / 2) ^ (48 * n) + 1 * (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from \<open>n > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "4 * (1/2::real)^(48*n) \<le> (1/2)^(46*n)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 4 * (1 / 2) ^ (48 * n) \<le> (1 / 2) ^ (46 * n)
[PROOF STEP]
by (cases n) (simp_all add: field_simps power_add)
[PROOF STATE]
proof (state)
this:
4 * (1 / 2) ^ (48 * n) \<le> (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
4 * (1 / 2) ^ (48 * n) \<le> (1 / 2) ^ (46 * n)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
from \<open>n > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "(1/2::real) ^ (46 * n) + 1 * (1 / 2) ^ (46 * n) = (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (1 / 2) ^ (46 * n) + 1 * (1 / 2) ^ (46 * n) = (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by (cases n; simp_all add: power_add power_divide)
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ (46 * n) + 1 * (1 / 2) ^ (46 * n) = (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> x + 1 * (1 / 2) ^ (46 * n) \<le> y + 1 * (1 / 2) ^ (46 * n)) \<Longrightarrow> 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
have "?u1 + ?u2 \<le> (1/2) ^ (46 * n - 1)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x + 1 * (1 / 2) ^ (46 * n) \<le> y + 1 * (1 / 2) ^ (46 * n)) \<Longrightarrow> 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. 48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by - simp
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
have "{-?l..?u1 + ?u2} \<subseteq> {-((1/2)^(46*n-1))..(1/2)^(46*n-1)}"
[PROOF STATE]
proof (prove)
using this:
20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n) \<le> (1 / 2) ^ (46 * n - 1)
48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n) \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. {- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)} \<subseteq> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}
[PROOF STEP]
by (subst atLeastatMost_subset_iff) simp_all
[PROOF STATE]
proof (state)
this:
{- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)} \<subseteq> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
{- (20 / 239 / (1 - (1 / 239) ^ 4) * (1 / 239) ^ (6 * n))..48 / 18 / (1 - (1 / 18) ^ 4) * (1 / 18) ^ (12 * n) + 32 / 57 / (1 - (1 / 57) ^ 4) * (1 / 57) ^ (8 * n)} \<subseteq> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
pi - pi_approx2 n \<in> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}
[PROOF STEP]
have "\<bar>pi - pi_approx2 n\<bar> \<le> ((1/2) ^ (46 * n - 1))"
[PROOF STATE]
proof (prove)
using this:
pi - pi_approx2 n \<in> {- ((1 / 2) ^ (46 * n - 1))..(1 / 2) ^ (46 * n - 1)}

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> (1 / 2) ^ (46 * n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>pi - pi_approx2 n\<bar> \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>pi - pi_approx2 n\<bar> \<le> (1 / 2) ^ (46 * n - 1)

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
\<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ (46 * n - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invariance_of_dimension_closedin_Euclidean_space:
  assumes "closedin (Euclidean_space n) S"
  shows "subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n
         \<longleftrightarrow> S = topspace(Euclidean_space n)"
         (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n) = (S = topspace (Euclidean_space n))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n \<Longrightarrow> S = topspace (Euclidean_space n)
 2. S = topspace (Euclidean_space n) \<Longrightarrow> subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n

goal (2 subgoals):
 1. subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n \<Longrightarrow> S = topspace (Euclidean_space n)
 2. S = topspace (Euclidean_space n) \<Longrightarrow> subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n
[PROOF STEP]
have Ssub: "S \<subseteq> topspace (Euclidean_space n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> topspace (Euclidean_space n)
[PROOF STEP]
by (meson assms closedin_def)
[PROOF STATE]
proof (state)
this:
S \<subseteq> topspace (Euclidean_space n)

goal (2 subgoals):
 1. subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n \<Longrightarrow> S = topspace (Euclidean_space n)
 2. S = topspace (Euclidean_space n) \<Longrightarrow> subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S \<subseteq> topspace (Euclidean_space n)

goal (2 subgoals):
 1. subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n \<Longrightarrow> S = topspace (Euclidean_space n)
 2. S = topspace (Euclidean_space n) \<Longrightarrow> subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n
[PROOF STEP]
have False if "a \<notin> S" and "a \<in> topspace (Euclidean_space n)" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have cl_n: "closedin (Euclidean_space (Suc n)) (topspace(Euclidean_space n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (Euclidean_space (Suc n)) (topspace (Euclidean_space n))
[PROOF STEP]
using Euclidean_space_def closedin_Euclidean_space closedin_subtopology
[PROOF STATE]
proof (prove)
using this:
Euclidean_space ?n \<equiv> subtopology (powertop_real UNIV) {x. \<forall>i\<ge>?n. x i = 0}
closedin (powertop_real UNIV) (topspace (Euclidean_space ?n))
closedin (subtopology ?U ?V) ?S = (\<exists>T. closedin ?U T \<and> ?S = T \<inter> ?V)

goal (1 subgoal):
 1. closedin (Euclidean_space (Suc n)) (topspace (Euclidean_space n))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
closedin (Euclidean_space (Suc n)) (topspace (Euclidean_space n))

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closedin (Euclidean_space (Suc n)) (topspace (Euclidean_space n))
[PROOF STEP]
have sub: "subtopology (Euclidean_space(Suc n)) (topspace(Euclidean_space n)) = Euclidean_space n"
[PROOF STATE]
proof (prove)
using this:
closedin (Euclidean_space (Suc n)) (topspace (Euclidean_space n))

goal (1 subgoal):
 1. subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space n)) = Euclidean_space n
[PROOF STEP]
by (metis (no_types, lifting) Euclidean_space_def closedin_subset subtopology_subtopology topspace_Euclidean_space topspace_subtopology topspace_subtopology_subset)
[PROOF STATE]
proof (state)
this:
subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space n)) = Euclidean_space n

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space n)) = Euclidean_space n
[PROOF STEP]
have cl_S: "closedin (Euclidean_space(Suc n)) S"
[PROOF STATE]
proof (prove)
using this:
subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space n)) = Euclidean_space n

goal (1 subgoal):
 1. closedin (Euclidean_space (Suc n)) S
[PROOF STEP]
using cl_n assms closedin_closed_subtopology
[PROOF STATE]
proof (prove)
using this:
subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space n)) = Euclidean_space n
closedin (Euclidean_space (Suc n)) (topspace (Euclidean_space n))
closedin (Euclidean_space n) S
closedin ?X ?S \<Longrightarrow> closedin (subtopology ?X ?S) ?T = (closedin ?X ?T \<and> ?T \<subseteq> ?S)

goal (1 subgoal):
 1. closedin (Euclidean_space (Suc n)) S
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
closedin (Euclidean_space (Suc n)) S

goal (1 subgoal):
 1. False
[PROOF STEP]
have sub_SucS: "subtopology (Euclidean_space (Suc n)) S = subtopology (Euclidean_space n) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subtopology (Euclidean_space (Suc n)) S = subtopology (Euclidean_space n) S
[PROOF STEP]
by (metis Ssub sub subtopology_subtopology topspace_subtopology topspace_subtopology_subset)
[PROOF STATE]
proof (state)
this:
subtopology (Euclidean_space (Suc n)) S = subtopology (Euclidean_space n) S

goal (1 subgoal):
 1. False
[PROOF STEP]
have non0: "{y. \<exists>x::nat\<Rightarrow>real. (\<forall>i\<ge>Suc n. x i = 0) \<and> (\<exists>i\<ge>n. x i \<noteq> 0) \<and> y = x n} = -{0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x. (\<forall>i\<ge>Suc n. x i = 0) \<and> (\<exists>i\<ge>n. x i \<noteq> 0) \<and> y = x n} = - {0}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa i. \<lbrakk>\<forall>i\<ge>Suc n. xa i = 0; 0 = xa n; n \<le> i; xa i \<noteq> 0\<rbrakk> \<Longrightarrow> False
 2. \<And>x. \<lbrakk>x \<notin> {}; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>xa. (\<forall>i\<ge>Suc n. xa i = 0) \<and> (\<exists>i\<ge>n. xa i \<noteq> 0) \<and> x = xa n
[PROOF STEP]
show "False" if "\<forall>i\<ge>Suc n. f i = 0" "0 = f n" "n \<le> i" "f i \<noteq> 0" for f::"nat\<Rightarrow>real" and i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis that le_antisym not_less_eq_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<ge>Suc n. ?f i = 0; 0 = ?f n; n \<le> ?i; ?f ?i \<noteq> 0\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<notin> {}; x \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>xa. (\<forall>i\<ge>Suc n. xa i = 0) \<and> (\<exists>i\<ge>n. xa i \<noteq> 0) \<and> x = xa n
[PROOF STEP]
show "\<exists>f::nat\<Rightarrow>real. (\<forall>i\<ge>Suc n. f i = 0) \<and> (\<exists>i\<ge>n. f i \<noteq> 0) \<and> a = f n" if "a \<noteq> 0" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. (\<forall>i\<ge>Suc n. f i = 0) \<and> (\<exists>i\<ge>n. f i \<noteq> 0) \<and> a = f n
[PROOF STEP]
by (rule_tac x="(\<lambda>i. 0)(n:= a)" in exI) (force simp: that)
[PROOF STATE]
proof (state)
this:
?a \<noteq> 0 \<Longrightarrow> \<exists>f. (\<forall>i\<ge>Suc n. f i = 0) \<and> (\<exists>i\<ge>n. f i \<noteq> 0) \<and> ?a = f n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{y. \<exists>x. (\<forall>i\<ge>Suc n. x i = 0) \<and> (\<exists>i\<ge>n. x i \<noteq> 0) \<and> y = x n} = - {0}

goal (1 subgoal):
 1. False
[PROOF STEP]
have "homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S))
          \<cong> homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)) \<cong> homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))
[PROOF STEP]
proof (rule isomorphic_relative_contractible_space_imp_homology_groups)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. contractible_space (Euclidean_space (Suc n))
 2. contractible_space (Euclidean_space (Suc n))
 3. topspace (Euclidean_space (Suc n)) - S \<subseteq> topspace (Euclidean_space (Suc n))
 4. topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) \<subseteq> topspace (Euclidean_space (Suc n))
 5. (topspace (Euclidean_space (Suc n)) - S = {}) = (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) = {})
 6. \<And>p. relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S) \<cong> relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))
[PROOF STEP]
show "(topspace (Euclidean_space (Suc n)) - S = {}) =
            (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (topspace (Euclidean_space (Suc n)) - S = {}) = (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) = {})
[PROOF STEP]
using cl_n closedin_subset that
[PROOF STATE]
proof (prove)
using this:
closedin (Euclidean_space (Suc n)) (topspace (Euclidean_space n))
closedin ?U ?S \<Longrightarrow> ?S \<subseteq> topspace ?U
a \<notin> S
a \<in> topspace (Euclidean_space n)

goal (1 subgoal):
 1. (topspace (Euclidean_space (Suc n)) - S = {}) = (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) = {})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(topspace (Euclidean_space (Suc n)) - S = {}) = (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) = {})

goal (5 subgoals):
 1. contractible_space (Euclidean_space (Suc n))
 2. contractible_space (Euclidean_space (Suc n))
 3. topspace (Euclidean_space (Suc n)) - S \<subseteq> topspace (Euclidean_space (Suc n))
 4. topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) \<subseteq> topspace (Euclidean_space (Suc n))
 5. \<And>p. relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S) \<cong> relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. contractible_space (Euclidean_space (Suc n))
 2. contractible_space (Euclidean_space (Suc n))
 3. topspace (Euclidean_space (Suc n)) - S \<subseteq> topspace (Euclidean_space (Suc n))
 4. topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) \<subseteq> topspace (Euclidean_space (Suc n))
 5. \<And>p. relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S) \<cong> relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. contractible_space (Euclidean_space (Suc n))
 2. contractible_space (Euclidean_space (Suc n))
 3. topspace (Euclidean_space (Suc n)) - S \<subseteq> topspace (Euclidean_space (Suc n))
 4. topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) \<subseteq> topspace (Euclidean_space (Suc n))
 5. \<And>p. relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S) \<cong> relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))
[PROOF STEP]
show "relative_homology_group p (Euclidean_space (Suc n))
         (topspace (Euclidean_space (Suc n)) - S) \<cong>
        relative_homology_group p (Euclidean_space (Suc n))
         (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S) \<cong> relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))
[PROOF STEP]
by (simp add: L sub_SucS cl_S cl_n isomorphic_relative_homology_groups_Euclidean_complements sub)
[PROOF STATE]
proof (state)
this:
relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S) \<cong> relative_homology_group p (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))

goal (4 subgoals):
 1. contractible_space (Euclidean_space (Suc n))
 2. contractible_space (Euclidean_space (Suc n))
 3. topspace (Euclidean_space (Suc n)) - S \<subseteq> topspace (Euclidean_space (Suc n))
 4. topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n) \<subseteq> topspace (Euclidean_space (Suc n))
[PROOF STEP]
qed (auto simp: L)
[PROOF STATE]
proof (state)
this:
homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)) \<cong> homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))

goal (1 subgoal):
 1. False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)) \<cong> homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))

goal (1 subgoal):
 1. False
[PROOF STEP]
have "continuous_map (powertop_real UNIV) euclideanreal (\<lambda>x. x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (powertop_real UNIV) euclideanreal (\<lambda>x. x n)
[PROOF STEP]
by (metis (no_types) UNIV_I continuous_map_product_projection)
[PROOF STATE]
proof (state)
this:
continuous_map (powertop_real UNIV) euclideanreal (\<lambda>x. x n)

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_map (powertop_real UNIV) euclideanreal (\<lambda>x. x n)
[PROOF STEP]
have cm: "continuous_map (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))
                                  euclideanreal (\<lambda>x. x n)"
[PROOF STATE]
proof (prove)
using this:
continuous_map (powertop_real UNIV) euclideanreal (\<lambda>x. x n)

goal (1 subgoal):
 1. continuous_map (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))) euclideanreal (\<lambda>x. x n)
[PROOF STEP]
by (simp add: Euclidean_space_def continuous_map_from_subtopology)
[PROOF STATE]
proof (state)
this:
continuous_map (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))) euclideanreal (\<lambda>x. x n)

goal (1 subgoal):
 1. False
[PROOF STEP]
have False if "path_connected_space
                      (subtopology (Euclidean_space (Suc n))
                       (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using path_connectedin_continuous_map_image [OF cm that [unfolded path_connectedin_topspace [symmetric]]]
            bounded_path_connected_Compl_real [of "{0}"]
[PROOF STATE]
proof (prove)
using this:
path_connectedin euclideanreal ((\<lambda>x. x n) ` topspace (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))))
\<lbrakk>bounded {0}; path_connected (- {0})\<rbrakk> \<Longrightarrow> {0} = {}

goal (1 subgoal):
 1. False
[PROOF STEP]
by (simp add: topspace_Euclidean_space image_def Bex_def non0 flip: path_connectedin_topspace)
[PROOF STATE]
proof (state)
this:
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))) \<Longrightarrow> False

goal (1 subgoal):
 1. False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))) \<Longrightarrow> False

goal (1 subgoal):
 1. False
[PROOF STEP]
have eq: "T = T \<inter> {x. x n \<le> 0} \<union> T \<inter> {x. x n \<ge> 0}" for T :: "(nat \<Rightarrow> real) set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T = T \<inter> {x. x n \<le> 0} \<union> T \<inter> {x. 0 \<le> x n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?T = ?T \<inter> {x. x n \<le> 0} \<union> ?T \<inter> {x. 0 \<le> x n}

goal (1 subgoal):
 1. False
[PROOF STEP]
have "path_connectedin (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)
[PROOF STEP]
proof (subst eq, rule path_connectedin_Un)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0})
 2. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})
 3. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
have "topspace(Euclidean_space(Suc n)) \<inter> {x. x n = 0} = topspace(Euclidean_space n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. x n = 0} = topspace (Euclidean_space n)
[PROOF STEP]
apply (auto simp: topspace_Euclidean_space)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x i. \<lbrakk>\<forall>i\<ge>Suc n. x i = 0; x n = 0; n \<le> i\<rbrakk> \<Longrightarrow> x i = 0
[PROOF STEP]
by (metis Suc_leI inf.absorb_iff2 inf.orderE leI)
[PROOF STATE]
proof (state)
this:
topspace (Euclidean_space (Suc n)) \<inter> {x. x n = 0} = topspace (Euclidean_space n)

goal (3 subgoals):
 1. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0})
 2. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})
 3. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
let ?S = "topspace(Euclidean_space(Suc n)) \<inter> {x. x n < 0}"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0})
 2. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})
 3. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
show "path_connectedin (Euclidean_space (Suc n))
              ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0})
[PROOF STEP]
proof (rule lemma_iod)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?S \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}
 2. ?S \<noteq> {}
 3. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<subseteq> topspace (Euclidean_space (Suc n))
 4. \<And>a b u. \<lbrakk>a \<in> ?S; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> ?S
[PROOF STEP]
show "?S \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0} \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}
[PROOF STEP]
using Ssub topspace_Euclidean_space
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> topspace (Euclidean_space n)
topspace (Euclidean_space ?n) = {x. \<forall>i\<ge>?n. x i = 0}

goal (1 subgoal):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0} \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0} \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}

goal (3 subgoals):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0} \<noteq> {}
 2. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<subseteq> topspace (Euclidean_space (Suc n))
 3. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
[PROOF STEP]
show "?S \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0} \<noteq> {}
[PROOF STEP]
apply (simp add: topspace_Euclidean_space set_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. (\<forall>i\<ge>Suc n. x i = 0) \<and> x n < 0
[PROOF STEP]
apply (rule_tac x="(\<lambda>i. 0)(n:= -1)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<ge>Suc n. ((\<lambda>i. 0)(n := - 1)) i = 0) \<and> ((\<lambda>i. 0)(n := - 1)) n < 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0} \<noteq> {}

goal (2 subgoals):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<subseteq> topspace (Euclidean_space (Suc n))
 2. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
[PROOF STEP]
fix a b and u::real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<subseteq> topspace (Euclidean_space (Suc n))
 2. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
[PROOF STEP]
assume
          "a \<in> ?S" "0 < u" "u < 1"
          "b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}"
[PROOF STATE]
proof (state)
this:
a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
0 < u
u < 1
b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}

goal (2 subgoals):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<subseteq> topspace (Euclidean_space (Suc n))
 2. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
0 < u
u < 1
b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}
[PROOF STEP]
show "(\<lambda>i. (1 - u) * a i + u * b i) \<in> ?S"
[PROOF STATE]
proof (prove)
using this:
a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
0 < u
u < 1
b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0}

goal (1 subgoal):
 1. (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}
[PROOF STEP]
by (simp add: topspace_Euclidean_space add_neg_nonpos less_eq_real_def mult_less_0_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. x n < 0}

goal (1 subgoal):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<subseteq> topspace (Euclidean_space (Suc n))
[PROOF STEP]
qed (simp add: topspace_Euclidean_space subset_iff)
[PROOF STATE]
proof (state)
this:
path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0})

goal (2 subgoals):
 1. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})
 2. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
let ?T = "topspace(Euclidean_space(Suc n)) \<inter> {x. x n > 0}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})
 2. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
show "path_connectedin (Euclidean_space (Suc n))
              ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})
[PROOF STEP]
proof (rule lemma_iod)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?S \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}
 2. ?S \<noteq> {}
 3. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n} \<subseteq> topspace (Euclidean_space (Suc n))
 4. \<And>a b u. \<lbrakk>a \<in> ?S; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> ?S
[PROOF STEP]
show "?T \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n} \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}
[PROOF STEP]
using Ssub topspace_Euclidean_space
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> topspace (Euclidean_space n)
topspace (Euclidean_space ?n) = {x. \<forall>i\<ge>?n. x i = 0}

goal (1 subgoal):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n} \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n} \<subseteq> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}

goal (3 subgoals):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n} \<noteq> {}
 2. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n} \<subseteq> topspace (Euclidean_space (Suc n))
 3. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
[PROOF STEP]
show "?T \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n} \<noteq> {}
[PROOF STEP]
apply (simp add: topspace_Euclidean_space set_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. (\<forall>i\<ge>Suc n. x i = 0) \<and> 0 < x n
[PROOF STEP]
apply (rule_tac x="(\<lambda>i. 0)(n:= 1)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<ge>Suc n. ((\<lambda>i. 0)(n := 1)) i = 0) \<and> 0 < ((\<lambda>i. 0)(n := 1)) n
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n} \<noteq> {}

goal (2 subgoals):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n} \<subseteq> topspace (Euclidean_space (Suc n))
 2. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
[PROOF STEP]
fix a b and u::real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n} \<subseteq> topspace (Euclidean_space (Suc n))
 2. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
[PROOF STEP]
assume  "a \<in> ?T" "0 < u" "u < 1" "b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}"
[PROOF STATE]
proof (state)
this:
a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
0 < u
u < 1
b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}

goal (2 subgoals):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n} \<subseteq> topspace (Euclidean_space (Suc n))
 2. \<And>a b u. \<lbrakk>a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}; b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}; 0 < u; u < 1\<rbrakk> \<Longrightarrow> (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
0 < u
u < 1
b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}
[PROOF STEP]
show "(\<lambda>i. (1 - u) * a i + u * b i) \<in> ?T"
[PROOF STATE]
proof (prove)
using this:
a \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
0 < u
u < 1
b \<in> (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}

goal (1 subgoal):
 1. (\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}
[PROOF STEP]
by (simp add: topspace_Euclidean_space add_pos_nonneg)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. (1 - u) * a i + u * b i) \<in> topspace (Euclidean_space (Suc n)) \<inter> {x. 0 < x n}

goal (1 subgoal):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n} \<subseteq> topspace (Euclidean_space (Suc n))
[PROOF STEP]
qed (simp add: topspace_Euclidean_space subset_iff)
[PROOF STATE]
proof (state)
this:
path_connectedin (Euclidean_space (Suc n)) ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n})

goal (1 subgoal):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
show "(topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter>
            ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<notin> S
a \<in> topspace (Euclidean_space n)

goal (1 subgoal):
 1. (topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}
[PROOF STEP]
apply (auto simp: Set.set_eq_iff topspace_Euclidean_space)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<notin> S; \<forall>i\<ge>n. a i = 0\<rbrakk> \<Longrightarrow> \<exists>x. x n \<le> 0 \<and> (\<forall>i\<ge>Suc n. x i = 0) \<and> x \<notin> S \<and> (\<forall>i\<ge>Suc n. x i = 0) \<and> x \<notin> S \<and> x n = 0
[PROOF STEP]
by (metis Suc_leD order_refl)
[PROOF STATE]
proof (state)
this:
(topspace (Euclidean_space (Suc n)) - S) \<inter> {x. x n \<le> 0} \<inter> ((topspace (Euclidean_space (Suc n)) - S) \<inter> {x. 0 \<le> x n}) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
path_connectedin (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_connectedin (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)
[PROOF STEP]
have "path_connected_space (subtopology (Euclidean_space (Suc n))
                                         (topspace (Euclidean_space (Suc n)) - S))"
[PROOF STATE]
proof (prove)
using this:
path_connectedin (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)

goal (1 subgoal):
 1. path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S))
[PROOF STEP]
apply (simp add: path_connectedin_subtopology flip: path_connectedin_topspace)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S) \<Longrightarrow> path_connectedin (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) \<inter> (topspace (Euclidean_space (Suc n)) - S))
[PROOF STEP]
by (metis Int_Diff inf_idem)
[PROOF STATE]
proof (state)
this:
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S))

goal (1 subgoal):
 1. False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)) \<cong> homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))) \<Longrightarrow> False
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)) \<cong> homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))) \<Longrightarrow> False
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S))

goal (1 subgoal):
 1. False
[PROOF STEP]
using isomorphic_homology_imp_path_connectedness
[PROOF STATE]
proof (prove)
using this:
homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S)) \<cong> homology_group 0 (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n)))
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - topspace (Euclidean_space n))) \<Longrightarrow> False
path_connected_space (subtopology (Euclidean_space (Suc n)) (topspace (Euclidean_space (Suc n)) - S))
homology_group 0 ?X \<cong> homology_group 0 ?Y \<Longrightarrow> path_connected_space ?X = path_connected_space ?Y

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<notin> S; ?a \<in> topspace (Euclidean_space n)\<rbrakk> \<Longrightarrow> False

goal (2 subgoals):
 1. subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n \<Longrightarrow> S = topspace (Euclidean_space n)
 2. S = topspace (Euclidean_space n) \<Longrightarrow> subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> topspace (Euclidean_space n)
\<lbrakk>?a \<notin> S; ?a \<in> topspace (Euclidean_space n)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> topspace (Euclidean_space n)
\<lbrakk>?a \<notin> S; ?a \<in> topspace (Euclidean_space n)\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. S = topspace (Euclidean_space n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S = topspace (Euclidean_space n)

goal (1 subgoal):
 1. S = topspace (Euclidean_space n) \<Longrightarrow> subtopology (Euclidean_space n) S homeomorphic_space Euclidean_space n
[PROOF STEP]
qed (simp add: homeomorphic_space_refl)


[STATEMENT]
lemma min_0L [simp]: "min 0 n = 0" for n :: V
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min 0 n = 0
[PROOF STEP]
by (simp add: min_absorb1)


[STATEMENT]
lemma Ball_mem_monad_gt_zero: "0 < x \<Longrightarrow> x \<notin> Infinitesimal \<Longrightarrow> u \<in> monad x \<Longrightarrow> 0 < u"
  for u x :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<notin> Infinitesimal; u \<in> monad x\<rbrakk> \<Longrightarrow> 0 < u
[PROOF STEP]
by (metis bex_Infinitesimal_iff2 less_Infinitesimal_less less_add_same_cancel2 mem_monad_approx)


[STATEMENT]
lemma mat_of_cblinfun_Uswap[simp, code]: "mat_of_cblinfun Uswap = matrix_Uswap"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun Uswap = matrix_Uswap
[PROOF STEP]
apply (auto simp add: Uswap_def matrix_Uswap_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (cblinfun_of_mat (mat_of_rows_list 4 [[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]])) = mat_of_rows_list 4 [[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]
[PROOF STEP]
apply (subst cblinfun_of_mat_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mat_of_rows_list 4 [[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]] \<in> carrier_mat (length canonical_basis) (length canonical_basis)
 2. mat_of_rows_list 4 [[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]] = mat_of_rows_list 4 [[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]]
[PROOF STEP]
by (auto)


[STATEMENT]
lemma det_cols_sum:
  "det (upd_cols M T (\<lambda>i. \<Sum>s\<in>S. a i s)) = (\<Sum>f\<in>T \<rightarrow>\<^sub>E S. det (upd_cols M T (\<lambda>i. a i (f i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (upd_cols M T (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M T (\<lambda>i. a i (f i))))
[PROOF STEP]
proof (induct T arbitrary: M rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A M. infinite A \<Longrightarrow> Square_Matrix.det (upd_cols M A (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>A \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M A (\<lambda>i. a i (f i))))
 2. \<And>M. Square_Matrix.det (upd_cols M {} (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>{} \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M {} (\<lambda>i. a i (f i))))
 3. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. Square_Matrix.det (upd_cols M F (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M F (\<lambda>i. a i (f i))))\<rbrakk> \<Longrightarrow> Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>insert x F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. a i (f i))))
[PROOF STEP]
case (insert i T)
[PROOF STATE]
proof (state)
this:
finite T
i \<notin> T
Square_Matrix.det (upd_cols ?M T (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols ?M T (\<lambda>i. a i (f i))))

goal (3 subgoals):
 1. \<And>A M. infinite A \<Longrightarrow> Square_Matrix.det (upd_cols M A (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>A \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M A (\<lambda>i. a i (f i))))
 2. \<And>M. Square_Matrix.det (upd_cols M {} (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>{} \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M {} (\<lambda>i. a i (f i))))
 3. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. Square_Matrix.det (upd_cols M F (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M F (\<lambda>i. a i (f i))))\<rbrakk> \<Longrightarrow> Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>insert x F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. a i (f i))))
[PROOF STEP]
have "(\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) =
    (\<Sum>s\<in>S. \<Sum>f\<in>T \<rightarrow>\<^sub>E S. det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) = (\<Sum>s\<in>S. \<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i))))
[PROOF STEP]
unfolding sum.cartesian_product PiE_insert_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>f\<in>(\<lambda>(y, g). g(i := y)) ` (S \<times> (T \<rightarrow>\<^sub>E S)). Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) = (\<Sum>(s, f)\<in>S \<times> (T \<rightarrow>\<^sub>E S). Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i))))
[PROOF STEP]
using \<open>i \<notin> T\<close>
[PROOF STATE]
proof (prove)
using this:
i \<notin> T

goal (1 subgoal):
 1. (\<Sum>f\<in>(\<lambda>(y, g). g(i := y)) ` (S \<times> (T \<rightarrow>\<^sub>E S)). Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) = (\<Sum>(s, f)\<in>S \<times> (T \<rightarrow>\<^sub>E S). Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i))))
[PROOF STEP]
by (subst sum.reindex[OF inj_combinator[OF \<open>i \<notin> T\<close>]])
       (auto intro!: sum.cong arg_cong[where f=det] upd_cols_cong
             simp: upd_cols_insert_rev simp_implies_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) = (\<Sum>s\<in>S. \<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i))))

goal (3 subgoals):
 1. \<And>A M. infinite A \<Longrightarrow> Square_Matrix.det (upd_cols M A (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>A \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M A (\<lambda>i. a i (f i))))
 2. \<And>M. Square_Matrix.det (upd_cols M {} (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>{} \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M {} (\<lambda>i. a i (f i))))
 3. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. Square_Matrix.det (upd_cols M F (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M F (\<lambda>i. a i (f i))))\<rbrakk> \<Longrightarrow> Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>insert x F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. a i (f i))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) = (\<Sum>s\<in>S. \<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i))))

goal (3 subgoals):
 1. \<And>A M. infinite A \<Longrightarrow> Square_Matrix.det (upd_cols M A (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>A \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M A (\<lambda>i. a i (f i))))
 2. \<And>M. Square_Matrix.det (upd_cols M {} (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>{} \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M {} (\<lambda>i. a i (f i))))
 3. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. Square_Matrix.det (upd_cols M F (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M F (\<lambda>i. a i (f i))))\<rbrakk> \<Longrightarrow> Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>insert x F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. a i (f i))))
[PROOF STEP]
have "\<dots> = det (upd_col (upd_cols M T (\<lambda>i. sum (a i) S)) i (\<Sum>s\<in>S. a i s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>s\<in>S. \<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i)))) = Square_Matrix.det (upd_col (upd_cols M T (\<lambda>i. sum (a i) S)) i (sum (a i) S))
[PROOF STEP]
unfolding insert(3)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>s\<in>S. Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. sum (a i) S))) = Square_Matrix.det (upd_col (upd_cols M T (\<lambda>i. sum (a i) S)) i (sum (a i) S))
[PROOF STEP]
by (simp add: upd_cols_upd_col_swap[OF \<open>i \<notin> T\<close>] det_col_sum)
[PROOF STATE]
proof (state)
this:
(\<Sum>s\<in>S. \<Sum>f\<in>T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols (upd_col M i (a i s)) T (\<lambda>i. a i (f i)))) = Square_Matrix.det (upd_col (upd_cols M T (\<lambda>i. sum (a i) S)) i (sum (a i) S))

goal (3 subgoals):
 1. \<And>A M. infinite A \<Longrightarrow> Square_Matrix.det (upd_cols M A (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>A \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M A (\<lambda>i. a i (f i))))
 2. \<And>M. Square_Matrix.det (upd_cols M {} (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>{} \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M {} (\<lambda>i. a i (f i))))
 3. \<And>x F M. \<lbrakk>finite F; x \<notin> F; \<And>M. Square_Matrix.det (upd_cols M F (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M F (\<lambda>i. a i (f i))))\<rbrakk> \<Longrightarrow> Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>insert x F \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert x F) (\<lambda>i. a i (f i))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) = Square_Matrix.det (upd_col (upd_cols M T (\<lambda>i. sum (a i) S)) i (sum (a i) S))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i)))) = Square_Matrix.det (upd_col (upd_cols M T (\<lambda>i. sum (a i) S)) i (sum (a i) S))

goal (1 subgoal):
 1. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i))))
[PROOF STEP]
by (simp add: upd_cols_insert)
[PROOF STATE]
proof (state)
this:
Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>insert i T \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M (insert i T) (\<lambda>i. a i (f i))))

goal (2 subgoals):
 1. \<And>A M. infinite A \<Longrightarrow> Square_Matrix.det (upd_cols M A (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>A \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M A (\<lambda>i. a i (f i))))
 2. \<And>M. Square_Matrix.det (upd_cols M {} (\<lambda>i. sum (a i) S)) = (\<Sum>f\<in>{} \<rightarrow>\<^sub>E S. Square_Matrix.det (upd_cols M {} (\<lambda>i. a i (f i))))
[PROOF STEP]
qed auto


[STATEMENT]
lemma min_product_assoc[simp]:
  "(A \<otimes>\<^sub>m B) \<otimes>\<^sub>m C = A \<otimes>\<^sub>m (B \<otimes>\<^sub>m C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<otimes>\<^sub>m B) \<otimes>\<^sub>m C = A \<otimes>\<^sub>m B \<otimes>\<^sub>m C
[PROOF STEP]
unfolding min_product_def[of A B] min_product_def[of B C]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_set (A \<otimes> B) \<otimes>\<^sub>m C = A \<otimes>\<^sub>m min_set (B \<otimes> C)
[PROOF STEP]
by simp (simp add: min_product_def)


[STATEMENT]
lemma coprime_commute [ac_simps]:
    "coprime p q \<longleftrightarrow> coprime q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime p q = coprime q p
[PROOF STEP]
by (auto simp add: coprime_def')


[STATEMENT]
lemma natpermute_0'[simp]: "natpermute 0 k = (if k = 0 then {[]} else {replicate k 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natpermute 0 k = (if k = 0 then {[]} else {replicate k 0})
[PROOF STEP]
by (auto simp add: set_replicate_conv_if natpermute_def replicate_length_same)


[STATEMENT]
lemma interval_integrable_mirror:
  shows "interval_lebesgue_integrable lborel a b (\<lambda>x. f (-x)) \<longleftrightarrow>
    interval_lebesgue_integrable lborel (-b) (-a) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integrable lborel a b (\<lambda>x. f (- x)) = interval_lebesgue_integrable lborel (- b) (- a) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interval_lebesgue_integrable lborel a b (\<lambda>x. f (- x)) = interval_lebesgue_integrable lborel (- b) (- a) f
[PROOF STEP]
have *: "indicator (einterval a b) (- x) = (indicator (einterval (-b) (-a)) x :: real)"
    for a b :: ereal and x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicat_real (einterval a b) (- x) = indicat_real (einterval (- b) (- a)) x
[PROOF STEP]
by (cases a b rule: ereal2_cases) (auto simp: einterval_def split: split_indicator)
[PROOF STATE]
proof (state)
this:
indicat_real (einterval ?a ?b) (- ?x) = indicat_real (einterval (- ?b) (- ?a)) ?x

goal (1 subgoal):
 1. interval_lebesgue_integrable lborel a b (\<lambda>x. f (- x)) = interval_lebesgue_integrable lborel (- b) (- a) f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integrable lborel a b (\<lambda>x. f (- x)) = interval_lebesgue_integrable lborel (- b) (- a) f
[PROOF STEP]
unfolding interval_lebesgue_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a \<le> b then set_integrable lborel (einterval a b) (\<lambda>x. f (- x)) else set_integrable lborel (einterval b a) (\<lambda>x. f (- x))) = (if - b \<le> - a then set_integrable lborel (einterval (- b) (- a)) f else set_integrable lborel (einterval (- a) (- b)) f)
[PROOF STEP]
using lborel_integrable_real_affine_iff[symmetric, of "-1" "\<lambda>x. indicator (einterval _ _) x *\<^sub>R f x" 0]
[PROOF STATE]
proof (prove)
using this:
- 1 \<noteq> 0 \<Longrightarrow> integrable lborel (\<lambda>x. indicat_real (einterval ?uu3 ?uua3) x *\<^sub>R f x) = integrable lborel (\<lambda>x. indicat_real (einterval ?uu3 ?uua3) (0 + - 1 * x) *\<^sub>R f (0 + - 1 * x))

goal (1 subgoal):
 1. (if a \<le> b then set_integrable lborel (einterval a b) (\<lambda>x. f (- x)) else set_integrable lborel (einterval b a) (\<lambda>x. f (- x))) = (if - b \<le> - a then set_integrable lborel (einterval (- b) (- a)) f else set_integrable lborel (einterval (- a) (- b)) f)
[PROOF STEP]
by (simp add: * set_integrable_def)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integrable lborel a b (\<lambda>x. f (- x)) = interval_lebesgue_integrable lborel (- b) (- a) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIM_Im: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow> Im L"
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>x. Im (f x)) \<midarrow>a\<rightarrow> Im L
[PROOF STEP]
by (simp add: LIM_NSLIM_iff NSLIM_Im)


[STATEMENT]
lemma numeral_eq_enat:
  "numeral k = enat (numeral k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral k = enat (numeral k)
[PROOF STEP]
using of_nat_eq_enat [of "numeral k"]
[PROOF STATE]
proof (prove)
using this:
of_nat (numeral k) = enat (numeral k)

goal (1 subgoal):
 1. numeral k = enat (numeral k)
[PROOF STEP]
by simp


[STATEMENT]
lemma constant_in_extended_predist_pos [simp, mono_intros]:
  "epsilonG(TYPE('a::Gromov_hyperbolic_space)) > 0"
  "epsilonG(TYPE('a::Gromov_hyperbolic_space)) \<ge> 0"
  "ennreal (epsilonG(TYPE('a))) * top = top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < epsilonG TYPE('a) &&& 0 \<le> epsilonG TYPE('a) &&& ennreal (epsilonG TYPE('a)) * top = top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 < epsilonG TYPE('a)
 2. 0 \<le> epsilonG TYPE('a)
 3. ennreal (epsilonG TYPE('a)) * top = top
[PROOF STEP]
have *: "2+2*deltaG(TYPE('a)) \<ge> 2 + 2 * 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 + 2 * 0 \<le> 2 + 2 * deltaG TYPE('a)
[PROOF STEP]
by (intro mono_intros, auto)
[PROOF STATE]
proof (state)
this:
2 + 2 * 0 \<le> 2 + 2 * deltaG TYPE('a)

goal (3 subgoals):
 1. 0 < epsilonG TYPE('a)
 2. 0 \<le> epsilonG TYPE('a)
 3. ennreal (epsilonG TYPE('a)) * top = top
[PROOF STEP]
show **: "epsilonG(TYPE('a)) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < epsilonG TYPE('a)
[PROOF STEP]
unfolding epsilonG_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < ln 2 / (2 + 2 * deltaG TYPE('a))
[PROOF STEP]
apply (auto simp add: divide_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 2 + 2 * deltaG TYPE('a) < 0 \<Longrightarrow> False
 2. 2 + 2 * deltaG TYPE('a) = 0 \<Longrightarrow> False
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
2 + 2 * 0 \<le> 2 + 2 * deltaG TYPE('a)

goal (2 subgoals):
 1. 2 + 2 * deltaG TYPE('a) < 0 \<Longrightarrow> False
 2. 2 + 2 * deltaG TYPE('a) = 0 \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < epsilonG TYPE('a)

goal (2 subgoals):
 1. 0 \<le> epsilonG TYPE('a)
 2. ennreal (epsilonG TYPE('a)) * top = top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < epsilonG TYPE('a)
[PROOF STEP]
show "ennreal (epsilonG(TYPE('a))) * top = top"
[PROOF STATE]
proof (prove)
using this:
0 < epsilonG TYPE('a)

goal (1 subgoal):
 1. ennreal (epsilonG TYPE('a)) * top = top
[PROOF STEP]
using ennreal_mult_top
[PROOF STATE]
proof (prove)
using this:
0 < epsilonG TYPE('a)
?a * top = (if ?a = 0 then 0 else top)

goal (1 subgoal):
 1. ennreal (epsilonG TYPE('a)) * top = top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ennreal (epsilonG TYPE('a)) * top = top

goal (1 subgoal):
 1. 0 \<le> epsilonG TYPE('a)
[PROOF STEP]
show "epsilonG(TYPE('a::Gromov_hyperbolic_space)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> epsilonG TYPE('a)
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
0 < epsilonG TYPE('a)

goal (1 subgoal):
 1. 0 \<le> epsilonG TYPE('a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> epsilonG TYPE('a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_shift_times_monom:
  "poly_shift n (monom c n * p) = smult c p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_shift n (monom c n * p) = smult c p
[PROOF STEP]
by (intro poly_eqI) (auto simp: coeff_monom_mult coeff_poly_shift)


[STATEMENT]
lemma finite_calM: "finite calM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite calM
[PROOF STEP]
unfolding calM_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {s. s \<subseteq> carrier G \<and> card s = p ^ a}
[PROOF STEP]
by (rule finite_subset [where B = "Pow (carrier G)"]) auto


[STATEMENT]
lemma ht_hash_dom_map_of_disj:
  assumes "ht_hash l"
  assumes "i < length l"
  assumes "j < length l"
  assumes "i \<noteq> j"
  shows "dom (map_of (l!i)) \<inter> dom (map_of(l!j)) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom (map_of (l ! i)) \<inter> dom (map_of (l ! j)) = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ht_hash l
i < length l
j < length l
i \<noteq> j

goal (1 subgoal):
 1. dom (map_of (l ! i)) \<inter> dom (map_of (l ! j)) = {}
[PROOF STEP]
unfolding ht_hash_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length l. \<forall>x\<in>set (l ! i). bounded_hashcode_nat (length l) (fst x) = i
i < length l
j < length l
i \<noteq> j

goal (1 subgoal):
 1. dom (map_of (l ! i)) \<inter> dom (map_of (l ! j)) = {}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y ya. \<lbrakk>\<forall>i<length l. \<forall>x\<in>set (l ! i). bounded_hashcode_nat (length l) (fst x) = i; i < length l; j < length l; i \<noteq> j; map_of (l ! i) x = Some y; map_of (l ! j) x = Some ya\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis fst_conv map_of_SomeD)


[STATEMENT]
lemma plus_vec_eq: "(\<chi> i. f i  + g i) = (\<chi> i. f i) + (\<chi> i. g i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. f i + g i) = (\<chi>i. f i) + (\<chi>i. g i)
[PROOF STEP]
by (simp add: Finite_Cartesian_Product.plus_vec_def)


[STATEMENT]
lemma homeomorphic_hyperplanes_eq:
  fixes a :: "'a::euclidean_space" and c :: "'b::euclidean_space"
  assumes "a \<noteq> 0" "c \<noteq> 0"
  shows "({x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} \<longleftrightarrow> DIM('a) = DIM('b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a \<bullet> x = b} homeomorphic {x. c \<bullet> x = d} = (DIM('a) = DIM('b))
[PROOF STEP]
apply (auto simp: homeomorphic_affine_sets_eq affine_hyperplane assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DIM('a) - Suc 0 = DIM('b) - Suc 0 \<Longrightarrow> DIM('a) = DIM('b)
[PROOF STEP]
by (metis DIM_positive Suc_pred)