[STATEMENT]
lemma zip_nth_conv: "length xs = length ys \<Longrightarrow> zip xs ys = map (\<lambda> i. (xs ! i, ys ! i)) [0 ..< length ys]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys \<Longrightarrow> zip xs ys = map (\<lambda>i. (xs ! i, ys ! i)) [0..<length ys]
[PROOF STEP]
proof (induct xs arbitrary: ys, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. length xs = length ys \<Longrightarrow> zip xs ys = map (\<lambda>i. (xs ! i, ys ! i)) [0..<length ys]; length (a # xs) = length ys\<rbrakk> \<Longrightarrow> zip (a # xs) ys = map (\<lambda>i. ((a # xs) ! i, ys ! i)) [0..<length ys]
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
length xs = length ?ys \<Longrightarrow> zip xs ?ys = map (\<lambda>i. (xs ! i, ?ys ! i)) [0..<length ?ys]
length (x # xs) = length ys

goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. length xs = length ys \<Longrightarrow> zip xs ys = map (\<lambda>i. (xs ! i, ys ! i)) [0..<length ys]; length (a # xs) = length ys\<rbrakk> \<Longrightarrow> zip (a # xs) ys = map (\<lambda>i. ((a # xs) ! i, ys ! i)) [0..<length ys]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length xs = length ?ys \<Longrightarrow> zip xs ?ys = map (\<lambda>i. (xs ! i, ?ys ! i)) [0..<length ?ys]
length (x # xs) = length ys
[PROOF STEP]
obtain y yys where ys: "ys = y # yys"
[PROOF STATE]
proof (prove)
using this:
length xs = length ?ys \<Longrightarrow> zip xs ?ys = map (\<lambda>i. (xs ! i, ?ys ! i)) [0..<length ?ys]
length (x # xs) = length ys

goal (1 subgoal):
 1. (\<And>y yys. ys = y # yys \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases ys, auto)
[PROOF STATE]
proof (state)
this:
ys = y # yys

goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. length xs = length ys \<Longrightarrow> zip xs ys = map (\<lambda>i. (xs ! i, ys ! i)) [0..<length ys]; length (a # xs) = length ys\<rbrakk> \<Longrightarrow> zip (a # xs) ys = map (\<lambda>i. ((a # xs) ! i, ys ! i)) [0..<length ys]
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
length xs = length ?ys \<Longrightarrow> zip xs ?ys = map (\<lambda>i. (xs ! i, ?ys ! i)) [0..<length ?ys]
length (x # xs) = length ys
ys = y # yys
[PROOF STEP]
have len: "length xs = length yys"
[PROOF STATE]
proof (prove)
using this:
length xs = length ?ys \<Longrightarrow> zip xs ?ys = map (\<lambda>i. (xs ! i, ?ys ! i)) [0..<length ?ys]
length (x # xs) = length ys
ys = y # yys

goal (1 subgoal):
 1. length xs = length yys
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length xs = length yys

goal (1 subgoal):
 1. \<And>a xs ys. \<lbrakk>\<And>ys. length xs = length ys \<Longrightarrow> zip xs ys = map (\<lambda>i. (xs ! i, ys ! i)) [0..<length ys]; length (a # xs) = length ys\<rbrakk> \<Longrightarrow> zip (a # xs) ys = map (\<lambda>i. ((a # xs) ! i, ys ! i)) [0..<length ys]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (x # xs) ys = map (\<lambda>i. ((x # xs) ! i, ys ! i)) [0..<length ys]
[PROOF STEP]
unfolding ys
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip (x # xs) (y # yys) = map (\<lambda>i. ((x # xs) ! i, (y # yys) ! i)) [0..<length (y # yys)]
[PROOF STEP]
by (simp del: upt_Suc add: map_upt_Suc, unfold Cons(1)[OF len], simp)
[PROOF STATE]
proof (state)
this:
zip (x # xs) ys = map (\<lambda>i. ((x # xs) ! i, ys ! i)) [0..<length ys]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_sum_card_elements_with_ord_eq_totient:
  "(\<Sum>d | d dvd totient n. \<psi> d) = totient n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
have "totient n = card (totatives n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient n = card (totatives n)
[PROOF STEP]
by (simp add: totient_def)
[PROOF STATE]
proof (state)
this:
totient n = card (totatives n)

goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
totient n = card (totatives n)

goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
have "totatives n = (\<Union>d\<in>{d. d dvd totient n}. {x\<in>totatives n. ord n x = d})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totatives n = (\<Union>d\<in>{d. d dvd totient n}. {x \<in> totatives n. ord n x = d})
[PROOF STEP]
by (force simp: order_divides_totient totatives_def coprime_commute)
[PROOF STATE]
proof (state)
this:
totatives n = (\<Union>d\<in>{d. d dvd totient n}. {x \<in> totatives n. ord n x = d})

goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
totatives n = (\<Union>d\<in>{d. d dvd totient n}. {x \<in> totatives n. ord n x = d})

goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
have "card \<dots> = (\<Sum>d | d dvd totient n. \<psi> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union>d\<in>{d. d dvd totient n}. {x \<in> totatives n. ord n x = d}) = (\<Sum>d | d dvd totient n. \<psi> d)
[PROOF STEP]
unfolding \<psi>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union>d\<in>{d. d dvd totient n}. {x \<in> totatives n. ord n x = d}) = (\<Sum>d | d dvd totient n. card {x \<in> totatives n. ord n x = d})
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. card (\<Union>d\<in>{d. d dvd totient n}. {x \<in> totatives n. ord n x = d}) = (\<Sum>d | d dvd totient n. card {x \<in> totatives n. ord n x = d})
[PROOF STEP]
by (subst card_UN_disjoint) (auto intro!: finite_divisors_nat)
[PROOF STATE]
proof (state)
this:
card (\<Union>d\<in>{d. d dvd totient n}. {x \<in> totatives n. ord n x = d}) = (\<Sum>d | d dvd totient n. \<psi> d)

goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
totient n = (\<Sum>d | d dvd totient n. \<psi> d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
totient n = (\<Sum>d | d dvd totient n. \<psi> d)

goal (1 subgoal):
 1. (\<Sum>d | d dvd totient n. \<psi> d) = totient n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd totient n. \<psi> d) = totient n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distinct_mset_image_mset:
  \<open>distinct_mset (image_mset f (mset xs)) \<longleftrightarrow> distinct (map f xs)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset (image_mset f (mset xs)) = distinct (map f xs)
[PROOF STEP]
apply (subst mset_map[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset (mset (map f xs)) = distinct (map f xs)
[PROOF STEP]
apply (subst distinct_mset_mset_distinct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map f xs) = distinct (map f xs)
[PROOF STEP]
..


[STATEMENT]
lemma one_le_of_rat_iff [simp]: "1 \<le> (of_rat r :: 'a::linordered_field) \<longleftrightarrow> 1 \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1::'a) \<le> of_rat r) = (1 \<le> r)
[PROOF STEP]
using of_rat_less_eq [of 1 r]
[PROOF STATE]
proof (prove)
using this:
(of_rat 1 \<le> of_rat r) = (1 \<le> r)

goal (1 subgoal):
 1. ((1::'a) \<le> of_rat r) = (1 \<le> r)
[PROOF STEP]
by simp


[STATEMENT]
lemma proj2_Col_coeff_unique:
  assumes "a \<noteq> r"
  and "proj2_abs (i *\<^sub>R proj2_rep a + proj2_rep r)
  = proj2_abs (j *\<^sub>R proj2_rep a + proj2_rep r)"
  shows "i = j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = j
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i = j
[PROOF STEP]
let ?a' = "proj2_rep a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i = j
[PROOF STEP]
let ?r' = "proj2_rep r"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i = j
[PROOF STEP]
have "?a' \<noteq> 0" and "?r' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_rep a \<noteq> 0 &&& proj2_rep r \<noteq> 0
[PROOF STEP]
by (rule proj2_rep_non_zero)+
[PROOF STATE]
proof (state)
this:
proj2_rep a \<noteq> 0
proj2_rep r \<noteq> 0

goal (1 subgoal):
 1. i = j
[PROOF STEP]
from \<open>a \<noteq> r\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> r
[PROOF STEP]
have "proj2_abs ?a' \<noteq> proj2_abs ?r'"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> r

goal (1 subgoal):
 1. proj2_abs (proj2_rep a) \<noteq> proj2_abs (proj2_rep r)
[PROOF STEP]
by (simp add: proj2_abs_rep)
[PROOF STATE]
proof (state)
this:
proj2_abs (proj2_rep a) \<noteq> proj2_abs (proj2_rep r)

goal (1 subgoal):
 1. i = j
[PROOF STEP]
with \<open>?a' \<noteq> 0\<close> and \<open>?r' \<noteq> 0\<close>
    and \<open>proj2_abs (i *\<^sub>R ?a' + ?r') = proj2_abs (j *\<^sub>R ?a' + ?r')\<close>
    and proj2_Col_coeff_unique'
[PROOF STATE]
proof (chain)
picking this:
proj2_rep a \<noteq> 0
proj2_rep r \<noteq> 0
proj2_abs (i *\<^sub>R proj2_rep a + proj2_rep r) = proj2_abs (j *\<^sub>R proj2_rep a + proj2_rep r)
\<lbrakk>?a \<noteq> 0; ?r \<noteq> 0; proj2_abs ?a \<noteq> proj2_abs ?r; proj2_abs (?i *\<^sub>R ?a + ?r) = proj2_abs (?j *\<^sub>R ?a + ?r)\<rbrakk> \<Longrightarrow> ?i = ?j
proj2_abs (proj2_rep a) \<noteq> proj2_abs (proj2_rep r)
[PROOF STEP]
show "i = j"
[PROOF STATE]
proof (prove)
using this:
proj2_rep a \<noteq> 0
proj2_rep r \<noteq> 0
proj2_abs (i *\<^sub>R proj2_rep a + proj2_rep r) = proj2_abs (j *\<^sub>R proj2_rep a + proj2_rep r)
\<lbrakk>?a \<noteq> 0; ?r \<noteq> 0; proj2_abs ?a \<noteq> proj2_abs ?r; proj2_abs (?i *\<^sub>R ?a + ?r) = proj2_abs (?j *\<^sub>R ?a + ?r)\<rbrakk> \<Longrightarrow> ?i = ?j
proj2_abs (proj2_rep a) \<noteq> proj2_abs (proj2_rep r)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in comm_group) finprod_minus_symm:
  assumes "a \<in> A" "f \<in> A \<rightarrow> carrier G" "finite A"
  shows "finprod G f A = finprod G f (A - {a}) \<otimes> f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> A
f \<in> A \<rightarrow> carrier G
finite A
[PROOF STEP]
have "A = insert a (A - {a})"
[PROOF STATE]
proof (prove)
using this:
a \<in> A
f \<in> A \<rightarrow> carrier G
finite A

goal (1 subgoal):
 1. A = insert a (A - {a})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A = insert a (A - {a})

goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = insert a (A - {a})
[PROOF STEP]
have "finprod G f A = finprod G f (insert a (A - {a}))"
[PROOF STATE]
proof (prove)
using this:
A = insert a (A - {a})

goal (1 subgoal):
 1. finprod G f A = finprod G f (insert a (A - {a}))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finprod G f A = finprod G f (insert a (A - {a}))

goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
finprod G f A = finprod G f (insert a (A - {a}))

goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
have "\<dots> = f a \<otimes> finprod G f (A - {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G f (insert a (A - {a})) = f a \<otimes> finprod G f (A - {a})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> A
f \<in> A \<rightarrow> carrier G
finite A

goal (1 subgoal):
 1. finprod G f (insert a (A - {a})) = f a \<otimes> finprod G f (A - {a})
[PROOF STEP]
by (intro finprod_insert, auto)
[PROOF STATE]
proof (state)
this:
finprod G f (insert a (A - {a})) = f a \<otimes> finprod G f (A - {a})

goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
finprod G f (insert a (A - {a})) = f a \<otimes> finprod G f (A - {a})

goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
have "\<dots> = finprod G f (A - {a}) \<otimes> f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a \<otimes> finprod G f (A - {a}) = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
by (intro m_comm, use assms in blast, intro finprod_closed, use assms in blast)
[PROOF STATE]
proof (state)
this:
f a \<otimes> finprod G f (A - {a}) = finprod G f (A - {a}) \<otimes> f a

goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finprod G f A = finprod G f (A - {a}) \<otimes> f a

goal (1 subgoal):
 1. finprod G f A = finprod G f (A - {a}) \<otimes> f a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finprod G f A = finprod G f (A - {a}) \<otimes> f a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simply_connected_imp_winding_number_zero:
  assumes "simply_connected S" "path g"
           "path_image g \<subseteq> S" "pathfinish g = pathstart g" "z \<notin> S"
    shows "winding_number g z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
have hom: "homotopic_loops S g (linepath (pathstart g) (pathstart g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_loops S g (linepath (pathstart g) (pathstart g))
[PROOF STEP]
by (meson assms homotopic_paths_imp_homotopic_loops pathfinish_linepath simply_connected_eq_contractible_path)
[PROOF STATE]
proof (state)
this:
homotopic_loops S g (linepath (pathstart g) (pathstart g))

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_loops S g (linepath (pathstart g) (pathstart g))
[PROOF STEP]
have "homotopic_paths (- {z}) g (linepath (pathstart g) (pathstart g))"
[PROOF STATE]
proof (prove)
using this:
homotopic_loops S g (linepath (pathstart g) (pathstart g))

goal (1 subgoal):
 1. homotopic_paths (- {z}) g (linepath (pathstart g) (pathstart g))
[PROOF STEP]
by (meson \<open>z \<notin> S\<close> homotopic_loops_imp_homotopic_paths_null homotopic_paths_subset subset_Compl_singleton)
[PROOF STATE]
proof (state)
this:
homotopic_paths (- {z}) g (linepath (pathstart g) (pathstart g))

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homotopic_paths (- {z}) g (linepath (pathstart g) (pathstart g))
[PROOF STEP]
have "winding_number g z = winding_number(linepath (pathstart g) (pathstart g)) z"
[PROOF STATE]
proof (prove)
using this:
homotopic_paths (- {z}) g (linepath (pathstart g) (pathstart g))

goal (1 subgoal):
 1. winding_number g z = winding_number (linepath (pathstart g) (pathstart g)) z
[PROOF STEP]
by (rule winding_number_homotopic_paths)
[PROOF STATE]
proof (state)
this:
winding_number g z = winding_number (linepath (pathstart g) (pathstart g)) z

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
winding_number g z = winding_number (linepath (pathstart g) (pathstart g)) z

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (linepath (pathstart g) (pathstart g)) z = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
simply_connected S
path g
path_image g \<subseteq> S
pathfinish g = pathstart g
z \<notin> S

goal (1 subgoal):
 1. winding_number (linepath (pathstart g) (pathstart g)) z = 0
[PROOF STEP]
by (force intro: winding_number_trivial)
[PROOF STATE]
proof (state)
this:
winding_number (linepath (pathstart g) (pathstart g)) z = 0

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
winding_number g z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
winding_number g z = 0

goal (1 subgoal):
 1. winding_number g z = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
winding_number g z = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_order_gt0: "(add_order a > 0) = (\<exists>n>0. a+^n = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < add_order a) = (\<exists>n>0. a +^ n = (0::'a))
[PROOF STEP]
using LeastI_ex[of "\<lambda>n. n>0 \<and> a+^n = 0"] add_order_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x>0. a +^ x = (0::'a) \<Longrightarrow> 0 < (LEAST n. 0 < n \<and> a +^ n = (0::'a)) \<and> a +^ (LEAST n. 0 < n \<and> a +^ n = (0::'a)) = (0::'a)
add_order ?a \<equiv> if \<exists>n>0. ?a +^ n = (0::'a) then LEAST n. 0 < n \<and> ?a +^ n = (0::'a) else 0

goal (1 subgoal):
 1. (0 < add_order a) = (\<exists>n>0. a +^ n = (0::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma poincare_line_0_real_is_x_axis:
  assumes "x \<in> circline_set x_axis" "x \<noteq> 0\<^sub>h" "x \<noteq> \<infinity>\<^sub>h"
  shows "poincare_line 0\<^sub>h x = x_axis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_line 0\<^sub>h x = x_axis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> circline_set x_axis
x \<noteq> 0\<^sub>h
x \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. poincare_line 0\<^sub>h x = x_axis
[PROOF STEP]
using is_poincare_line_0_real_is_x_axis[of "poincare_line 0\<^sub>h x" x]
[PROOF STATE]
proof (prove)
using this:
x \<in> circline_set x_axis
x \<noteq> 0\<^sub>h
x \<noteq> \<infinity>\<^sub>h
\<lbrakk>is_poincare_line (poincare_line 0\<^sub>h x); 0\<^sub>h \<in> circline_set (poincare_line 0\<^sub>h x); x \<in> circline_set (poincare_line 0\<^sub>h x) \<inter> circline_set x_axis; x \<noteq> 0\<^sub>h; x \<noteq> \<infinity>\<^sub>h\<rbrakk> \<Longrightarrow> poincare_line 0\<^sub>h x = x_axis

goal (1 subgoal):
 1. poincare_line 0\<^sub>h x = x_axis
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_sum_less : "(\<forall>i\<in>{0..n::nat}. MPoly_Type.degree (f i :: real mpoly) var < x) \<Longrightarrow> (MPoly_Type.degree (\<Sum>x\<in>{0..n}. f x) var) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x
[PROOF STEP]
proof(induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i\<in>{0..0}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..0}) var < x
 2. \<And>n. \<lbrakk>\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x; \<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x\<rbrakk> \<Longrightarrow> MPoly_Type.degree (sum f {0..Suc n}) var < x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{0..0}. MPoly_Type.degree (f i) var < x

goal (2 subgoals):
 1. \<forall>i\<in>{0..0}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..0}) var < x
 2. \<And>n. \<lbrakk>\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x; \<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x\<rbrakk> \<Longrightarrow> MPoly_Type.degree (sum f {0..Suc n}) var < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>{0..0}. MPoly_Type.degree (f i) var < x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>{0..0}. MPoly_Type.degree (f i) var < x

goal (1 subgoal):
 1. MPoly_Type.degree (sum f {0..0}) var < x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
MPoly_Type.degree (sum f {0..0}) var < x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x; \<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x\<rbrakk> \<Longrightarrow> MPoly_Type.degree (sum f {0..Suc n}) var < x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x; \<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x\<rbrakk> \<Longrightarrow> MPoly_Type.degree (sum f {0..Suc n}) var < x
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x
\<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x; \<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x\<rbrakk> \<Longrightarrow> MPoly_Type.degree (sum f {0..Suc n}) var < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x
\<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>{0..n}. MPoly_Type.degree (f i) var < x \<Longrightarrow> MPoly_Type.degree (sum f {0..n}) var < x
\<forall>i\<in>{0..Suc n}. MPoly_Type.degree (f i) var < x

goal (1 subgoal):
 1. MPoly_Type.degree (sum f {0..Suc n}) var < x
[PROOF STEP]
by(simp add: degree_add_less)
[PROOF STATE]
proof (state)
this:
MPoly_Type.degree (sum f {0..Suc n}) var < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Re_mult_real3:
  assumes "is_real z1" and "is_real z2" and "is_real z3"
  shows "Re (z1 * z2 * z3) = Re z1 * Re z2 * Re z3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (z1 * z2 * z3) = Re z1 * Re z2 * Re z3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real z1
is_real z2
is_real z3

goal (1 subgoal):
 1. Re (z1 * z2 * z3) = Re z1 * Re z2 * Re z3
[PROOF STEP]
by (metis Re_mult_real mult_reals)


[STATEMENT]
lemma drop_res_eq_f:
  assumes "maps_to_n (Suc n) f"
  assumes "\<not> (\<forall>m. \<exists>n. n>m \<and> (f n = (Suc k)))"
  shows "\<exists>N. \<forall>n. n>N \<longrightarrow> f n = drop_res (Suc k) f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n>N. f n = drop_res (int (Suc k)) f n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>N. \<forall>n>N. f n = drop_res (int (Suc k)) f n
[PROOF STEP]
have "\<exists>m. \<forall>n. n \<le> m \<or> (f n) \<noteq> (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m. \<forall>n. n \<le> m \<or> f n \<noteq> int (Suc k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
maps_to_n (int (Suc n)) f
\<not> (\<forall>m. \<exists>n>m. f n = int (Suc k))

goal (1 subgoal):
 1. \<exists>m. \<forall>n. n \<le> m \<or> f n \<noteq> int (Suc k)
[PROOF STEP]
by (meson Suc_le_eq nat_le_linear)
[PROOF STATE]
proof (state)
this:
\<exists>m. \<forall>n. n \<le> m \<or> f n \<noteq> int (Suc k)

goal (1 subgoal):
 1. \<exists>N. \<forall>n>N. f n = drop_res (int (Suc k)) f n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>m. \<forall>n. n \<le> m \<or> f n \<noteq> int (Suc k)
[PROOF STEP]
have "\<exists>m. \<forall>n. n \<le> m \<or> (f n)  = drop_res (Suc k) f n"
[PROOF STATE]
proof (prove)
using this:
\<exists>m. \<forall>n. n \<le> m \<or> f n \<noteq> int (Suc k)

goal (1 subgoal):
 1. \<exists>m. \<forall>n. n \<le> m \<or> f n = drop_res (int (Suc k)) f n
[PROOF STEP]
using drop_res_def
[PROOF STATE]
proof (prove)
using this:
\<exists>m. \<forall>n. n \<le> m \<or> f n \<noteq> int (Suc k)
drop_res ?k ?f ?n = (if ?f ?n = ?k then 0 else ?f ?n)

goal (1 subgoal):
 1. \<exists>m. \<forall>n. n \<le> m \<or> f n = drop_res (int (Suc k)) f n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>m. \<forall>n. n \<le> m \<or> f n = drop_res (int (Suc k)) f n

goal (1 subgoal):
 1. \<exists>N. \<forall>n>N. f n = drop_res (int (Suc k)) f n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>m. \<forall>n. n \<le> m \<or> f n = drop_res (int (Suc k)) f n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>m. \<forall>n. n \<le> m \<or> f n = drop_res (int (Suc k)) f n

goal (1 subgoal):
 1. \<exists>N. \<forall>n>N. f n = drop_res (int (Suc k)) f n
[PROOF STEP]
by (meson less_Suc_eq_le order.asym)
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n>N. f n = drop_res (int (Suc k)) f n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary_X:
  shows "Complex_Matrix.unitary X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.unitary X
[PROOF STEP]
have "Complex_Matrix.adjoint X * X = (1\<^sub>m 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint X * X = 1\<^sub>m 2
[PROOF STEP]
using dagger_adjoint[of X]
[PROOF STATE]
proof (prove)
using this:
X\<^sup>\<dagger> = Complex_Matrix.adjoint X

goal (1 subgoal):
 1. Complex_Matrix.adjoint X * X = 1\<^sub>m 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint X * X = 1\<^sub>m 2

goal (1 subgoal):
 1. Complex_Matrix.unitary X
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint X * X = 1\<^sub>m 2

goal (1 subgoal):
 1. Complex_Matrix.unitary X
[PROOF STEP]
unfolding unitary_def
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint X * X = 1\<^sub>m 2

goal (1 subgoal):
 1. X \<in> carrier_mat (dim_row X) (dim_row X) \<and> inverts_mat X (Complex_Matrix.adjoint X)
[PROOF STEP]
by (metis Complex_Matrix.adjoint_adjoint Complex_Matrix.unitary_def X_carrier adjoint_dim
        carrier_matD(1) inverts_mat_def unitary_adjoint)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.unitary X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_mult_fps_XD_shift:
  "(fps_XD ^^ k) (a :: 'a::comm_ring_1 fps) = Abs_fps (\<lambda>n. (of_nat n ^ k) * a$n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_XD ^^ k) a = Abs_fps (\<lambda>n. of_nat n ^ k * a $ n)
[PROOF STEP]
by (induct k arbitrary: a) (simp_all add: fps_XD_def fps_eq_iff field_simps del: One_nat_def)


[STATEMENT]
lemma mtx_ith_eq[simp]: "mtx A $$ i $ j = foldr (\<lambda>x f n. (f (n + 1))(n := x))
  (map (\<lambda>l. vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) l (\<lambda>n x. 0) 1)) A) (\<lambda>n x. 0) 1 i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mtx A $$ i $ j = foldr (\<lambda>x f n. (f (n + (1::'a)))(n := x)) (map (\<lambda>l. vec_lambda (foldr (\<lambda>x f n. (f (n + (1::'a)))(n := x)) l (\<lambda>n x. 0) (1::'a))) A) (\<lambda>n x. 0) (1::'a) i $ j
[PROOF STEP]
unfolding mtx_def vector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_mtx (vec_lambda (foldr (\<lambda>x f n. (f (n + (1::'a)))(n := x)) (map (\<lambda>l. vec_lambda (foldr (\<lambda>x f n. (f (n + (1::'a)))(n := x)) l (\<lambda>n x. 0) (1::'a))) A) (\<lambda>n x. 0) (1::'a))) $$ i $ j = foldr (\<lambda>x f n. (f (n + (1::'a)))(n := x)) (map (\<lambda>l. vec_lambda (foldr (\<lambda>x f n. (f (n + (1::'a)))(n := x)) l (\<lambda>n x. 0) (1::'a))) A) (\<lambda>n x. 0) (1::'a) i $ j
[PROOF STEP]
by (simp add: vector_nth_eq)


[STATEMENT]
lemma iMin_ge_iff: "I \<noteq> {} \<Longrightarrow> (n \<le> iMin I) = (\<forall>a\<in>I. n \<le> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> (n \<le> iMin I) = (\<forall>a\<in>I. n \<le> a)
[PROOF STEP]
by (metis Collect_iMin_le Collect_mem_eq iMinI_ex2 order_trans)


[STATEMENT]
lemma cr_real_eq: "pcr_real = (\<lambda>x y. cauchy x \<and> Real x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pcr_real = (\<lambda>x y. cauchy x \<and> Real x = y)
[PROOF STEP]
unfolding real.pcr_cr_eq cr_real_def realrel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y. (cauchy x \<and> cauchy x \<and> vanishes (\<lambda>n. x n - x n)) \<and> Real x = y) = (\<lambda>x y. cauchy x \<and> Real x = y)
[PROOF STEP]
by auto


[STATEMENT]
lemma nth_concat_conv:
  "n < length (concat xss)
   \<Longrightarrow> \<exists>m n'. concat xss ! n = (xss ! m) ! n' \<and> n' < length (xss ! m) \<and>
             m < length xss \<and> n = (\<Sum>i<m. length (xss ! i)) + n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length (concat xss) \<Longrightarrow> \<exists>m n'. concat xss ! n = xss ! m ! n' \<and> n' < length (xss ! m) \<and> m < length xss \<and> n = (\<Sum>i<m. length (xss ! i)) + n'
[PROOF STEP]
using lnth_lconcat_conv[of n "llist_of (map llist_of xss)"]
  sum_comp_morphism[where h = enat and g = "\<lambda>i. length (xss ! i)"]
[PROOF STATE]
proof (prove)
using this:
enat n < llength (lconcat (llist_of (map llist_of xss))) \<Longrightarrow> \<exists>m n'. lnth (lconcat (llist_of (map llist_of xss))) n = lnth (lnth (llist_of (map llist_of xss)) m) n' \<and> enat n' < llength (lnth (llist_of (map llist_of xss)) m) \<and> enat m < llength (llist_of (map llist_of xss)) \<and> enat n = (\<Sum>i<m. llength (lnth (llist_of (map llist_of xss)) i)) + enat n'
\<lbrakk>enat 0 = 0; \<And>x y. enat (x + y) = enat x + enat y\<rbrakk> \<Longrightarrow> sum (enat \<circ> (\<lambda>i. length (xss ! i))) ?A = enat (\<Sum>i\<in>?A. length (xss ! i))

goal (1 subgoal):
 1. n < length (concat xss) \<Longrightarrow> \<exists>m n'. concat xss ! n = xss ! m ! n' \<and> n' < length (xss ! m) \<and> m < length xss \<and> n = (\<Sum>i<m. length (xss ! i)) + n'
[PROOF STEP]
by(clarsimp simp add: lconcat_llist_of zero_enat_def[symmetric]) blast


[STATEMENT]
lemma interleave_set: "w\<in>w1\<otimes>w2 \<Longrightarrow> set w = set w1 \<union> set w2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> w1 \<otimes> w2 \<Longrightarrow> set w = set w1 \<union> set w2
[PROOF STEP]
by (induct rule: interleave_elem_induct) auto


[STATEMENT]
lemma Gcd_minors_A_dvd_Gcd_minors_PAQ:
 fixes A::"'a::{semiring_Gcd,comm_ring_1} mat"
 assumes A: "A \<in> carrier_mat m n"
    and P: "P \<in> carrier_mat m m" and Q: "Q \<in> carrier_mat n n"
  shows "Gcd (minors A k) dvd Gcd (minors (P*A*Q) k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gcd (minors A k) dvd Gcd (minors (P * A * Q) k)
[PROOF STEP]
proof (rule Gcd_greatest)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> minors (P * A * Q) k \<Longrightarrow> Gcd (minors A k) dvd b
[PROOF STEP]
let ?B="(P * A * Q)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> minors (P * A * Q) k \<Longrightarrow> Gcd (minors A k) dvd b
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> minors (P * A * Q) k \<Longrightarrow> Gcd (minors A k) dvd b
[PROOF STEP]
assume "b \<in> minors ?B k"
[PROOF STATE]
proof (state)
this:
b \<in> minors (P * A * Q) k

goal (1 subgoal):
 1. \<And>b. b \<in> minors (P * A * Q) k \<Longrightarrow> Gcd (minors A k) dvd b
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
b \<in> minors (P * A * Q) k
[PROOF STEP]
obtain I J where b: "b = det (submatrix ?B I J)" and I: "I \<subseteq> {0..<dim_row ?B}"
    and J: "J \<subseteq> {0..<dim_col ?B}" and Ik: "card I = k" and Jk: "card J = k"
[PROOF STATE]
proof (prove)
using this:
b \<in> minors (P * A * Q) k

goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>b = Determinant.det (submatrix (P * A * Q) I J); I \<subseteq> {0..<dim_row (P * A * Q)}; J \<subseteq> {0..<dim_col (P * A * Q)}; card I = k; card J = k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding minors_def
[PROOF STATE]
proof (prove)
using this:
b \<in> {Determinant.det (submatrix (P * A * Q) I J) |I J. I \<subseteq> {0..<dim_row (P * A * Q)} \<and> J \<subseteq> {0..<dim_col (P * A * Q)} \<and> card I = k \<and> card J = k}

goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>b = Determinant.det (submatrix (P * A * Q) I J); I \<subseteq> {0..<dim_row (P * A * Q)}; J \<subseteq> {0..<dim_col (P * A * Q)}; card I = k; card J = k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b = Determinant.det (submatrix (P * A * Q) I J)
I \<subseteq> {0..<dim_row (P * A * Q)}
J \<subseteq> {0..<dim_col (P * A * Q)}
card I = k
card J = k

goal (1 subgoal):
 1. \<And>b. b \<in> minors (P * A * Q) k \<Longrightarrow> Gcd (minors A k) dvd b
[PROOF STEP]
have "Gcd (minors A k) dvd det (submatrix ?B I J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gcd (minors A k) dvd Determinant.det (submatrix (P * A * Q) I J)
[PROOF STEP]
by (rule Gcd_minors_dvd[OF _ P A Q _ _ Ik Jk], insert A I J P Q, auto)
[PROOF STATE]
proof (state)
this:
Gcd (minors A k) dvd Determinant.det (submatrix (P * A * Q) I J)

goal (1 subgoal):
 1. \<And>b. b \<in> minors (P * A * Q) k \<Longrightarrow> Gcd (minors A k) dvd b
[PROOF STEP]
thus "Gcd (minors A k) dvd b"
[PROOF STATE]
proof (prove)
using this:
Gcd (minors A k) dvd Determinant.det (submatrix (P * A * Q) I J)

goal (1 subgoal):
 1. Gcd (minors A k) dvd b
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
Gcd (minors A k) dvd Determinant.det (submatrix (P * A * Q) I J)
b = Determinant.det (submatrix (P * A * Q) I J)

goal (1 subgoal):
 1. Gcd (minors A k) dvd b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Gcd (minors A k) dvd b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma antisym_FSM :
  fixes x :: "('a,'b,'c) fsm"
  fixes y :: "('a,'b,'c) fsm"
shows "x \<le> y \<Longrightarrow> y \<le> x \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
unfolding less_eq_fsm.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>if FSM.initial x < FSM.initial y then True else FSM.initial x = FSM.initial y \<and> (if set_less_aux (FSM.states x) (FSM.states y) then True else FSM.states x = FSM.states y \<and> (if set_less_aux (FSM.inputs x) (FSM.inputs y) then True else FSM.inputs x = FSM.inputs y \<and> (if set_less_aux (FSM.outputs x) (FSM.outputs y) then True else FSM.outputs x = FSM.outputs y \<and> (set_less_aux (FSM.transitions x) (FSM.transitions y) \<or> FSM.transitions x = FSM.transitions y)))); if FSM.initial y < FSM.initial x then True else FSM.initial y = FSM.initial x \<and> (if set_less_aux (FSM.states y) (FSM.states x) then True else FSM.states y = FSM.states x \<and> (if set_less_aux (FSM.inputs y) (FSM.inputs x) then True else FSM.inputs y = FSM.inputs x \<and> (if set_less_aux (FSM.outputs y) (FSM.outputs x) then True else FSM.outputs y = FSM.outputs x \<and> (set_less_aux (FSM.transitions y) (FSM.transitions x) \<or> FSM.transitions y = FSM.transitions x))))\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using equal_fsm_def[of x y]
[PROOF STATE]
proof (prove)
using this:
equal_class.equal x y = (FSM.initial x = FSM.initial y \<and> FSM.states x = FSM.states y \<and> FSM.inputs x = FSM.inputs y \<and> FSM.outputs x = FSM.outputs y \<and> FSM.transitions x = FSM.transitions y)

goal (1 subgoal):
 1. \<lbrakk>if FSM.initial x < FSM.initial y then True else FSM.initial x = FSM.initial y \<and> (if set_less_aux (FSM.states x) (FSM.states y) then True else FSM.states x = FSM.states y \<and> (if set_less_aux (FSM.inputs x) (FSM.inputs y) then True else FSM.inputs x = FSM.inputs y \<and> (if set_less_aux (FSM.outputs x) (FSM.outputs y) then True else FSM.outputs x = FSM.outputs y \<and> (set_less_aux (FSM.transitions x) (FSM.transitions y) \<or> FSM.transitions x = FSM.transitions y)))); if FSM.initial y < FSM.initial x then True else FSM.initial y = FSM.initial x \<and> (if set_less_aux (FSM.states y) (FSM.states x) then True else FSM.states y = FSM.states x \<and> (if set_less_aux (FSM.inputs y) (FSM.inputs x) then True else FSM.inputs y = FSM.inputs x \<and> (if set_less_aux (FSM.outputs y) (FSM.outputs x) then True else FSM.outputs y = FSM.outputs x \<and> (set_less_aux (FSM.transitions y) (FSM.transitions x) \<or> FSM.transitions y = FSM.transitions x))))\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
unfolding equal_class.equal
[PROOF STATE]
proof (prove)
using this:
(x = y) = (FSM.initial x = FSM.initial y \<and> FSM.states x = FSM.states y \<and> FSM.inputs x = FSM.inputs y \<and> FSM.outputs x = FSM.outputs y \<and> FSM.transitions x = FSM.transitions y)

goal (1 subgoal):
 1. \<lbrakk>if FSM.initial x < FSM.initial y then True else FSM.initial x = FSM.initial y \<and> (if set_less_aux (FSM.states x) (FSM.states y) then True else FSM.states x = FSM.states y \<and> (if set_less_aux (FSM.inputs x) (FSM.inputs y) then True else FSM.inputs x = FSM.inputs y \<and> (if set_less_aux (FSM.outputs x) (FSM.outputs y) then True else FSM.outputs x = FSM.outputs y \<and> (set_less_aux (FSM.transitions x) (FSM.transitions y) \<or> FSM.transitions x = FSM.transitions y)))); if FSM.initial y < FSM.initial x then True else FSM.initial y = FSM.initial x \<and> (if set_less_aux (FSM.states y) (FSM.states x) then True else FSM.states y = FSM.states x \<and> (if set_less_aux (FSM.inputs y) (FSM.inputs x) then True else FSM.inputs y = FSM.inputs x \<and> (if set_less_aux (FSM.outputs y) (FSM.outputs x) then True else FSM.outputs y = FSM.outputs x \<and> (set_less_aux (FSM.transitions y) (FSM.transitions x) \<or> FSM.transitions y = FSM.transitions x))))\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis order.asym set_less_aux_antisym)


[STATEMENT]
lemma (in group_hom) subgroup_img_is_subgroup: \<^marker>\<open>contributor \<open>Paulo Em?lio de Vilhena\<close>\<close>
  assumes "subgroup I G"
  shows "subgroup (h ` I) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (h ` I) H
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup (h ` I) H
[PROOF STEP]
have "h \<in> hom (G \<lparr> carrier := I \<rparr>) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> hom (G\<lparr>carrier := I\<rparr>) H
[PROOF STEP]
using G.subgroupE[OF assms] subgroup.mem_carrier[OF assms] homh
[PROOF STATE]
proof (prove)
using this:
I \<subseteq> carrier G
I \<noteq> {}
?a \<in> I \<Longrightarrow> inv ?a \<in> I
\<lbrakk>?a \<in> I; ?b \<in> I\<rbrakk> \<Longrightarrow> ?a \<otimes> ?b \<in> I
?x \<in> I \<Longrightarrow> ?x \<in> carrier G
h \<in> hom G H

goal (1 subgoal):
 1. h \<in> hom (G\<lparr>carrier := I\<rparr>) H
[PROOF STEP]
unfolding hom_def
[PROOF STATE]
proof (prove)
using this:
I \<subseteq> carrier G
I \<noteq> {}
?a \<in> I \<Longrightarrow> inv ?a \<in> I
\<lbrakk>?a \<in> I; ?b \<in> I\<rbrakk> \<Longrightarrow> ?a \<otimes> ?b \<in> I
?x \<in> I \<Longrightarrow> ?x \<in> carrier G
h \<in> {h \<in> carrier G \<rightarrow> carrier H. \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. h (x \<otimes> y) = h x \<otimes>\<^bsub>H\<^esub> h y}

goal (1 subgoal):
 1. h \<in> {h \<in> carrier (G\<lparr>carrier := I\<rparr>) \<rightarrow> carrier H. \<forall>x\<in>carrier (G\<lparr>carrier := I\<rparr>). \<forall>y\<in>carrier (G\<lparr>carrier := I\<rparr>). h (x \<otimes>\<^bsub>G\<lparr>carrier := I\<rparr>\<^esub> y) = h x \<otimes>\<^bsub>H\<^esub> h y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> hom (G\<lparr>carrier := I\<rparr>) H

goal (1 subgoal):
 1. subgroup (h ` I) H
[PROOF STEP]
hence "group_hom (G \<lparr> carrier := I \<rparr>) H h"
[PROOF STATE]
proof (prove)
using this:
h \<in> hom (G\<lparr>carrier := I\<rparr>) H

goal (1 subgoal):
 1. group_hom (G\<lparr>carrier := I\<rparr>) H h
[PROOF STEP]
using subgroup.subgroup_is_group[OF assms G.is_group] is_group
[PROOF STATE]
proof (prove)
using this:
h \<in> hom (G\<lparr>carrier := I\<rparr>) H
Group.group (G\<lparr>carrier := I\<rparr>)
Group.group H

goal (1 subgoal):
 1. group_hom (G\<lparr>carrier := I\<rparr>) H h
[PROOF STEP]
unfolding group_hom_def group_hom_axioms_def
[PROOF STATE]
proof (prove)
using this:
h \<in> hom (G\<lparr>carrier := I\<rparr>) H
Group.group (G\<lparr>carrier := I\<rparr>)
Group.group H

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := I\<rparr>) \<and> Group.group H \<and> h \<in> hom (G\<lparr>carrier := I\<rparr>) H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
group_hom (G\<lparr>carrier := I\<rparr>) H h

goal (1 subgoal):
 1. subgroup (h ` I) H
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
group_hom (G\<lparr>carrier := I\<rparr>) H h

goal (1 subgoal):
 1. subgroup (h ` I) H
[PROOF STEP]
using group_hom.img_is_subgroup[of "G \<lparr> carrier := I \<rparr>" H h]
[PROOF STATE]
proof (prove)
using this:
group_hom (G\<lparr>carrier := I\<rparr>) H h
group_hom (G\<lparr>carrier := I\<rparr>) H h \<Longrightarrow> subgroup (h ` carrier (G\<lparr>carrier := I\<rparr>)) H

goal (1 subgoal):
 1. subgroup (h ` I) H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subgroup (h ` I) H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eint_pow_int_is_pos:
  assumes "n > 0"
  shows "eint n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < eint n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 0 < eint n
[PROOF STEP]
by (simp add: zero_eint_def)


[STATEMENT]
lemma mono_oFix: "mono F \<Longrightarrow> mono (oFix F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono F \<Longrightarrow> mono (oFix F)
[PROOF STEP]
apply (rule monoI, unfold oFix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>mono F; x \<le> y\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. iter n F x) \<le> oLimit (\<lambda>n. iter n F y)
[PROOF STEP]
apply (subgoal_tac "\<forall>n. iter n F x \<le> iter n F y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>mono F; x \<le> y; \<forall>n. iter n F x \<le> iter n F y\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. iter n F x) \<le> oLimit (\<lambda>n. iter n F y)
 2. \<And>x y. \<lbrakk>mono F; x \<le> y\<rbrakk> \<Longrightarrow> \<forall>n. iter n F x \<le> iter n F y
[PROOF STEP]
apply (rule oLimit_leI, clarify)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y n. \<lbrakk>mono F; x \<le> y; \<forall>n. iter n F x \<le> iter n F y\<rbrakk> \<Longrightarrow> iter n F x \<le> oLimit (\<lambda>n. iter n F y)
 2. \<And>x y. \<lbrakk>mono F; x \<le> y\<rbrakk> \<Longrightarrow> \<forall>n. iter n F x \<le> iter n F y
[PROOF STEP]
apply (rule_tac n=n in le_oLimitI, erule spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>mono F; x \<le> y\<rbrakk> \<Longrightarrow> \<forall>n. iter n F x \<le> iter n F y
[PROOF STEP]
apply (rule allI, induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y n. \<lbrakk>mono F; x \<le> y\<rbrakk> \<Longrightarrow> iter 0 F x \<le> iter 0 F y
 2. \<And>x y n na. \<lbrakk>mono F; x \<le> y; iter na F x \<le> iter na F y\<rbrakk> \<Longrightarrow> iter (Suc na) F x \<le> iter (Suc na) F y
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y n na. \<lbrakk>mono F; x \<le> y; iter na F x \<le> iter na F y\<rbrakk> \<Longrightarrow> iter (Suc na) F x \<le> iter (Suc na) F y
[PROOF STEP]
apply (simp add: monoD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nn_integral_enat_function:
  assumes f: "f \<in> measurable M (count_space UNIV)"
  shows "(\<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M) = (\<Sum>t. emeasure M {x \<in> space M. t < f x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
define F where "F i = {x\<in>space M. i < f x}" for i :: nat
[PROOF STATE]
proof (state)
this:
F ?i = {x \<in> space M. enat ?i < f x}

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
f \<in> M \<rightarrow>\<^sub>M count_space UNIV
F ?i = {x \<in> space M. enat ?i < f x}
[PROOF STEP]
have [measurable]: "\<And>i. F i \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
f \<in> M \<rightarrow>\<^sub>M count_space UNIV
F ?i = {x \<in> space M. enat ?i < f x}

goal (1 subgoal):
 1. \<And>i. F i \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
F ?i \<in> sets M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
F ?i \<in> sets M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
assume "x \<in> space M"
[PROOF STATE]
proof (state)
this:
x \<in> space M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
have "(\<lambda>i::nat. if i < f x then 1 else 0) sums ennreal_of_enat (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xa. if enat xa < f x then 1 else 0) sums ennreal_of_enat (f x)
[PROOF STEP]
using sums_If_finite[of "\<lambda>r. r < f x" "\<lambda>_. 1 :: ennreal"]
[PROOF STATE]
proof (prove)
using this:
finite {r. enat r < f x} \<Longrightarrow> (\<lambda>r. if enat r < f x then 1 else 0) sums (\<Sum>r | enat r < f x. 1)

goal (1 subgoal):
 1. (\<lambda>xa. if enat xa < f x then 1 else 0) sums ennreal_of_enat (f x)
[PROOF STEP]
by (cases "f x") (simp_all add: sums_def of_nat_tendsto_top_ennreal)
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. if enat xa < f x then 1 else 0) sums ennreal_of_enat (f x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. if enat xa < f x then 1 else 0) sums ennreal_of_enat (f x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
have "(\<lambda>i. (if i < f x then 1 else 0)) = (\<lambda>i. indicator (F i) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xa. if enat xa < f x then 1::'b else (0::'b)) = (\<lambda>i. indicator (F i) x)
[PROOF STEP]
using \<open>x \<in> space M\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> space M

goal (1 subgoal):
 1. (\<lambda>xa. if enat xa < f x then 1::'b else (0::'b)) = (\<lambda>i. indicator (F i) x)
[PROOF STEP]
by (simp add: one_ennreal_def F_def fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. if enat xa < f x then 1::?'b1 else (0::?'b1)) = (\<lambda>i. indicator (F i) x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>xa. indicator (F xa) x) sums ennreal_of_enat (f x)
[PROOF STEP]
have "ennreal_of_enat (f x) = (\<Sum>i. indicator (F i) x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. indicator (F xa) x) sums ennreal_of_enat (f x)

goal (1 subgoal):
 1. ennreal_of_enat (f x) = (\<Sum>i. indicator (F i) x)
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
ennreal_of_enat (f x) = (\<Sum>i. indicator (F i) x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> space M \<Longrightarrow> ennreal_of_enat (f ?x2) = (\<Sum>i. indicator (F i) ?x2)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2 \<in> space M \<Longrightarrow> ennreal_of_enat (f ?x2) = (\<Sum>i. indicator (F i) ?x2)
[PROOF STEP]
have "(\<integral>\<^sup>+x. ennreal_of_enat (f x) \<partial>M) = (\<integral>\<^sup>+x. (\<Sum>i. indicator (F i) x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> space M \<Longrightarrow> ennreal_of_enat (f ?x2) = (\<Sum>i. indicator (F i) ?x2)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = \<integral>\<^sup>+ x. (\<Sum>i. indicator (F i) x) \<partial>M
[PROOF STEP]
by (simp cong: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = \<integral>\<^sup>+ x. (\<Sum>i. indicator (F i) x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = \<integral>\<^sup>+ x. (\<Sum>i. indicator (F i) x) \<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
have "\<dots> = (\<Sum>i. emeasure M (F i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Sum>i. indicator (F i) x) \<partial>M = (\<Sum>i. emeasure M (F i))
[PROOF STEP]
by (simp add: nn_integral_suminf)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<Sum>i. indicator (F i) x) \<partial>M = (\<Sum>i. emeasure M (F i))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>i. emeasure M (F i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>i. emeasure M (F i))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})
[PROOF STEP]
by (simp add: F_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal_of_enat (f x) \<partial>M = (\<Sum>x. emeasure M {xa \<in> space M. enat x < f xa})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_derivationD:
  assumes "is_derivation X p"
  shows is_derivation_linear_on: "linear_diff_fun X"
    and is_derivation_derivation: "\<And>f g. f \<in> diff_fun_space \<Longrightarrow> g \<in> diff_fun_space \<Longrightarrow> X (f * g) = f p * X g + g p * X f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) X &&& (\<And>f g. \<lbrakk>f \<in> diff_fun_space; g \<in> diff_fun_space\<rbrakk> \<Longrightarrow> X (f * g) = f p * X g + g p * X f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_derivation X p

goal (1 subgoal):
 1. linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) X &&& (\<And>f g. \<lbrakk>f \<in> diff_fun_space; g \<in> diff_fun_space\<rbrakk> \<Longrightarrow> X (f * g) = f p * X g + g p * X f)
[PROOF STEP]
unfolding is_derivation_def
[PROOF STATE]
proof (prove)
using this:
linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) X \<and> (\<forall>f g. f \<in> diff_fun_space \<longrightarrow> g \<in> diff_fun_space \<longrightarrow> X (f * g) = f p * X g + g p * X f)

goal (1 subgoal):
 1. linear_on diff_fun_space UNIV (*\<^sub>R) (*\<^sub>R) X &&& (\<And>f g. \<lbrakk>f \<in> diff_fun_space; g \<in> diff_fun_space\<rbrakk> \<Longrightarrow> X (f * g) = f p * X g + g p * X f)
[PROOF STEP]
by blast+


[STATEMENT]
lemma t_times_pow_pos[simp]:
"(2^(n::nat))*t > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < eint (2 ^ n) * t
[PROOF STEP]
apply(cases "n = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> 0 < eint (2 ^ n) * t
 2. n \<noteq> 0 \<Longrightarrow> 0 < eint (2 ^ n) * t
[PROOF STEP]
using one_eint_def
[PROOF STATE]
proof (prove)
using this:
1 = eint 1

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> 0 < eint (2 ^ n) * t
 2. n \<noteq> 0 \<Longrightarrow> 0 < eint (2 ^ n) * t
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> 0 < eint (2 ^ n) * t
[PROOF STEP]
using eint_mult_mono'[of t 1 "2^n"] t_pos
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> t \<and> t \<noteq> \<infinity>; 1 < eint (2 ^ n)\<rbrakk> \<Longrightarrow> 1 * t \<le> eint (2 ^ n) * t
0 < t

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> 0 < eint (2 ^ n) * t
[PROOF STEP]
by (smt eint_ord_simps(2) linorder_not_less mult_one_left neq0_conv one_eint_def order_less_le order_trans self_le_power t_neq_infty)


[STATEMENT]
lemma iso_subgroup:
  assumes groups:"group G" "group F"
  assumes HG:"subgroup H G"
  assumes \<phi>:"\<phi> \<in> iso G F"
  shows "subgroup (\<phi> ` H) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
from groups \<phi>
[PROOF STATE]
proof (chain)
picking this:
Group.group G
Group.group F
\<phi> \<in> Group.iso G F
[PROOF STEP]
have "group_hom G F \<phi>"
[PROOF STATE]
proof (prove)
using this:
Group.group G
Group.group F
\<phi> \<in> Group.iso G F

goal (1 subgoal):
 1. group_hom G F \<phi>
[PROOF STEP]
unfolding group_hom_def group_hom_axioms_def iso_def
[PROOF STATE]
proof (prove)
using this:
Group.group G
Group.group F
\<phi> \<in> {h \<in> hom G F. bij_betw h (carrier G) (carrier F)}

goal (1 subgoal):
 1. Group.group G \<and> Group.group F \<and> \<phi> \<in> hom G F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
group_hom G F \<phi>

goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
group_hom G F \<phi>

goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
from \<phi>
[PROOF STATE]
proof (chain)
picking this:
\<phi> \<in> Group.iso G F
[PROOF STEP]
have "\<phi> ` (carrier G) = carrier F"
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> Group.iso G F

goal (1 subgoal):
 1. \<phi> ` carrier G = carrier F
[PROOF STEP]
unfolding iso_def bij_betw_def
[PROOF STATE]
proof (prove)
using this:
\<phi> \<in> {h \<in> hom G F. inj_on h (carrier G) \<and> h ` carrier G = carrier F}

goal (1 subgoal):
 1. \<phi> ` carrier G = carrier F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<phi> ` carrier G = carrier F

goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<phi> ` carrier G = carrier F

goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
note HG
[PROOF STATE]
proof (state)
this:
subgroup H G

goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
group_hom G F \<phi>
\<phi> ` carrier G = carrier F
subgroup H G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
group_hom G F \<phi>
\<phi> ` carrier G = carrier F
subgroup H G

goal (1 subgoal):
 1. subgroup (\<phi> ` H) F
[PROOF STEP]
by (metis subgroup.surj_hom_subgroup)
[PROOF STATE]
proof (state)
this:
subgroup (\<phi> ` H) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefix_Cons:
   "(xs <= y#ys) = (xs=[] | (\<exists>zs. xs=y#zs \<and> zs <= ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<le> y # ys) = (xs = [] \<or> (\<exists>zs. xs = y # zs \<and> zs \<le> ys))
[PROOF STEP]
by (simp add: prefix_def genPrefix_Cons)


[STATEMENT]
lemma path_eq: "path p \<Longrightarrow> (\<And>t. t \<in> {0..1} \<Longrightarrow> p t = q t) \<Longrightarrow> path q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path p; \<And>t. t \<in> {0..1} \<Longrightarrow> p t = q t\<rbrakk> \<Longrightarrow> path q
[PROOF STEP]
using continuous_on_eq path_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on ?s ?f; \<And>x. x \<in> ?s \<Longrightarrow> ?f x = ?g x\<rbrakk> \<Longrightarrow> continuous_on ?s ?g
path ?g = continuous_on {0..1} ?g

goal (1 subgoal):
 1. \<lbrakk>path p; \<And>t. t \<in> {0..1} \<Longrightarrow> p t = q t\<rbrakk> \<Longrightarrow> path q
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_admissible: "closed {x. P x} \<longleftrightarrow> ccpo.admissible Sup (\<le>) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x} = ccpo.admissible Sup (\<le>) P
[PROOF STEP]
unfolding closed_ccpo ccpo.admissible_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>C. chain C \<longrightarrow> C \<noteq> {} \<longrightarrow> C \<subseteq> Collect P \<longrightarrow> \<Squnion> C \<in> Collect P) = (\<forall>A. chain A \<longrightarrow> A \<noteq> {} \<longrightarrow> Ball A P \<longrightarrow> P (\<Squnion> A))
[PROOF STEP]
by auto


[STATEMENT]
lemma subgroup_finite:
  assumes subgroup:"subgroup H G"
  assumes finite:"finite (carrier G)"
  shows "finite H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite H
[PROOF STEP]
by (metis finite finite_subset subgroup subgroup.subset)


[STATEMENT]
lemma geometric_increasing_sum_aux: "(1-r)^2 * (\<Sum>k<n. (k+1)*r^k) = 1 - (n+1)*r^n + n*r^(n+1)"
  for n::nat and r::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (1 - r)\<^sup>2 * (\<Sum>k<0. real (k + 1) * r ^ k) = 1 - real (0 + 1) * r ^ 0 + real 0 * r ^ (0 + 1)
 2. \<And>n. (1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1) \<Longrightarrow> (1 - r)\<^sup>2 * (\<Sum>k<Suc n. real (k + 1) * r ^ k) = 1 - real (Suc n + 1) * r ^ Suc n + real (Suc n) * r ^ (Suc n + 1)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (1 - r)\<^sup>2 * (\<Sum>k<0. real (k + 1) * r ^ k) = 1 - real (0 + 1) * r ^ 0 + real 0 * r ^ (0 + 1)
 2. \<And>n. (1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1) \<Longrightarrow> (1 - r)\<^sup>2 * (\<Sum>k<Suc n. real (k + 1) * r ^ k) = 1 - real (Suc n + 1) * r ^ Suc n + real (Suc n) * r ^ (Suc n + 1)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - r)\<^sup>2 * (\<Sum>k<0. real (k + 1) * r ^ k) = 1 - real (0 + 1) * r ^ 0 + real 0 * r ^ (0 + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 - r)\<^sup>2 * (\<Sum>k<0. real (k + 1) * r ^ k) = 1 - real (0 + 1) * r ^ 0 + real 0 * r ^ (0 + 1)

goal (1 subgoal):
 1. \<And>n. (1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1) \<Longrightarrow> (1 - r)\<^sup>2 * (\<Sum>k<Suc n. real (k + 1) * r ^ k) = 1 - real (Suc n + 1) * r ^ Suc n + real (Suc n) * r ^ (Suc n + 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1) \<Longrightarrow> (1 - r)\<^sup>2 * (\<Sum>k<Suc n. real (k + 1) * r ^ k) = 1 - real (Suc n + 1) * r ^ Suc n + real (Suc n) * r ^ (Suc n + 1)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1)

goal (1 subgoal):
 1. \<And>n. (1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1) \<Longrightarrow> (1 - r)\<^sup>2 * (\<Sum>k<Suc n. real (k + 1) * r ^ k) = 1 - real (Suc n + 1) * r ^ Suc n + real (Suc n) * r ^ (Suc n + 1)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(1 - r)\<^sup>2 * (\<Sum>k<n. real (k + 1) * r ^ k) = 1 - real (n + 1) * r ^ n + real n * r ^ (n + 1)

goal (1 subgoal):
 1. (1 - r)\<^sup>2 * (\<Sum>k<Suc n. real (k + 1) * r ^ k) = 1 - real (Suc n + 1) * r ^ Suc n + real (Suc n) * r ^ (Suc n + 1)
[PROOF STEP]
by (simp add: distrib_left power2_diff field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(1 - r)\<^sup>2 * (\<Sum>k<Suc n. real (k + 1) * r ^ k) = 1 - real (Suc n + 1) * r ^ Suc n + real (Suc n) * r ^ (Suc n + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_circle_fix_iff_unit_circle_set:
  shows "unit_circle_fix M \<longleftrightarrow> moebius_pt M ` unit_circle_set = unit_circle_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_circle_fix M = (moebius_pt M ` unit_circle_set = unit_circle_set)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unit_circle_fix M = (moebius_pt M ` unit_circle_set = unit_circle_set)
[PROOF STEP]
have "circline_set unit_circle \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline_set unit_circle \<noteq> {}
[PROOF STEP]
using one_in_unit_circle_set
[PROOF STATE]
proof (prove)
using this:
1\<^sub>h \<in> circline_set unit_circle

goal (1 subgoal):
 1. circline_set unit_circle \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
circline_set unit_circle \<noteq> {}

goal (1 subgoal):
 1. unit_circle_fix M = (moebius_pt M ` unit_circle_set = unit_circle_set)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
circline_set unit_circle \<noteq> {}

goal (1 subgoal):
 1. unit_circle_fix M = (moebius_pt M ` unit_circle_set = unit_circle_set)
[PROOF STEP]
using unit_circle_fix_iff[of M] circline_set_fix_iff_circline_fix[of unit_circle M unit_circle]
[PROOF STATE]
proof (prove)
using this:
circline_set unit_circle \<noteq> {}
unit_circle_fix M = (moebius_circline M unit_circle = unit_circle)
circline_set unit_circle \<noteq> {} \<Longrightarrow> (circline_set (moebius_circline M unit_circle) = circline_set unit_circle) = (moebius_circline M unit_circle = unit_circle)

goal (1 subgoal):
 1. unit_circle_fix M = (moebius_pt M ` unit_circle_set = unit_circle_set)
[PROOF STEP]
by (simp add: unit_circle_set_def)
[PROOF STATE]
proof (state)
this:
unit_circle_fix M = (moebius_pt M ` unit_circle_set = unit_circle_set)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equiv_eq: "((((P::'\<alpha> predicate) \<and> Q) \<or> (\<not>P \<and> \<not>Q)) = true) \<longleftrightarrow> (P = Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((P \<and> Q \<or> \<not> P \<and> \<not> Q) = true) = (P = Q)
[PROOF STEP]
by (auto simp add: fun_eq_iff utp_defs)


[STATEMENT]
lemma "(x \<le> x + y) = ((0::real) \<le> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> x + y) = (0 \<le> y)
[PROOF STEP]
by arith


[STATEMENT]
lemma gcd_impl_main_code:
  "gcd_impl_main G1 G2 = (if G1 = 0 then 0 else if G2 = 0 then normalize G1 else
    let c1 = content G1;
      c2 = content G2;
      p1 = map_poly (\<lambda> x. x div c1) G1;
      p2 = map_poly (\<lambda> x. x div c2) G2
     in smult (gcd c1 c2) (normalize (primitive_part (gcd_impl_start p1 p2))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd_impl_main G1 G2 = (if G1 = 0 then 0 else if G2 = 0 then normalize G1 else let c1 = content G1; c2 = content G2; p1 = map_poly (\<lambda>x. x div c1) G1; p2 = map_poly (\<lambda>x. x div c2) G2 in Polynomial.smult (gcd c1 c2) (normalize (primitive_part (gcd_impl_start p1 p2))))
[PROOF STEP]
unfolding gcd_impl_main_def Let_def primitive_part_def gcd_impl_start_def gcd_impl_primitive_def
    subresultant_prs_impl
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if G1 = 0 then 0 else if G2 = 0 then normalize G1 else Polynomial.smult (gcd (content G1) (content G2)) (normalize (map_poly (\<lambda>x. x div content (fst (subresultant_prs (map_poly (\<lambda>x. x div content G1) G1) (map_poly (\<lambda>x. x div content G2) G2)))) (fst (subresultant_prs (map_poly (\<lambda>x. x div content G1) G1) (map_poly (\<lambda>x. x div content G2) G2)))))) = (if G1 = 0 then 0 else if G2 = 0 then normalize G1 else Polynomial.smult (gcd (content G1) (content G2)) (normalize (map_poly (\<lambda>x. x div content (fst (subresultant_prs (map_poly (\<lambda>x. x div content G1) G1) (map_poly (\<lambda>x. x div content G2) G2)))) (fst (subresultant_prs (map_poly (\<lambda>x. x div content G1) G1) (map_poly (\<lambda>x. x div content G2) G2))))))
[PROOF STEP]
by simp


[STATEMENT]
lemma LCL111_1:
 "(\<forall>X Y. is_a_theorem(implies(X,Y)) & is_a_theorem(X) --> is_a_theorem(Y)) &
  (\<forall>Y X. is_a_theorem(implies(X,implies(Y,X)))) &
  (\<forall>Y X Z. is_a_theorem(implies(implies(X,Y),implies(implies(Y,Z),implies(X,Z))))) &
  (\<forall>Y X. is_a_theorem(implies(implies(implies(X,Y),Y),implies(implies(Y,X),X)))) &
  (\<forall>Y X. is_a_theorem(implies(implies(not(X),not(Y)),implies(Y,X)))) &
  (~is_a_theorem(implies(implies(a,b),implies(implies(c,a),implies(c,b))))) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>X Y. is_a_theorem (implies (X, Y)) \<and> is_a_theorem X \<longrightarrow> is_a_theorem Y) \<and> (\<forall>Y X. is_a_theorem (implies (X, implies (Y, X)))) \<and> (\<forall>Y X Z. is_a_theorem (implies (implies (X, Y), implies (implies (Y, Z), implies (X, Z))))) \<and> (\<forall>Y X. is_a_theorem (implies (implies (implies (X, Y), Y), implies (implies (Y, X), X)))) \<and> (\<forall>Y X. is_a_theorem (implies (implies (not X, not Y), implies (Y, X)))) \<and> \<not> is_a_theorem (implies (implies (a, b), implies (implies (c, a), implies (c, b)))) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma norm_exp: "norm (exp x) \<le> exp (norm x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm x)
[PROOF STEP]
from summable_norm[OF summable_norm_exp, of x]
[PROOF STATE]
proof (chain)
picking this:
norm (\<Sum>n. x ^ n /\<^sub>R fact n) \<le> (\<Sum>n. norm (x ^ n /\<^sub>R fact n))
[PROOF STEP]
have "norm (exp x) \<le> (\<Sum>n. inverse (fact n) * norm (x^n))"
[PROOF STATE]
proof (prove)
using this:
norm (\<Sum>n. x ^ n /\<^sub>R fact n) \<le> (\<Sum>n. norm (x ^ n /\<^sub>R fact n))

goal (1 subgoal):
 1. norm (exp x) \<le> (\<Sum>n. inverse (fact n) * norm (x ^ n))
[PROOF STEP]
by (simp add: exp_def)
[PROOF STATE]
proof (state)
this:
norm (exp x) \<le> (\<Sum>n. inverse (fact n) * norm (x ^ n))

goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (exp x) \<le> (\<Sum>n. inverse (fact n) * norm (x ^ n))

goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm x)
[PROOF STEP]
have "\<dots> \<le> exp (norm x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. inverse (fact n) * norm (x ^ n)) \<le> exp (norm x)
[PROOF STEP]
using summable_exp_generic[of "norm x"] summable_norm_exp[of x]
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm x ^ n /\<^sub>R fact n)
summable (\<lambda>n. norm (x ^ n /\<^sub>R fact n))

goal (1 subgoal):
 1. (\<Sum>n. inverse (fact n) * norm (x ^ n)) \<le> exp (norm x)
[PROOF STEP]
by (auto simp: exp_def intro!: suminf_le norm_power_ineq)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. inverse (fact n) * norm (x ^ n)) \<le> exp (norm x)

goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (exp x) \<le> exp (norm x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (exp x) \<le> exp (norm x)

goal (1 subgoal):
 1. norm (exp x) \<le> exp (norm x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (exp x) \<le> exp (norm x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invertible_implies_full_rank:
  fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
  assumes inv_A: "invertible A"
  shows "rank A = nrows A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = nrows A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank A = nrows A
[PROOF STEP]
have "(\<forall>x. A *v x = 0 \<longrightarrow> x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. A *v x = 0 \<longrightarrow> x = 0
[PROOF STEP]
using inv_A
[PROOF STATE]
proof (prove)
using this:
invertible A

goal (1 subgoal):
 1. \<forall>x. A *v x = 0 \<longrightarrow> x = 0
[PROOF STEP]
unfolding  invertible_left_inverse[unfolded matrix_left_invertible_ker]
[PROOF STATE]
proof (prove)
using this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0

goal (1 subgoal):
 1. \<forall>x. A *v x = 0 \<longrightarrow> x = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0

goal (1 subgoal):
 1. rank A = nrows A
[PROOF STEP]
hence null_space_eq_0: "(null_space A) = {0}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0

goal (1 subgoal):
 1. null_space A = {0}
[PROOF STEP]
unfolding null_space_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0

goal (1 subgoal):
 1. {x. A *v x = 0} = {0}
[PROOF STEP]
using matrix_vector_mult_0_right
[PROOF STATE]
proof (prove)
using this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0
?A *v 0 = 0

goal (1 subgoal):
 1. {x. A *v x = 0} = {0}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
null_space A = {0}

goal (1 subgoal):
 1. rank A = nrows A
[PROOF STEP]
have dim_null_space: "vec.dim (null_space A) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (null_space A) = 0
[PROOF STEP]
unfolding vec.dim_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if \<exists>b. vec.independent b \<and> vec.span b = vec.span (null_space A) then card (SOME b. vec.independent b \<and> vec.span b = vec.span (null_space A)) else 0) = 0
[PROOF STEP]
by (metis (no_types) null_space_eq_0 vec.dim_def vec.dim_zero_eq')
[PROOF STATE]
proof (state)
this:
vec.dim (null_space A) = 0

goal (1 subgoal):
 1. rank A = nrows A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = nrows A
[PROOF STEP]
using rank_nullity_theorem_matrices[of A]
[PROOF STATE]
proof (prove)
using this:
ncols A = vec.dim (null_space A) + vec.dim (col_space A)

goal (1 subgoal):
 1. rank A = nrows A
[PROOF STEP]
unfolding dim_null_space rank_eq_dim_col_space nrows_def
[PROOF STATE]
proof (prove)
using this:
ncols A = 0 + vec.dim (col_space A)

goal (1 subgoal):
 1. vec.dim (col_space A) = CARD('n)
[PROOF STEP]
unfolding col_space_eq
[PROOF STATE]
proof (prove)
using this:
ncols A = 0 + vec.dim {y. \<exists>x. A *v x = y}

goal (1 subgoal):
 1. vec.dim {y. \<exists>x. A *v x = y} = CARD('n)
[PROOF STEP]
unfolding ncols_def
[PROOF STATE]
proof (prove)
using this:
CARD('n) = 0 + vec.dim {y. \<exists>x. A *v x = y}

goal (1 subgoal):
 1. vec.dim {y. \<exists>x. A *v x = y} = CARD('n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rank A = nrows A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in domain) alg_mult_eq_count_roots:
  assumes "p \<in> carrier (poly_ring R)" shows "alg_mult p = count (roots p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alg_mult p = count (roots p)
[PROOF STEP]
using finite_number_of_roots[OF assms]
[PROOF STATE]
proof (prove)
using this:
finite {x. is_root p x}

goal (1 subgoal):
 1. alg_mult p = count (roots p)
[PROOF STEP]
unfolding sym[OF alg_mult_gt_zero_iff_is_root[OF assms]]
[PROOF STATE]
proof (prove)
using this:
finite {x. 0 < alg_mult p x}

goal (1 subgoal):
 1. alg_mult p = count (roots p)
[PROOF STEP]
by (simp add: roots_def)


[STATEMENT]
lemma (in group) gen_subgroup_is_subgroup:
      "gens \<subseteq> carrier G \<Longrightarrow> \<langle>gens\<rangle>\<^bsub>G\<^esub> \<le> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gens \<subseteq> carrier G \<Longrightarrow> \<langle>gens\<rangle> \<le> G
[PROOF STEP]
by(rule subgroupI)(auto intro:gen_span.intros simp add:gen_span_closed)


[STATEMENT]
lemma totient_less:
  assumes "n > 1"
  shows "totient n < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient n < n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. totient n < n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
have "card (totatives n) \<le> card {0<..<n}"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. card (totatives n) \<le> card {0<..<n}
[PROOF STEP]
using totatives_less[of _ n] totatives_subset[of n]
[PROOF STATE]
proof (prove)
using this:
1 < n
\<lbrakk>?x \<in> totatives n; 1 < n\<rbrakk> \<Longrightarrow> ?x < n
totatives n \<subseteq> {0<..n}

goal (1 subgoal):
 1. card (totatives n) \<le> card {0<..<n}
[PROOF STEP]
by (intro card_mono) auto
[PROOF STATE]
proof (state)
this:
card (totatives n) \<le> card {0<..<n}

goal (1 subgoal):
 1. totient n < n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
card (totatives n) \<le> card {0<..<n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < n
card (totatives n) \<le> card {0<..<n}

goal (1 subgoal):
 1. totient n < n
[PROOF STEP]
by (simp add: totient_def)
[PROOF STATE]
proof (state)
this:
totient n < n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma N_dvd_mono:
  assumes "m dvd n"
  shows   "N n \<le> N m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N n \<le> N m
[PROOF STEP]
proof (rule sums_le[OF _ N_sums N_sums])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na. (if na = 0 \<or> int na dvd n then 0 else 1 / q ^ na) \<le> (if na = 0 \<or> int na dvd m then 0 else 1 / q ^ na)
[PROOF STEP]
fix k :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na. (if na = 0 \<or> int na dvd n then 0 else 1 / q ^ na) \<le> (if na = 0 \<or> int na dvd m then 0 else 1 / q ^ na)
[PROOF STEP]
show "(if k = 0 \<or> int k dvd n then 0 else 1 / q ^ k) \<le>
        (if k = 0 \<or> int k dvd m then 0 else 1 / q ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if k = 0 \<or> int k dvd n then 0 else 1 / q ^ k) \<le> (if k = 0 \<or> int k dvd m then 0 else 1 / q ^ k)
[PROOF STEP]
using q_gt_1 assms
[PROOF STATE]
proof (prove)
using this:
1 < q
m dvd n

goal (1 subgoal):
 1. (if k = 0 \<or> int k dvd n then 0 else 1 / q ^ k) \<le> (if k = 0 \<or> int k dvd m then 0 else 1 / q ^ k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if k = 0 \<or> int k dvd n then 0 else 1 / q ^ k) \<le> (if k = 0 \<or> int k dvd m then 0 else 1 / q ^ k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_in_subgroup_generated: "a \<in> subgroup_generated H \<Longrightarrow> inverse a \<in> subgroup_generated H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> subgroup_generated H \<Longrightarrow> local.inverse a \<in> subgroup_generated H
[PROOF STEP]
unfolding subgroup_generated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> generate (G \<inter> H) \<Longrightarrow> local.inverse a \<in> generate (G \<inter> H)
[PROOF STEP]
proof (induction rule: generate.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. local.inverse \<one> \<in> generate (G \<inter> H)
 2. \<And>a. a \<in> G \<inter> H \<Longrightarrow> local.inverse a \<in> generate (G \<inter> H)
 3. \<And>a. a \<in> G \<inter> H \<Longrightarrow> local.inverse (local.inverse a) \<in> generate (G \<inter> H)
 4. \<And>a b. \<lbrakk>a \<in> generate (G \<inter> H); local.inverse a \<in> generate (G \<inter> H); b \<in> generate (G \<inter> H); local.inverse b \<in> generate (G \<inter> H)\<rbrakk> \<Longrightarrow> local.inverse (a \<cdot> b) \<in> generate (G \<inter> H)
[PROOF STEP]
case (mult a b)
[PROOF STATE]
proof (state)
this:
a \<in> generate (G \<inter> H)
b \<in> generate (G \<inter> H)
local.inverse a \<in> generate (G \<inter> H)
local.inverse b \<in> generate (G \<inter> H)

goal (4 subgoals):
 1. local.inverse \<one> \<in> generate (G \<inter> H)
 2. \<And>a. a \<in> G \<inter> H \<Longrightarrow> local.inverse a \<in> generate (G \<inter> H)
 3. \<And>a. a \<in> G \<inter> H \<Longrightarrow> local.inverse (local.inverse a) \<in> generate (G \<inter> H)
 4. \<And>a b. \<lbrakk>a \<in> generate (G \<inter> H); local.inverse a \<in> generate (G \<inter> H); b \<in> generate (G \<inter> H); local.inverse b \<in> generate (G \<inter> H)\<rbrakk> \<Longrightarrow> local.inverse (a \<cdot> b) \<in> generate (G \<inter> H)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> generate (G \<inter> H)
b \<in> generate (G \<inter> H)
local.inverse a \<in> generate (G \<inter> H)
local.inverse b \<in> generate (G \<inter> H)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a \<in> generate (G \<inter> H)
b \<in> generate (G \<inter> H)
local.inverse a \<in> generate (G \<inter> H)
local.inverse b \<in> generate (G \<inter> H)

goal (1 subgoal):
 1. local.inverse (a \<cdot> b) \<in> generate (G \<inter> H)
[PROOF STEP]
by (simp add: generate.mult generate_into_G inverse_composition_commute)
[PROOF STATE]
proof (state)
this:
local.inverse (a \<cdot> b) \<in> generate (G \<inter> H)

goal (3 subgoals):
 1. local.inverse \<one> \<in> generate (G \<inter> H)
 2. \<And>a. a \<in> G \<inter> H \<Longrightarrow> local.inverse a \<in> generate (G \<inter> H)
 3. \<And>a. a \<in> G \<inter> H \<Longrightarrow> local.inverse (local.inverse a) \<in> generate (G \<inter> H)
[PROOF STEP]
qed (auto simp add: generate.unit generate.incl generate.inv)


[STATEMENT]
lemma zfact_prime_is_finite_field:
  assumes "Factorial_Ring.prime p"
  shows "finite_field (ZFact (int p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_field (ZFact (int p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite_field (ZFact (int p))
[PROOF STEP]
have p_gt_0: "p > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
using assms(1) prime_gt_0_nat
[PROOF STATE]
proof (prove)
using this:
normalization_semidom_class.prime p
normalization_semidom_class.prime ?p \<Longrightarrow> 0 < ?p

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

goal (1 subgoal):
 1. finite_field (ZFact (int p))
[PROOF STEP]
have "Factorial_Ring.prime (int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalization_semidom_class.prime (int p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
normalization_semidom_class.prime p

goal (1 subgoal):
 1. normalization_semidom_class.prime (int p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
normalization_semidom_class.prime (int p)

goal (1 subgoal):
 1. finite_field (ZFact (int p))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
normalization_semidom_class.prime (int p)

goal (1 subgoal):
 1. finite_field (ZFact (int p))
[PROOF STEP]
have "finite (carrier (ZFact (int p)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier (ZFact (int p)))
[PROOF STEP]
using fin_zfact[OF p_gt_0]
[PROOF STATE]
proof (prove)
using this:
finite (carrier (ZFact (int p)))

goal (1 subgoal):
 1. finite (carrier (ZFact (int p)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (carrier (ZFact (int p)))

goal (1 subgoal):
 1. finite_field (ZFact (int p))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
normalization_semidom_class.prime (int p)
finite (carrier (ZFact (int p)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
normalization_semidom_class.prime (int p)
finite (carrier (ZFact (int p)))

goal (1 subgoal):
 1. finite_field (ZFact (int p))
[PROOF STEP]
by (intro finite_domains_are_fields ZFact_prime_is_domain, auto)
[PROOF STATE]
proof (state)
this:
finite_field (ZFact (int p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma select_append:
  assumes "\<And>y z. y \<in> set ys \<Longrightarrow> z \<in> set zs \<Longrightarrow> y \<le> z"
  shows   "k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys"
          "k \<in> {length ys..<length ys + length zs} \<Longrightarrow>
             select k (ys @ zs) = select (k - length ys) zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys) &&& (k \<in> {length ys..<length ys + length zs} \<Longrightarrow> select k (ys @ zs) = select (k - length ys) zs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<in> set ys; ?z \<in> set zs\<rbrakk> \<Longrightarrow> ?y \<le> ?z

goal (1 subgoal):
 1. (k < length ys \<Longrightarrow> select k (ys @ zs) = select k ys) &&& (k \<in> {length ys..<length ys + length zs} \<Longrightarrow> select k (ys @ zs) = select (k - length ys) zs)
[PROOF STEP]
by (simp_all add: select_def sort_append nth_append)


[STATEMENT]
lemma all_ones_mat_index[simp]: "i < dim_row (J\<^sub>m n) \<Longrightarrow> j < dim_col (J\<^sub>m n) \<Longrightarrow> J\<^sub>m n $$ (i, j)= 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < dim_row (J\<^sub>m n); j < dim_col (J\<^sub>m n)\<rbrakk> \<Longrightarrow> J\<^sub>m n $$ (i, j) = (1::'c)
[PROOF STEP]
by (simp add: all_ones_mat_def)


[STATEMENT]
lemma cball_translation:
  "cball (a + c) r = (+) a ` cball c r" for a :: "'n::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (a + c) r = (+) a ` cball c r
[PROOF STEP]
by (auto simp: dist_norm algebra_simps intro!: image_eqI [where x = "x - a" for x])


[STATEMENT]
lemma moebius_rotation_unit_circle_fix [simp]:
  shows "moebius_pt (moebius_rotation \<phi>) u \<in> unit_circle_set \<longleftrightarrow> u \<in> unit_circle_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (moebius_pt (moebius_rotation \<phi>) u \<in> unit_circle_set) = (u \<in> unit_circle_set)
[PROOF STEP]
using moebius_pt_moebius_inv_in_set unit_circle_fix_iff_unit_circle_set
[PROOF STATE]
proof (prove)
using this:
moebius_pt ?M ?z \<in> ?A \<Longrightarrow> ?z \<in> moebius_pt (moebius_inv ?M) ` ?A
unit_circle_fix ?M = (moebius_pt ?M ` unit_circle_set = unit_circle_set)

goal (1 subgoal):
 1. (moebius_pt (moebius_rotation \<phi>) u \<in> unit_circle_set) = (u \<in> unit_circle_set)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma prob1_is_prob:
  assumes "state n v"
  shows "prob1 n v i \<ge> 0 \<and> prob1 n v i \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> prob1 n v i \<and> prob1 n v i \<le> 1
[PROOF STEP]
by (simp add: assms prob1_geq_zero prob1_leq_one)


[STATEMENT]
lemma mat_row_first_dim[simp]:
  "dim_row (mat_row_first A n) = n"
  "dim_col (mat_row_first A n) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_row_first A n) = n &&& dim_col (mat_row_first A n) = dim_col A
[PROOF STEP]
unfolding mat_row_first_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat n (dim_col A) (\<lambda>(i, j). A $$ (i, j))) = n &&& dim_col (mat n (dim_col A) (\<lambda>(i, j). A $$ (i, j))) = dim_col A
[PROOF STEP]
by simp_all


[STATEMENT]
lemma ereal_add_le_add_iff2:
  fixes a b c :: ereal
  shows "a + c \<le> b + c \<longleftrightarrow> a \<le> b \<or> c = \<infinity> \<or> (c = -\<infinity> \<and> a \<noteq> \<infinity> \<and> b \<noteq> \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + c \<le> b + c) = (a \<le> b \<or> c = \<infinity> \<or> c = - \<infinity> \<and> a \<noteq> \<infinity> \<and> b \<noteq> \<infinity>)
[PROOF STEP]
by(cases rule: ereal3_cases[of a b c])(simp_all add: field_simps)


[STATEMENT]
lemma multiplicative_norm_octo: "norm (x * y) = norm x * norm y" for x y ::octo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x * y) = norm x * norm y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (x * y) = norm x * norm y
[PROOF STEP]
have "norm (x * y) ^ 2 = norm x ^ 2 * norm y ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (x * y))\<^sup>2 = (norm x)\<^sup>2 * (norm y)\<^sup>2
[PROOF STEP]
unfolding norm_octo_squared octo_mult_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Ree x * Ree y - Im1 x * Im1 y - Im2 x * Im2 y - Im3 x * Im3 y - Im4 x * Im4 y - Im5 x * Im5 y - Im6 x * Im6 y - Im7 x * Im7 y)\<^sup>2 + (Ree x * Im1 y + Im1 x * Ree y + Im2 x * Im4 y + Im3 x * Im7 y - Im4 x * Im2 y + Im5 x * Im6 y - Im6 x * Im5 y - Im7 x * Im3 y)\<^sup>2 + (Ree x * Im2 y - Im1 x * Im4 y + Im2 x * Ree y + Im3 x * Im5 y + Im4 x * Im1 y - Im5 x * Im3 y + Im6 x * Im7 y - Im7 x * Im6 y)\<^sup>2 + (Ree x * Im3 y - Im1 x * Im7 y - Im2 x * Im5 y + Im3 x * Ree y + Im4 x * Im6 y + Im5 x * Im2 y - Im6 x * Im4 y + Im7 x * Im1 y)\<^sup>2 + (Ree x * Im4 y + Im1 x * Im2 y - Im2 x * Im1 y - Im3 x * Im6 y + Im4 x * Ree y + Im5 x * Im7 y + Im6 x * Im3 y - Im7 x * Im5 y)\<^sup>2 + (Ree x * Im5 y - Im1 x * Im6 y + Im2 x * Im3 y - Im3 x * Im2 y - Im4 x * Im7 y + Im5 x * Ree y + Im6 x * Im1 y + Im7 x * Im4 y)\<^sup>2 + (Ree x * Im6 y + Im1 x * Im5 y - Im2 x * Im7 y + Im3 x * Im4 y - Im4 x * Im3 y - Im5 x * Im1 y + Im6 x * Ree y + Im7 x * Im2 y)\<^sup>2 + (Ree x * Im7 y + Im1 x * Im3 y + Im2 x * Im6 y - Im3 x * Im1 y + Im4 x * Im5 y - Im5 x * Im4 y - Im6 x * Im2 y + Im7 x * Ree y)\<^sup>2 = ((Ree x)\<^sup>2 + (Im1 x)\<^sup>2 + (Im2 x)\<^sup>2 + (Im3 x)\<^sup>2 + (Im4 x)\<^sup>2 + (Im5 x)\<^sup>2 + (Im6 x)\<^sup>2 + (Im7 x)\<^sup>2) * ((Ree y)\<^sup>2 + (Im1 y)\<^sup>2 + (Im2 y)\<^sup>2 + (Im3 y)\<^sup>2 + (Im4 y)\<^sup>2 + (Im5 y)\<^sup>2 + (Im6 y)\<^sup>2 + (Im7 y)\<^sup>2)
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
(norm (x * y))\<^sup>2 = (norm x)\<^sup>2 * (norm y)\<^sup>2

goal (1 subgoal):
 1. norm (x * y) = norm x * norm y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (x * y))\<^sup>2 = (norm x)\<^sup>2 * (norm y)\<^sup>2

goal (1 subgoal):
 1. norm (x * y) = norm x * norm y
[PROOF STEP]
have "... = (norm x * norm y) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x)\<^sup>2 * (norm y)\<^sup>2 = (norm x * norm y)\<^sup>2
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(norm x)\<^sup>2 * (norm y)\<^sup>2 = (norm x * norm y)\<^sup>2

goal (1 subgoal):
 1. norm (x * y) = norm x * norm y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(norm (x * y))\<^sup>2 = (norm x * norm y)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(norm (x * y))\<^sup>2 = (norm x * norm y)\<^sup>2

goal (1 subgoal):
 1. norm (x * y) = norm x * norm y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (x * y) = norm x * norm y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma visited_states_take :
  "(take (Suc n) (visited_states q p)) = (visited_states q (take n p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take (Suc n) (visited_states q p) = visited_states q (take n p)
[PROOF STEP]
proof (induction p rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. take (Suc n) (visited_states q []) = visited_states q (take n [])
 2. \<And>x xs. take (Suc n) (visited_states q xs) = visited_states q (take n xs) \<Longrightarrow> take (Suc n) (visited_states q (xs @ [x])) = visited_states q (take n (xs @ [x]))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. take (Suc n) (visited_states q []) = visited_states q (take n [])
 2. \<And>x xs. take (Suc n) (visited_states q xs) = visited_states q (take n xs) \<Longrightarrow> take (Suc n) (visited_states q (xs @ [x])) = visited_states q (take n (xs @ [x]))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take (Suc n) (visited_states q []) = visited_states q (take n [])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
take (Suc n) (visited_states q []) = visited_states q (take n [])

goal (1 subgoal):
 1. \<And>x xs. take (Suc n) (visited_states q xs) = visited_states q (take n xs) \<Longrightarrow> take (Suc n) (visited_states q (xs @ [x])) = visited_states q (take n (xs @ [x]))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. take (Suc n) (visited_states q xs) = visited_states q (take n xs) \<Longrightarrow> take (Suc n) (visited_states q (xs @ [x])) = visited_states q (take n (xs @ [x]))
[PROOF STEP]
case (snoc x xs)
[PROOF STATE]
proof (state)
this:
take (Suc n) (visited_states q xs) = visited_states q (take n xs)

goal (1 subgoal):
 1. \<And>x xs. take (Suc n) (visited_states q xs) = visited_states q (take n xs) \<Longrightarrow> take (Suc n) (visited_states q (xs @ [x])) = visited_states q (take n (xs @ [x]))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take (Suc n) (visited_states q xs) = visited_states q (take n xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
take (Suc n) (visited_states q xs) = visited_states q (take n xs)

goal (1 subgoal):
 1. take (Suc n) (visited_states q (xs @ [x])) = visited_states q (take n (xs @ [x]))
[PROOF STEP]
by (cases "n \<le> length xs"; auto)
[PROOF STATE]
proof (state)
this:
take (Suc n) (visited_states q (xs @ [x])) = visited_states q (take n (xs @ [x]))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma borel_measurable_continuous_on_if:
  "A \<in> sets borel \<Longrightarrow> continuous_on A f \<Longrightarrow> continuous_on (- A) g \<Longrightarrow>
    (\<lambda>x. if x \<in> A then f x else g x) \<in> borel_measurable borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> sets borel; continuous_on A f; continuous_on (- A) g\<rbrakk> \<Longrightarrow> (\<lambda>x. if x \<in> A then f x else g x) \<in> borel_measurable borel
[PROOF STEP]
by (auto simp add: measurable_If_restrict_space_iff Collect_neg_eq
           intro!: borel_measurable_continuous_on_restrict)


[STATEMENT]
lemma sorted_list_psub:
  "sorted w \<longrightarrow>
   w \<noteq> [] \<longrightarrow>
   (sorted_list_of_set (set (tl w)), w) \<in> (\<lambda>(x, y). (sorted_list_of_set x, sorted_list_of_set y)) ` {(A, B). A \<subset> B \<and> finite B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted w \<longrightarrow> w \<noteq> [] \<longrightarrow> (sorted_list_of_set (set (tl w)), w) \<in> (\<lambda>(x, y). (sorted_list_of_set x, sorted_list_of_set y)) ` {(A, B). A \<subset> B \<and> finite B}
[PROOF STEP]
proof(intro strip, simp add:image_iff)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted w; w \<noteq> []\<rbrakk> \<Longrightarrow> \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
assume sorted_w: "sorted w" and w_n_nil: "w \<noteq> []"
[PROOF STATE]
proof (state)
this:
Sorted_Less.sorted w
w \<noteq> []

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted w; w \<noteq> []\<rbrakk> \<Longrightarrow> \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
let ?a = "set (tl w)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted w; w \<noteq> []\<rbrakk> \<Longrightarrow> \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
let ?b = "set w"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted w; w \<noteq> []\<rbrakk> \<Longrightarrow> \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
from sorted_w
[PROOF STATE]
proof (chain)
picking this:
Sorted_Less.sorted w
[PROOF STEP]
have sorted_tl_w: "sorted (tl w)" and dist: "distinct w"
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted w

goal (1 subgoal):
 1. Sorted_Less.sorted (tl w) &&& distinct w
[PROOF STEP]
by (induct w) (auto simp add: sorted_wrt_append )
[PROOF STATE]
proof (state)
this:
Sorted_Less.sorted (tl w)
distinct w

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted w; w \<noteq> []\<rbrakk> \<Longrightarrow> \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
with w_n_nil
[PROOF STATE]
proof (chain)
picking this:
w \<noteq> []
Sorted_Less.sorted (tl w)
distinct w
[PROOF STEP]
have a_psub_b: "?a \<subset> ?b"
[PROOF STATE]
proof (prove)
using this:
w \<noteq> []
Sorted_Less.sorted (tl w)
distinct w

goal (1 subgoal):
 1. set (tl w) \<subset> set w
[PROOF STEP]
by (induct w)auto
[PROOF STATE]
proof (state)
this:
set (tl w) \<subset> set w

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted w; w \<noteq> []\<rbrakk> \<Longrightarrow> \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
from sorted_w sorted_tl_w
[PROOF STATE]
proof (chain)
picking this:
Sorted_Less.sorted w
Sorted_Less.sorted (tl w)
[PROOF STEP]
have "w = sorted_list_of_set ?b" and "tl w = sorted_list_of_set (set (tl w))"
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted w
Sorted_Less.sorted (tl w)

goal (1 subgoal):
 1. w = sorted_list_of_set (set w) &&& tl w = sorted_list_of_set (set (tl w))
[PROOF STEP]
by (auto simp add: sorted_less_set_eq)
[PROOF STATE]
proof (state)
this:
w = sorted_list_of_set (set w)
tl w = sorted_list_of_set (set (tl w))

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted w; w \<noteq> []\<rbrakk> \<Longrightarrow> \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
with a_psub_b
[PROOF STATE]
proof (chain)
picking this:
set (tl w) \<subset> set w
w = sorted_list_of_set (set w)
tl w = sorted_list_of_set (set (tl w))
[PROOF STEP]
show "\<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b"
[PROOF STATE]
proof (prove)
using this:
set (tl w) \<subset> set w
w = sorted_list_of_set (set w)
tl w = sorted_list_of_set (set (tl w))

goal (1 subgoal):
 1. \<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a b. a \<subset> b \<and> finite b \<and> sorted_list_of_set (set (tl w)) = sorted_list_of_set a \<and> w = sorted_list_of_set b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r_bound: "4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> real r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> real r
[PROOF STEP]
have "0 \<le> log 2 (1 / real_of_rat \<delta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> log 2 (1 / real_of_rat \<delta>)
[PROOF STEP]
using \<delta>_range
[PROOF STATE]
proof (prove)
using this:
\<delta> \<in> {0<..<1}

goal (1 subgoal):
 1. 0 \<le> log 2 (1 / real_of_rat \<delta>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> log 2 (1 / real_of_rat \<delta>)

goal (1 subgoal):
 1. 4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> real r
[PROOF STEP]
hence "0 \<le> \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil>"
[PROOF STATE]
proof (prove)
using this:
0 \<le> log 2 (1 / real_of_rat \<delta>)

goal (1 subgoal):
 1. 0 \<le> \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil>

goal (1 subgoal):
 1. 4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> real r
[PROOF STEP]
hence "0 \<le> 4 * \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil> + 23"
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil>

goal (1 subgoal):
 1. 0 \<le> 4 * \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil> + 23
[PROOF STEP]
by (intro add_nonneg_nonneg mult_nonneg_nonneg, auto)
[PROOF STATE]
proof (state)
this:
0 \<le> 4 * \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil> + 23

goal (1 subgoal):
 1. 4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> real r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> 4 * \<lceil>log 2 (1 / real_of_rat \<delta>)\<rceil> + 23

goal (1 subgoal):
 1. 4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> real r
[PROOF STEP]
by (simp add:r_def)
[PROOF STATE]
proof (state)
this:
4 * log 2 (1 / real_of_rat \<delta>) + 23 \<le> real r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_indices_lem_R:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes arb_list :: "('a list*'a list) list"
  fixes index_list :: "nat list"
  fixes n:: "nat"
  assumes lest: "n < length (take_indices arb_list index_list)"
  assumes well_def: "\<forall>q.(List.member index_list q \<longrightarrow> q < length arb_list)"
  shows "\<exists>k<length arb_list.
            (take_indices arb_list index_list) ! n =  arb_list ! k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k<length arb_list. take_indices arb_list index_list ! n = arb_list ! k
[PROOF STEP]
using lest well_def
[PROOF STATE]
proof (prove)
using this:
n < length (take_indices arb_list index_list)
\<forall>q. List.member index_list q \<longrightarrow> q < length arb_list

goal (1 subgoal):
 1. \<exists>k<length arb_list. take_indices arb_list index_list ! n = arb_list ! k
[PROOF STEP]
unfolding take_indices_def
[PROOF STATE]
proof (prove)
using this:
n < length (map ((!) arb_list) index_list)
\<forall>q. List.member index_list q \<longrightarrow> q < length arb_list

goal (1 subgoal):
 1. \<exists>k<length arb_list. map ((!) arb_list) index_list ! n = arb_list ! k
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < length index_list; \<forall>q. List.member index_list q \<longrightarrow> q < length arb_list\<rbrakk> \<Longrightarrow> \<exists>k<length arb_list. arb_list ! (index_list ! n) = arb_list ! k
[PROOF STEP]
by (metis member_def nth_mem)