[STATEMENT]
lemma eq_ast:
"simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
= set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f))
          (simplicial_complex_induced_by_monotone_boolean_function m (snd f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) = set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<subseteq> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
 2. set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
show "set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f))
     (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
    \<subseteq> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m)
        (bool_fun_ast (n, m) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
fix \<gamma>::"nat set*nat set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
assume pert: "\<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f))
     (simplicial_complex_induced_by_monotone_boolean_function m (snd f))"
[PROOF STATE]
proof (state)
this:
\<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))

goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
hence f: "(fst \<gamma>) \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)"
[PROOF STATE]
proof (prove)
using this:
\<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))

goal (1 subgoal):
 1. fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
[PROOF STEP]
unfolding set_ast_def
[PROOF STATE]
proof (prove)
using this:
\<gamma> \<in> {c. \<exists>a\<in>simplicial_complex_induced_by_monotone_boolean_function n (fst f). \<exists>b\<in>simplicial_complex_induced_by_monotone_boolean_function m (snd f). c = (a, b)}

goal (1 subgoal):
 1. fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)

goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
have sigma: "fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
using simplicial_complex.simplicial_complex_implies_true [OF f]
[PROOF STATE]
proof (prove)
using this:
fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))

goal (1 subgoal):
 1. fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))

goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
from pert
[PROOF STATE]
proof (chain)
picking this:
\<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
have g: "(snd \<gamma>) \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)"
[PROOF STATE]
proof (prove)
using this:
\<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))

goal (1 subgoal):
 1. snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)
[PROOF STEP]
unfolding set_ast_def
[PROOF STATE]
proof (prove)
using this:
\<gamma> \<in> {c. \<exists>a\<in>simplicial_complex_induced_by_monotone_boolean_function n (fst f). \<exists>b\<in>simplicial_complex_induced_by_monotone_boolean_function m (snd f). c = (a, b)}

goal (1 subgoal):
 1. snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)

goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
have tau: "(snd f) (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
using simplicial_complex.simplicial_complex_implies_true [OF g]
[PROOF STATE]
proof (prove)
using this:
snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))

goal (1 subgoal):
 1. snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))

goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
from sigma and tau
[PROOF STATE]
proof (chain)
picking this:
fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
have sigtau: "bool_fun_ast (n, m) f
        ((simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)),
         (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)))"
[PROOF STATE]
proof (prove)
using this:
fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))

goal (1 subgoal):
 1. bool_fun_ast (n, m) f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
unfolding bool_fun_ast_def
[PROOF STATE]
proof (prove)
using this:
fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))

goal (1 subgoal):
 1. case (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) of (x, y) \<Rightarrow> fst f x \<and> snd f y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bool_fun_ast (n, m) f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))

goal (1 subgoal):
 1. \<And>x. x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
from sigtau
[PROOF STATE]
proof (chain)
picking this:
bool_fun_ast (n, m) f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
show "\<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m)
              (bool_fun_ast (n, m) f)"
[PROOF STATE]
proof (prove)
using this:
bool_fun_ast (n, m) f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))

goal (1 subgoal):
 1. \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
[PROOF STEP]
unfolding simplicial_complex_induced_by_monotone_boolean_function_ast_def
[PROOF STATE]
proof (prove)
using this:
bool_fun_ast (n, m) f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))

goal (1 subgoal):
 1. \<gamma> \<in> {z. \<exists>x y. dim_vec x = fst (n, m) \<and> dim_vec y = snd (n, m) \<and> bool_fun_ast (n, m) f (x, y) \<and> (ceros_of_boolean_input x, ceros_of_boolean_input y) = z}
[PROOF STEP]
unfolding bool_fun_ast_def
[PROOF STATE]
proof (prove)
using this:
case (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) of (x, y) \<Rightarrow> fst f x \<and> snd f y

goal (1 subgoal):
 1. \<gamma> \<in> {z. \<exists>x y. dim_vec x = fst (n, m) \<and> dim_vec y = snd (n, m) \<and> (case (x, y) of (x, y) \<Rightarrow> fst f x \<and> snd f y) \<and> (ceros_of_boolean_input x, ceros_of_boolean_input y) = z}
[PROOF STEP]
using sigma
[PROOF STATE]
proof (prove)
using this:
case (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>), simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) of (x, y) \<Rightarrow> fst f x \<and> snd f y
fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))

goal (1 subgoal):
 1. \<gamma> \<in> {z. \<exists>x y. dim_vec x = fst (n, m) \<and> dim_vec y = snd (n, m) \<and> (case (x, y) of (x, y) \<Rightarrow> fst f x \<and> snd f y) \<and> (ceros_of_boolean_input x, ceros_of_boolean_input y) = z}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)); fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))\<rbrakk> \<Longrightarrow> \<exists>x. dim_vec x = n \<and> (\<exists>y. dim_vec y = m \<and> fst f x \<and> snd f y \<and> (ceros_of_boolean_input x, ceros_of_boolean_input y) = \<gamma>)
[PROOF STEP]
using f g simplicial_complex_induced_by_monotone_boolean_function_def
[PROOF STATE]
proof (prove)
using this:
fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)
simplicial_complex_induced_by_monotone_boolean_function ?n ?f = {y. \<exists>x. dim_vec x = ?n \<and> ?f x \<and> ceros_of_boolean_input x = y}

goal (1 subgoal):
 1. \<lbrakk>snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)); fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))\<rbrakk> \<Longrightarrow> \<exists>x. dim_vec x = n \<and> (\<exists>y. dim_vec y = m \<and> fst f x \<and> snd f y \<and> (ceros_of_boolean_input x, ceros_of_boolean_input y) = \<gamma>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f)) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)

goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<subseteq> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<subseteq> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
show "simplicial_complex_induced_by_monotone_boolean_function_ast (n, m)
     (bool_fun_ast (n, m) f)
    \<subseteq> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f))
        (simplicial_complex_induced_by_monotone_boolean_function m (snd f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<subseteq> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<Longrightarrow> x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
fix \<gamma> :: "nat set*nat set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<Longrightarrow> x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
assume pert: "\<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m)
     (bool_fun_ast (n, m) f)"
[PROOF STATE]
proof (state)
this:
\<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<Longrightarrow> x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
have sigma: "(fst \<gamma>) \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
[PROOF STEP]
unfolding bool_fun_ast_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
[PROOF STEP]
unfolding simplicial_complex_induced_by_monotone_boolean_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst \<gamma> \<in> {y. \<exists>x. dim_vec x = n \<and> fst f x \<and> ceros_of_boolean_input x = y}
[PROOF STEP]
unfolding simplicial_complex_induced_by_monotone_boolean_function_ast_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst \<gamma> \<in> {y. \<exists>x. dim_vec x = n \<and> fst f x \<and> ceros_of_boolean_input x = y}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. dim_vec x = n \<and> fst f x \<and> ceros_of_boolean_input x = fst \<gamma>
[PROOF STEP]
apply (rule exI [of _ "simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)"], safe)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. dim_vec (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)) = n
 2. fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
 3. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)) \<Longrightarrow> x \<in> fst \<gamma>
 4. \<And>x. x \<in> fst \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
using simplicial_complex.bool_vec_from_simplice_def
[PROOF STATE]
proof (prove)
using this:
simplicial_complex.bool_vec_from_simplice ?n ?\<sigma> = vec ?n (\<lambda>i. i \<notin> ?\<sigma>)

goal (4 subgoals):
 1. dim_vec (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)) = n
 2. fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
 3. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)) \<Longrightarrow> x \<in> fst \<gamma>
 4. \<And>x. x \<in> fst \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. fst f (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
 2. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)) \<Longrightarrow> x \<in> fst \<gamma>
 3. \<And>x. x \<in> fst \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
apply (metis fst_conv pert simplicial_complex_ast_implies_fst_true)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)) \<Longrightarrow> x \<in> fst \<gamma>
 2. \<And>x. x \<in> fst \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
using ceros_of_boolean_input_def simplicial_complex.bool_vec_from_simplice_def
[PROOF STATE]
proof (prove)
using this:
ceros_of_boolean_input ?v = {x. x < dim_vec ?v \<and> ?v $ x = False}
simplicial_complex.bool_vec_from_simplice ?n ?\<sigma> = vec ?n (\<lambda>i. i \<notin> ?\<sigma>)

goal (2 subgoals):
 1. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>)) \<Longrightarrow> x \<in> fst \<gamma>
 2. \<And>x. x \<in> fst \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> fst \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
using ceros_of_boolean_input_def pert
          simplicial_complex.bool_vec_from_simplice_def
          simplicial_complex_induced_by_monotone_boolean_function_ast_def
[PROOF STATE]
proof (prove)
using this:
ceros_of_boolean_input ?v = {x. x < dim_vec ?v \<and> ?v $ x = False}
\<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
simplicial_complex.bool_vec_from_simplice ?n ?\<sigma> = vec ?n (\<lambda>i. i \<notin> ?\<sigma>)
simplicial_complex_induced_by_monotone_boolean_function_ast ?n ?f = {z. \<exists>x y. dim_vec x = fst ?n \<and> dim_vec y = snd ?n \<and> ?f (x, y) \<and> (ceros_of_boolean_input x, ceros_of_boolean_input y) = z}

goal (1 subgoal):
 1. \<And>x. x \<in> fst \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice n (fst \<gamma>))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<Longrightarrow> x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
have tau: "(snd \<gamma>) \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)
[PROOF STEP]
unfolding bool_fun_ast_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)
[PROOF STEP]
unfolding simplicial_complex_induced_by_monotone_boolean_function_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd \<gamma> \<in> {y. \<exists>x. dim_vec x = m \<and> snd f x \<and> ceros_of_boolean_input x = y}
[PROOF STEP]
unfolding simplicial_complex_induced_by_monotone_boolean_function_ast_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd \<gamma> \<in> {y. \<exists>x. dim_vec x = m \<and> snd f x \<and> ceros_of_boolean_input x = y}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. dim_vec x = m \<and> snd f x \<and> ceros_of_boolean_input x = snd \<gamma>
[PROOF STEP]
apply (rule exI [of _ "simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)"], safe)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. dim_vec (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) = m
 2. snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
 3. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) \<Longrightarrow> x \<in> snd \<gamma>
 4. \<And>x. x \<in> snd \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
using simplicial_complex.bool_vec_from_simplice_def
[PROOF STATE]
proof (prove)
using this:
simplicial_complex.bool_vec_from_simplice ?n ?\<sigma> = vec ?n (\<lambda>i. i \<notin> ?\<sigma>)

goal (4 subgoals):
 1. dim_vec (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) = m
 2. snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
 3. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) \<Longrightarrow> x \<in> snd \<gamma>
 4. \<And>x. x \<in> snd \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. snd f (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
 2. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) \<Longrightarrow> x \<in> snd \<gamma>
 3. \<And>x. x \<in> snd \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
apply (metis snd_conv pert simplicial_complex_ast_implies_snd_true)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) \<Longrightarrow> x \<in> snd \<gamma>
 2. \<And>x. x \<in> snd \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
using ceros_of_boolean_input_def simplicial_complex.bool_vec_from_simplice_def
[PROOF STATE]
proof (prove)
using this:
ceros_of_boolean_input ?v = {x. x < dim_vec ?v \<and> ?v $ x = False}
simplicial_complex.bool_vec_from_simplice ?n ?\<sigma> = vec ?n (\<lambda>i. i \<notin> ?\<sigma>)

goal (2 subgoals):
 1. \<And>x. x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>)) \<Longrightarrow> x \<in> snd \<gamma>
 2. \<And>x. x \<in> snd \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> snd \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
using ceros_of_boolean_input_def pert
        simplicial_complex.bool_vec_from_simplice_def
        simplicial_complex_induced_by_monotone_boolean_function_ast_def
[PROOF STATE]
proof (prove)
using this:
ceros_of_boolean_input ?v = {x. x < dim_vec ?v \<and> ?v $ x = False}
\<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f)
simplicial_complex.bool_vec_from_simplice ?n ?\<sigma> = vec ?n (\<lambda>i. i \<notin> ?\<sigma>)
simplicial_complex_induced_by_monotone_boolean_function_ast ?n ?f = {z. \<exists>x y. dim_vec x = fst ?n \<and> dim_vec y = snd ?n \<and> ?f (x, y) \<and> (ceros_of_boolean_input x, ceros_of_boolean_input y) = z}

goal (1 subgoal):
 1. \<And>x. x \<in> snd \<gamma> \<Longrightarrow> x \<in> ceros_of_boolean_input (simplicial_complex.bool_vec_from_simplice m (snd \<gamma>))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<Longrightarrow> x \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
from sigma and tau
[PROOF STATE]
proof (chain)
picking this:
fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)
[PROOF STEP]
show "\<gamma> \<in> set_ast
        (simplicial_complex_induced_by_monotone_boolean_function n (fst f))
        (simplicial_complex_induced_by_monotone_boolean_function m (snd f))"
[PROOF STATE]
proof (prove)
using this:
fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)

goal (1 subgoal):
 1. \<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
using set_ast_def
[PROOF STATE]
proof (prove)
using this:
fst \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (fst f)
snd \<gamma> \<in> simplicial_complex_induced_by_monotone_boolean_function m (snd f)
set_ast ?A ?B \<equiv> {c. \<exists>a\<in>?A. \<exists>b\<in>?B. c = (a, b)}

goal (1 subgoal):
 1. \<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<gamma> \<in> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
simplicial_complex_induced_by_monotone_boolean_function_ast (n, m) (bool_fun_ast (n, m) f) \<subseteq> set_ast (simplicial_complex_induced_by_monotone_boolean_function n (fst f)) (simplicial_complex_induced_by_monotone_boolean_function m (snd f))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma denote_trace:
  "well_com S \<Longrightarrow> \<rho> \<in> carrier_mat d d \<Longrightarrow> partial_density_operator \<rho>
   \<Longrightarrow> trace (denote S \<rho>) \<le> trace \<rho>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>well_com S; \<rho> \<in> carrier_mat d d; partial_density_operator \<rho>\<rbrakk> \<Longrightarrow> trace (denote S \<rho>) \<le> trace \<rho>
[PROOF STEP]
using denote_positive_trace_dim
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_com ?S; ?\<rho> \<in> carrier_mat d d; partial_density_operator ?\<rho>\<rbrakk> \<Longrightarrow> positive (denote ?S ?\<rho>) \<and> trace (denote ?S ?\<rho>) \<le> trace ?\<rho> \<and> denote ?S ?\<rho> \<in> carrier_mat d d

goal (1 subgoal):
 1. \<lbrakk>well_com S; \<rho> \<in> carrier_mat d d; partial_density_operator \<rho>\<rbrakk> \<Longrightarrow> trace (denote S \<rho>) \<le> trace \<rho>
[PROOF STEP]
by auto


[STATEMENT]
lemma godel_code_append_cons:
  "length xs = i \<Longrightarrow> godel_code' (xs@y#ys) (Suc 0)
    = godel_code' xs (Suc 0) * Pi (Suc i)^y * godel_code' ys (i + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = i \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (i + 2)
[PROOF STEP]
proof(induct "length xs" arbitrary: i y ys xs, simp add: godel_code'.simps,simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
fix x xs i y ys
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
assume ind:
    "\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow>
       godel_code' (xs @ y # ys) (Suc 0)
     = godel_code' xs (Suc 0) * Pi (Suc i) ^ y *
                             godel_code' ys (Suc (Suc i))"
    and h: "Suc x = i"
    "length (xs::nat list) = i"
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = ?i; length ?xs = ?i\<rbrakk> \<Longrightarrow> godel_code' (?xs @ ?y # ?ys) (Suc 0) = godel_code' ?xs (Suc 0) * Pi (Suc ?i) ^ ?y * godel_code' ?ys (Suc (Suc ?i))
Suc x = i
length xs = i

goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
have
    "godel_code' (butlast xs @ last xs # ((y::nat)#ys)) (Suc 0) =
        godel_code' (butlast xs) (Suc 0) * Pi (Suc (i - 1))^(last xs)
              * godel_code' (y#ys) (Suc (Suc (i - 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. godel_code' (butlast xs @ last xs # y # ys) (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi (Suc (i - 1)) ^ last xs * godel_code' (y # ys) (Suc (Suc (i - 1)))
[PROOF STEP]
apply(rule_tac ind)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x = i - 1
 2. length (butlast xs) = i - 1
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
Suc x = i
length xs = i

goal (2 subgoals):
 1. x = i - 1
 2. length (butlast xs) = i - 1
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
godel_code' (butlast xs @ last xs # y # ys) (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi (Suc (i - 1)) ^ last xs * godel_code' (y # ys) (Suc (Suc (i - 1)))

goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
godel_code' (butlast xs @ last xs # y # ys) (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi (Suc (i - 1)) ^ last xs * godel_code' (y # ys) (Suc (Suc (i - 1)))

goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
have
    "godel_code' xs (Suc 0)= godel_code' (butlast xs) (Suc 0) *
                                                  Pi (i)^(last xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs
[PROOF STEP]
using godel_code'_butlast_last_id[of xs] h
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> [] \<Longrightarrow> godel_code' xs (Suc ?j) = godel_code' (butlast xs) (Suc ?j) * Pi (length xs + ?j) ^ last xs
Suc x = i
length xs = i

goal (1 subgoal):
 1. godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs
[PROOF STEP]
apply(cases "xs = []", simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs

goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs

goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
have "butlast xs @ last xs # y # ys = xs @ y # ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast xs @ last xs # y # ys = xs @ y # ys
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
Suc x = i
length xs = i

goal (1 subgoal):
 1. butlast xs @ last xs # y # ys = xs @ y # ys
[PROOF STEP]
apply(cases xs, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
butlast xs @ last xs # y # ys = xs @ y # ys

goal (1 subgoal):
 1. \<And>x xs i y ys. \<lbrakk>\<And>xs i y ys. \<lbrakk>x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)); Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
godel_code' (butlast xs @ last xs # y # ys) (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi (Suc (i - 1)) ^ last xs * godel_code' (y # ys) (Suc (Suc (i - 1)))
godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs
butlast xs @ last xs # y # ys = xs @ y # ys
[PROOF STEP]
show
    "godel_code' (xs @ y # ys) (Suc 0) =
               godel_code' xs (Suc 0) * Pi (Suc i) ^ y *
                    godel_code' ys (Suc (Suc i))"
[PROOF STATE]
proof (prove)
using this:
godel_code' (butlast xs @ last xs # y # ys) (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi (Suc (i - 1)) ^ last xs * godel_code' (y # ys) (Suc (Suc (i - 1)))
godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs
butlast xs @ last xs # y # ys = xs @ y # ys

goal (1 subgoal):
 1. godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
godel_code' (butlast xs @ last xs # y # ys) (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi (Suc (i - 1)) ^ last xs * godel_code' (y # ys) (Suc (Suc (i - 1)))
godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs
butlast xs @ last xs # y # ys = xs @ y # ys
Suc x = i
length xs = i

goal (1 subgoal):
 1. godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))
[PROOF STEP]
apply(simp add: godel_code'_not0 Pi_not_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>godel_code' (xs @ y # ys) (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs * godel_code' (y # ys) (Suc i); godel_code' xs (Suc 0) = godel_code' (butlast xs) (Suc 0) * Pi i ^ last xs; butlast xs @ [last xs] = xs; Suc x = i; length xs = i\<rbrakk> \<Longrightarrow> godel_code' (y # ys) (Suc i) = Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i)) \<or> Pi i = 0 \<and> 0 < last xs
[PROOF STEP]
apply(simp add: godel_code'.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
godel_code' (xs @ y # ys) (Suc 0) = godel_code' xs (Suc 0) * Pi (Suc i) ^ y * godel_code' ys (Suc (Suc i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closedin_Un_complement_component:
  fixes S :: "'a::real_normed_vector set"
  assumes u: "locally connected u"
      and S: "closedin (top_of_set u) S"
      and c: " c \<in> components(u - S)"
    shows "closedin (top_of_set u) (S \<union> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set u) (S \<union> c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin (top_of_set u) (S \<union> c)
[PROOF STEP]
have "closedin (top_of_set u) (S \<union> \<Union>{c})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set u) (S \<union> \<Union> {c})
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
c \<in> components (u - S)

goal (1 subgoal):
 1. closedin (top_of_set u) (S \<union> \<Union> {c})
[PROOF STEP]
by (blast intro: closedin_union_complement_components [OF u S])
[PROOF STATE]
proof (state)
this:
closedin (top_of_set u) (S \<union> \<Union> {c})

goal (1 subgoal):
 1. closedin (top_of_set u) (S \<union> c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closedin (top_of_set u) (S \<union> \<Union> {c})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set u) (S \<union> \<Union> {c})

goal (1 subgoal):
 1. closedin (top_of_set u) (S \<union> c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closedin (top_of_set u) (S \<union> c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<forall>x. p a \<and> (p x \<longrightarrow> p(f x)) \<longrightarrow> p(f(f x)))  =
      (\<forall>x. (\<not> p a \<or> p x \<or> p(f(f x))) \<and>
              (\<not> p a \<or> \<not> p(f x) \<or> p(f(f x))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. p a \<and> (p x \<longrightarrow> p (f x)) \<longrightarrow> p (f (f x))) = (\<forall>x. (\<not> p a \<or> p x \<or> p (f (f x))) \<and> (\<not> p a \<or> \<not> p (f x) \<or> p (f (f x))))
[PROOF STEP]
by blast


[STATEMENT]
theorem wls_substEnv_compose2:
assumes  "wlsEnv rho" and "wls (asSort ys) Y" and "wls (asSort zs) Z"
and "ys \<noteq> zs \<or> y \<noteq> z" and fresh: "fresh ys y Z"
shows "((rho &[Y / y]_ys) &[Z / z]_zs) = ((rho &[Z / z]_zs) &[(Y #[Z / z]_zs) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[Y / y]_ys &[Z / z]_zs = rho &[Z / z]_zs &[Y #[Z / z]_zs / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho
wls (asSort ys) Y
wls (asSort zs) Z
ys \<noteq> zs \<or> y \<noteq> z
fresh ys y Z

goal (1 subgoal):
 1. rho &[Y / y]_ys &[Z / z]_zs = rho &[Z / z]_zs &[Y #[Z / z]_zs / y]_ys
[PROOF STEP]
by(simp add: substEnv_compose2)


[STATEMENT]
lemma INFM_Suc[simp]: "(\<exists>\<^sub>\<infinity> i. P (Suc i)) \<longleftrightarrow> (\<exists>\<^sub>\<infinity> i. P i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>i. P (Suc i)) = (\<exists>\<^sub>\<infinity>i. P i)
[PROOF STEP]
unfolding INFM_nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m. \<exists>n>m. P (Suc n)) = (\<forall>m. \<exists>n>m. P n)
[PROOF STEP]
using Suc_lessE less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Suc ?i < ?k; \<And>j. \<lbrakk>?i < j; ?k = Suc j\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
(?m < Suc ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. (\<forall>m. \<exists>n>m. P (Suc n)) = (\<forall>m. \<exists>n>m. P n)
[PROOF STEP]
by metis


[STATEMENT]
lemma c_offending_flows_subseteq_edges: "configured_SecurityInvariant m \<Longrightarrow> \<Union>(c_offending_flows m G) \<subseteq> edges G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. configured_SecurityInvariant m \<Longrightarrow> \<Union> (c_offending_flows m G) \<subseteq> edges G
[PROOF STEP]
apply(clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b X. \<lbrakk>configured_SecurityInvariant m; (a, b) \<in> X; X \<in> c_offending_flows m G\<rbrakk> \<Longrightarrow> (a, b) \<in> edges G
[PROOF STEP]
apply(simp only: configured_SecurityInvariant.valid_c_offending_flows)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b X. \<lbrakk>configured_SecurityInvariant m; (a, b) \<in> X; X \<in> {F. F \<subseteq> edges G \<and> \<not> c_sinvar m G \<and> c_sinvar m (delete_edges G F) \<and> (\<forall>(e1, e2)\<in>F. \<not> c_sinvar m (add_edge e1 e2 (delete_edges G F)))}\<rbrakk> \<Longrightarrow> (a, b) \<in> edges G
[PROOF STEP]
apply(thin_tac "configured_SecurityInvariant x" for x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b X. \<lbrakk>(a, b) \<in> X; X \<in> {F. F \<subseteq> edges G \<and> \<not> c_sinvar m G \<and> c_sinvar m (delete_edges G F) \<and> (\<forall>(e1, e2)\<in>F. \<not> c_sinvar m (add_edge e1 e2 (delete_edges G F)))}\<rbrakk> \<Longrightarrow> (a, b) \<in> edges G
[PROOF STEP]
by auto


[STATEMENT]
lemma qbs_normal_distribution_integral:
 "(\<integral>\<^sub>Q x. f x \<partial> (qbs_normal_distribution \<mu> \<sigma>)) = (\<integral> x. f x \<partial> (density lborel (\<lambda>x. ennreal (normal_density \<mu> \<sigma> x))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_prob_integral (qbs_normal_distribution \<mu> \<sigma>) f = integral\<^sup>L (density lborel (\<lambda>x. ennreal (normal_density \<mu> \<sigma> x))) f
[PROOF STEP]
by(simp add: qbs_normal_distribution_def2 n_dist.integral_as_qbs_integral)
    (simp add: normal_distribution_def sigma)


[STATEMENT]
lemma has_derivative_proj:
  fixes j::"('a::finite)"
  fixes f::"'a \<Rightarrow> real \<Rightarrow> real"
  assumes assm:"((\<lambda>x. \<chi> i. f i x) has_derivative (\<lambda>h. \<chi> i. f' i h)) F"
  shows "((\<lambda>x. f j x) has_derivative (\<lambda>h. f' j h)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f j has_derivative f' j) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f j has_derivative f' j) F
[PROOF STEP]
have bounded_proj:"bounded_linear (\<lambda> x::(real^'a). x $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>x. x $ j)
[PROOF STEP]
by (simp add: bounded_linear_vec_nth)
[PROOF STATE]
proof (state)
this:
bounded_linear (\<lambda>x. x $ j)

goal (1 subgoal):
 1. (f j has_derivative f' j) F
[PROOF STEP]
show "?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f j has_derivative f' j) F
[PROOF STEP]
using bounded_linear.has_derivative[OF bounded_proj, of "(\<lambda>x. \<chi> i. f i x)" "(\<lambda>h. \<chi> i. f' i h)", OF assm]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. (\<chi>i. f i x) $ j) has_derivative (\<lambda>x. (\<chi>i. f' i x) $ j)) F

goal (1 subgoal):
 1. (f j has_derivative f' j) F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f j has_derivative f' j) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_elem_one_plus_i_gauss_int: "prime_elem (1 + \<i>\<^sub>\<int>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_elem (1 + \<i>\<^sub>\<int>)
[PROOF STEP]
by (rule prime_gauss_int_norm_imp_prime_elem) (auto simp: gauss_int_norm_def)


[STATEMENT]
lemma vec_vs_col: "vectorspace (class_ring :: 'a :: field ring)
  (module_vec TYPE('a) (dim_row A)
      \<lparr>carrier :=
         LinearCombinations.module.span
          class_ring
          (module_vec TYPE('a)
            (dim_row A))
          (set (cols A))\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace class_ring (module_vec TYPE('a) (dim_row A)\<lparr>carrier := LinearCombinations.module.span class_ring (module_vec TYPE('a) (dim_row A)) (set (cols A))\<rparr>)
[PROOF STEP]
unfolding vectorspace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module class_ring (module_vec TYPE('a) (dim_row A)\<lparr>carrier := LinearCombinations.module.span class_ring (module_vec TYPE('a) (dim_row A)) (set (cols A))\<rparr>) \<and> field class_ring
[PROOF STEP]
using vec_module_col class_field
[PROOF STATE]
proof (prove)
using this:
module class_ring (module_vec TYPE(?'a) (dim_row ?A)\<lparr>carrier := LinearCombinations.module.span class_ring (module_vec TYPE(?'a) (dim_row ?A)) (set (cols ?A))\<rparr>)
field class_ring

goal (1 subgoal):
 1. module class_ring (module_vec TYPE('a) (dim_row A)\<lparr>carrier := LinearCombinations.module.span class_ring (module_vec TYPE('a) (dim_row A)) (set (cols A))\<rparr>) \<and> field class_ring
[PROOF STEP]
by (auto simp: class_field_def)


[STATEMENT]
lemma self_mult_gauss_cnj: "z * gauss_cnj z = of_nat (gauss_int_norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z * gauss_cnj z = of_nat (gauss_int_norm z)
[PROOF STEP]
by (simp add: gauss_int_norm_def gauss_int_eq_iff algebra_simps power2_eq_square)


[STATEMENT]
lemma construct_lhs_vector_cleaner_R:
  assumes "p \<noteq> 0"
  shows "(construct_lhs_vector_R p qs signs) =
   vec_of_list (map (\<lambda>s. rat_of_int (card {x. poly p x = 0 \<and> ((consistent_sign_vec qs x) = s)})) signs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. construct_lhs_vector_R p qs signs = vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = s}))) signs)
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = s}))) signs)) \<Longrightarrow> construct_lhs_vector_R p qs signs $ i = vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = s}))) signs) $ i
 2. dim_vec (construct_lhs_vector_R p qs signs) = dim_vec (vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = s}))) signs))
[PROOF STEP]
apply (auto simp add:  construct_lhs_vector_clean_R[OF assms] )
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> construct_lhs_vector_R p qs signs $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = vec_of_list signs $ i})
 2. dim_vec (construct_lhs_vector_R p qs signs) = length signs
[PROOF STEP]
apply (simp add: vec_of_list_index)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> construct_lhs_vector_R p qs signs $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = signs ! i})
 2. dim_vec (construct_lhs_vector_R p qs signs) = length signs
[PROOF STEP]
unfolding construct_lhs_vector_R_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec qs) (characterize_root_list_p p)))))) signs) $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = signs ! i})
 2. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
using assms construct_lhs_vector_clean_R construct_lhs_vector_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
\<lbrakk>?p \<noteq> 0; ?i < length ?signs\<rbrakk> \<Longrightarrow> of_rat (construct_lhs_vector_R ?p ?qs ?signs $ ?i) = of_nat (card {x. poly ?p x = 0 \<and> consistent_sign_vec ?qs x = ?signs ! ?i})
w_vec ?p ?qs ?signs \<equiv> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr ?qs) (characterize_root_list_p ?p)))))) ?signs)

goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec qs) (characterize_root_list_p p)))))) signs) $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = signs ! i})
 2. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>i < length signs; p \<noteq> 0; \<And>p i signs qs. \<lbrakk>p \<noteq> 0; i < length signs\<rbrakk> \<Longrightarrow> of_rat (construct_lhs_vector_R p qs signs $ i) = of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec qs x = signs ! i}); \<And>p qs signs. w_vec p qs signs \<equiv> map_vec (\<lambda>w. rat_of_nat (length (filter ((\<lambda>v. v = w) \<circ> consistent_sign_vec_copr qs) (characterize_root_list_p p)))) (vec_of_list signs)\<rbrakk> \<Longrightarrow> length (filter ((\<lambda>v. v = vec_of_list signs $ i) \<circ> consistent_sign_vec qs) (characterize_root_list_p p)) = card {x. poly p x = 0 \<and> consistent_sign_vec qs x = signs ! i}
 2. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
apply (simp add: construct_lhs_vector_R_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
by auto


[STATEMENT]
lemma distance_cross_ratio_real_positive:
  assumes "u \<in> unit_disc" and "v \<in> unit_disc" and "u \<noteq> v"
  shows "\<forall> i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow>
                  cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> Re_cross_ratio u i1 v i2 > 0" (is "?P u v")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
proof (rule wlog_positive_x_axis[OF assms])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
assume *: "is_real x" "0 < Re x" "Re x < 1"
[PROOF STATE]
proof (state)
this:
is_real x
0 < Re x
Re x < 1

goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
hence "x \<noteq> -1" "x \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
is_real x
0 < Re x
Re x < 1

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

goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
hence **: "of_complex x \<noteq> \<infinity>\<^sub>h" "of_complex x \<noteq> 0\<^sub>h" "of_complex x \<noteq> of_complex (-1)" "of_complex 1 \<noteq> of_complex x"
        "of_complex x \<in> circline_set x_axis"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> - 1
x \<noteq> 1

goal (1 subgoal):
 1. (of_complex x \<noteq> \<infinity>\<^sub>h &&& of_complex x \<noteq> 0\<^sub>h) &&& of_complex x \<noteq> of_complex (- 1) &&& of_complex 1 \<noteq> of_complex x &&& of_complex x \<in> circline_set x_axis
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
x \<noteq> - 1
x \<noteq> 1
is_real x
0 < Re x
Re x < 1

goal (1 subgoal):
 1. (of_complex x \<noteq> \<infinity>\<^sub>h &&& of_complex x \<noteq> 0\<^sub>h) &&& of_complex x \<noteq> of_complex (- 1) &&& of_complex 1 \<noteq> of_complex x &&& of_complex x \<in> circline_set x_axis
[PROOF STEP]
unfolding circline_set_x_axis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> - 1
x \<noteq> 1
is_real x
0 < Re x
Re x < 1

goal (1 subgoal):
 1. (of_complex x \<noteq> \<infinity>\<^sub>h &&& of_complex x \<noteq> 0\<^sub>h) &&& of_complex x \<noteq> of_complex (- 1) &&& of_complex 1 \<noteq> of_complex x &&& of_complex x \<in> of_complex ` {x. is_real x} \<union> {\<infinity>\<^sub>h}
[PROOF STEP]
by (auto simp add: of_complex_inj)
[PROOF STATE]
proof (state)
this:
of_complex x \<noteq> \<infinity>\<^sub>h
of_complex x \<noteq> 0\<^sub>h
of_complex x \<noteq> of_complex (- 1)
of_complex 1 \<noteq> of_complex x
of_complex x \<in> circline_set x_axis

goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
have ***:  "0\<^sub>h \<noteq> of_complex (-1)" "0\<^sub>h \<noteq> of_complex 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>h \<noteq> of_complex (- 1) &&& 0\<^sub>h \<noteq> of_complex 1
[PROOF STEP]
by (metis of_complex_zero_iff zero_neq_neg_one, simp)
[PROOF STATE]
proof (state)
this:
0\<^sub>h \<noteq> of_complex (- 1)
0\<^sub>h \<noteq> of_complex 1

goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
have ****: "- x - 1 \<noteq> 0" "x - 1 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x - 1 \<noteq> 0 &&& x - 1 \<noteq> 0
[PROOF STEP]
using \<open>x \<noteq> -1\<close> \<open>x \<noteq> 1\<close>
[PROOF STATE]
proof (prove)
using this:
x \<noteq> - 1
x \<noteq> 1

goal (1 subgoal):
 1. - x - 1 \<noteq> 0 &&& x - 1 \<noteq> 0
[PROOF STEP]
by (metis add.inverse_inverse eq_iff_diff_eq_0, simp)
[PROOF STATE]
proof (state)
this:
- x - 1 \<noteq> 0
x - 1 \<noteq> 0

goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
have "poincare_line 0\<^sub>h (of_complex x) = x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_line 0\<^sub>h (of_complex x) = x_axis
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
of_complex x \<noteq> \<infinity>\<^sub>h
of_complex x \<noteq> 0\<^sub>h
of_complex x \<noteq> of_complex (- 1)
of_complex 1 \<noteq> of_complex x
of_complex x \<in> circline_set x_axis

goal (1 subgoal):
 1. poincare_line 0\<^sub>h (of_complex x) = x_axis
[PROOF STEP]
by (simp add: poincare_line_0_real_is_x_axis)
[PROOF STATE]
proof (state)
this:
poincare_line 0\<^sub>h (of_complex x) = x_axis

goal (2 subgoals):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
 2. \<And>x. \<lbrakk>is_real x; 0 < Re x; Re x < 1\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
thus "?P 0\<^sub>h (of_complex x)"
[PROOF STATE]
proof (prove)
using this:
poincare_line 0\<^sub>h (of_complex x) = x_axis

goal (1 subgoal):
 1. \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
using * ** *** ****
[PROOF STATE]
proof (prove)
using this:
poincare_line 0\<^sub>h (of_complex x) = x_axis
is_real x
0 < Re x
Re x < 1
of_complex x \<noteq> \<infinity>\<^sub>h
of_complex x \<noteq> 0\<^sub>h
of_complex x \<noteq> of_complex (- 1)
of_complex 1 \<noteq> of_complex x
of_complex x \<in> circline_set x_axis
0\<^sub>h \<noteq> of_complex (- 1)
0\<^sub>h \<noteq> of_complex 1
- x - 1 \<noteq> 0
x - 1 \<noteq> 0

goal (1 subgoal):
 1. \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
using cross_ratio_not_inf[of "0\<^sub>h" "of_complex 1" "of_complex (-1)" "of_complex x"]
[PROOF STATE]
proof (prove)
using this:
poincare_line 0\<^sub>h (of_complex x) = x_axis
is_real x
0 < Re x
Re x < 1
of_complex x \<noteq> \<infinity>\<^sub>h
of_complex x \<noteq> 0\<^sub>h
of_complex x \<noteq> of_complex (- 1)
of_complex 1 \<noteq> of_complex x
of_complex x \<in> circline_set x_axis
0\<^sub>h \<noteq> of_complex (- 1)
0\<^sub>h \<noteq> of_complex 1
- x - 1 \<noteq> 0
x - 1 \<noteq> 0
\<lbrakk>0\<^sub>h \<noteq> of_complex 1; of_complex (- 1) \<noteq> of_complex x\<rbrakk> \<Longrightarrow> cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) (of_complex 1) \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
using cross_ratio_not_inf[of "0\<^sub>h" "of_complex (-1)" "of_complex 1" "of_complex x"]
[PROOF STATE]
proof (prove)
using this:
poincare_line 0\<^sub>h (of_complex x) = x_axis
is_real x
0 < Re x
Re x < 1
of_complex x \<noteq> \<infinity>\<^sub>h
of_complex x \<noteq> 0\<^sub>h
of_complex x \<noteq> of_complex (- 1)
of_complex 1 \<noteq> of_complex x
of_complex x \<in> circline_set x_axis
0\<^sub>h \<noteq> of_complex (- 1)
0\<^sub>h \<noteq> of_complex 1
- x - 1 \<noteq> 0
x - 1 \<noteq> 0
\<lbrakk>0\<^sub>h \<noteq> of_complex 1; of_complex (- 1) \<noteq> of_complex x\<rbrakk> \<Longrightarrow> cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) (of_complex 1) \<noteq> \<infinity>\<^sub>h
\<lbrakk>0\<^sub>h \<noteq> of_complex (- 1); of_complex 1 \<noteq> of_complex x\<rbrakk> \<Longrightarrow> cross_ratio 0\<^sub>h (of_complex 1) (of_complex x) (of_complex (- 1)) \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
using cross_ratio_real[of 0 "-1" x 1] cross_ratio_real[of 0 1 x "-1"]
[PROOF STATE]
proof (prove)
using this:
poincare_line 0\<^sub>h (of_complex x) = x_axis
is_real x
0 < Re x
Re x < 1
of_complex x \<noteq> \<infinity>\<^sub>h
of_complex x \<noteq> 0\<^sub>h
of_complex x \<noteq> of_complex (- 1)
of_complex 1 \<noteq> of_complex x
of_complex x \<in> circline_set x_axis
0\<^sub>h \<noteq> of_complex (- 1)
0\<^sub>h \<noteq> of_complex 1
- x - 1 \<noteq> 0
x - 1 \<noteq> 0
\<lbrakk>0\<^sub>h \<noteq> of_complex 1; of_complex (- 1) \<noteq> of_complex x\<rbrakk> \<Longrightarrow> cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) (of_complex 1) \<noteq> \<infinity>\<^sub>h
\<lbrakk>0\<^sub>h \<noteq> of_complex (- 1); of_complex 1 \<noteq> of_complex x\<rbrakk> \<Longrightarrow> cross_ratio 0\<^sub>h (of_complex 1) (of_complex x) (of_complex (- 1)) \<noteq> \<infinity>\<^sub>h
\<lbrakk>is_real 0; is_real (- 1); is_real x; is_real 1; 0 \<noteq> - 1 \<and> x \<noteq> 1 \<or> 0 \<noteq> 1 \<and> - 1 \<noteq> x\<rbrakk> \<Longrightarrow> is_real (to_complex (cross_ratio (of_complex 0) (of_complex (- 1)) (of_complex x) (of_complex 1)))
\<lbrakk>is_real 0; is_real 1; is_real x; is_real (- 1); 0 \<noteq> 1 \<and> x \<noteq> - 1 \<or> 0 \<noteq> - 1 \<and> 1 \<noteq> x\<rbrakk> \<Longrightarrow> is_real (to_complex (cross_ratio (of_complex 0) (of_complex 1) (of_complex x) (of_complex (- 1))))

goal (1 subgoal):
 1. \<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2
[PROOF STEP]
apply (auto simp add: poincare_line_0_real_is_x_axis doubleton_eq_iff circline_set_x_axis)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>is_real x; 0 < Re x; Re x < 1; x \<noteq> 0; of_complex x \<noteq> of_complex (- 1); 1\<^sub>h \<noteq> of_complex x; 0\<^sub>h \<noteq> of_complex (- 1); - x \<noteq> 1; x \<noteq> 1; cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) 1\<^sub>h \<noteq> \<infinity>\<^sub>h; cross_ratio 0\<^sub>h 1\<^sub>h (of_complex x) (of_complex (- 1)) \<noteq> \<infinity>\<^sub>h; is_real (to_complex (cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) 1\<^sub>h)); is_real (to_complex (cross_ratio 0\<^sub>h 1\<^sub>h (of_complex x) (of_complex (- 1))))\<rbrakk> \<Longrightarrow> 0 < Re_cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) 1\<^sub>h
 2. \<lbrakk>is_real x; 0 < Re x; Re x < 1; x \<noteq> 0; of_complex x \<noteq> of_complex (- 1); 1\<^sub>h \<noteq> of_complex x; 0\<^sub>h \<noteq> of_complex (- 1); - x \<noteq> 1; x \<noteq> 1; cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) 1\<^sub>h \<noteq> \<infinity>\<^sub>h; cross_ratio 0\<^sub>h 1\<^sub>h (of_complex x) (of_complex (- 1)) \<noteq> \<infinity>\<^sub>h; is_real (to_complex (cross_ratio 0\<^sub>h (of_complex (- 1)) (of_complex x) 1\<^sub>h)); is_real (to_complex (cross_ratio 0\<^sub>h 1\<^sub>h (of_complex x) (of_complex (- 1))))\<rbrakk> \<Longrightarrow> 0 < Re_cross_ratio 0\<^sub>h 1\<^sub>h (of_complex x) (of_complex (- 1))
[PROOF STEP]
apply (subst cross_ratio, simp_all, subst Re_complex_div_gt_0, simp, subst mult_neg_neg, simp_all)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>i1 i2. ideal_points (poincare_line 0\<^sub>h (of_complex x)) = {i1, i2} \<longrightarrow> cross_ratio 0\<^sub>h i1 (of_complex x) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio 0\<^sub>h i1 (of_complex x) i2)) \<and> 0 < Re_cross_ratio 0\<^sub>h i1 (of_complex x) i2

goal (1 subgoal):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
fix M u v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
let ?Mu = "moebius_pt M u" and ?Mv = "moebius_pt M v"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
assume *: "unit_disc_fix M" "u \<in> unit_disc" "v \<in> unit_disc" "u \<noteq> v"
            "?P ?Mu ?Mv"
[PROOF STATE]
proof (state)
this:
unit_disc_fix M
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> v
\<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2

goal (1 subgoal):
 1. \<And>M u v. \<lbrakk>unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; \<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
show "?P u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i1 i2. \<lbrakk>ideal_points (poincare_line u v) = {i1, i2}; cross_ratio u i1 v i2 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> False
 2. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> is_real (to_complex (cross_ratio u i1 v i2))
 3. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
fix i1 i2
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i1 i2. \<lbrakk>ideal_points (poincare_line u v) = {i1, i2}; cross_ratio u i1 v i2 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> False
 2. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> is_real (to_complex (cross_ratio u i1 v i2))
 3. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
let ?cr = "cross_ratio u i1 v i2"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i1 i2. \<lbrakk>ideal_points (poincare_line u v) = {i1, i2}; cross_ratio u i1 v i2 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> False
 2. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> is_real (to_complex (cross_ratio u i1 v i2))
 3. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
assume **: "ideal_points (poincare_line u v) = {i1, i2}"
[PROOF STATE]
proof (state)
this:
ideal_points (poincare_line u v) = {i1, i2}

goal (3 subgoals):
 1. \<And>i1 i2. \<lbrakk>ideal_points (poincare_line u v) = {i1, i2}; cross_ratio u i1 v i2 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> False
 2. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> is_real (to_complex (cross_ratio u i1 v i2))
 3. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
have "i1 \<noteq> u" "i1 \<noteq> v" "i2 \<noteq> u" "i2 \<noteq> v" "i1 \<noteq> i2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i1 \<noteq> u &&& i1 \<noteq> v) &&& i2 \<noteq> u &&& i2 \<noteq> v &&& i1 \<noteq> i2
[PROOF STEP]
using ideal_points_different[OF *(2-3), of i1 i2] ** \<open>u \<noteq> v\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>u \<noteq> v; ideal_points (poincare_line u v) = {i1, i2}\<rbrakk> \<Longrightarrow> i1 \<noteq> i2
\<lbrakk>u \<noteq> v; ideal_points (poincare_line u v) = {i1, i2}\<rbrakk> \<Longrightarrow> u \<noteq> i1
\<lbrakk>u \<noteq> v; ideal_points (poincare_line u v) = {i1, i2}\<rbrakk> \<Longrightarrow> u \<noteq> i2
\<lbrakk>u \<noteq> v; ideal_points (poincare_line u v) = {i1, i2}\<rbrakk> \<Longrightarrow> v \<noteq> i1
\<lbrakk>u \<noteq> v; ideal_points (poincare_line u v) = {i1, i2}\<rbrakk> \<Longrightarrow> v \<noteq> i2
ideal_points (poincare_line u v) = {i1, i2}
u \<noteq> v

goal (1 subgoal):
 1. (i1 \<noteq> u &&& i1 \<noteq> v) &&& i2 \<noteq> u &&& i2 \<noteq> v &&& i1 \<noteq> i2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i1 \<noteq> u
i1 \<noteq> v
i2 \<noteq> u
i2 \<noteq> v
i1 \<noteq> i2

goal (3 subgoals):
 1. \<And>i1 i2. \<lbrakk>ideal_points (poincare_line u v) = {i1, i2}; cross_ratio u i1 v i2 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> False
 2. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> is_real (to_complex (cross_ratio u i1 v i2))
 3. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
hence "0 < Re (to_complex ?cr) \<and> is_real (to_complex ?cr) \<and> ?cr \<noteq> \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
using this:
i1 \<noteq> u
i1 \<noteq> v
i2 \<noteq> u
i2 \<noteq> v
i1 \<noteq> i2

goal (1 subgoal):
 1. 0 < Re_cross_ratio u i1 v i2 \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
i1 \<noteq> u
i1 \<noteq> v
i2 \<noteq> u
i2 \<noteq> v
i1 \<noteq> i2
unit_disc_fix M
u \<in> unit_disc
v \<in> unit_disc
u \<noteq> v
\<forall>i1 i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) i1 (moebius_pt M v) i2
ideal_points (poincare_line u v) = {i1, i2}

goal (1 subgoal):
 1. 0 < Re_cross_ratio u i1 v i2 \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
apply (erule_tac x="moebius_pt M i1" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i1 \<noteq> u; i1 \<noteq> v; i2 \<noteq> u; i2 \<noteq> v; i1 \<noteq> i2; unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; ideal_points (poincare_line u v) = {i1, i2}; \<forall>i2. ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {moebius_pt M i1, i2} \<longrightarrow> cross_ratio (moebius_pt M u) (moebius_pt M i1) (moebius_pt M v) i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) (moebius_pt M i1) (moebius_pt M v) i2)) \<and> 0 < Re_cross_ratio (moebius_pt M u) (moebius_pt M i1) (moebius_pt M v) i2\<rbrakk> \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2 \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
apply (erule_tac x="moebius_pt M i2" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i1 \<noteq> u; i1 \<noteq> v; i2 \<noteq> u; i2 \<noteq> v; i1 \<noteq> i2; unit_disc_fix M; u \<in> unit_disc; v \<in> unit_disc; u \<noteq> v; ideal_points (poincare_line u v) = {i1, i2}; ideal_points (poincare_line (moebius_pt M u) (moebius_pt M v)) = {moebius_pt M i1, moebius_pt M i2} \<longrightarrow> cross_ratio (moebius_pt M u) (moebius_pt M i1) (moebius_pt M v) (moebius_pt M i2) \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio (moebius_pt M u) (moebius_pt M i1) (moebius_pt M v) (moebius_pt M i2))) \<and> 0 < Re_cross_ratio (moebius_pt M u) (moebius_pt M i1) (moebius_pt M v) (moebius_pt M i2)\<rbrakk> \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2 \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
apply (subst (asm) ideal_points_poincare_line_moebius[of M u v i1 i2], simp_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
0 < Re_cross_ratio u i1 v i2 \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h

goal (3 subgoals):
 1. \<And>i1 i2. \<lbrakk>ideal_points (poincare_line u v) = {i1, i2}; cross_ratio u i1 v i2 = \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> False
 2. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> is_real (to_complex (cross_ratio u i1 v i2))
 3. \<And>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<Longrightarrow> 0 < Re_cross_ratio u i1 v i2
[PROOF STEP]
thus "0 < Re (to_complex ?cr)" "is_real (to_complex ?cr)" "?cr = \<infinity>\<^sub>h \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
0 < Re_cross_ratio u i1 v i2 \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. 0 < Re_cross_ratio u i1 v i2 &&& is_real (to_complex (cross_ratio u i1 v i2)) &&& (cross_ratio u i1 v i2 = \<infinity>\<^sub>h \<Longrightarrow> False)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 < Re_cross_ratio u i1 v i2
is_real (to_complex (cross_ratio u i1 v i2))
cross_ratio u i1 v i2 = \<infinity>\<^sub>h \<Longrightarrow> False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i1 i2. ideal_points (poincare_line u v) = {i1, i2} \<longrightarrow> cross_ratio u i1 v i2 \<noteq> \<infinity>\<^sub>h \<and> is_real (to_complex (cross_ratio u i1 v i2)) \<and> 0 < Re_cross_ratio u i1 v i2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma listrel1_converse: "listrel1 (r\<inverse>) = (listrel1 r)\<inverse>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listrel1 (r\<inverse>) = (listrel1 r)\<inverse>
[PROOF STEP]
unfolding listrel1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(xs, ys). \<exists>us z z' vs. xs = us @ z # vs \<and> (z, z') \<in> r\<inverse> \<and> ys = us @ z' # vs} = {(xs, ys). \<exists>us z z' vs. xs = us @ z # vs \<and> (z, z') \<in> r \<and> ys = us @ z' # vs}\<inverse>
[PROOF STEP]
by blast


[STATEMENT]
lemma integrable_\<phi>2: "integrable lborel (\<lambda>x. \<phi> p x * \<phi> q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. \<phi> p x * \<phi> q x)
[PROOF STEP]
proof (cases p q rule: prod.exhaust[case_product prod.exhaust])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1__ x2__ x1a__ x2a__. \<lbrakk>p = (x1__, x2__); q = (x1a__, x2a__)\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>x. \<phi> p x * \<phi> q x)
[PROOF STEP]
case (Pair_Pair l i l' i')
[PROOF STATE]
proof (state)
this:
p = (l, i)
q = (l', i')

goal (1 subgoal):
 1. \<And>x1__ x2__ x1a__ x2a__. \<lbrakk>p = (x1__, x2__); q = (x1a__, x2a__)\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>x. \<phi> p x * \<phi> q x)
[PROOF STEP]
have "integrable lborel
      (\<lambda>x. indicator {real_of_int (i - 1) / 2^(l + 1) .. real_of_int (i + 1) / 2^(l + 1)} x *\<^sub>R (\<phi> (l, i) x * \<phi> (l', i') x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real {real_of_int (i - 1) / 2 ^ (l + 1)..real_of_int (i + 1) / 2 ^ (l + 1)} x *\<^sub>R (\<phi> (l, i) x * \<phi> (l', i') x))
[PROOF STEP]
unfolding \<phi>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real {real_of_int (i - 1) / 2 ^ (l + 1)..real_of_int (i + 1) / 2 ^ (l + 1)} x *\<^sub>R ((case (l, i) of (l, i) \<Rightarrow> \<lambda>x. max 0 (1 - \<bar>x * 2 ^ (l + 1) - real_of_int i\<bar>)) x * (case (l', i') of (l, i) \<Rightarrow> \<lambda>x. max 0 (1 - \<bar>x * 2 ^ (l + 1) - real_of_int i\<bar>)) x))
[PROOF STEP]
by (intro borel_integrable_compact) (auto intro!: continuous_intros)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. indicat_real {real_of_int (i - 1) / 2 ^ (l + 1)..real_of_int (i + 1) / 2 ^ (l + 1)} x *\<^sub>R (\<phi> (l, i) x * \<phi> (l', i') x))

goal (1 subgoal):
 1. \<And>x1__ x2__ x1a__ x2a__. \<lbrakk>p = (x1__, x2__); q = (x1a__, x2a__)\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>x. \<phi> p x * \<phi> q x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable lborel (\<lambda>x. indicat_real {real_of_int (i - 1) / 2 ^ (l + 1)..real_of_int (i + 1) / 2 ^ (l + 1)} x *\<^sub>R (\<phi> (l, i) x * \<phi> (l', i') x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>x. indicat_real {real_of_int (i - 1) / 2 ^ (l + 1)..real_of_int (i + 1) / 2 ^ (l + 1)} x *\<^sub>R (\<phi> (l, i) x * \<phi> (l', i') x))

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. \<phi> p x * \<phi> q x)
[PROOF STEP]
unfolding Pair_Pair
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>x. indicat_real {real_of_int (i - 1) / 2 ^ (l + 1)..real_of_int (i + 1) / 2 ^ (l + 1)} x *\<^sub>R (\<phi> (l, i) x * \<phi> (l', i') x))

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. \<phi> (l, i) x * \<phi> (l', i') x)
[PROOF STEP]
by (rule Bochner_Integration.integrable_cong[THEN iffD1, rotated -1]) (auto simp: \<phi>_zero_iff)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. \<phi> p x * \<phi> q x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_gba_impl_rel_eext_def:
  "\<langle>Rm,Rl\<rangle>gen_gba_impl_rel_eext = { (
  \<lparr> gbai_L = Li, \<dots>=mi \<rparr>,
  \<lparr> gba_L = L, \<dots>=m \<rparr>)
  | Li mi L m.
    (Li,L)\<in>Rl
  \<and> (mi,m)\<in>Rm
  }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>Rm, Rl\<rangle>gen_gba_impl_rel_eext = {(\<lparr>gbai_L = Li, \<dots> = mi\<rparr>, \<lparr>gba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}
[PROOF STEP]
unfolding gen_gba_impl_rel_eext_def_internal relAPP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(\<lparr>gbai_L = Li, \<dots> = mi\<rparr>, \<lparr>gba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm} = {(\<lparr>gbai_L = Li, \<dots> = mi\<rparr>, \<lparr>gba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}
[PROOF STEP]
by simp


[STATEMENT]
lemma add_to_coefficient_simps:
  \<open>n + sum_mset (snd `# {#(a', _) \<in># b. a' = a#}) \<noteq> 0 \<Longrightarrow>
    add_to_coefficient (a, n) b = {#(a', _) \<in># b. a' \<noteq> a#} +
             {#(a, n + sum_mset (snd `# {#(a', _) \<in># b. a' = a#}))#}\<close>
  \<open>n + sum_mset (snd `# {#(a', _) \<in># b. a' = a#}) = 0 \<Longrightarrow>
    add_to_coefficient (a, n) b = {#(a', _) \<in># b. a' \<noteq> a#}\<close> and
  add_to_coefficient_simps_If:
  \<open>add_to_coefficient (a, n) b = {#(a', _) \<in># b. a' \<noteq> a#} +
             (if n + sum_mset (snd `# {#(a', _) \<in># b. a' = a#}) = 0 then {#}
               else {#(a, n + sum_mset (snd `# {#(a', _) \<in># b. a' = a#}))#})\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((n + \<Sum>\<^sub># (snd `# {#(a', uu_) \<in># b. a' = a#}) \<noteq> 0 \<Longrightarrow> add_to_coefficient (a, n) b = {#(a', uu_) \<in># b. a' \<noteq> a#} + {#(a, n + \<Sum>\<^sub># (snd `# {#(a', uu_) \<in># b. a' = a#}))#}) &&& (n + \<Sum>\<^sub># (snd `# {#(a', uu_) \<in># b. a' = a#}) = 0 \<Longrightarrow> add_to_coefficient (a, n) b = {#(a', uu_) \<in># b. a' \<noteq> a#})) &&& add_to_coefficient (a, n) b = {#(a', uu_) \<in># b. a' \<noteq> a#} + (if n + \<Sum>\<^sub># (snd `# {#(a', uu_) \<in># b. a' = a#}) = 0 then {#} else {#(a, n + \<Sum>\<^sub># (snd `# {#(a', uu_) \<in># b. a' = a#}))#})
[PROOF STEP]
by (auto simp: add_to_coefficient_def)


[STATEMENT]
lemma measure_cond_pmf:
  "measure (measure_pmf (cond_pmf p A)) B = measure (measure_pmf p) (A \<inter> B) / measure (measure_pmf p) A"
  if "set_pmf p \<inter> A \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (cond_pmf p A) B = measure_pmf.prob p (A \<inter> B) / measure_pmf.prob p A
[PROOF STEP]
using emeasure_cond_pmf[OF that, of B] that
[PROOF STATE]
proof (prove)
using this:
emeasure (measure_pmf (cond_pmf p A)) B = emeasure (measure_pmf p) (A \<inter> B) / emeasure (measure_pmf p) A
set_pmf p \<inter> A \<noteq> {}

goal (1 subgoal):
 1. measure_pmf.prob (cond_pmf p A) B = measure_pmf.prob p (A \<inter> B) / measure_pmf.prob p A
[PROOF STEP]
by(auto simp add: measure_pmf.emeasure_eq_measure measure_pmf_posI divide_ennreal)


[STATEMENT]
theorem homeomorphic_punctured_affine_sphere_affine:
  fixes a :: "'a :: euclidean_space"
  assumes "0 < r" "b \<in> sphere a r" "affine T" "a \<in> T" "b \<in> T" "affine p"
      and aff: "aff_dim T = aff_dim p + 1"
    shows "(sphere a r \<inter> T) - {b} homeomorphic p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
have "a \<noteq> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < r
b \<in> sphere a r
affine T
a \<in> T
b \<in> T
affine p
aff_dim T = aff_dim p + 1

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

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
[PROOF STEP]
have inj: "inj (\<lambda>x::'a. x /\<^sub>R norm (a - b))"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b

goal (1 subgoal):
 1. inj (\<lambda>x. x /\<^sub>R norm (a - b))
[PROOF STEP]
by (simp add: inj_on_def)
[PROOF STATE]
proof (state)
this:
inj (\<lambda>x. x /\<^sub>R norm (a - b))

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
have "((sphere a r \<inter> T) - {b}) homeomorphic
        (+) (-a) ` ((sphere a r \<inter> T) - {b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic (+) (- a) ` (sphere a r \<inter> T - {b})
[PROOF STEP]
by (rule homeomorphic_translation)
[PROOF STATE]
proof (state)
this:
sphere a r \<inter> T - {b} homeomorphic (+) (- a) ` (sphere a r \<inter> T - {b})

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sphere a r \<inter> T - {b} homeomorphic (+) (- a) ` (sphere a r \<inter> T - {b})

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
have "... homeomorphic (*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) (- a) ` (sphere a r \<inter> T - {b}) homeomorphic (*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b})
[PROOF STEP]
by (metis \<open>0 < r\<close> homeomorphic_scaling inverse_inverse_eq inverse_zero less_irrefl)
[PROOF STATE]
proof (state)
this:
(+) (- a) ` (sphere a r \<inter> T - {b}) homeomorphic (*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b})

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(+) (- a) ` (sphere a r \<inter> T - {b}) homeomorphic (*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b})

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
have "... = sphere 0 1 \<inter> ((*\<^sub>R) (inverse r) ` (+) (- a) ` T) - {(b - a) /\<^sub>R r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b}) = sphere (0::'a) 1 \<inter> (*\<^sub>R) (inverse r) ` (+) (- a) ` T - {(b - a) /\<^sub>R r}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < r
b \<in> sphere a r
affine T
a \<in> T
b \<in> T
affine p
aff_dim T = aff_dim p + 1

goal (1 subgoal):
 1. (*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b}) = sphere (0::'a) 1 \<inter> (*\<^sub>R) (inverse r) ` (+) (- a) ` T - {(b - a) /\<^sub>R r}
[PROOF STEP]
by (auto simp: dist_norm norm_minus_commute divide_simps)
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b}) = sphere (0::'a) 1 \<inter> (*\<^sub>R) (inverse r) ` (+) (- a) ` T - {(b - a) /\<^sub>R r}

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(*\<^sub>R) (inverse r) ` (+) (- a) ` (sphere a r \<inter> T - {b}) = sphere (0::'a) 1 \<inter> (*\<^sub>R) (inverse r) ` (+) (- a) ` T - {(b - a) /\<^sub>R r}

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
have "... homeomorphic p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sphere (0::'a) 1 \<inter> (*\<^sub>R) (inverse r) ` (+) (- a) ` T - {(b - a) /\<^sub>R r} homeomorphic p
[PROOF STEP]
using assms affine_translation [symmetric, of "- a"] aff_dim_translation_eq [of "- a"]
[PROOF STATE]
proof (prove)
using this:
0 < r
b \<in> sphere a r
affine T
a \<in> T
b \<in> T
affine p
aff_dim T = aff_dim p + 1
affine ((+) (- a) ` ?S) = affine ?S
aff_dim ((+) (- a) ` ?S) = aff_dim ?S

goal (1 subgoal):
 1. sphere (0::'a) 1 \<inter> (*\<^sub>R) (inverse r) ` (+) (- a) ` T - {(b - a) /\<^sub>R r} homeomorphic p
[PROOF STEP]
by (intro homeomorphic_punctured_affine_sphere_affine_01) (auto simp: dist_norm norm_minus_commute affine_scaling inj)
[PROOF STATE]
proof (state)
this:
sphere (0::'a) 1 \<inter> (*\<^sub>R) (inverse r) ` (+) (- a) ` T - {(b - a) /\<^sub>R r} homeomorphic p

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sphere a r \<inter> T - {b} homeomorphic p

goal (1 subgoal):
 1. sphere a r \<inter> T - {b} homeomorphic p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sphere a r \<inter> T - {b} homeomorphic p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cod_tensor [simp]:
    assumes "arr f" and "arr g"
    shows "cod (f \<otimes>\<^sub>S g) = cod f \<otimes>\<^sub>S cod g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cod (f \<otimes>\<^sub>S g) = cod f \<otimes>\<^sub>S cod g
[PROOF STEP]
using assms arr_iff_in_hom [of f] arr_iff_in_hom [of g] tensor_in_hom
[PROOF STATE]
proof (prove)
using this:
arr f
arr g
arr f = \<guillemotleft>f : local.dom f \<rightarrow> cod f\<guillemotright>
arr g = \<guillemotleft>g : local.dom g \<rightarrow> cod g\<guillemotright>
\<lbrakk>\<guillemotleft>?f : ?a \<rightarrow> ?b\<guillemotright>; \<guillemotleft>?g : ?c \<rightarrow> ?d\<guillemotright>\<rbrakk> \<Longrightarrow> \<guillemotleft>?f \<otimes>\<^sub>S ?g : ?a \<otimes>\<^sub>S ?c \<rightarrow> ?b \<otimes>\<^sub>S ?d\<guillemotright>

goal (1 subgoal):
 1. cod (f \<otimes>\<^sub>S g) = cod f \<otimes>\<^sub>S cod g
[PROOF STEP]
by blast


[STATEMENT]
lemma less_add_diff: "k < (n::nat) \<Longrightarrow> m < n + m - k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < n \<Longrightarrow> m < n + m - k
[PROOF STEP]
by (rule add_less_imp_less_right[of _ k], simp)


[STATEMENT]
lemma from_hma\<^sub>m_diff: "from_hma\<^sub>m a - from_hma\<^sub>m b = from_hma\<^sub>m (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mod_Type_Connect.from_hma\<^sub>m a - Mod_Type_Connect.from_hma\<^sub>m b = Mod_Type_Connect.from_hma\<^sub>m (a - b)
[PROOF STEP]
unfolding from_hma\<^sub>m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat CARD('c) CARD('b) (\<lambda>(i, j). a $h mod_type_class.from_nat i $h mod_type_class.from_nat j) - Matrix.mat CARD('c) CARD('b) (\<lambda>(i, j). b $h mod_type_class.from_nat i $h mod_type_class.from_nat j) = Matrix.mat CARD('c) CARD('b) (\<lambda>(i, j). (a - b) $h mod_type_class.from_nat i $h mod_type_class.from_nat j)
[PROOF STEP]
by auto


[STATEMENT]
lemma im_diff : "g \<in> G \<Longrightarrow> g' \<in> G \<Longrightarrow> T (g - g') = T g - T g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<in> G; g' \<in> G\<rbrakk> \<Longrightarrow> T (g - g') = T g - T g'
[PROOF STEP]
using hom neg_closed hom[of g "-g'"] im_neg
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?g \<in> G; ?g' \<in> G\<rbrakk> \<Longrightarrow> T (?g + ?g') = T ?g + T ?g'
?g \<in> G \<Longrightarrow> - ?g \<in> G
\<lbrakk>g \<in> G; - g' \<in> G\<rbrakk> \<Longrightarrow> T (g + - g') = T g + T (- g')
T (- ?g) = - T ?g

goal (1 subgoal):
 1. \<lbrakk>g \<in> G; g' \<in> G\<rbrakk> \<Longrightarrow> T (g - g') = T g - T g'
[PROOF STEP]
by simp