[STATEMENT]
lemma ftft_4: assumes dx: "dim_vec x = 4"
  and be: "x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = True"
  shows "ceros_of_boolean_input x = {0,2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 2}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = True

goal (1 subgoal):
 1. ceros_of_boolean_input x = {0, 2}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = True

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 2}
[PROOF STEP]
using less_4_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 4
x $ 0 = False \<and> x $ 1 = True \<and> x $ 2 = False \<and> x $ 3 = True
?n < 4 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2 \<or> ?n = 3

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {0, 2}
[PROOF STEP]
by auto


[STATEMENT]
lemma uniformly_continuous_imp_continuous:
  assumes f: "uniformly_continuous_on s f"
  shows "continuous_on s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on s f
[PROOF STEP]
by (auto simp: filterlim_iff eventually_at_filter eventually_nhds_uniformity continuous_on_def
           elim: eventually_mono dest!: uniformly_continuous_onD[OF f])


[STATEMENT]
theorem substEnv_idEnv: "(idEnv &[X / x]_xs) = (idEnv [x \<leftarrow> X]_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. idEnv &[X / x]_xs = idEnv [x \<leftarrow> X]_xs
[PROOF STEP]
unfolding substEnv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. idEnv &[idEnv [x \<leftarrow> X]_xs] = idEnv [x \<leftarrow> X]_xs
[PROOF STEP]
using psubstEnv_idEnv
[PROOF STATE]
proof (prove)
using this:
idEnv &[?rho] = ?rho

goal (1 subgoal):
 1. idEnv &[idEnv [x \<leftarrow> X]_xs] = idEnv [x \<leftarrow> X]_xs
[PROOF STEP]
by auto


[STATEMENT]
lemma right_move_to_left: "a + - c \<le> b \<Longrightarrow> a \<le> b + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + - c \<le> b \<Longrightarrow> a \<le> b + c
[PROOF STEP]
apply (drule_tac v = "c" in add_order_preserving_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + - c + c \<le> b + c \<Longrightarrow> a \<le> b + c
[PROOF STEP]
by (simp add: add.assoc)


[STATEMENT]
lemma gfinprod_eq_finprod [simp]: "\<lbrakk>finite A; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> gfinprod G f A = finprod G f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> gfinprod G f A = finprod G f A
[PROOF STEP]
by (auto simp: gfinprod_def intro: finprod_mono_neutral_cong_left)


[STATEMENT]
lemma sigma_sets_singleton:
  assumes "X \<subseteq> S"
  shows "sigma_sets S { X } = { {}, X, S - X, S }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
interpret sigma_algebra S "{ {}, X, S - X, S }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra S {{}, X, S - X, S}
[PROOF STEP]
by (rule sigma_algebra_single_set) fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
have "sigma_sets S { X } \<subseteq> sigma_sets S { {}, X, S - X, S }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets S {X} \<subseteq> sigma_sets S {{}, X, S - X, S}
[PROOF STEP]
by (rule sigma_sets_subseteq) simp
[PROOF STATE]
proof (state)
this:
sigma_sets S {X} \<subseteq> sigma_sets S {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sigma_sets S {X} \<subseteq> sigma_sets S {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
have "\<dots> = { {}, X, S - X, S }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}
[PROOF STEP]
using sigma_sets_eq
[PROOF STATE]
proof (prove)
using this:
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
assume "A \<in> { {}, X, S - X, S }"
[PROOF STATE]
proof (state)
this:
A \<in> {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> {{}, X, S - X, S}
[PROOF STEP]
have "A \<in> sigma_sets S { X }"
[PROOF STATE]
proof (prove)
using this:
A \<in> {{}, X, S - X, S}

goal (1 subgoal):
 1. A \<in> sigma_sets S {X}
[PROOF STEP]
by (auto intro: sigma_sets.intros(2-) sigma_sets_top)
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets S {X}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?A2 \<in> {{}, X, S - X, S} \<Longrightarrow> ?A2 \<in> sigma_sets S {X}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sigma_sets S {X} \<subseteq> sigma_sets S {{}, X, S - X, S}
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}
?A2 \<in> {{}, X, S - X, S} \<Longrightarrow> ?A2 \<in> sigma_sets S {X}
[PROOF STEP]
have "sigma_sets S { X } = sigma_sets S { {}, X, S - X, S }"
[PROOF STATE]
proof (prove)
using this:
sigma_sets S {X} \<subseteq> sigma_sets S {{}, X, S - X, S}
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}
?A2 \<in> {{}, X, S - X, S} \<Longrightarrow> ?A2 \<in> sigma_sets S {X}

goal (1 subgoal):
 1. sigma_sets S {X} = sigma_sets S {{}, X, S - X, S}
[PROOF STEP]
by (intro antisym) auto
[PROOF STATE]
proof (state)
this:
sigma_sets S {X} = sigma_sets S {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
with sigma_sets_eq
[PROOF STATE]
proof (chain)
picking this:
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}
sigma_sets S {X} = sigma_sets S {{}, X, S - X, S}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sigma_sets S {{}, X, S - X, S} = {{}, X, S - X, S}
sigma_sets S {X} = sigma_sets S {{}, X, S - X, S}

goal (1 subgoal):
 1. sigma_sets S {X} = {{}, X, S - X, S}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sigma_sets S {X} = {{}, X, S - X, S}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_segment_line_iff:
  "{a--line a b i} = line a b ` {0..i}"
  if "0 < i" "a \<noteq> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a--{a -- b}\<^bsub>i\<^esub>} = {a -- b}\<^bsub>`{0..i}\<^esub>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < i
a \<noteq> b

goal (1 subgoal):
 1. {a--{a -- b}\<^bsub>i\<^esub>} = {a -- b}\<^bsub>`{0..i}\<^esub>
[PROOF STEP]
apply (auto simp: in_segment line_convex_combination2 plus_times_less_one_lemma)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>0 < i; a \<noteq> b; 0 \<le> xa; xa \<le> i\<rbrakk> \<Longrightarrow> \<exists>u\<ge>0. u \<le> 1 \<and> xa = i * u
[PROOF STEP]
subgoal for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; a \<noteq> b; 0 \<le> j; j \<le> i\<rbrakk> \<Longrightarrow> \<exists>u\<ge>0. u \<le> 1 \<and> j = i * u
[PROOF STEP]
apply (rule exI[where x="j/i"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < i; a \<noteq> b; 0 \<le> j; j \<le> i\<rbrakk> \<Longrightarrow> 0 \<le> j / i \<and> j / i \<le> 1 \<and> j = i * (j / i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma partition_returns_index_in_bounds:
  assumes effect: "effect (partition a l r) h h' rs"
  assumes "l < r"
  shows "l \<le> rs \<and> rs \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<le> rs \<and> rs \<le> r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l \<le> rs \<and> rs \<le> r
[PROOF STEP]
from effect
[PROOF STATE]
proof (chain)
picking this:
effect (Imperative_Quicksort.partition a l r) h h' rs
[PROOF STEP]
obtain middle h'' p where part: "effect (part1 a l (r - 1) p) h h'' middle"
    and rs_equals: "rs = (if Array.get h'' a ! middle \<le> Array.get h a ! r then middle + 1
         else middle)"
[PROOF STATE]
proof (prove)
using this:
effect (Imperative_Quicksort.partition a l r) h h' rs

goal (1 subgoal):
 1. (\<And>p h'' middle. \<lbrakk>effect (part1 a l (r - 1) p) h h'' middle; rs = (if Array.get h'' a ! middle \<le> Array.get h a ! r then middle + 1 else middle)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding partition.simps
[PROOF STATE]
proof (prove)
using this:
effect (Array.nth a r \<bind> (\<lambda>pivot. part1 a l (r - 1) pivot \<bind> (\<lambda>middle. Array.nth a middle \<bind> (\<lambda>v. return (if v \<le> pivot then middle + 1 else middle) \<bind> (\<lambda>m. swap a m r \<bind> (\<lambda>_. return m)))))) h h' rs

goal (1 subgoal):
 1. (\<And>p h'' middle. \<lbrakk>effect (part1 a l (r - 1) p) h h'' middle; rs = (if Array.get h'' a ! middle \<le> Array.get h a ! r then middle + 1 else middle)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim effect_bindE effect_returnE effect_nthE effect_ifE effect_updE) simp
[PROOF STATE]
proof (state)
this:
effect (part1 a l (r - 1) p) h h'' middle
rs = (if Array.get h'' a ! middle \<le> Array.get h a ! r then middle + 1 else middle)

goal (1 subgoal):
 1. l \<le> rs \<and> rs \<le> r
[PROOF STEP]
from \<open>l < r\<close>
[PROOF STATE]
proof (chain)
picking this:
l < r
[PROOF STEP]
have "l \<le> r - 1"
[PROOF STATE]
proof (prove)
using this:
l < r

goal (1 subgoal):
 1. l \<le> r - 1
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
l \<le> r - 1

goal (1 subgoal):
 1. l \<le> rs \<and> rs \<le> r
[PROOF STEP]
from part_returns_index_in_bounds[OF part this] rs_equals \<open>l < r\<close>
[PROOF STATE]
proof (chain)
picking this:
l \<le> middle \<and> middle \<le> r - 1
rs = (if Array.get h'' a ! middle \<le> Array.get h a ! r then middle + 1 else middle)
l < r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l \<le> middle \<and> middle \<le> r - 1
rs = (if Array.get h'' a ! middle \<le> Array.get h a ! r then middle + 1 else middle)
l < r

goal (1 subgoal):
 1. l \<le> rs \<and> rs \<le> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l \<le> rs \<and> rs \<le> r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sin_less_zero_iff:
  assumes "0 \<le> x" "x < 2 * pi"
  shows "sin x < 0 \<longleftrightarrow> pi < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin x < 0) = (pi < x)
[PROOF STEP]
using assms sin_ge_zero_iff
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
x < 2 * pi
\<lbrakk>0 \<le> ?x; ?x < 2 * pi\<rbrakk> \<Longrightarrow> (0 \<le> sin ?x) = (?x \<le> pi)

goal (1 subgoal):
 1. (sin x < 0) = (pi < x)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma img_in_bij:
  assumes "g \<in> carrier G"
  shows "(\<phi> g) \<in> Bij M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> g \<in> Bij M
[PROOF STEP]
using assms grouphom
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G
group_hom G (BijGroup M) \<phi>

goal (1 subgoal):
 1. \<phi> g \<in> Bij M
[PROOF STEP]
unfolding BijGroup_def
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G
group_hom G \<lparr>carrier = Bij M, monoid.mult = \<lambda>g\<in>Bij M. restrict (compose M g) (Bij M), one = \<lambda>x\<in>M. x\<rparr> \<phi>

goal (1 subgoal):
 1. \<phi> g \<in> Bij M
[PROOF STEP]
by (auto dest: group_hom.hom_closed)


[STATEMENT]
lemma transpose_move_matrix[simp]:
  "transpose_matrix (move_matrix A x y) = move_matrix (transpose_matrix A) y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_matrix (move_matrix A x y) = move_matrix (transpose_matrix A) y x
[PROOF STEP]
apply (subst Rep_matrix_inject[symmetric], (rule ext)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xaa. Rep_matrix (transpose_matrix (move_matrix A x y)) xa xaa = Rep_matrix (move_matrix (transpose_matrix A) y x) xa xaa
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in group_action) orbit_trans:
  assumes "x \<in> E" "y \<in> E" "z \<in> E"
    and "y \<in> orbit G \<phi> x" "z \<in> orbit G \<phi> y"
  shows "z \<in> orbit G \<phi> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
interpret group G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group G
[PROOF STEP]
using group_hom group_hom.axioms(1)
[PROOF STATE]
proof (prove)
using this:
group_hom G (BijGroup E) \<phi>
group_hom ?G ?H ?h \<Longrightarrow> Group.group ?G

goal (1 subgoal):
 1. Group.group G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
obtain g1 where g1: "g1 \<in> carrier G \<and> (\<phi> g1) x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g1. g1 \<in> carrier G \<and> \<phi> g1 x = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> E
y \<in> E
z \<in> E
y \<in> orbit G \<phi> x
z \<in> orbit G \<phi> y

goal (1 subgoal):
 1. (\<And>g1. g1 \<in> carrier G \<and> \<phi> g1 x = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: orbit_def)
[PROOF STATE]
proof (state)
this:
g1 \<in> carrier G \<and> \<phi> g1 x = y

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
obtain g2 where g2: "g2 \<in> carrier G \<and> (\<phi> g2) y = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g2. g2 \<in> carrier G \<and> \<phi> g2 y = z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> E
y \<in> E
z \<in> E
y \<in> orbit G \<phi> x
z \<in> orbit G \<phi> y

goal (1 subgoal):
 1. (\<And>g2. g2 \<in> carrier G \<and> \<phi> g2 y = z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: orbit_def)
[PROOF STATE]
proof (state)
this:
g2 \<in> carrier G \<and> \<phi> g2 y = z

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
have "(\<phi> (g2 \<otimes> g1)) x = ((\<phi> g2) \<otimes>\<^bsub>BijGroup E\<^esub> (\<phi> g1)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> (g2 \<otimes> g1) x = (\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x
[PROOF STEP]
using g1 g2 group_hom group_hom.hom_mult
[PROOF STATE]
proof (prove)
using this:
g1 \<in> carrier G \<and> \<phi> g1 x = y
g2 \<in> carrier G \<and> \<phi> g2 y = z
group_hom G (BijGroup E) \<phi>
\<lbrakk>group_hom ?G ?H ?h; ?x \<in> carrier ?G; ?y \<in> carrier ?G\<rbrakk> \<Longrightarrow> ?h (?x \<otimes>\<^bsub>?G\<^esub> ?y) = ?h ?x \<otimes>\<^bsub>?H\<^esub> ?h ?y

goal (1 subgoal):
 1. \<phi> (g2 \<otimes> g1) x = (\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<phi> (g2 \<otimes> g1) x = (\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<phi> (g2 \<otimes> g1) x = (\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
have " ... = (\<phi> g2) ((\<phi> g1) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x = \<phi> g2 (\<phi> g1 x)
[PROOF STEP]
using composition_rule assms(1) calculation g1 g2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> E; ?g1.0 \<in> carrier G; ?g2.0 \<in> carrier G\<rbrakk> \<Longrightarrow> \<phi> (?g1.0 \<otimes> ?g2.0) ?x = \<phi> ?g1.0 (\<phi> ?g2.0 ?x)
x \<in> E
\<phi> (g2 \<otimes> g1) x = (\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x
g1 \<in> carrier G \<and> \<phi> g1 x = y
g2 \<in> carrier G \<and> \<phi> g2 y = z

goal (1 subgoal):
 1. (\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x = \<phi> g2 (\<phi> g1 x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<phi> g2 \<otimes>\<^bsub>BijGroup E\<^esub> \<phi> g1) x = \<phi> g2 (\<phi> g1 x)

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<phi> (g2 \<otimes> g1) x = \<phi> g2 (\<phi> g1 x)
[PROOF STEP]
have "(\<phi> (g2 \<otimes> g1)) x = z"
[PROOF STATE]
proof (prove)
using this:
\<phi> (g2 \<otimes> g1) x = \<phi> g2 (\<phi> g1 x)

goal (1 subgoal):
 1. \<phi> (g2 \<otimes> g1) x = z
[PROOF STEP]
by (simp add: g1 g2)
[PROOF STATE]
proof (state)
this:
\<phi> (g2 \<otimes> g1) x = z

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<phi> (g2 \<otimes> g1) x = z

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
using g1 g2 orbit_def
[PROOF STATE]
proof (prove)
using this:
\<phi> (g2 \<otimes> g1) x = z
g1 \<in> carrier G \<and> \<phi> g1 x = y
g2 \<in> carrier G \<and> \<phi> g2 y = z
orbit ?G ?\<phi> ?x = {?\<phi> g ?x |g. g \<in> carrier ?G}

goal (1 subgoal):
 1. z \<in> orbit G \<phi> x
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
z \<in> orbit G \<phi> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hd_swap_0: "i < length xs \<Longrightarrow> hd (swap xs 0 i) = xs ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length xs \<Longrightarrow> hd (swap xs 0 i) = xs ! i
[PROOF STEP]
unfolding swap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length xs \<Longrightarrow> hd (xs[0 := xs ! i, i := xs ! 0]) = xs ! i
[PROOF STEP]
by (subst hd_conv_nth) (subst nth_list_update | force)+


[STATEMENT]
lemma interior_idempotent:
  assumes "U \<subseteq> carrier Q\<^sub>p"
  shows "interior (interior U) = interior U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (interior U) = interior U
[PROOF STEP]
using assms interior_open[of U] open_interior[of "interior U"]
[PROOF STATE]
proof (prove)
using this:
U \<subseteq> carrier Q\<^sub>p
U \<subseteq> carrier Q\<^sub>p \<Longrightarrow> is_open (interior U)
is_open (interior U) \<Longrightarrow> interior (interior U) = interior U

goal (1 subgoal):
 1. interior (interior U) = interior U
[PROOF STEP]
by auto


[STATEMENT]
lemma dvd_factor_mult_gcd:
    assumes dvd: "k dvd p * q" "k dvd p * r"
      and q0: "q \<noteq> 0" and r0: "r \<noteq> 0"
    shows "k dvd p * gcd q r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k dvd p * gcd q r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k dvd p * gcd q r
[PROOF STEP]
from dvd gcd_greatest[of k "p * q" "p * r"]
[PROOF STATE]
proof (chain)
picking this:
k dvd p * q
k dvd p * r
\<lbrakk>k dvd p * q; k dvd p * r\<rbrakk> \<Longrightarrow> k dvd gcd (p * q) (p * r)
[PROOF STEP]
have "k dvd gcd (p * q) (p * r)"
[PROOF STATE]
proof (prove)
using this:
k dvd p * q
k dvd p * r
\<lbrakk>k dvd p * q; k dvd p * r\<rbrakk> \<Longrightarrow> k dvd gcd (p * q) (p * r)

goal (1 subgoal):
 1. k dvd gcd (p * q) (p * r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k dvd gcd (p * q) (p * r)

goal (1 subgoal):
 1. k dvd p * gcd q r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k dvd gcd (p * q) (p * r)

goal (1 subgoal):
 1. k dvd p * gcd q r
[PROOF STEP]
from gcd_mult_ddvd[of p q r]
[PROOF STATE]
proof (chain)
picking this:
p * gcd q r ddvd gcd (p * q) (p * r)
[PROOF STEP]
have "... dvd (p * gcd q r)"
[PROOF STATE]
proof (prove)
using this:
p * gcd q r ddvd gcd (p * q) (p * r)

goal (1 subgoal):
 1. gcd (p * q) (p * r) dvd p * gcd q r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gcd (p * q) (p * r) dvd p * gcd q r

goal (1 subgoal):
 1. k dvd p * gcd q r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k dvd p * gcd q r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k dvd p * gcd q r

goal (1 subgoal):
 1. k dvd p * gcd q r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k dvd p * gcd q r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefixes_length_lower_bound: "e_length (prefixes j t) \<ge> Suc t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc t \<le> e_length (local.prefixes j t)
[PROOF STEP]
proof (induction t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Suc 0 \<le> e_length (local.prefixes j 0)
 2. \<And>t. Suc t \<le> e_length (local.prefixes j t) \<Longrightarrow> Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. Suc 0 \<le> e_length (local.prefixes j 0)
 2. \<And>t. Suc t \<le> e_length (local.prefixes j t) \<Longrightarrow> Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 \<le> e_length (local.prefixes j 0)
[PROOF STEP]
by (simp add: prefixes_def r_prefixes_0)
[PROOF STATE]
proof (state)
this:
Suc 0 \<le> e_length (local.prefixes j 0)

goal (1 subgoal):
 1. \<And>t. Suc t \<le> e_length (local.prefixes j t) \<Longrightarrow> Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t. Suc t \<le> e_length (local.prefixes j t) \<Longrightarrow> Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
case (Suc t)
[PROOF STATE]
proof (state)
this:
Suc t \<le> e_length (local.prefixes j t)

goal (1 subgoal):
 1. \<And>t. Suc t \<le> e_length (local.prefixes j t) \<Longrightarrow> Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Suc t \<le> e_length (local.prefixes j t)

goal (1 subgoal):
 1. \<And>t. Suc t \<le> e_length (local.prefixes j t) \<Longrightarrow> Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
have "Suc (e_length (prefixes j t)) \<le> e_length (prefixes j (Suc t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (e_length (local.prefixes j t)) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
using prefixes_length_mono
[PROOF STATE]
proof (prove)
using this:
e_length (local.prefixes ?j ?t) < e_length (local.prefixes ?j (Suc ?t))

goal (1 subgoal):
 1. Suc (e_length (local.prefixes j t)) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
by (simp add: Suc_leI)
[PROOF STATE]
proof (state)
this:
Suc (e_length (local.prefixes j t)) \<le> e_length (local.prefixes j (Suc t))

goal (1 subgoal):
 1. \<And>t. Suc t \<le> e_length (local.prefixes j t) \<Longrightarrow> Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Suc t \<le> e_length (local.prefixes j t)
Suc (e_length (local.prefixes j t)) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Suc t \<le> e_length (local.prefixes j t)
Suc (e_length (local.prefixes j t)) \<le> e_length (local.prefixes j (Suc t))

goal (1 subgoal):
 1. Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (Suc t) \<le> e_length (local.prefixes j (Suc t))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hom_add_eq_zero: assumes "x + y = 0" shows "hom x + hom y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom x + hom y = (0::'b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom x + hom y = (0::'b)
[PROOF STEP]
have "0 = x + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) = x + y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x + y = (0::'a)

goal (1 subgoal):
 1. (0::'a) = x + y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(0::'a) = x + y

goal (1 subgoal):
 1. hom x + hom y = (0::'b)
[PROOF STEP]
hence "hom 0 = hom (x + y)"
[PROOF STATE]
proof (prove)
using this:
(0::'a) = x + y

goal (1 subgoal):
 1. hom (0::'a) = hom (x + y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hom (0::'a) = hom (x + y)

goal (1 subgoal):
 1. hom x + hom y = (0::'b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
hom (0::'a) = hom (x + y)

goal (1 subgoal):
 1. hom x + hom y = (0::'b)
[PROOF STEP]
by (auto simp: hom_distribs)
[PROOF STATE]
proof (state)
this:
hom x + hom y = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rank_conjugate_le:
  assumes A:"A \<in> carrier_mat n d"
  shows "rank (conjugate (A)) \<le> rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
(* S is a maximal linearly independent set of (conjugate A) *)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
let ?P = "(\<lambda>T. T \<subseteq> set (cols (conjugate A)) \<and> lin_indpt T)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
have *:"\<And>A. ?P A \<Longrightarrow> finite A \<and> card A \<le> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Aa. Aa \<subseteq> set (cols (conjugate A)) \<and> lin_indpt Aa \<Longrightarrow> finite Aa \<and> card Aa \<le> d
[PROOF STEP]
by (metis List.finite_set assms card_length card_mono carrier_matD(2) cols_length dim_col_conjugate dual_order.trans rev_finite_subset)
[PROOF STATE]
proof (state)
this:
?A1 \<subseteq> set (cols (conjugate A)) \<and> lin_indpt ?A1 \<Longrightarrow> finite ?A1 \<and> card ?A1 \<le> d

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
have **:"?P {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<subseteq> set (cols (conjugate A)) \<and> lin_indpt {}
[PROOF STEP]
by (simp add: finite_lin_indpt2)
[PROOF STATE]
proof (state)
this:
{} \<subseteq> set (cols (conjugate A)) \<and> lin_indpt {}

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
from maximal_exists[OF *]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>Aa. ?P Aa \<Longrightarrow> Aa \<subseteq> set (cols (conjugate A)) \<and> lin_indpt Aa; ?P ?B\<rbrakk> \<Longrightarrow> \<exists>A. finite A \<and> maximal A ?P
[PROOF STEP]
obtain S where S: "maximal S ?P"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>Aa. ?P Aa \<Longrightarrow> Aa \<subseteq> set (cols (conjugate A)) \<and> lin_indpt Aa; ?P ?B\<rbrakk> \<Longrightarrow> \<exists>A. finite A \<and> maximal A ?P

goal (1 subgoal):
 1. (\<And>S. maximal S (\<lambda>T. T \<subseteq> set (cols (conjugate A)) \<and> lin_indpt T) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using **
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>Aa. ?P Aa \<Longrightarrow> Aa \<subseteq> set (cols (conjugate A)) \<and> lin_indpt Aa; ?P ?B\<rbrakk> \<Longrightarrow> \<exists>A. finite A \<and> maximal A ?P
{} \<subseteq> set (cols (conjugate A)) \<and> lin_indpt {}

goal (1 subgoal):
 1. (\<And>S. maximal S (\<lambda>T. T \<subseteq> set (cols (conjugate A)) \<and> lin_indpt T) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
maximal S (\<lambda>T. T \<subseteq> set (cols (conjugate A)) \<and> lin_indpt T)

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
have s_hyp: "S \<subseteq> set (cols (conjugate A))" "lin_indpt S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> set (cols (conjugate A)) &&& lin_indpt S
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
maximal S (\<lambda>T. T \<subseteq> set (cols (conjugate A)) \<and> lin_indpt T)

goal (1 subgoal):
 1. S \<subseteq> set (cols (conjugate A)) &&& lin_indpt S
[PROOF STEP]
unfolding maximal_def
[PROOF STATE]
proof (prove)
using this:
(S \<subseteq> set (cols (conjugate A)) \<and> lin_indpt S) \<and> (\<forall>B. S \<subseteq> B \<and> B \<subseteq> set (cols (conjugate A)) \<and> lin_indpt B \<longrightarrow> B = S)

goal (1 subgoal):
 1. S \<subseteq> set (cols (conjugate A)) &&& lin_indpt S
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt S
[PROOF STEP]
by (metis (no_types, lifting) S maximal_def)
[PROOF STATE]
proof (state)
this:
S \<subseteq> set (cols (conjugate A))
lin_indpt S

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
from rank_card_indpt[OF _ S, of d]
[PROOF STATE]
proof (chain)
picking this:
conjugate A \<in> carrier_mat n d \<Longrightarrow> rank (conjugate A) = card S
[PROOF STEP]
have rankeq: "rank (conjugate A) = card S"
[PROOF STATE]
proof (prove)
using this:
conjugate A \<in> carrier_mat n d \<Longrightarrow> rank (conjugate A) = card S

goal (1 subgoal):
 1. rank (conjugate A) = card S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
conjugate A \<in> carrier_mat n d \<Longrightarrow> rank (conjugate A) = card S
A \<in> carrier_mat n d

goal (1 subgoal):
 1. rank (conjugate A) = card S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rank (conjugate A) = card S

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
have 1:"conjugate ` S \<subseteq> set (cols A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate ` S \<subseteq> set (cols A)
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
maximal S (\<lambda>T. T \<subseteq> set (cols (conjugate A)) \<and> lin_indpt T)

goal (1 subgoal):
 1. conjugate ` S \<subseteq> set (cols A)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>maximal S (\<lambda>T. T \<subseteq> set (cols (conjugate A)) \<and> lin_indpt T); xa \<in> S\<rbrakk> \<Longrightarrow> conjugate xa \<in> set (cols A)
[PROOF STEP]
by (metis (no_types, lifting) cols_conjugate conjugate_id image_eqI in_mono list.set_map s_hyp(1))
[PROOF STATE]
proof (state)
this:
conjugate ` S \<subseteq> set (cols A)

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
have 2: "lin_indpt (conjugate ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt (conjugate ` S)
[PROOF STEP]
apply (rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> lin_indpt (conjugate ` S) \<Longrightarrow> False
[PROOF STEP]
apply (auto simp add: lin_dep_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix T c v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume T: "T \<subseteq> conjugate ` S" "finite T" and
      lc:"lincomb c T = 0\<^sub>v n" and "v \<in> T"  "c v \<noteq> 0"
[PROOF STATE]
proof (state)
this:
T \<subseteq> conjugate ` S
finite T
lincomb c T = 0\<^sub>v n
v \<in> T
c v \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
let ?T = "conjugate ` T"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
let ?c = "conjugate \<circ> c \<circ> conjugate"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have 1: "finite ?T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (conjugate ` T)
[PROOF STEP]
using T
[PROOF STATE]
proof (prove)
using this:
T \<subseteq> conjugate ` S
finite T

goal (1 subgoal):
 1. finite (conjugate ` T)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (conjugate ` T)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have 2: "?T \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate ` T \<subseteq> S
[PROOF STEP]
using T
[PROOF STATE]
proof (prove)
using this:
T \<subseteq> conjugate ` S
finite T

goal (1 subgoal):
 1. conjugate ` T \<subseteq> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate ` T \<subseteq> S

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have 3: "?c \<in> ?T \<rightarrow> UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> UNIV

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "lincomb ?c ?T = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x)
[PROOF STEP]
unfolding lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>\<^bsub>V\<^esub>v\<in>conjugate ` T. (conjugate \<circ> c \<circ> conjugate) v \<cdot>\<^sub>v v) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x)
[PROOF STEP]
apply (subst finsum_reindex)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>v. (conjugate \<circ> c \<circ> conjugate) v \<cdot>\<^sub>v v) \<in> conjugate ` T \<rightarrow> carrier_vec n
 2. inj_on conjugate T
 3. (\<Oplus>\<^bsub>V\<^esub>x\<in>T. (conjugate \<circ> c \<circ> conjugate) (conjugate x) \<cdot>\<^sub>v conjugate x) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. xa \<in> T \<Longrightarrow> conjugate xa \<in> carrier_vec n
 2. inj_on conjugate T
[PROOF STEP]
apply (metis "2" carrier_vec_conjugate assms carrier_matD(1) cols_dim image_eqI s_hyp(1) subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on conjugate T
[PROOF STEP]
by (meson conjugate_cancel_iff inj_onI)
[PROOF STATE]
proof (state)
this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "... = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x))
[PROOF STEP]
by (simp add: conjugate_smult_vec)
[PROOF STATE]
proof (state)
this:
(\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x))

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x) \<cdot>\<^sub>v conjugate x) = (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x))

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "... = conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. (c x \<cdot>\<^sub>v x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x)) = conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x)
[PROOF STEP]
apply(subst conjugate_finsum[of "\<lambda>x.(c x \<cdot>\<^sub>v x)" T])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. c x \<cdot>\<^sub>v x) \<in> T \<rightarrow> carrier_vec n
 2. (\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x)) = finsum V (conjugate \<circ> (\<lambda>x. c x \<cdot>\<^sub>v x)) T
[PROOF STEP]
apply (auto simp add:o_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> T \<Longrightarrow> x \<in> carrier_vec n
[PROOF STEP]
by (smt Matrix.carrier_vec_conjugate Pi_I' T(1) assms carrier_matD(1) cols_dim dim_row_conjugate imageE s_hyp(1) smult_carrier_vec subset_eq)
[PROOF STATE]
proof (state)
this:
(\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x)) = conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Oplus>\<^bsub>V\<^esub>x\<in>T. conjugate (c x \<cdot>\<^sub>v x)) = conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "... = conjugate (lincomb c T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x) = conjugate (lincomb c T)
[PROOF STEP]
using lincomb_def
[PROOF STATE]
proof (prove)
using this:
lincomb ?a ?A = (\<Oplus>\<^bsub>V\<^esub>v\<in>?A. ?a v \<cdot>\<^sub>v v)

goal (1 subgoal):
 1. conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x) = conjugate (lincomb c T)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x) = conjugate (lincomb c T)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x)
conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x) = conjugate (lincomb c T)
[PROOF STEP]
have "lincomb ?c ?T = conjugate (lincomb c T)"
[PROOF STATE]
proof (prove)
using this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x)
conjugate (\<Oplus>\<^bsub>V\<^esub>x\<in>T. c x \<cdot>\<^sub>v x) = conjugate (lincomb c T)

goal (1 subgoal):
 1. lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = conjugate (lincomb c T)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = conjugate (lincomb c T)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = conjugate (lincomb c T)
[PROOF STEP]
have 4:"lincomb ?c ?T = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = conjugate (lincomb c T)

goal (1 subgoal):
 1. lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = 0\<^sub>v n
[PROOF STEP]
using lc
[PROOF STATE]
proof (prove)
using this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = conjugate (lincomb c T)
lincomb c T = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb (conjugate \<circ> c \<circ> conjugate) (conjugate ` T) = 0\<^sub>v n

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
from not_lindepD[OF s_hyp(2) 1 2 3 4]
[PROOF STATE]
proof (chain)
picking this:
conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> {0::'a}
[PROOF STEP]
have "conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> {0}"
[PROOF STATE]
proof (prove)
using this:
conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> {0::'a}

goal (1 subgoal):
 1. conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> {0::'a}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> {0::'a}

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> {0::'a}
[PROOF STEP]
have "c v = 0"
[PROOF STATE]
proof (prove)
using this:
conjugate \<circ> c \<circ> conjugate \<in> conjugate ` T \<rightarrow> {0::'a}

goal (1 subgoal):
 1. c v = (0::'a)
[PROOF STEP]
by (simp add: Pi_iff \<open>v \<in> T\<close>)
[PROOF STATE]
proof (state)
this:
c v = (0::'a)

goal (1 subgoal):
 1. \<And>A a v. \<lbrakk>A \<subseteq> conjugate ` S; finite A; lincomb a A = 0\<^sub>v n; v \<in> A; a v \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
c v = (0::'a)

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>c v \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
c v = (0::'a)
c v \<noteq> (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lin_indpt (conjugate ` S)

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
from rank_ge_card_indpt[OF A 1 2]
[PROOF STATE]
proof (chain)
picking this:
card (conjugate ` S) \<le> rank A
[PROOF STEP]
have 3:"card (conjugate ` S) \<le> rank A"
[PROOF STATE]
proof (prove)
using this:
card (conjugate ` S) \<le> rank A

goal (1 subgoal):
 1. card (conjugate ` S) \<le> rank A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (conjugate ` S) \<le> rank A

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
have 4: "card (conjugate ` S) = card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (conjugate ` S) = card S
[PROOF STEP]
apply (auto intro!: card_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on conjugate S
[PROOF STEP]
by (meson conjugate_cancel_iff inj_onI)
[PROOF STATE]
proof (state)
this:
card (conjugate ` S) = card S

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
using rankeq 3 4
[PROOF STATE]
proof (prove)
using this:
rank (conjugate A) = card S
card (conjugate ` S) \<le> rank A
card (conjugate ` S) = card S

goal (1 subgoal):
 1. rank (conjugate A) \<le> rank A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rank (conjugate A) \<le> rank A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_polynom_imp_zero_coeffs:
  fixes c :: "nat \<Rightarrow> 'a::{ab_semigroup_mult,real_normed_div_algebra}"
  assumes "\<And>w. (\<Sum>i\<le>n. c i * w^i) = 0"  "k \<le> n"
  shows "c k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c k = (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. c i * ?w ^ i) = (0::'a)
k \<le> n

goal (1 subgoal):
 1. c k = (0::'a)
[PROOF STEP]
proof (induction n arbitrary: c k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>0. c i * w ^ i) = (0::'a); k \<le> 0\<rbrakk> \<Longrightarrow> c k = (0::'a)
 2. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>0. c i * ?w ^ i) = (0::'a)
k \<le> 0

goal (2 subgoals):
 1. \<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>0. c i * w ^ i) = (0::'a); k \<le> 0\<rbrakk> \<Longrightarrow> c k = (0::'a)
 2. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>0. c i * ?w ^ i) = (0::'a)
k \<le> 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>0. c i * ?w ^ i) = (0::'a)
k \<le> 0

goal (1 subgoal):
 1. c k = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c k = (0::'a)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
case (Suc n c k)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>w. (\<Sum>i\<le>n. ?c i * w ^ i) = (0::'a); ?k \<le> n\<rbrakk> \<Longrightarrow> ?c ?k = (0::'a)
(\<Sum>i\<le>Suc n. c i * ?w ^ i) = (0::'a)
k \<le> Suc n

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
have [simp]: "c 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c 0 = (0::'a)
[PROOF STEP]
using Suc.prems(1) [of 0]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>Suc n. c i * (0::'a) ^ i) = (0::'a)

goal (1 subgoal):
 1. c 0 = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c 0 = (0::'a)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
have "(\<Sum>i\<le>Suc n. c i * w^i) = w * (\<Sum>i\<le>n. c (Suc i) * w^i)" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
have "(\<Sum>i\<le>Suc n. c i * w^i) = (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc n. c i * w ^ i) = (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i)
[PROOF STEP]
unfolding Set_Interval.sum.atMost_Suc_shift
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c 0 * w ^ 0 + (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i) = (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc n. c i * w ^ i) = (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i)

goal (1 subgoal):
 1. (\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc n. c i * w ^ i) = (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i)

goal (1 subgoal):
 1. (\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
have "\<dots> = w * (\<Sum>i\<le>n. c (Suc i) * w^i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. c (Suc i) * w ^ Suc i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
by (simp add: sum_distrib_left ac_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. c (Suc i) * w ^ Suc i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)

goal (1 subgoal):
 1. (\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)

goal (1 subgoal):
 1. (\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc n. c i * w ^ i) = w * (\<Sum>i\<le>n. c (Suc i) * w ^ i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc n. c i * ?w ^ i) = ?w * (\<Sum>i\<le>n. c (Suc i) * ?w ^ i)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>Suc n. c i * ?w ^ i) = ?w * (\<Sum>i\<le>n. c (Suc i) * ?w ^ i)
[PROOF STEP]
have w: "\<And>w. w \<noteq> 0 \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * w^i) = 0"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>Suc n. c i * ?w ^ i) = ?w * (\<Sum>i\<le>n. c (Suc i) * ?w ^ i)

goal (1 subgoal):
 1. \<And>w. w \<noteq> (0::'a) \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * w ^ i) = (0::'a)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>Suc n. c i * ?w ^ i) = ?w * (\<Sum>i\<le>n. c (Suc i) * ?w ^ i)
\<lbrakk>\<And>w. (\<Sum>i\<le>n. ?c i * w ^ i) = (0::'a); ?k \<le> n\<rbrakk> \<Longrightarrow> ?c ?k = (0::'a)
(\<Sum>i\<le>Suc n. c i * ?w ^ i) = (0::'a)
k \<le> Suc n

goal (1 subgoal):
 1. \<And>w. w \<noteq> (0::'a) \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * w ^ i) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?w \<noteq> (0::'a) \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?w \<noteq> (0::'a) \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)
[PROOF STEP]
have "(\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h^i) \<midarrow>0\<rightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
?w \<noteq> (0::'a) \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)

goal (1 subgoal):
 1. (\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h ^ i) \<midarrow>0::'a\<rightarrow> (0::'a)
[PROOF STEP]
by (simp cong: LIM_cong)  \<comment> \<open>the case \<open>w = 0\<close> by continuity\<close>
[PROOF STATE]
proof (state)
this:
(\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h ^ i) \<midarrow>0::'a\<rightarrow> (0::'a)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h ^ i) \<midarrow>0::'a\<rightarrow> (0::'a)
[PROOF STEP]
have "(\<Sum>i\<le>n. c (Suc i) * 0^i) = 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h ^ i) \<midarrow>0::'a\<rightarrow> (0::'a)

goal (1 subgoal):
 1. (\<Sum>i\<le>n. c (Suc i) * (0::'a) ^ i) = (0::'a)
[PROOF STEP]
using isCont_polynom [of 0 "\<lambda>i. c (Suc i)" n] LIM_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>h. \<Sum>i\<le>n. c (Suc i) * h ^ i) \<midarrow>0::'a\<rightarrow> (0::'a)
isCont (\<lambda>w. \<Sum>i\<le>n. c (Suc i) * w ^ i) (0::'a)
\<lbrakk>?f \<midarrow>?a\<rightarrow> ?L; ?f \<midarrow>?a\<rightarrow> ?M\<rbrakk> \<Longrightarrow> ?L = ?M

goal (1 subgoal):
 1. (\<Sum>i\<le>n. c (Suc i) * (0::'a) ^ i) = (0::'a)
[PROOF STEP]
by (force simp: Limits.isCont_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. c (Suc i) * (0::'a) ^ i) = (0::'a)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>n. c (Suc i) * (0::'a) ^ i) = (0::'a)
[PROOF STEP]
have "\<And>w. (\<Sum>i\<le>n. c (Suc i) * w^i) = 0"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. c (Suc i) * (0::'a) ^ i) = (0::'a)

goal (1 subgoal):
 1. \<And>w. (\<Sum>i\<le>n. c (Suc i) * w ^ i) = (0::'a)
[PROOF STEP]
using w
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. c (Suc i) * (0::'a) ^ i) = (0::'a)
?w \<noteq> (0::'a) \<Longrightarrow> (\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)

goal (1 subgoal):
 1. \<And>w. (\<Sum>i\<le>n. c (Suc i) * w ^ i) = (0::'a)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)
[PROOF STEP]
have "\<And>i. i \<le> n \<Longrightarrow> c (Suc i) = 0"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)

goal (1 subgoal):
 1. \<And>i. i \<le> n \<Longrightarrow> c (Suc i) = (0::'a)
[PROOF STEP]
using Suc.IH [of "\<lambda>i. c (Suc i)"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<le>n. c (Suc i) * ?w ^ i) = (0::'a)
\<lbrakk>\<And>w. (\<Sum>i\<le>n. c (Suc i) * w ^ i) = (0::'a); ?k \<le> n\<rbrakk> \<Longrightarrow> c (Suc ?k) = (0::'a)

goal (1 subgoal):
 1. \<And>i. i \<le> n \<Longrightarrow> c (Suc i) = (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?i \<le> n \<Longrightarrow> c (Suc ?i) = (0::'a)

goal (1 subgoal):
 1. \<And>n c k. \<lbrakk>\<And>c k. \<lbrakk>\<And>w. (\<Sum>i\<le>n. c i * w ^ i) = (0::'a); k \<le> n\<rbrakk> \<Longrightarrow> c k = (0::'a); \<And>w. (\<Sum>i\<le>Suc n. c i * w ^ i) = (0::'a); k \<le> Suc n\<rbrakk> \<Longrightarrow> c k = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<le> n \<Longrightarrow> c (Suc ?i) = (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i \<le> n \<Longrightarrow> c (Suc ?i) = (0::'a)

goal (1 subgoal):
 1. c k = (0::'a)
[PROOF STEP]
using \<open>k \<le> Suc n\<close>
[PROOF STATE]
proof (prove)
using this:
?i \<le> n \<Longrightarrow> c (Suc ?i) = (0::'a)
k \<le> Suc n

goal (1 subgoal):
 1. c k = (0::'a)
[PROOF STEP]
by (cases k) auto
[PROOF STATE]
proof (state)
this:
c k = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_less_suminf2:
  "summable f \<Longrightarrow> (\<And>m. m\<ge>n \<Longrightarrow> 0 \<le> f m) \<Longrightarrow> n \<le> i \<Longrightarrow> 0 < f i \<Longrightarrow> sum f {..<n} < suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) \<le> f m; n \<le> i; (0::'a) < f i\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
using sum_le_suminf[of f "{..< Suc i}"]
    and add_strict_increasing[of "f i" "sum f {..<n}" "sum f {..<i}"]
    and sum_mono2[of "{..<i}" "{..<n}" f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>summable f; finite {..<Suc i}; \<And>n. n \<in> - {..<Suc i} \<Longrightarrow> (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> sum f {..<Suc i} \<le> suminf f
\<lbrakk>(0::'a) < f i; sum f {..<n} \<le> sum f {..<i}\<rbrakk> \<Longrightarrow> sum f {..<n} < f i + sum f {..<i}
\<lbrakk>finite {..<i}; {..<n} \<subseteq> {..<i}; \<And>b. b \<in> {..<i} - {..<n} \<Longrightarrow> (0::'a) \<le> f b\<rbrakk> \<Longrightarrow> sum f {..<n} \<le> sum f {..<i}

goal (1 subgoal):
 1. \<lbrakk>summable f; \<And>m. n \<le> m \<Longrightarrow> (0::'a) \<le> f m; n \<le> i; (0::'a) < f i\<rbrakk> \<Longrightarrow> sum f {..<n} < suminf f
[PROOF STEP]
by (auto simp: less_imp_le ac_simps)


[STATEMENT]
lemma all_partial_equivs_on:
  assumes "finite A"
  shows "all_partial_equivs_on A = {R. partial_equiv A R}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_partial_equivs_on A = {R. partial_equiv A R}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. all_partial_equivs_on A \<subseteq> {R. partial_equiv A R}
 2. {R. partial_equiv A R} \<subseteq> all_partial_equivs_on A
[PROOF STEP]
show "all_partial_equivs_on A \<subseteq> {R. partial_equiv A R}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_partial_equivs_on A \<subseteq> {R. partial_equiv A R}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> all_partial_equivs_on A \<Longrightarrow> x \<in> {R. partial_equiv A R}
[PROOF STEP]
fix R
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> all_partial_equivs_on A \<Longrightarrow> x \<in> {R. partial_equiv A R}
[PROOF STEP]
assume "R \<in> all_partial_equivs_on A"
[PROOF STATE]
proof (state)
this:
R \<in> all_partial_equivs_on A

goal (1 subgoal):
 1. \<And>x. x \<in> all_partial_equivs_on A \<Longrightarrow> x \<in> {R. partial_equiv A R}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
R \<in> all_partial_equivs_on A
[PROOF STEP]
obtain A' where "A' \<subseteq> A" and "equiv A' R"
[PROOF STATE]
proof (prove)
using this:
R \<in> all_partial_equivs_on A

goal (1 subgoal):
 1. (\<And>A'. \<lbrakk>A' \<subseteq> A; equiv A' R\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding all_partial_equivs_on_def
[PROOF STATE]
proof (prove)
using this:
R \<in> {0..card A} \<bind> (\<lambda>k. {A'. A' \<subseteq> A \<and> card A' = k} \<bind> (\<lambda>A'. Collect (equiv A')))

goal (1 subgoal):
 1. (\<And>A'. \<lbrakk>A' \<subseteq> A; equiv A' R\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A' \<subseteq> A
equiv A' R

goal (1 subgoal):
 1. \<And>x. x \<in> all_partial_equivs_on A \<Longrightarrow> x \<in> {R. partial_equiv A R}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
A' \<subseteq> A
equiv A' R
[PROOF STEP]
have "partial_equiv A R"
[PROOF STATE]
proof (prove)
using this:
A' \<subseteq> A
equiv A' R

goal (1 subgoal):
 1. partial_equiv A R
[PROOF STEP]
using partial_equiv_iff
[PROOF STATE]
proof (prove)
using this:
A' \<subseteq> A
equiv A' R
partial_equiv ?A ?R = (\<exists>A'\<subseteq>?A. equiv A' ?R)

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

goal (1 subgoal):
 1. \<And>x. x \<in> all_partial_equivs_on A \<Longrightarrow> x \<in> {R. partial_equiv A R}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
partial_equiv A R
[PROOF STEP]
show "R \<in> {R. partial_equiv A R}"
[PROOF STATE]
proof (prove)
using this:
partial_equiv A R

goal (1 subgoal):
 1. R \<in> {R. partial_equiv A R}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
R \<in> {R. partial_equiv A R}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
all_partial_equivs_on A \<subseteq> {R. partial_equiv A R}

goal (1 subgoal):
 1. {R. partial_equiv A R} \<subseteq> all_partial_equivs_on A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {R. partial_equiv A R} \<subseteq> all_partial_equivs_on A
[PROOF STEP]
show "{R. partial_equiv A R} \<subseteq> all_partial_equivs_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {R. partial_equiv A R} \<subseteq> all_partial_equivs_on A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {R. partial_equiv A R} \<Longrightarrow> x \<in> all_partial_equivs_on A
[PROOF STEP]
fix R
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {R. partial_equiv A R} \<Longrightarrow> x \<in> all_partial_equivs_on A
[PROOF STEP]
assume "R \<in> {R. partial_equiv A R}"
[PROOF STATE]
proof (state)
this:
R \<in> {R. partial_equiv A R}

goal (1 subgoal):
 1. \<And>x. x \<in> {R. partial_equiv A R} \<Longrightarrow> x \<in> all_partial_equivs_on A
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
R \<in> {R. partial_equiv A R}
[PROOF STEP]
obtain A' where "A' \<subseteq> A" and "equiv A' R"
[PROOF STATE]
proof (prove)
using this:
R \<in> {R. partial_equiv A R}

goal (1 subgoal):
 1. (\<And>A'. \<lbrakk>A' \<subseteq> A; equiv A' R\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using partial_equiv_iff
[PROOF STATE]
proof (prove)
using this:
R \<in> {R. partial_equiv A R}
partial_equiv ?A ?R = (\<exists>A'\<subseteq>?A. equiv A' ?R)

goal (1 subgoal):
 1. (\<And>A'. \<lbrakk>A' \<subseteq> A; equiv A' R\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
A' \<subseteq> A
equiv A' R

goal (1 subgoal):
 1. \<And>x. x \<in> {R. partial_equiv A R} \<Longrightarrow> x \<in> all_partial_equivs_on A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A' \<subseteq> A
equiv A' R

goal (1 subgoal):
 1. \<And>x. x \<in> {R. partial_equiv A R} \<Longrightarrow> x \<in> all_partial_equivs_on A
[PROOF STEP]
have "card A' \<in> {0..card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A' \<in> {0..card A}
[PROOF STEP]
using \<open>A' \<subseteq> A\<close> \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
A' \<subseteq> A
finite A

goal (1 subgoal):
 1. card A' \<in> {0..card A}
[PROOF STEP]
by (simp add: card_mono)
[PROOF STATE]
proof (state)
this:
card A' \<in> {0..card A}

goal (1 subgoal):
 1. \<And>x. x \<in> {R. partial_equiv A R} \<Longrightarrow> x \<in> all_partial_equivs_on A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A' \<subseteq> A
equiv A' R
card A' \<in> {0..card A}
[PROOF STEP]
show "R \<in> all_partial_equivs_on A"
[PROOF STATE]
proof (prove)
using this:
A' \<subseteq> A
equiv A' R
card A' \<in> {0..card A}

goal (1 subgoal):
 1. R \<in> all_partial_equivs_on A
[PROOF STEP]
unfolding all_partial_equivs_on_def
[PROOF STATE]
proof (prove)
using this:
A' \<subseteq> A
equiv A' R
card A' \<in> {0..card A}

goal (1 subgoal):
 1. R \<in> {0..card A} \<bind> (\<lambda>k. {A'. A' \<subseteq> A \<and> card A' = k} \<bind> (\<lambda>A'. Collect (equiv A')))
[PROOF STEP]
by (auto simp del: atLeastAtMost_iff)
[PROOF STATE]
proof (state)
this:
R \<in> all_partial_equivs_on A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{R. partial_equiv A R} \<subseteq> all_partial_equivs_on A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parallel_commute: "a \<parallel> b \<longleftrightarrow> b \<parallel> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<parallel> b) = (b \<parallel> a)
[PROOF STEP]
unfolding parallel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> prefix a b \<and> \<not> prefix b a) = (\<not> prefix b a \<and> \<not> prefix a b)
[PROOF STEP]
by auto


[STATEMENT]
lemma infdist_mono:
  assumes "A \<subseteq> B" "A \<noteq> {}"
  shows "infdist x B \<le> infdist x A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x B \<le> infdist x A
[PROOF STEP]
by (simp add: assms infdist_eq_setdist setdist_subset_right)


[STATEMENT]
lemma sum_list_plus:
  fixes xs :: "'a::comm_monoid_add list"
  assumes "length xs = length ys" shows "\<sigma> (xs + ys) = \<sigma> xs + \<sigma> ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<sigma> (xs + ys) = \<sigma> xs + \<sigma> ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys

goal (1 subgoal):
 1. \<sigma> (xs + ys) = \<sigma> xs + \<sigma> ys
[PROOF STEP]
by (simp add: plus_list_def case_prod_unfold sum_list_addf)


[STATEMENT]
lemma eq_comp_sum_diag_mat:
  shows "sum_list (eq_comps (diag_mat A)) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (eq_comps (diag_mat A)) = dim_row A
[PROOF STEP]
using eq_comps_sum_list[of "diag_mat A"] diag_mat_length
[PROOF STATE]
proof (prove)
using this:
sum_list (eq_comps (diag_mat A)) = length (diag_mat A)
length (diag_mat ?A) = dim_row ?A

goal (1 subgoal):
 1. sum_list (eq_comps (diag_mat A)) = dim_row A
[PROOF STEP]
by simp


[STATEMENT]
lemma list_of_oalist_sorted: "sorted_wrt (lt (snd (list_of_oalist xs))) (map fst (fst (list_of_oalist xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (lt (snd (list_of_oalist xs))) (map fst (fst (list_of_oalist xs)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sorted_wrt (lt (snd (list_of_oalist xs))) (map fst (fst (list_of_oalist xs)))
[PROOF STEP]
from oalist_inv_list_of_oalist
[PROOF STATE]
proof (chain)
picking this:
oalist_inv (list_of_oalist ?x)
[PROOF STEP]
have "oalist_inv_raw (snd (list_of_oalist xs)) (fst (list_of_oalist xs))"
[PROOF STATE]
proof (prove)
using this:
oalist_inv (list_of_oalist ?x)

goal (1 subgoal):
 1. oalist_inv_raw (snd (list_of_oalist xs)) (fst (list_of_oalist xs))
[PROOF STEP]
by (simp only: oalist_inv_def)
[PROOF STATE]
proof (state)
this:
oalist_inv_raw (snd (list_of_oalist xs)) (fst (list_of_oalist xs))

goal (1 subgoal):
 1. sorted_wrt (lt (snd (list_of_oalist xs))) (map fst (fst (list_of_oalist xs)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
oalist_inv_raw (snd (list_of_oalist xs)) (fst (list_of_oalist xs))

goal (1 subgoal):
 1. sorted_wrt (lt (snd (list_of_oalist xs))) (map fst (fst (list_of_oalist xs)))
[PROOF STEP]
by (rule oalist_inv_rawD2)
[PROOF STATE]
proof (state)
this:
sorted_wrt (lt (snd (list_of_oalist xs))) (map fst (fst (list_of_oalist xs)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma toSet_ODList[simp]:
  "\<lbrakk> distinct xs; sorted xs \<rbrakk> \<Longrightarrow> toSet (ODList xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; sorted xs\<rbrakk> \<Longrightarrow> toSet (ODList xs) = set xs
[PROOF STEP]
unfolding toSet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; sorted xs\<rbrakk> \<Longrightarrow> set (toList (ODList xs)) = set xs
[PROOF STEP]
by (simp add: toList_ODList)


[STATEMENT]
lemma inext_nth_card_append: "
  \<lbrakk> finite A; A \<noteq> {}; B \<noteq> {}; Max A < iMin B \<rbrakk> \<Longrightarrow>
  (A \<union> B) \<rightarrow> n = (if n < card A then A \<rightarrow> n else B \<rightarrow> (n - card A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}; B \<noteq> {}; Max A < iMin B\<rbrakk> \<Longrightarrow> (A \<union> B) \<rightarrow> n = (if n < card A then A \<rightarrow> n else B \<rightarrow> (n - card A))
[PROOF STEP]
by (simp add: inext_nth_card_append_eq1 inext_nth_card_append_eq2)


[STATEMENT]
lemma tr_ltr:
  assumes "trans R"
  shows "locally_trans R A B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_trans R A B C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
trans R

goal (1 subgoal):
 1. locally_trans R A B C
[PROOF STEP]
unfolding trans_def and locally_trans_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y z. (x, y) \<in> R \<longrightarrow> (y, z) \<in> R \<longrightarrow> (x, z) \<in> R

goal (1 subgoal):
 1. \<forall>t u v. t \<in># A \<longrightarrow> u \<in># B \<longrightarrow> v \<in># C \<longrightarrow> (t, u) \<in> R \<longrightarrow> (u, v) \<in> R \<longrightarrow> (t, v) \<in> R
[PROOF STEP]
by fast


[STATEMENT]
lemma eventually_deriv_mult:
  assumes "f twice_field_differentiable_at x"
      and "g twice_field_differentiable_at x"
    shows "\<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
obtain S and S'
    where "f field_differentiable_on S"   and in_S:  "x \<in> interior S"
      and "g field_differentiable_on S'"  and in_S': "x \<in> interior S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S S'. \<lbrakk>f field_differentiable_on S; x \<in> interior S; g field_differentiable_on S'; x \<in> interior S'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms twice_field_differentiable_at_def
[PROOF STATE]
proof (prove)
using this:
f twice_field_differentiable_at x
g twice_field_differentiable_at x
?f twice_field_differentiable_at ?x \<equiv> \<exists>S. ?f field_differentiable_on S \<and> ?x \<in> interior S \<and> deriv ?f field_differentiable at ?x

goal (1 subgoal):
 1. (\<And>S S'. \<lbrakk>f field_differentiable_on S; x \<in> interior S; g field_differentiable_on S'; x \<in> interior S'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f field_differentiable_on S
x \<in> interior S
g field_differentiable_on S'
x \<in> interior S'

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f field_differentiable_on S
x \<in> interior S
g field_differentiable_on S'
x \<in> interior S'
[PROOF STEP]
have Df_on_SS': "f field_differentiable_on (S \<inter> S')"
        and Dg_on_SS': "g field_differentiable_on (S \<inter> S')"
[PROOF STATE]
proof (prove)
using this:
f field_differentiable_on S
x \<in> interior S
g field_differentiable_on S'
x \<in> interior S'

goal (1 subgoal):
 1. f field_differentiable_on S \<inter> S' &&& g field_differentiable_on S \<inter> S'
[PROOF STEP]
using field_differentiable_on_subset
[PROOF STATE]
proof (prove)
using this:
f field_differentiable_on S
x \<in> interior S
g field_differentiable_on S'
x \<in> interior S'
\<lbrakk>?f field_differentiable_on ?S; ?T \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f field_differentiable_on ?T

goal (1 subgoal):
 1. f field_differentiable_on S \<inter> S' &&& g field_differentiable_on S \<inter> S'
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
f field_differentiable_on S \<inter> S'
g field_differentiable_on S \<inter> S'

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
have "\<forall>x\<in> interior (S \<inter> S'). deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>interior (S \<inter> S'). deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior (S \<inter> S') \<Longrightarrow> deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> interior (S \<inter> S') \<Longrightarrow> deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
assume "x \<in> interior (S \<inter> S')"
[PROOF STATE]
proof (state)
this:
x \<in> interior (S \<inter> S')

goal (1 subgoal):
 1. \<And>x. x \<in> interior (S \<inter> S') \<Longrightarrow> deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> interior (S \<inter> S')
[PROOF STEP]
have "f field_differentiable (at x)"
          and "g field_differentiable (at x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> interior (S \<inter> S')

goal (1 subgoal):
 1. f field_differentiable at x &&& g field_differentiable at x
[PROOF STEP]
using Df_on_SS' Dg_on_SS' field_differentiable_on_def at_within_interior interior_subset subsetD
[PROOF STATE]
proof (prove)
using this:
x \<in> interior (S \<inter> S')
f field_differentiable_on S \<inter> S'
g field_differentiable_on S \<inter> S'
?f field_differentiable_on ?s \<equiv> \<forall>x\<in>?s. ?f field_differentiable at x within ?s
?x \<in> interior ?S \<Longrightarrow> at ?x within ?S = at ?x
interior ?S \<subseteq> ?S
\<lbrakk>?A \<subseteq> ?B; ?c \<in> ?A\<rbrakk> \<Longrightarrow> ?c \<in> ?B

goal (1 subgoal):
 1. f field_differentiable at x &&& g field_differentiable at x
[PROOF STEP]
by metis+
[PROOF STATE]
proof (state)
this:
f field_differentiable at x
g field_differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> interior (S \<inter> S') \<Longrightarrow> deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f field_differentiable at x
g field_differentiable at x
[PROOF STEP]
show "deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x"
[PROOF STATE]
proof (prove)
using this:
f field_differentiable at x
g field_differentiable at x

goal (1 subgoal):
 1. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>interior (S \<inter> S'). deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>interior (S \<inter> S'). deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
have "x \<in> interior (S \<inter> S')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> interior (S \<inter> S')
[PROOF STEP]
by (simp add: in_S in_S')
[PROOF STATE]
proof (state)
this:
x \<in> interior (S \<inter> S')

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> interior (S \<inter> S')

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
have "open (interior (S \<inter> S'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (interior (S \<inter> S'))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
open (interior (S \<inter> S'))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>interior (S \<inter> S'). deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
x \<in> interior (S \<inter> S')
open (interior (S \<inter> S'))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>interior (S \<inter> S'). deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
x \<in> interior (S \<inter> S')
open (interior (S \<inter> S'))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
using eventually_nhds
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>interior (S \<inter> S'). deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
x \<in> interior (S \<inter> S')
open (interior (S \<inter> S'))
eventually ?P (nhds ?a) = (\<exists>S. open S \<and> ?a \<in> S \<and> (\<forall>x\<in>S. ?P x))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds x. deriv (\<lambda>x. f x * g x) x = f x * deriv g x + deriv f x * g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lambert_W'_strict_antimono:
  assumes "-exp (-1) \<le> x" "x < y" "y < 0"
  shows   "Lambert_W' x > Lambert_W' y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lambert_W' y < Lambert_W' x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Lambert_W' y < Lambert_W' x \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(Lambert_W' x > Lambert_W' y)"
[PROOF STATE]
proof (state)
this:
\<not> Lambert_W' y < Lambert_W' x

goal (1 subgoal):
 1. \<not> Lambert_W' y < Lambert_W' x \<Longrightarrow> False
[PROOF STEP]
hence "Lambert_W' x * exp (Lambert_W' x) \<ge> Lambert_W' y * exp (Lambert_W' y)"
[PROOF STATE]
proof (prove)
using this:
\<not> Lambert_W' y < Lambert_W' x

goal (1 subgoal):
 1. Lambert_W' y * exp (Lambert_W' y) \<le> Lambert_W' x * exp (Lambert_W' x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> Lambert_W' y < Lambert_W' x
- exp (- 1) \<le> x
x < y
y < 0

goal (1 subgoal):
 1. Lambert_W' y * exp (Lambert_W' y) \<le> Lambert_W' x * exp (Lambert_W' x)
[PROOF STEP]
by (intro exp_times_self_antimono Lambert_W'_le) auto
[PROOF STATE]
proof (state)
this:
Lambert_W' y * exp (Lambert_W' y) \<le> Lambert_W' x * exp (Lambert_W' x)

goal (1 subgoal):
 1. \<not> Lambert_W' y < Lambert_W' x \<Longrightarrow> False
[PROOF STEP]
hence "x \<ge> y"
[PROOF STATE]
proof (prove)
using this:
Lambert_W' y * exp (Lambert_W' y) \<le> Lambert_W' x * exp (Lambert_W' x)

goal (1 subgoal):
 1. y \<le> x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Lambert_W' y * exp (Lambert_W' y) \<le> Lambert_W' x * exp (Lambert_W' x)
- exp (- 1) \<le> x
x < y
y < 0

goal (1 subgoal):
 1. y \<le> x
[PROOF STEP]
by (simp add: Lambert_W'_times_exp_self)
[PROOF STATE]
proof (state)
this:
y \<le> x

goal (1 subgoal):
 1. \<not> Lambert_W' y < Lambert_W' x \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
- exp (- 1) \<le> x
x < y
y < 0
y \<le> x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
- exp (- 1) \<le> x
x < y
y < 0
y \<le> x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pmult_distr:
  "pmult a (padd b c) = padd (pmult a b) (pmult a c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmult a (padd b c) = padd (pmult a b) (pmult a c)
[PROOF STEP]
by (metis Rep_prat_inject distrib_left padd.rep_eq pmult.rep_eq)


[STATEMENT]
lemma Fr_ClBr: "\<forall>A. Fr(A) = (Cl(A) \<and> Br(A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
using join_def meet_def pB2 pC2
[PROOF STATE]
proof (prove)
using this:
?A \<^bold>\<or> ?B \<equiv> \<lambda>w. ?A w \<or> ?B w
?A \<^bold>\<and> ?B \<equiv> \<lambda>w. ?A w \<and> ?B w
\<forall>A w. \<B> A w = (A \<^bold>\<and> \<F> A) w
\<forall>A w. \<C> A w = (A \<^bold>\<or> \<F> A) w

goal (1 subgoal):
 1. \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
by auto


[STATEMENT]
lemma antisymp_rel_pmf:
  "\<lbrakk> reflp R; transp R; antisymp R \<rbrakk>
  \<Longrightarrow> antisymp (rel_pmf R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>reflp R; transp R; antisymp R\<rbrakk> \<Longrightarrow> antisymp (rel_pmf R)
[PROOF STEP]
by(rule antisympI)(blast intro: rel_pmf_antisym)


[STATEMENT]
lemma roundup_le_ub:
  "\<lbrakk> 176 + sLen \<le> emBits; emBits \<le> 2^32 * 160\<rbrakk> \<Longrightarrow> (roundup emBits 8) * 8 - 168 \<le> 2^32 * 160"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>176 + sLen \<le> emBits; emBits \<le> 2 ^ 32 * 160\<rbrakk> \<Longrightarrow> roundup emBits 8 * 8 - 168 \<le> 2 ^ 32 * 160
[PROOF STEP]
apply (simp add: roundup)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>176 + sLen \<le> emBits; emBits \<le> 687194767360\<rbrakk> \<Longrightarrow> (emBits mod 8 = 0 \<longrightarrow> emBits div 8 * 8 - 168 \<le> 687194767360) \<and> (0 < emBits mod 8 \<longrightarrow> emBits div 8 * 8 - 160 \<le> 687194767360)
[PROOF STEP]
apply (safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>176 + sLen \<le> emBits; emBits \<le> 687194767360; 8 dvd emBits\<rbrakk> \<Longrightarrow> emBits div 8 * 8 - 168 \<le> 687194767360
 2. \<lbrakk>176 + sLen \<le> emBits; emBits \<le> 687194767360; 0 < emBits mod 8\<rbrakk> \<Longrightarrow> emBits div 8 * 8 - 160 \<le> 687194767360
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>176 + sLen \<le> emBits; emBits \<le> 687194767360; 0 < emBits mod 8\<rbrakk> \<Longrightarrow> emBits div 8 * 8 - 160 \<le> 687194767360
[PROOF STEP]
apply (arith)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_nat_lt_zhmset_of_enat_iff: "of_nat m < zhmset_of_enat n \<longleftrightarrow> enat m < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat m < zhmset_of_enat n) = (enat m < n)
[PROOF STEP]
by (metis zhmset_of_enat.simps(1) zhmset_of_enat_lt_iff_lt)


[STATEMENT]
lemma fs_int_d_pos [intro]:
  assumes k: "k \<le> m"
shows "d fs k > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d fs k
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < gs.Gramian_determinant fs k
[PROOF STEP]
using Gramian_determinant[OF k]
[PROOF STATE]
proof (prove)
using this:
rat_of_int (gs.Gramian_determinant fs k) = (\<Prod>j<k. \<parallel>gs.gso j\<parallel>\<^sup>2)
0 < gs.Gramian_determinant fs k

goal (1 subgoal):
 1. 0 < gs.Gramian_determinant fs k
[PROOF STEP]
by auto


[STATEMENT]
lemma rev_append_invert: "(xs @ ys = rev zs) = (zs = rev ys @ rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ ys = rev zs) = (zs = rev ys @ rev xs)
[PROOF STEP]
by (induct xs arbitrary: ys rule: rev_induct) auto


[STATEMENT]
lemma rbt_lookup_rbt_inter:
  "\<lbrakk> rbt_sorted t1; rbt_sorted t2 \<rbrakk>
  \<Longrightarrow> rbt_lookup (rbt_inter t1 t2) = rbt_lookup t2 |` dom (rbt_lookup t1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbt_sorted t1; rbt_sorted t2\<rbrakk> \<Longrightarrow> rbt_lookup (rbt_inter t1 t2) = rbt_lookup t2 |` dom (rbt_lookup t1)
[PROOF STEP]
by(auto simp add: rbt_inter_def rbt_lookup_rbt_interwk restrict_map_def split: option.split)


[STATEMENT]
lemma nonempty_int: "A \<inter> B \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> A \<inter> B "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B \<noteq> {} \<Longrightarrow> \<exists>x. x \<in> A \<inter> B
[PROOF STEP]
by blast


[STATEMENT]
lemma transpose_board: "transpose_board (board n m) = board m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_board (board n m) = board m n
[PROOF STEP]
unfolding board_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. transpose_board {(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m} = {(i, j) |i j. 1 \<le> i \<and> i \<le> int m \<and> 1 \<le> j \<and> j \<le> int n}
[PROOF STEP]
using transpose_board_correct
[PROOF STATE]
proof (prove)
using this:
(?s\<^sub>i \<in> ?b) = (transpose_square ?s\<^sub>i \<in> transpose_board ?b)

goal (1 subgoal):
 1. transpose_board {(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m} = {(i, j) |i j. 1 \<le> i \<and> i \<le> int m \<and> 1 \<le> j \<and> j \<le> int n}
[PROOF STEP]
by (auto simp: transpose_square_def)


[STATEMENT]
lemma matrix_to_iarray_fst_snd_Gauss_Jordan_column_k_det_P:
assumes i: "i\<le>nrows A" and k: "k<ncols A"
shows "fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
proof (cases "i<nrows A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < nrows A \<Longrightarrow> fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
 2. \<not> i < nrows A \<Longrightarrow> fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < nrows A

goal (2 subgoals):
 1. i < nrows A \<Longrightarrow> fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
 2. \<not> i < nrows A \<Longrightarrow> fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
unfolding Gauss_Jordan_column_k_det_P_def Gauss_Jordan_column_k_det_P_iarrays_def Let_def snd_conv fst_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (n, i, A) else (fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))))) = fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, matrix_to_iarray A) else (fst (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k))))
[PROOF STEP]
unfolding matrix_to_iarray_nrows matrix_vector_all_zero_from_index
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (if vector_all_zero_from_index (mod_type_class.to_nat (mod_type_class.from_nat i), vec_to_iarray (column (mod_type_class.from_nat k) A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, A) else (fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))))) = fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, matrix_to_iarray A) else (fst (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k))))
[PROOF STEP]
unfolding vec_to_iarray_column
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (if vector_all_zero_from_index (mod_type_class.to_nat (mod_type_class.from_nat i), column_iarray (mod_type_class.to_nat (mod_type_class.from_nat k)) (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, A) else (fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))))) = fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, matrix_to_iarray A) else (fst (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k))))
[PROOF STEP]
unfolding to_nat_from_nat_id[OF True[unfolded nrows_def]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (if vector_all_zero_from_index (i, column_iarray (mod_type_class.to_nat (mod_type_class.from_nat k)) (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, A) else (fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))))) = fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, matrix_to_iarray A) else (fst (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k))))
[PROOF STEP]
unfolding to_nat_from_nat_id[OF k[unfolded ncols_def]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, A) else (fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))))) = fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, matrix_to_iarray A) else (fst (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))

goal (1 subgoal):
 1. \<not> i < nrows A \<Longrightarrow> fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < nrows A \<Longrightarrow> fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < nrows A

goal (1 subgoal):
 1. \<not> i < nrows A \<Longrightarrow> fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> i < nrows A

goal (1 subgoal):
 1. fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> i < nrows A
i \<le> nrows A
k < ncols A

goal (1 subgoal):
 1. fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))
[PROOF STEP]
unfolding Gauss_Jordan_column_k_det_P_def Gauss_Jordan_column_k_det_P_iarrays_def Let_def snd_conv fst_conv
[PROOF STATE]
proof (prove)
using this:
\<not> i < nrows A
i \<le> nrows A
k < ncols A

goal (1 subgoal):
 1. fst (snd (if (\<forall>m\<ge>mod_type_class.from_nat i. A $ m $ mod_type_class.from_nat k = (0::'a)) \<or> i = nrows A then (n, i, A) else (fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))))) = fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, matrix_to_iarray A) else (fst (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k))))
[PROOF STEP]
unfolding matrix_to_iarray_nrows matrix_vector_all_zero_from_index
[PROOF STATE]
proof (prove)
using this:
\<not> i < nrows_iarray (matrix_to_iarray A)
i \<le> nrows_iarray (matrix_to_iarray A)
k < ncols A

goal (1 subgoal):
 1. fst (snd (if vector_all_zero_from_index (mod_type_class.to_nat (mod_type_class.from_nat i), vec_to_iarray (column (mod_type_class.from_nat k) A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, A) else (fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))))) = fst (snd (if vector_all_zero_from_index (i, column_iarray k (matrix_to_iarray A)) \<or> i = nrows_iarray (matrix_to_iarray A) then (n, i, matrix_to_iarray A) else (fst (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k) * n, i + 1, snd (Gauss_Jordan_in_ij_det_P_iarrays (matrix_to_iarray A) i k))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst (snd (Gauss_Jordan_column_k_det_P (n, i, A) k)) = fst (snd (Gauss_Jordan_column_k_det_P_iarrays (n, i, matrix_to_iarray A) k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ipoly_interval_args_mono:
  fixes p::"'a::linordered_idom poly"
    and   x::"'a list"
    and   xs::"'a interval list"
  assumes "x all_in\<^sub>i xs"
  assumes "num_params p \<le> length xs"
  shows "Ipoly x p \<in> set_of (Ipoly xs (map_poly interval_of p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly x p \<in>\<^sub>i Ipoly xs (map_poly interval_of p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x all_in\<^sub>i xs
num_params p \<le> length xs

goal (1 subgoal):
 1. Ipoly x p \<in>\<^sub>i Ipoly xs (map_poly interval_of p)
[PROOF STEP]
by (induction p)
    (auto simp: all_in_i_def plus_in_intervalI minus_in_intervalI times_in_intervalI
      uminus_in_intervalI set_of_power_mono)


[STATEMENT]
lemma permutep_Const\<^sub>0 [simp]: "(\<And>x. f x = 0 \<longleftrightarrow> x = 0) \<Longrightarrow> permutep f (Const\<^sub>0 c) = Const\<^sub>0 c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. (f x = 0) = (x = 0)) \<Longrightarrow> permutep f (Const\<^sub>0 c) = Const\<^sub>0 c
[PROOF STEP]
unfolding Const\<^sub>0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. (f x = 0) = (x = 0)) \<Longrightarrow> permutep f (Poly_Mapping.single 0 c) = Poly_Mapping.single 0 c
[PROOF STEP]
by transfer' (auto simp: when_def fun_eq_iff)