[STATEMENT]
lemma continuous_power' [continuous_intros]:
  fixes f :: "_ \<Rightarrow> 'b::topological_monoid_mult"
  shows "continuous F f \<Longrightarrow> continuous F g \<Longrightarrow> continuous F (\<lambda>x. f x ^ g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. f x ^ g x)
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F; (g \<longlongrightarrow> g (Lim F (\<lambda>x. x))) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x ^ g x) \<longlongrightarrow> f (Lim F (\<lambda>x. x)) ^ g (Lim F (\<lambda>x. x))) F
[PROOF STEP]
by (rule tendsto_power_strong) auto


[STATEMENT]
lemma P_ends_on_deadend: "\<lbrakk> enat n < llength P; deadend (P $ n) \<rbrakk> \<Longrightarrow> enat (Suc n) = llength P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat n < llength P; deadend (P $ n)\<rbrakk> \<Longrightarrow> enat (Suc n) = llength P
[PROOF STEP]
using P_valid valid_path_ends_on_deadend
[PROOF STATE]
proof (prove)
using this:
valid_path P
\<lbrakk>valid_path ?P; enat ?i < llength ?P; deadend (?P $ ?i)\<rbrakk> \<Longrightarrow> enat (Suc ?i) = llength ?P

goal (1 subgoal):
 1. \<lbrakk>enat n < llength P; deadend (P $ n)\<rbrakk> \<Longrightarrow> enat (Suc n) = llength P
[PROOF STEP]
by blast


[STATEMENT]
lemma lex_convex_self2:
  assumes "lex p q" "0 \<le> a" "a \<le> 1"
  defines "r \<equiv> a *\<^sub>R p + (1 - a) *\<^sub>R q"
  shows "lex p r" (is ?th1)
    and "lex r q" (is ?th2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex p r &&& Counterclockwise_2D_Arbitrary.lex r q
[PROOF STEP]
using lex_convex3[OF \<open>lex p q\<close>, of q a "1 - a" 0 r]
      assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Counterclockwise_2D_Arbitrary.lex q q; 0 \<le> a; 0 \<le> 1 - a; 0 \<le> 0; a + (1 - a) + 0 = 1; r = a *\<^sub>R p + (1 - a) *\<^sub>R q + 0 *\<^sub>R q\<rbrakk> \<Longrightarrow> Counterclockwise_2D_Arbitrary.lex p r
\<lbrakk>Counterclockwise_2D_Arbitrary.lex q q; 0 \<le> a; 0 \<le> 1 - a; 0 \<le> 0; a + (1 - a) + 0 = 1; r = a *\<^sub>R p + (1 - a) *\<^sub>R q + 0 *\<^sub>R q\<rbrakk> \<Longrightarrow> Counterclockwise_2D_Arbitrary.lex r q
Counterclockwise_2D_Arbitrary.lex p q
0 \<le> a
a \<le> 1
r \<equiv> a *\<^sub>R p + (1 - a) *\<^sub>R q

goal (1 subgoal):
 1. Counterclockwise_2D_Arbitrary.lex p r &&& Counterclockwise_2D_Arbitrary.lex r q
[PROOF STEP]
by (simp_all add: r_def)


[STATEMENT]
lemma generated_is_dual: "is_dual [0..<(length \<B>s)] \<B>s*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_dual [0..<length \<B>s] \<B>s*
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_dual [0..<length \<B>s] \<B>s*
[PROOF STEP]
interpret osys: ordered_incidence_system "[0..<(length \<B>s)]" "\<B>s*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system [0..<length \<B>s] \<B>s*
[PROOF STEP]
using dual_is_ordered_inc_sys
[PROOF STATE]
proof (prove)
using this:
ordered_incidence_system [0..<length \<B>s] \<B>s*

goal (1 subgoal):
 1. ordered_incidence_system [0..<length \<B>s] \<B>s*
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_dual [0..<length \<B>s] \<B>s*
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_dual [0..<length \<B>s] \<B>s*
[PROOF STEP]
using is_dual_def
[PROOF STATE]
proof (prove)
using this:
is_dual ?Vs' ?Bs' \<equiv> ordered_incidence_system ?Vs' ?Bs' \<and> inc_mat_of ?Vs' ?Bs' = N\<^sup>T

goal (1 subgoal):
 1. is_dual [0..<length \<B>s] \<B>s*
[PROOF STEP]
by (simp add: is_dual_def dual_incidence_mat_eq_trans osys.ordered_incidence_system_axioms)
[PROOF STATE]
proof (state)
this:
is_dual [0..<length \<B>s] \<B>s*

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exist_matrix'_implies_similar:
  fixes A B::"'a::{field}^'n^'n"
  assumes linear_f: "linear ((*s)) ((*s)) f" and A: "matrix' X X f = A" and B: "matrix' Y Y f = B"
  and X: "is_basis (set_of_vector X)" and Y: "is_basis (set_of_vector Y)"
  shows "similar_matrices A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_matrices A B
[PROOF STEP]
proof (unfold similar_matrices_def, rule exI[of _ "matrix_change_of_basis Y X"], rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. invertible (matrix_change_of_basis Y X)
 2. B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
have "B=matrix' Y Y f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = matrix' Y Y f
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
matrix' Y Y f = B

goal (1 subgoal):
 1. B = matrix' Y Y f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
B = matrix' Y Y f

goal (2 subgoals):
 1. invertible (matrix_change_of_basis Y X)
 2. B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B = matrix' Y Y f

goal (2 subgoals):
 1. invertible (matrix_change_of_basis Y X)
 2. B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
have "... = matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix' Y Y f = matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X
[PROOF STEP]
using matrix'_matrix_change_of_basis[OF X Y X Y linear_f]
[PROOF STATE]
proof (prove)
using this:
matrix' Y Y f = matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X

goal (1 subgoal):
 1. matrix' Y Y f = matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matrix' Y Y f = matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X

goal (2 subgoals):
 1. invertible (matrix_change_of_basis Y X)
 2. B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
matrix' Y Y f = matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X

goal (2 subgoals):
 1. invertible (matrix_change_of_basis Y X)
 2. B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
have "... =  matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
unfolding A matrix_inv_matrix_change_of_basis[OF Y X]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
matrix_change_of_basis X Y ** matrix' X X f ** matrix_change_of_basis Y X = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X

goal (2 subgoals):
 1. invertible (matrix_change_of_basis Y X)
 2. B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
show "B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X"
[PROOF STATE]
proof (prove)
using this:
B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X

goal (1 subgoal):
 1. B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
B = matrix_inv (matrix_change_of_basis Y X) ** A ** matrix_change_of_basis Y X

goal (1 subgoal):
 1. invertible (matrix_change_of_basis Y X)
[PROOF STEP]
show "invertible (matrix_change_of_basis Y X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (matrix_change_of_basis Y X)
[PROOF STEP]
using invertible_matrix_change_of_basis[OF Y X]
[PROOF STATE]
proof (prove)
using this:
invertible (matrix_change_of_basis Y X)

goal (1 subgoal):
 1. invertible (matrix_change_of_basis Y X)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
invertible (matrix_change_of_basis Y X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_two_impl4[dest]:
  assumes "a * 2 = 2 * b - 1"
  shows "((a::enat) = 0 \<and> b = 0) \<or> (a = \<infinity> \<and> b=\<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
[PROOF STEP]
proof(cases a;cases b)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>nat nata. \<lbrakk>a = enat nat; b = enat nata\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 2. \<And>nat. \<lbrakk>a = enat nat; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 3. \<And>nat. \<lbrakk>a = \<infinity>; b = enat nat\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 4. \<lbrakk>a = \<infinity>; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
[PROOF STEP]
fix anat bnat
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>nat nata. \<lbrakk>a = enat nat; b = enat nata\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 2. \<And>nat. \<lbrakk>a = enat nat; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 3. \<And>nat. \<lbrakk>a = \<infinity>; b = enat nat\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 4. \<lbrakk>a = \<infinity>; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
[PROOF STEP]
assume *:"a = enat anat" "b = enat bnat"
[PROOF STATE]
proof (state)
this:
a = enat anat
b = enat bnat

goal (4 subgoals):
 1. \<And>nat nata. \<lbrakk>a = enat nat; b = enat nata\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 2. \<And>nat. \<lbrakk>a = enat nat; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 3. \<And>nat. \<lbrakk>a = \<infinity>; b = enat nat\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 4. \<lbrakk>a = \<infinity>; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
[PROOF STEP]
hence "anat + anat = bnat + bnat - Suc 0"
[PROOF STATE]
proof (prove)
using this:
a = enat anat
b = enat bnat

goal (1 subgoal):
 1. anat + anat = bnat + bnat - Suc 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a = enat anat
b = enat bnat
a * 2 = 2 * b - 1

goal (1 subgoal):
 1. anat + anat = bnat + bnat - Suc 0
[PROOF STEP]
by (auto simp add:enat_0_iff one_enat_def mult_2 mult_2_right)
[PROOF STATE]
proof (state)
this:
anat + anat = bnat + bnat - Suc 0

goal (4 subgoals):
 1. \<And>nat nata. \<lbrakk>a = enat nat; b = enat nata\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 2. \<And>nat. \<lbrakk>a = enat nat; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 3. \<And>nat. \<lbrakk>a = \<infinity>; b = enat nat\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 4. \<lbrakk>a = \<infinity>; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
anat + anat = bnat + bnat - Suc 0

goal (1 subgoal):
 1. a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
anat + anat = bnat + bnat - Suc 0

goal (1 subgoal):
 1. enat anat = 0 \<and> enat bnat = 0 \<or> enat anat = \<infinity> \<and> enat bnat = \<infinity>
[PROOF STEP]
using Suc_double_not_eq_double[unfolded mult_2, symmetric]
[PROOF STATE]
proof (prove)
using this:
anat + anat = bnat + bnat - Suc 0
?n + ?n \<noteq> Suc (?m + ?m)

goal (1 subgoal):
 1. enat anat = 0 \<and> enat bnat = 0 \<or> enat anat = \<infinity> \<and> enat bnat = \<infinity>
[PROOF STEP]
by (metis Suc_pred add_gr_0 enat_0_iff(1) neq0_conv not_less0 zero_less_diff)
[PROOF STATE]
proof (state)
this:
a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>

goal (3 subgoals):
 1. \<And>nat. \<lbrakk>a = enat nat; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 2. \<And>nat. \<lbrakk>a = \<infinity>; b = enat nat\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
 3. \<lbrakk>a = \<infinity>; b = \<infinity>\<rbrakk> \<Longrightarrow> a = 0 \<and> b = 0 \<or> a = \<infinity> \<and> b = \<infinity>
[PROOF STEP]
qed(insert assms,auto simp add:enat_0_iff one_enat_def mult_2 mult_2_right)


[STATEMENT]
lemma vproduct_vsingletonD:
  assumes "f \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>set{c}. A i)"
  shows "vsv f" and "f\<lparr>c\<rparr> \<in>\<^sub>\<circ> A c" and "f = set {\<langle>c, f\<lparr>c\<rparr>\<rangle>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv f &&& f\<lparr>c\<rparr> \<in>\<^sub>\<circ> A c &&& f = set {\<langle>c, f\<lparr>c\<rparr>\<rangle>}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. vsv f
 2. f\<lparr>c\<rparr> \<in>\<^sub>\<circ> A c
 3. f = set {\<langle>c, f\<lparr>c\<rparr>\<rangle>}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<in>\<^sub>\<circ> vproduct (set {c}) A
[PROOF STEP]
show "f = set {\<langle>c, f\<lparr>c\<rparr>\<rangle>}"
[PROOF STATE]
proof (prove)
using this:
f \<in>\<^sub>\<circ> vproduct (set {c}) A

goal (1 subgoal):
 1. f = set {\<langle>c, f\<lparr>c\<rparr>\<rangle>}
[PROOF STEP]
by (elim vproductE) (metis VLambda_vsingleton  vsv.vsv_is_VLambda)
[PROOF STATE]
proof (state)
this:
f = set {\<langle>c, f\<lparr>c\<rparr>\<rangle>}

goal (2 subgoals):
 1. vsv f
 2. f\<lparr>c\<rparr> \<in>\<^sub>\<circ> A c
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma frontier_of_complement: "X frontier_of (topspace X - S) = X frontier_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X frontier_of (topspace X - S) = X frontier_of S
[PROOF STEP]
by (metis Diff_Diff_Int closure_of_restrict frontier_of_closures inf_commute)


[STATEMENT]
lemma hRe_add: "\<And>x y. hRe (x + y) = hRe x + hRe y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. hRe (x + y) = hRe x + hRe y
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma fst_Gauss_Jordan_PA:
fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
shows "fst (Gauss_Jordan_PA A) ** A = snd (Gauss_Jordan_PA A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_PA A) ** A = snd (Gauss_Jordan_PA A)
[PROOF STEP]
unfolding Gauss_Jordan_PA_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_upt_k_PA A (ncols A - 1)) ** A = snd (Gauss_Jordan_upt_k_PA A (ncols A - 1))
[PROOF STEP]
using fst_Gauss_Jordan_upt_k_PA
[PROOF STATE]
proof (prove)
using this:
fst (Gauss_Jordan_upt_k_PA ?A ?k) ** ?A = snd (Gauss_Jordan_upt_k_PA ?A ?k)

goal (1 subgoal):
 1. fst (Gauss_Jordan_upt_k_PA A (ncols A - 1)) ** A = snd (Gauss_Jordan_upt_k_PA A (ncols A - 1))
[PROOF STEP]
by simp


[STATEMENT]
lemma height_size1_alpha:
  "wbt t \<Longrightarrow> (1/(1-\<alpha>)) ^ (height t) \<le> size1 t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wbt t \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t \<le> real (size1 t)
[PROOF STEP]
proof(induction  t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. wbt \<langle>\<rangle> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>\<rangle> \<le> real (size1 \<langle>\<rangle>)
 2. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
case Leaf
[PROOF STATE]
proof (state)
this:
wbt \<langle>\<rangle>

goal (2 subgoals):
 1. wbt \<langle>\<rangle> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>\<rangle> \<le> real (size1 \<langle>\<rangle>)
 2. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
wbt \<langle>\<rangle>

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height \<langle>\<rangle> \<le> real (size1 \<langle>\<rangle>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>\<rangle> \<le> real (size1 \<langle>\<rangle>)

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
note wbt.simps[simp del] wbt_Node_alpha[simp]
[PROOF STATE]
proof (state)
this:
wbt \<langle>\<rangle> = True
wbt \<langle>?l, ?uu, ?r\<rangle> = (balanced1 ?l ?r \<and> balanced1 ?r ?l \<and> wbt ?l \<and> wbt ?r)
wbt \<langle>?l, ?x, ?r\<rangle> = ((let q = real (size1 ?l) / real (size1 ?l + size1 ?r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt ?l \<and> wbt ?r)

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
case (Node l a r)
[PROOF STATE]
proof (state)
this:
wbt l \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height l \<le> real (size1 l)
wbt r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height r \<le> real (size1 r)
wbt \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
let ?t = "Node l a r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
let ?s = "size1 ?t"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
from Node.prems(1)
[PROOF STATE]
proof (chain)
picking this:
wbt \<langle>l, a, r\<rangle>
[PROOF STEP]
have 1: "size1 l / (1-\<alpha>) \<le> ?s" and 2: "size1 r / (1-\<alpha>)  \<le> ?s"
[PROOF STATE]
proof (prove)
using this:
wbt \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. real (size1 l) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>) &&& real (size1 r) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
using alpha_ub
[PROOF STATE]
proof (prove)
using this:
wbt \<langle>l, a, r\<rangle>
\<alpha> \<le> 1 / 2

goal (1 subgoal):
 1. real (size1 l) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>) &&& real (size1 r) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
by (auto simp: Let_def field_simps add_pos_pos neq0_if)
[PROOF STATE]
proof (state)
this:
real (size1 l) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>)
real (size1 r) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (1 subgoal):
 1. \<And>t1 x2 t2. \<lbrakk>wbt t1 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t1 \<le> real (size1 t1); wbt t2 \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height t2 \<le> real (size1 t2); wbt \<langle>t1, x2, t2\<rangle>\<rbrakk> \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>t1, x2, t2\<rangle> \<le> real (size1 \<langle>t1, x2, t2\<rangle>)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
proof (cases "height l \<le> height r")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
 2. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
height l \<le> height r

goal (2 subgoals):
 1. height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
 2. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
hence "(1/(1-\<alpha>)) ^ (height ?t) = (1/(1-\<alpha>)) ^ (height r) * (1/(1-\<alpha>))"
[PROOF STATE]
proof (prove)
using this:
height l \<le> height r

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> = (1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>))
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> = (1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>))

goal (2 subgoals):
 1. height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
 2. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> = (1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>))

goal (2 subgoals):
 1. height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
 2. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
have "\<dots> \<le> size1 r * (1/(1-\<alpha>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>)) \<le> real (size1 r) * (1 / (1 - \<alpha>))
[PROOF STEP]
using Node.IH(2) Node.prems
[PROOF STATE]
proof (prove)
using this:
wbt r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height r \<le> real (size1 r)
wbt \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>)) \<le> real (size1 r) * (1 / (1 - \<alpha>))
[PROOF STEP]
unfolding wbt_Node_alpha
[PROOF STATE]
proof (prove)
using this:
wbt r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height r \<le> real (size1 r)
(let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>)) \<le> real (size1 r) * (1 / (1 - \<alpha>))
[PROOF STEP]
by (smt (verit) mult_right_mono zero_le_divide_1_iff)
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>)) \<le> real (size1 r) * (1 / (1 - \<alpha>))

goal (2 subgoals):
 1. height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
 2. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height r * (1 / (1 - \<alpha>)) \<le> real (size1 r) * (1 / (1 - \<alpha>))

goal (2 subgoals):
 1. height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
 2. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
have "\<dots> \<le> ?s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (size1 r) * (1 / (1 - \<alpha>)) \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
real (size1 r) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (1 subgoal):
 1. real (size1 r) * (1 / (1 - \<alpha>)) \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
real (size1 r) * (1 / (1 - \<alpha>)) \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (2 subgoals):
 1. height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
 2. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> height l \<le> height r

goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
hence "(1/(1-\<alpha>)) ^ (height ?t) = (1/(1-\<alpha>)) ^ (height l) * (1/(1-\<alpha>))"
[PROOF STATE]
proof (prove)
using this:
\<not> height l \<le> height r

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> = (1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>))
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> = (1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>))

goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> = (1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>))

goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
have "\<dots> \<le> size1 l * (1/(1-\<alpha>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>)) \<le> real (size1 l) * (1 / (1 - \<alpha>))
[PROOF STEP]
using Node.IH(1) Node.prems
[PROOF STATE]
proof (prove)
using this:
wbt l \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height l \<le> real (size1 l)
wbt \<langle>l, a, r\<rangle>

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>)) \<le> real (size1 l) * (1 / (1 - \<alpha>))
[PROOF STEP]
unfolding wbt_Node_alpha
[PROOF STATE]
proof (prove)
using this:
wbt l \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height l \<le> real (size1 l)
(let q = real (size1 l) / real (size1 l + size1 r) in \<alpha> \<le> q \<and> q \<le> 1 - \<alpha>) \<and> wbt l \<and> wbt r

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>)) \<le> real (size1 l) * (1 / (1 - \<alpha>))
[PROOF STEP]
by (smt (verit) mult_right_mono zero_le_divide_1_iff)
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>)) \<le> real (size1 l) * (1 / (1 - \<alpha>))

goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height l * (1 / (1 - \<alpha>)) \<le> real (size1 l) * (1 / (1 - \<alpha>))

goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
have "\<dots> \<le> ?s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (size1 l) * (1 / (1 - \<alpha>)) \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
real (size1 l) / (1 - \<alpha>) \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (1 subgoal):
 1. real (size1 l) * (1 / (1 - \<alpha>)) \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
real (size1 l) * (1 / (1 - \<alpha>)) \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (1 subgoal):
 1. \<not> height l \<le> height r \<Longrightarrow> (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)

goal (1 subgoal):
 1. (1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 / (1 - \<alpha>)) ^ height \<langle>l, a, r\<rangle> \<le> real (size1 \<langle>l, a, r\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hom_boundary2:
  "\<exists>d. (\<forall>p X S.
           (d p X S) \<in> hom (relative_homology_group p X S)
                           (homology_group (p - 1) (subtopology X S)))
     \<and> (\<forall>p X S c. singular_relcycle p X S c \<and> Suc 0 \<le> p
            \<longrightarrow> d p X S (homologous_rel_set p X S c)
              = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))"
  (is "\<exists>d. ?\<Phi> d")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d. (\<forall>p X S. d p X S \<in> hom (relative_homology_group p X S) (homology_group (p - 1) (subtopology X S))) \<and> (\<forall>p X S c. singular_relcycle p X S c \<and> Suc 0 \<le> p \<longrightarrow> d (int p) X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>d. (\<forall>p X S. d p X S \<in> hom (relative_homology_group p X S) (homology_group (p - 1) (subtopology X S))) \<and> (\<forall>p X S c. singular_relcycle p X S c \<and> Suc 0 \<le> p \<longrightarrow> d (int p) X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))
[PROOF STEP]
have *: "\<exists>f. \<Phi>(\<lambda>p. if p \<le> 0 then \<lambda>q r t. undefined else f(nat p)) \<Longrightarrow> \<exists>f. \<Phi> f"  for \<Phi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. \<Phi> (\<lambda>p. if p \<le> 0 then \<lambda>q r t. undefined else f (nat p)) \<Longrightarrow> \<exists>f. \<Phi> f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f. ?\<Phi>1 (\<lambda>p. if p \<le> 0 then \<lambda>q r t. undefined else f (nat p)) \<Longrightarrow> \<exists>f. ?\<Phi>1 f

goal (1 subgoal):
 1. \<exists>d. (\<forall>p X S. d p X S \<in> hom (relative_homology_group p X S) (homology_group (p - 1) (subtopology X S))) \<and> (\<forall>p X S c. singular_relcycle p X S c \<and> Suc 0 \<le> p \<longrightarrow> d (int p) X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d. (\<forall>p X S. d p X S \<in> hom (relative_homology_group p X S) (homology_group (p - 1) (subtopology X S))) \<and> (\<forall>p X S c. singular_relcycle p X S c \<and> Suc 0 \<le> p \<longrightarrow> d (int p) X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))
[PROOF STEP]
apply (rule * [OF ex_forward [OF hom_boundary1]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>d. \<forall>p X S. d p X S \<in> hom (relative_homology_group (int p) X S) (homology_group (int (p - Suc 0)) (subtopology X S)) \<and> (\<forall>c. singular_relcycle p X S c \<longrightarrow> d p X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c)) \<Longrightarrow> (\<forall>p X S. (if p \<le> 0 then \<lambda>q r t. undefined else d (nat p)) X S \<in> hom (relative_homology_group p X S) (homology_group (p - 1) (subtopology X S))) \<and> (\<forall>p X S c. singular_relcycle p X S c \<and> Suc 0 \<le> p \<longrightarrow> (if int p \<le> 0 then \<lambda>q r t. undefined else d (nat (int p))) X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))
[PROOF STEP]
apply (simp add: not_le relative_homology_group_def nat_diff_distrib' int_eq_iff nat_diff_distrib flip: nat_1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>d. \<forall>p X S. d p X S \<in> hom (relcycle_group p X S Mod singular_relboundary_set p X S) (relcycle_group (p - nat 1) (subtopology X S) {} Mod singular_relboundary_set (p - nat 1) (subtopology X S) {}) \<and> (\<forall>c. singular_relcycle p X S c \<longrightarrow> d p X S (homologous_rel_set p X S c) = homologous_rel_set (p - nat 1) (subtopology X S) {} (chain_boundary p c)) \<Longrightarrow> \<forall>X S. (\<lambda>t. undefined) \<in> hom (relcycle_group 0 X S Mod singular_relboundary_set 0 X S) (singleton_group undefined)
[PROOF STEP]
by (simp add: hom_def singleton_group_def)
[PROOF STATE]
proof (state)
this:
\<exists>d. (\<forall>p X S. d p X S \<in> hom (relative_homology_group p X S) (homology_group (p - 1) (subtopology X S))) \<and> (\<forall>p X S c. singular_relcycle p X S c \<and> Suc 0 \<le> p \<longrightarrow> d (int p) X S (homologous_rel_set p X S c) = homologous_rel_set (p - Suc 0) (subtopology X S) {} (chain_boundary p c))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cyclic_group) sample_uniform_one_time_pad:
  assumes [simp]: "c \<in> carrier G"
  shows
  "map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) =
   map_spmf (\<lambda>x. \<^bold>g [^] x) (sample_uniform (order G))"
   (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
proof(cases "finite (carrier G)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
 2. infinite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite (carrier G)

goal (2 subgoals):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
 2. infinite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (carrier G)

goal (1 subgoal):
 1. map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
by(simp add: order_def sample_uniform_def)
[PROOF STATE]
proof (state)
this:
map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite (carrier G)

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
have "?lhs = map_spmf (\<lambda>x. x \<otimes> c) ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (\<lambda>x. x \<otimes> c) (map_spmf (([^]) \<^bold>g) (sample_uniform (order G)))
[PROOF STEP]
by(simp add: pmf.map_comp o_def option.map_comp)
[PROOF STATE]
proof (state)
this:
map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (\<lambda>x. x \<otimes> c) (map_spmf (([^]) \<^bold>g) (sample_uniform (order G)))

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (\<lambda>x. x \<otimes> c) (map_spmf (([^]) \<^bold>g) (sample_uniform (order G)))

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
have rhs: "?rhs = spmf_of_set (carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (([^]) \<^bold>g) (sample_uniform (order G)) = spmf_of_set (carrier G)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)

goal (1 subgoal):
 1. map_spmf (([^]) \<^bold>g) (sample_uniform (order G)) = spmf_of_set (carrier G)
[PROOF STEP]
by(simp add: carrier_conv_generator inj_on_generator sample_uniform_def)
[PROOF STATE]
proof (state)
this:
map_spmf (([^]) \<^bold>g) (sample_uniform (order G)) = spmf_of_set (carrier G)

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map_spmf (([^]) \<^bold>g) (sample_uniform (order G)) = spmf_of_set (carrier G)

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
have "map_spmf (\<lambda>x. x \<otimes> c) \<dots> = spmf_of_set ((\<lambda>x. x \<otimes> c) ` carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf (\<lambda>x. x \<otimes> c) (spmf_of_set (carrier G)) = spmf_of_set ((\<lambda>x. x \<otimes> c) ` carrier G)
[PROOF STEP]
by(simp add: inj_on_multc)
[PROOF STATE]
proof (state)
this:
map_spmf (\<lambda>x. x \<otimes> c) (spmf_of_set (carrier G)) = spmf_of_set ((\<lambda>x. x \<otimes> c) ` carrier G)

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map_spmf (\<lambda>x. x \<otimes> c) (spmf_of_set (carrier G)) = spmf_of_set ((\<lambda>x. x \<otimes> c) ` carrier G)

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
have "(\<lambda>x. x \<otimes> c) ` carrier G = carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x \<otimes> c) ` carrier G = carrier G
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)

goal (1 subgoal):
 1. (\<lambda>x. x \<otimes> c) ` carrier G = carrier G
[PROOF STEP]
by(rule endo_inj_surj)(auto simp add: inj_on_multc)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x \<otimes> c) ` carrier G = carrier G

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = spmf_of_set (carrier G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = spmf_of_set (carrier G)

goal (1 subgoal):
 1. map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
using rhs
[PROOF STATE]
proof (prove)
using this:
map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = spmf_of_set (carrier G)
map_spmf (([^]) \<^bold>g) (sample_uniform (order G)) = spmf_of_set (carrier G)

goal (1 subgoal):
 1. map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map_spmf (\<lambda>x. \<^bold>g [^] x \<otimes> c) (sample_uniform (order G)) = map_spmf (([^]) \<^bold>g) (sample_uniform (order G))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simplicial_simplex_oriented_simplex:
   "simplicial_simplex p S (oriented_simplex p l)
    \<longleftrightarrow> ((\<lambda>x i. \<Sum>j\<le>p. l j i * x j) ` standard_simplex p \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_simplex p S (oriented_simplex p l) = ((\<lambda>x i. \<Sum>j\<le>p. l j i * x j) ` standard_simplex p \<subseteq> S)
[PROOF STEP]
by (auto simp: simplicial_simplex oriented_simplex_def)


[STATEMENT]
lemma in_latticeI: assumes "f = sumlist (map (\<lambda> i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0 ..< length fs])"
  shows "f \<in> lattice_of fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> lattice_of fs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f = M.sumlist (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0..<length fs])

goal (1 subgoal):
 1. f \<in> lattice_of fs
[PROOF STEP]
unfolding lattice_of_def
[PROOF STATE]
proof (prove)
using this:
f = M.sumlist (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0..<length fs])

goal (1 subgoal):
 1. f \<in> range (\<lambda>c. M.sumlist (map (\<lambda>i. of_int (c i) \<cdot>\<^sub>v fs ! i) [0..<length fs]))
[PROOF STEP]
by auto


[STATEMENT]
lemma double_sum_aux:
  fixes f::"nat \<Rightarrow> real"
  shows
  "(\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j)) =
   (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. (f k * g j + f j * g k) / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
have
    "2 * (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j)) =
    (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j)) +
    (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
have
    "\<dots> =
    (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j)) +
    (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f j * g k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f j * g k)
[PROOF STEP]
by (simp only: double_sum_equiv)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f j * g k)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f j * g k)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
have
    "\<dots> =
    (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j + f j * g k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f j * g k) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k)
[PROOF STEP]
by (auto simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) + (\<Sum>k = 1..n. \<Sum>j = 1..n. f j * g k) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k)
[PROOF STEP]
have
    "2 * (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j)) =
    (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j + f j * g k))"
[PROOF STATE]
proof (prove)
using this:
2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k)

goal (1 subgoal):
 1. 2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
hence
    "(\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. f k * g j)) =
     (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. (f k * g j + f j * g k)))*(1/2)"
[PROOF STATE]
proof (prove)
using this:
2 * (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k) * (1 / 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k) * (1 / 2)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k) * (1 / 2)

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
have
    "\<dots> =
     (\<Sum>k\<in>{1..n}. (\<Sum>j\<in>{1..n}. (f k * g j + f j * g k)*(1/2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k) * (1 / 2) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) * (1 / 2))
[PROOF STEP]
by (simp add: sum_distrib_left mult.commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j + f j * g k) * (1 / 2) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) * (1 / 2))

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) * (1 / 2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) * (1 / 2))

goal (1 subgoal):
 1. (\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)
[PROOF STEP]
by (auto simp add: inverse_eq_divide)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. \<Sum>j = 1..n. f k * g j) = (\<Sum>k = 1..n. \<Sum>j = 1..n. (f k * g j + f j * g k) / 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_useNodes_of: "Mapping.lookup (useNodes_of g) v =
    (if (\<exists>n \<in> set (\<alpha>n g). v \<in> uses g n) then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup (useNodes_of g) v = (if \<exists>n\<in>set (\<alpha>n g). v \<in> uses g n then Some {n \<in> set (\<alpha>n g). v \<in> uses g n} else None)
[PROOF STEP]
by clarsimp (transfer'; auto)


[STATEMENT]
lemma card_1_imp_singleton: "card A = Suc 0 \<Longrightarrow> (\<exists>a. A = {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = Suc 0 \<Longrightarrow> \<exists>a. A = {a}
[PROOF STEP]
by (metis card_eq_SucD)


[STATEMENT]
lemma lfp_to_gfp_var:
  fixes f :: "'a::complete_lattice_with_dual \<Rightarrow> 'a"
  shows "lfp f = \<partial> (gfp (\<partial>\<^sub>F f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = \<partial> (gfp (\<partial>\<^sub>F f))
[PROOF STEP]
by (metis invol_dual_var lfp_dual_var)


[STATEMENT]
lemma reduce_system_matrix_equation_preserved:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "nat list list"
  fixes signs :: "rat list list"
  assumes nonzero: "p \<noteq> 0"
  assumes welldefined_signs: "well_def_signs (length qs) signs"
  assumes welldefined_subsets: "all_list_constr (subsets) (length qs)"
  assumes distinct_signs: "distinct signs"
  assumes all_info: "set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set(signs)"
  assumes match: "satisfy_equation p qs subsets signs"
  assumes invertible_mat: "invertible_mat (matrix_A signs subsets)"
  assumes pairwise_rel_prime: "\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))"
  shows "satisfy_equation p qs (get_subsets (reduce_system p (qs, ((matrix_A signs subsets), (subsets, signs)))))
  (get_signs (reduce_system p (qs, ((matrix_A signs subsets), (subsets, signs)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
have poly_type_hyp: "p \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
using nonzero
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
have distinct_signs_hyp: "distinct (snd (snd (reduce_system p (qs, ((matrix_A signs subsets), (subsets, signs))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
let ?sym = "(find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
have h1: "\<forall> i < length (take_indices signs ?sym). \<forall>j < length(take_indices signs ?sym).
      i \<noteq> j \<longrightarrow> nth (take_indices signs ?sym) i \<noteq> nth (take_indices signs ?sym) j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). \<forall>j<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). i \<noteq> j \<longrightarrow> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! i \<noteq> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! j
[PROOF STEP]
using distinct_signs
[PROOF STATE]
proof (prove)
using this:
distinct signs

goal (1 subgoal):
 1. \<forall>i<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). \<forall>j<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). i \<noteq> j \<longrightarrow> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! i \<noteq> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! j
[PROOF STEP]
unfolding take_indices_def
[PROOF STATE]
proof (prove)
using this:
distinct signs

goal (1 subgoal):
 1. \<forall>i<length (map ((!) signs) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). \<forall>j<length (map ((!) signs) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). i \<noteq> j \<longrightarrow> map ((!) signs) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! i \<noteq> map ((!) signs) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! j
[PROOF STEP]
proof clarsimp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "distinct signs"
[PROOF STATE]
proof (state)
this:
distinct signs

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "i < length
                (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"
[PROOF STATE]
proof (state)
this:
i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "j < length
                (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))"
[PROOF STATE]
proof (state)
this:
j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume neq_hyp: "i \<noteq> j"
[PROOF STATE]
proof (state)
this:
i \<noteq> j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets
              (matrix_A signs subsets)) ! i) =
           signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets
              (matrix_A signs subsets)) ! j)"
[PROOF STATE]
proof (state)
this:
signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have h1: "find_nonzeros_from_input_vec (solve_for_lhs p qs subsets
              (matrix_A signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets
              (matrix_A signs subsets)) ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j
[PROOF STEP]
unfolding find_nonzeros_from_input_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! i \<noteq> filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j
[PROOF STEP]
using neq_hyp
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j

goal (1 subgoal):
 1. filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! i \<noteq> filter (\<lambda>i. solve_for_lhs p qs subsets (M_mat signs subsets) $ i \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j
[PROOF STEP]
by (metis \<open>i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))\<close> \<open>j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))\<close> distinct_conv_nth distinct_filter distinct_upt find_nonzeros_from_input_vec_def)
[PROOF STATE]
proof (state)
this:
find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>distinct signs; i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))); i \<noteq> j; signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j

goal (1 subgoal):
 1. False
[PROOF STEP]
using distinct_signs
[PROOF STATE]
proof (prove)
using this:
find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j
distinct signs

goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j; distinct signs\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have f1: "\<forall>p ns n. ((n::nat) \<in> {n \<in> set ns. p n}) = (n \<in> set ns \<and> n \<in> Collect p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p ns n. (n \<in> {n \<in> set ns. p n}) = (n \<in> set ns \<and> n \<in> Collect p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>p ns n. (n \<in> {n \<in> set ns. p n}) = (n \<in> set ns \<and> n \<in> Collect p)

goal (1 subgoal):
 1. \<lbrakk>find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j; distinct signs\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>p ns n. (n \<in> {n \<in> set ns. p n}) = (n \<in> set ns \<and> n \<in> Collect p)
[PROOF STEP]
have f2: "filter (\<lambda>n. solve_for_lhs p qs subsets (matrix_A signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))] ! i \<in> set [0..<length signs]"
[PROOF STATE]
proof (prove)
using this:
\<forall>p ns n. (n \<in> {n \<in> set ns. p n}) = (n \<in> set ns \<and> n \<in> Collect p)

goal (1 subgoal):
 1. filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! i \<in> set [0..<length signs]
[PROOF STEP]
by (metis (full_types) \<open>i < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))\<close> construct_lhs_matches_solve_for_lhs find_nonzeros_from_input_vec_def invertible_mat match nth_mem set_filter size_of_lhs)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! i \<in> set [0..<length signs]

goal (1 subgoal):
 1. \<lbrakk>find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j; distinct signs\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "filter (\<lambda>n. solve_for_lhs p qs subsets (matrix_A signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))] ! j \<in> set [0..<length signs]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j \<in> set [0..<length signs]
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
\<forall>p ns n. (n \<in> {n \<in> set ns. p n}) = (n \<in> set ns \<and> n \<in> Collect p)

goal (1 subgoal):
 1. filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j \<in> set [0..<length signs]
[PROOF STEP]
by (metis (full_types) \<open>j < length (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)))\<close> construct_lhs_matches_solve_for_lhs find_nonzeros_from_input_vec_def invertible_mat match nth_mem set_filter size_of_lhs)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j \<in> set [0..<length signs]

goal (1 subgoal):
 1. \<lbrakk>find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! i \<noteq> find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)) ! j; distinct signs\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j \<in> set [0..<length signs]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j \<in> set [0..<length signs]

goal (1 subgoal):
 1. False
[PROOF STEP]
using f2
[PROOF STATE]
proof (prove)
using this:
filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! j \<in> set [0..<length signs]
filter (\<lambda>n. solve_for_lhs p qs subsets (M_mat signs subsets) $ n \<noteq> 0) [0..<dim_vec (solve_for_lhs p qs subsets (M_mat signs subsets))] ! i \<in> set [0..<length signs]

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis \<open>signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)) ! i) = signs ! (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets)) ! j)\<close> atLeastLessThan_iff distinct_conv_nth distinct_signs find_nonzeros_from_input_vec_def h1 set_upt)
[PROOF STATE]
proof (state)
this:
False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). \<forall>j<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). i \<noteq> j \<longrightarrow> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! i \<noteq> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! j

goal (1 subgoal):
 1. distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). \<forall>j<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). i \<noteq> j \<longrightarrow> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! i \<noteq> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! j
[PROOF STEP]
have "distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (matrix_A signs subsets))))"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). \<forall>j<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). i \<noteq> j \<longrightarrow> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! i \<noteq> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! j

goal (1 subgoal):
 1. distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
using distinct_conv_nth
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). \<forall>j<length (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))). i \<noteq> j \<longrightarrow> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! i \<noteq> take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))) ! j
distinct ?xs = (\<forall>i<length ?xs. \<forall>j<length ?xs. i \<noteq> j \<longrightarrow> ?xs ! i \<noteq> ?xs ! j)

goal (1 subgoal):
 1. distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))

goal (1 subgoal):
 1. distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))

goal (1 subgoal):
 1. distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
using get_signs_def reduction_signs_def reduction_signs_is_get_signs
[PROOF STATE]
proof (prove)
using this:
distinct (take_indices signs (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets))))
get_signs ?data = snd (snd ?data)
reduction_signs ?p ?qs ?signs ?subsets ?matr = take_indices ?signs (find_nonzeros_from_input_vec (solve_for_lhs ?p ?qs ?subsets ?matr))
reduction_signs ?p ?qs ?signs ?subsets ?m = get_signs (reduce_system ?p (?qs, ?m, ?subsets, ?signs))

goal (1 subgoal):
 1. distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
have all_info_hyp: "set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set(snd (snd (reduce_system p (qs, ((matrix_A signs subsets), (subsets, signs))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
using reduce_system_sign_conditions assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<noteq> 0; well_def_signs (length ?qs) ?signs; distinct ?signs; set (characterize_consistent_signs_at_roots_copr ?p ?qs) \<subseteq> set ?signs; satisfy_equation ?p ?qs ?subsets ?signs; invertible_mat (M_mat ?signs ?subsets)\<rbrakk> \<Longrightarrow> set (get_signs (reduce_system ?p (?qs, M_mat ?signs ?subsets, ?subsets, ?signs))) = set (characterize_consistent_signs_at_roots_copr ?p ?qs)
p \<noteq> 0
well_def_signs (length qs) signs
all_list_constr subsets (length qs)
distinct signs
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set signs
satisfy_equation p qs subsets signs
invertible_mat (M_mat signs subsets)
\<forall>q. List.member qs q \<longrightarrow> coprime p q

goal (1 subgoal):
 1. set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
unfolding get_signs_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<noteq> 0; well_def_signs (length ?qs) ?signs; distinct ?signs; set (characterize_consistent_signs_at_roots_copr ?p ?qs) \<subseteq> set ?signs; satisfy_equation ?p ?qs ?subsets ?signs; invertible_mat (M_mat ?signs ?subsets)\<rbrakk> \<Longrightarrow> set (snd (snd (reduce_system ?p (?qs, M_mat ?signs ?subsets, ?subsets, ?signs)))) = set (characterize_consistent_signs_at_roots_copr ?p ?qs)
p \<noteq> 0
well_def_signs (length qs) signs
all_list_constr subsets (length qs)
distinct signs
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set signs
satisfy_equation p qs subsets signs
invertible_mat (M_mat signs subsets)
\<forall>q. List.member qs q \<longrightarrow> coprime p q

goal (1 subgoal):
 1. set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
have pairwise_rel_prime_hyp: "\<forall>q. ((List.member qs q) \<longrightarrow> (coprime p q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>q. List.member qs q \<longrightarrow> coprime p q
[PROOF STEP]
using pairwise_rel_prime
[PROOF STATE]
proof (prove)
using this:
\<forall>q. List.member qs q \<longrightarrow> coprime p q

goal (1 subgoal):
 1. \<forall>q. List.member qs q \<longrightarrow> coprime p q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>q. List.member qs q \<longrightarrow> coprime p q

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
have welldefined_hyp: "all_list_constr (fst (snd (reduce_system p (qs, ((matrix_A signs subsets), (subsets, signs)))))) (length qs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
[PROOF STEP]
using welldefined_subsets rows_to_keep_lem
[PROOF STATE]
proof (prove)
using this:
all_list_constr subsets (length qs)
?ell \<in> set (rows_to_keep ?A) \<Longrightarrow> ?ell < dim_row ?A

goal (1 subgoal):
 1. all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
[PROOF STEP]
unfolding all_list_constr_def List.member_def list_constr_def list_all_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x \<in> set subsets \<longrightarrow> (\<forall>x\<in>set x. x < length qs)
?ell \<in> set (rows_to_keep ?A) \<Longrightarrow> ?ell < dim_row ?A

goal (1 subgoal):
 1. \<forall>x. x \<in> set (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) \<longrightarrow> (\<forall>x\<in>set x. x < length qs)
[PROOF STEP]
apply (auto simp add: Let_def take_indices_def take_cols_from_matrix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xb. \<lbrakk>\<forall>x. x \<in> set subsets \<longrightarrow> (\<forall>x\<in>set x. x < length qs); \<And>ell A. ell \<in> set (rows_to_keep A) \<Longrightarrow> ell < dim_row A; xa \<in> set (rows_to_keep (mat_of_cols (length subsets) (map ((!) (cols (M_mat signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))))); xb \<in> set (subsets ! xa)\<rbrakk> \<Longrightarrow> xb < length qs
[PROOF STEP]
using nth_mem
[PROOF STATE]
proof (prove)
using this:
?n < length ?xs \<Longrightarrow> ?xs ! ?n \<in> set ?xs

goal (1 subgoal):
 1. \<And>xa xb. \<lbrakk>\<forall>x. x \<in> set subsets \<longrightarrow> (\<forall>x\<in>set x. x < length qs); \<And>ell A. ell \<in> set (rows_to_keep A) \<Longrightarrow> ell < dim_row A; xa \<in> set (rows_to_keep (mat_of_cols (length subsets) (map ((!) (cols (M_mat signs subsets))) (find_nonzeros_from_input_vec (solve_for_lhs p qs subsets (M_mat signs subsets)))))); xb \<in> set (subsets ! xa)\<rbrakk> \<Longrightarrow> xb < length qs
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
using poly_type_hyp distinct_signs_hyp all_info_hyp pairwise_rel_prime_hyp welldefined_hyp
[PROOF STATE]
proof (prove)
using this:
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
p \<noteq> 0
distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
\<forall>q. List.member qs q \<longrightarrow> coprime p q
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
using matrix_equation
[PROOF STATE]
proof (prove)
using this:
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
p \<noteq> 0
distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
\<forall>q. List.member qs q \<longrightarrow> coprime p q
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
\<lbrakk>?p \<noteq> 0; distinct ?signs; set (characterize_consistent_signs_at_roots_copr ?p ?qs) \<subseteq> set ?signs; \<forall>q. List.member ?qs q \<longrightarrow> coprime ?p q; all_list_constr ?subsets (length ?qs)\<rbrakk> \<Longrightarrow> satisfy_equation ?p ?qs ?subsets ?signs

goal (1 subgoal):
 1. satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))
[PROOF STEP]
unfolding get_subsets_def get_signs_def
[PROOF STATE]
proof (prove)
using this:
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
p \<noteq> 0
distinct (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
set (characterize_consistent_signs_at_roots_copr p qs) \<subseteq> set (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
\<forall>q. List.member qs q \<longrightarrow> coprime p q
all_list_constr (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (length qs)
\<lbrakk>?p \<noteq> 0; distinct ?signs; set (characterize_consistent_signs_at_roots_copr ?p ?qs) \<subseteq> set ?signs; \<forall>q. List.member ?qs q \<longrightarrow> coprime ?p q; all_list_constr ?subsets (length ?qs)\<rbrakk> \<Longrightarrow> satisfy_equation ?p ?qs ?subsets ?signs

goal (1 subgoal):
 1. satisfy_equation p qs (fst (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs)))) (snd (snd (reduce_system p (qs, M_mat signs subsets, subsets, signs))))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
satisfy_equation p qs (get_subsets (reduce_system p (qs, M_mat signs subsets, subsets, signs))) (get_signs (reduce_system p (qs, M_mat signs subsets, subsets, signs)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma H_g_orbital:
  "P = (\<lambda>s. (\<forall>X\<in>ivp_sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t))) \<Longrightarrow>
  \<^bold>{P\<^bold>} (x\<acute>= f & G on U S @ t\<^sub>0) \<^bold>{Q\<^bold>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = (\<lambda>s. \<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)) \<Longrightarrow> \<^bold>{P\<^bold>}x\<acute>=f & G on U S @ t\<^sub>0\<^bold>{Q\<^bold>}
[PROOF STEP]
unfolding rel_kat_H g_ode_def g_orbital_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = (\<lambda>s. \<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> Q (X t)) \<Longrightarrow> \<forall>s s'. P s \<longrightarrow> (s, s') \<in> {(s, s') |s s'. s' \<in> {X t |t X. t \<in> U s \<and> \<P> X (down (U s) t) \<subseteq> Collect G \<and> X \<in> Sols f U S t\<^sub>0 s}} \<longrightarrow> Q s'
[PROOF STEP]
by clarsimp


[STATEMENT]
lemma dist_triangle_ineq: "dist x z \<le> dist x y + dist y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dist x z \<le> local.dist x y + local.dist y z
[PROOF STEP]
proof transfer
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x z y. N (x - z) \<le> N (x - y) + N (y - z)
[PROOF STEP]
fix x y z :: int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x z y. N (x - z) \<le> N (x - y) + N (y - z)
[PROOF STEP]
show "N (x - z) \<le> N (x - y) + N (y - z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N (x - z) \<le> N (x - y) + N (y - z)
[PROOF STEP]
using N_triangle_ineq[of "x - y" "y - z"]
[PROOF STATE]
proof (prove)
using this:
N (x - y + (y - z)) \<le> N (x - y) + N (y - z)

goal (1 subgoal):
 1. N (x - z) \<le> N (x - y) + N (y - z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
N (x - z) \<le> N (x - y) + N (y - z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_plus_minus_rangeE':
  assumes "y \<in> {-\<lfloor>real_of_int b/2\<rfloor>..\<lfloor>real_of_int b/2\<rfloor>}"
          "odd b"
  shows "y = y mod+- b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = y mod+- b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y = y mod+- b
[PROOF STEP]
have "(y + \<lfloor> real_of_int b / 2 \<rfloor>) \<in> {0..<b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y + \<lfloor>real_of_int b / 2\<rfloor> \<in> {0..<b}
[PROOF STEP]
using assms(1) odd_smaller_b[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
y \<in> {- \<lfloor>real_of_int b / 2\<rfloor>..\<lfloor>real_of_int b / 2\<rfloor>}
\<lfloor>real_of_int b / 2\<rfloor> + \<lfloor>real_of_int b / 2\<rfloor> < b

goal (1 subgoal):
 1. y + \<lfloor>real_of_int b / 2\<rfloor> \<in> {0..<b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y + \<lfloor>real_of_int b / 2\<rfloor> \<in> {0..<b}

goal (1 subgoal):
 1. y = y mod+- b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y + \<lfloor>real_of_int b / 2\<rfloor> \<in> {0..<b}
[PROOF STEP]
have "(y + \<lfloor> real_of_int b / 2 \<rfloor>) mod b =
    (y + \<lfloor> real_of_int b / 2 \<rfloor>)"
[PROOF STATE]
proof (prove)
using this:
y + \<lfloor>real_of_int b / 2\<rfloor> \<in> {0..<b}

goal (1 subgoal):
 1. (y + \<lfloor>real_of_int b / 2\<rfloor>) mod b = y + \<lfloor>real_of_int b / 2\<rfloor>
[PROOF STEP]
using mod_rangeE
[PROOF STATE]
proof (prove)
using this:
y + \<lfloor>real_of_int b / 2\<rfloor> \<in> {0..<b}
?a \<in> {0..<?b} \<Longrightarrow> ?a = ?a mod ?b

goal (1 subgoal):
 1. (y + \<lfloor>real_of_int b / 2\<rfloor>) mod b = y + \<lfloor>real_of_int b / 2\<rfloor>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(y + \<lfloor>real_of_int b / 2\<rfloor>) mod b = y + \<lfloor>real_of_int b / 2\<rfloor>

goal (1 subgoal):
 1. y = y mod+- b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(y + \<lfloor>real_of_int b / 2\<rfloor>) mod b = y + \<lfloor>real_of_int b / 2\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(y + \<lfloor>real_of_int b / 2\<rfloor>) mod b = y + \<lfloor>real_of_int b / 2\<rfloor>

goal (1 subgoal):
 1. y = y mod+- b
[PROOF STEP]
unfolding mod_plus_minus_def
[PROOF STATE]
proof (prove)
using this:
(y + \<lfloor>real_of_int b / 2\<rfloor>) mod b = y + \<lfloor>real_of_int b / 2\<rfloor>

goal (1 subgoal):
 1. y = (y + \<lfloor>real_of_int b / 2\<rfloor>) mod b - \<lfloor>real_of_int b / 2\<rfloor>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = y mod+- b

goal:
No subgoals!
[PROOF STEP]
qed