[STATEMENT]
lemma map_idx_eq_map2: "map_idx f xs n = map2 f xs [n..<n + length xs]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_idx f xs n = map2 f xs [n..<n + length xs]
[PROOF STEP]
proof (induct xs arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. map_idx f [] n = map2 f [] [n..<n + length []]
 2. \<And>a xs n. (\<And>n. map_idx f xs n = map2 f xs [n..<n + length xs]) \<Longrightarrow> map_idx f (a # xs) n = map2 f (a # xs) [n..<n + length (a # xs)]
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>n. map_idx f [] n = map2 f [] [n..<n + length []]
 2. \<And>a xs n. (\<And>n. map_idx f xs n = map2 f xs [n..<n + length xs]) \<Longrightarrow> map_idx f (a # xs) n = map2 f (a # xs) [n..<n + length (a # xs)]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_idx f [] n = map2 f [] [n..<n + length []]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map_idx f [] n = map2 f [] [n..<n + length []]

goal (1 subgoal):
 1. \<And>a xs n. (\<And>n. map_idx f xs n = map2 f xs [n..<n + length xs]) \<Longrightarrow> map_idx f (a # xs) n = map2 f (a # xs) [n..<n + length (a # xs)]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs n. (\<And>n. map_idx f xs n = map2 f xs [n..<n + length xs]) \<Longrightarrow> map_idx f (a # xs) n = map2 f (a # xs) [n..<n + length (a # xs)]
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
map_idx f xs ?n = map2 f xs [?n..<?n + length xs]

goal (1 subgoal):
 1. \<And>a xs n. (\<And>n. map_idx f xs n = map2 f xs [n..<n + length xs]) \<Longrightarrow> map_idx f (a # xs) n = map2 f (a # xs) [n..<n + length (a # xs)]
[PROOF STEP]
have eq: "[n..<n + length (x # xs)] = n # [Suc n..<Suc (n + length xs)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [n..<n + length (x # xs)] = n # [Suc n..<Suc (n + length xs)]
[PROOF STEP]
by (metis add_Suc_right length_Cons less_add_Suc1 upt_conv_Cons)
[PROOF STATE]
proof (state)
this:
[n..<n + length (x # xs)] = n # [Suc n..<Suc (n + length xs)]

goal (1 subgoal):
 1. \<And>a xs n. (\<And>n. map_idx f xs n = map2 f xs [n..<n + length xs]) \<Longrightarrow> map_idx f (a # xs) n = map2 f (a # xs) [n..<n + length (a # xs)]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_idx f (x # xs) n = map2 f (x # xs) [n..<n + length (x # xs)]
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_idx f (x # xs) n = map2 f (x # xs) (n # [Suc n..<Suc (n + length xs)])
[PROOF STEP]
by (simp add: Cons del: upt_Suc)
[PROOF STATE]
proof (state)
this:
map_idx f (x # xs) n = map2 f (x # xs) [n..<n + length (x # xs)]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_shift_power [simp]:
  fixes f :: "'a :: {comm_semiring, nat_power} fds"
  shows "fds_shift c (f ^ n) = fds_shift c f ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_shift c (f ^ n) = fds_shift c f ^ n
[PROOF STEP]
by (induction n) simp_all


[STATEMENT]
lemma Gamma_real_altdef2: "Gamma x = Re (Gamma (of_real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma x = Re (Gamma (complex_of_real x))
[PROOF STEP]
using rGamma_complex_real[OF Reals_of_real[of x]]
[PROOF STATE]
proof (prove)
using this:
rGamma (complex_of_real x) \<in> \<real>

goal (1 subgoal):
 1. Gamma x = Re (Gamma (complex_of_real x))
[PROOF STEP]
by (elim Reals_cases)
     (simp only: Gamma_def rGamma_real_def of_real_inverse[symmetric] Re_complex_of_real)


[STATEMENT]
lemma of_char_of [simp]:
  \<open>of_char (char_of a) = a mod 256\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
have \<open>[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7 :: nat]\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]
[PROOF STEP]
by (simp add: upt_eq_Cons_conv)
[PROOF STATE]
proof (state)
this:
[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]
[PROOF STEP]
have \<open>[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]\<close>
[PROOF STATE]
proof (prove)
using this:
[0..<8] = [0, Suc 0, 2, 3, 4, 5, 6, 7]

goal (1 subgoal):
 1. [bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]
[PROOF STEP]
have \<open>of_char (char_of a) = take_bit 8 a\<close>
[PROOF STATE]
proof (prove)
using this:
[bit a 0, bit a 1, bit a 2, bit a 3, bit a 4, bit a 5, bit a 6, bit a 7] = map (bit a) [0..<8]

goal (1 subgoal):
 1. of_char (char_of a) = take_bit 8 a
[PROOF STEP]
by (simp only: char_of_def of_char_def char.sel horner_sum_bit_eq_take_bit)
[PROOF STATE]
proof (state)
this:
of_char (char_of a) = take_bit 8 a

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_char (char_of a) = take_bit 8 a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
of_char (char_of a) = take_bit 8 a

goal (1 subgoal):
 1. of_char (char_of a) = a mod (256::'a)
[PROOF STEP]
by (simp add: take_bit_eq_mod)
[PROOF STATE]
proof (state)
this:
of_char (char_of a) = a mod (256::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_linear_Base: "bounded_linear Base"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear Base
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>b1 b2. Base (b1 + b2) = Base b1 + Base b2
 2. \<And>r b. Base (r *\<^sub>R b) = r *\<^sub>R Base b
 3. \<exists>K. \<forall>x. norm (Base x) \<le> norm x * K
[PROOF STEP]
show "\<And>b1 b2. Base (b1 + b2) = Base b1 + Base b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b1 b2. Base (b1 + b2) = Base b1 + Base b2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Base (?b1.0 + ?b2.0) = Base ?b1.0 + Base ?b2.0

goal (2 subgoals):
 1. \<And>r b. Base (r *\<^sub>R b) = r *\<^sub>R Base b
 2. \<exists>K. \<forall>x. norm (Base x) \<le> norm x * K
[PROOF STEP]
show "\<And>r b. Base (r *\<^sub>R b) = r *\<^sub>R Base b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r b. Base (r *\<^sub>R b) = r *\<^sub>R Base b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Base (?r1 *\<^sub>R ?b1) = ?r1 *\<^sub>R Base ?b1

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (Base x) \<le> norm x * K
[PROOF STEP]
have "\<forall>x. norm (Base x) \<le> norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. norm (Base x) \<le> norm x
[PROOF STEP]
by (simp add: inner_hyperdual_def norm_eq_sqrt_inner)
[PROOF STATE]
proof (state)
this:
\<forall>x. norm (Base x) \<le> norm x

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (Base x) \<le> norm x * K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. norm (Base x) \<le> norm x
[PROOF STEP]
show "\<exists>K. \<forall>x. norm (Base x) \<le> norm x * K"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. norm (Base x) \<le> norm x

goal (1 subgoal):
 1. \<exists>K. \<forall>x. norm (Base x) \<le> norm x * K
[PROOF STEP]
by (metis mult.commute mult.left_neutral)
[PROOF STATE]
proof (state)
this:
\<exists>K. \<forall>x. norm (Base x) \<le> norm x * K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upt_append: "i < j \<Longrightarrow> j < k \<Longrightarrow> [i..<j]@[j..<k] = [i..<k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < j; j < k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<k] = [i..<k]
[PROOF STEP]
proof(induct k arbitrary: j)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>j. \<lbrakk>i < j; j < 0\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<0] = [i..<0]
 2. \<And>k j. \<lbrakk>\<And>j. \<lbrakk>i < j; j < k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<k] = [i..<k]; i < j; j < Suc k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<Suc k] = [i..<Suc k]
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
i < j
j < 0

goal (2 subgoals):
 1. \<And>j. \<lbrakk>i < j; j < 0\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<0] = [i..<0]
 2. \<And>k j. \<lbrakk>\<And>j. \<lbrakk>i < j; j < k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<k] = [i..<k]; i < j; j < Suc k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<Suc k] = [i..<Suc k]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < j
j < 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < j
j < 0

goal (1 subgoal):
 1. [i..<j] @ [j..<0] = [i..<0]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[i..<j] @ [j..<0] = [i..<0]

goal (1 subgoal):
 1. \<And>k j. \<lbrakk>\<And>j. \<lbrakk>i < j; j < k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<k] = [i..<k]; i < j; j < Suc k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<Suc k] = [i..<Suc k]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k j. \<lbrakk>\<And>j. \<lbrakk>i < j; j < k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<k] = [i..<k]; i < j; j < Suc k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<Suc k] = [i..<Suc k]
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
\<lbrakk>i < ?j; ?j < k\<rbrakk> \<Longrightarrow> [i..<?j] @ [?j..<k] = [i..<k]
i < j
j < Suc k

goal (1 subgoal):
 1. \<And>k j. \<lbrakk>\<And>j. \<lbrakk>i < j; j < k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<k] = [i..<k]; i < j; j < Suc k\<rbrakk> \<Longrightarrow> [i..<j] @ [j..<Suc k] = [i..<Suc k]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>i < ?j; ?j < k\<rbrakk> \<Longrightarrow> [i..<?j] @ [?j..<k] = [i..<k]
i < j
j < Suc k
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < ?j; ?j < k\<rbrakk> \<Longrightarrow> [i..<?j] @ [?j..<k] = [i..<k]
i < j
j < Suc k

goal (1 subgoal):
 1. [i..<j] @ [j..<Suc k] = [i..<Suc k]
[PROOF STEP]
by (cases "j = k", auto)
[PROOF STATE]
proof (state)
this:
[i..<j] @ [j..<Suc k] = [i..<Suc k]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hlog_less_cancel_iff [simp]:
  "\<And>a x y. 1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 0 < y \<Longrightarrow> hlog a x < hlog a y \<longleftrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x y. \<lbrakk>1 < a; 0 < x; 0 < y\<rbrakk> \<Longrightarrow> (hlog a x < hlog a y) = (x < y)
[PROOF STEP]
by transfer simp


[STATEMENT]
theorem sum_of_four_squares: "is_sum4sq_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_sum4sq_nat n
[PROOF STEP]
proof (induction n rule: nat_less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>m<n. is_sum4sq_nat m \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:
\<forall>m<n. is_sum4sq_nat m

goal (1 subgoal):
 1. \<And>n. \<forall>m<n. is_sum4sq_nat m \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_sum4sq_nat n
[PROOF STEP]
proof (cases "n>1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
 2. \<not> 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 1 < n

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
 2. \<not> 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
hence "n = 0 \<or> n = 1"
[PROOF STATE]
proof (prove)
using this:
\<not> 1 < n

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

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
 2. \<not> 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n = 0 \<or> n = 1

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
 2. \<not> 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
have "0 = sum4sq_nat 0 0 0 0" "1 = sum4sq_nat 1 0 0 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = sum4sq_nat 0 0 0 0 &&& 1 = sum4sq_nat 1 0 0 0
[PROOF STEP]
unfolding sum4sq_nat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = 0\<^sup>2 + 0\<^sup>2 + 0\<^sup>2 + 0\<^sup>2 &&& 1 = 1\<^sup>2 + 0\<^sup>2 + 0\<^sup>2 + 0\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 = sum4sq_nat 0 0 0 0
1 = sum4sq_nat 1 0 0 0

goal (2 subgoals):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
 2. \<not> 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n = 0 \<or> n = 1
0 = sum4sq_nat 0 0 0 0
1 = sum4sq_nat 1 0 0 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0 \<or> n = 1
0 = sum4sq_nat 0 0 0 0
1 = sum4sq_nat 1 0 0 0

goal (1 subgoal):
 1. is_sum4sq_nat n
[PROOF STEP]
unfolding is_sum4sq_nat_def
[PROOF STATE]
proof (prove)
using this:
n = 0 \<or> n = 1
0 = sum4sq_nat 0 0 0 0
1 = sum4sq_nat 1 0 0 0

goal (1 subgoal):
 1. \<exists>a b c d. n = sum4sq_nat a b c d
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_sum4sq_nat n

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
1 < n

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
obtain p m where dec: "prime p \<and> n = p * m"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. (\<And>p m. prime p \<and> n = p * m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using prime_factor_nat[of n]
[PROOF STATE]
proof (prove)
using this:
1 < n
n \<noteq> 1 \<Longrightarrow> \<exists>p. prime p \<and> p dvd n

goal (1 subgoal):
 1. (\<And>p m. prime p \<and> n = p * m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: dvdE)
[PROOF STATE]
proof (state)
this:
prime p \<and> n = p * m

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
prime p \<and> n = p * m

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
hence "m<n"
[PROOF STATE]
proof (prove)
using this:
prime p \<and> n = p * m

goal (1 subgoal):
 1. m < n
[PROOF STEP]
using n_less_m_mult_n[of m p] prime_gt_Suc_0_nat[of p] True
[PROOF STATE]
proof (prove)
using this:
prime p \<and> n = p * m
\<lbrakk>0 < m; Suc 0 < p\<rbrakk> \<Longrightarrow> m < p * m
prime p \<Longrightarrow> Suc 0 < p
1 < n

goal (1 subgoal):
 1. m < n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
m < n

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
prime p \<and> n = p * m
m < n
[PROOF STEP]
have "is_sum4sq_nat m" "is_sum4sq_nat p"
[PROOF STATE]
proof (prove)
using this:
prime p \<and> n = p * m
m < n

goal (1 subgoal):
 1. is_sum4sq_nat m &&& is_sum4sq_nat p
[PROOF STEP]
using 1 prime_is_sum4sq
[PROOF STATE]
proof (prove)
using this:
prime p \<and> n = p * m
m < n
\<forall>m<n. is_sum4sq_nat m
prime ?p \<Longrightarrow> is_sum4sq_nat ?p

goal (1 subgoal):
 1. is_sum4sq_nat m &&& is_sum4sq_nat p
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
is_sum4sq_nat m
is_sum4sq_nat p

goal (1 subgoal):
 1. 1 < n \<Longrightarrow> is_sum4sq_nat n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
is_sum4sq_nat m
is_sum4sq_nat p

goal (1 subgoal):
 1. is_sum4sq_nat n
[PROOF STEP]
using dec is_mult_sum4sq_nat
[PROOF STATE]
proof (prove)
using this:
is_sum4sq_nat m
is_sum4sq_nat p
prime p \<and> n = p * m
\<lbrakk>is_sum4sq_nat ?x; is_sum4sq_nat ?y\<rbrakk> \<Longrightarrow> is_sum4sq_nat (?x * ?y)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coprime_dvd_mult_right_iff:
  "a dvd c * b \<longleftrightarrow> a dvd b" if "coprime a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a dvd c * b) = (a dvd b)
[PROOF STEP]
using that coprime_dvd_mult_left_iff [of a c b]
[PROOF STATE]
proof (prove)
using this:
coprime a c
coprime a c \<Longrightarrow> (a dvd b * c) = (a dvd b)

goal (1 subgoal):
 1. (a dvd c * b) = (a dvd b)
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma division_of_content_0:
  assumes "content (cbox a b) = 0" "d division_of (cbox a b)" "K \<in> d"
  shows "content K = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content K = 0
[PROOF STEP]
unfolding forall_in_division[OF assms(2)]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content K = 0
[PROOF STEP]
by (meson assms content_0_subset division_of_def)


[STATEMENT]
lemma diagonal_in_associates:
  fixes H :: "int^'n::mod_type^'n::mod_type"
  assumes H: "Hermite associates residues H"
  and inv_H: "invertible (map_matrix rat_of_int H)" and up_H: "upper_triangular H"
  shows "H $ i $ i \<in> associates"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
have "H $ i $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H $ i $ i \<noteq> 0
[PROOF STEP]
by (rule invertible_and_upper_diagonal_not0[OF inv_H up_H])
[PROOF STATE]
proof (state)
this:
H $ i $ i \<noteq> 0

goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
hence "\<not> is_zero_row i H"
[PROOF STATE]
proof (prove)
using this:
H $ i $ i \<noteq> 0

goal (1 subgoal):
 1. \<not> is_zero_row i H
[PROOF STEP]
unfolding is_zero_row_def is_zero_row_upt_k_def ncols_def
[PROOF STATE]
proof (prove)
using this:
H $ i $ i \<noteq> 0

goal (1 subgoal):
 1. \<not> (\<forall>j. mod_type_class.to_nat j < CARD('n) \<longrightarrow> H $ i $ j = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> is_zero_row i H

goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H

goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H
Hermite associates residues H

goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
unfolding Hermite_def
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H
Complete_set_non_associates associates \<and> Complete_set_residues residues \<and> echelon_form H \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> H $ i $ (LEAST n. H $ i $ n \<noteq> 0) \<in> associates) \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> (\<forall>j<i. H $ j $ (LEAST n. H $ i $ n \<noteq> 0) \<in> residues (H $ i $ (LEAST n. H $ i $ n \<noteq> 0))))

goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
unfolding diagonal_least_nonzero[OF H inv_H up_H]
[PROOF STATE]
proof (prove)
using this:
\<not> is_zero_row i H
Complete_set_non_associates associates \<and> Complete_set_residues residues \<and> echelon_form H \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> H $ i $ i \<in> associates) \<and> (\<forall>i. \<not> is_zero_row i H \<longrightarrow> (\<forall>j<i. H $ j $ i \<in> residues (H $ i $ i)))

goal (1 subgoal):
 1. H $ i $ i \<in> associates
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H $ i $ i \<in> associates

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma null_sets_density_iff:
  assumes f: "f \<in> borel_measurable M"
  shows "A \<in> null_sets (density M f) \<longleftrightarrow> A \<in> sets M \<and> (AE x in M. x \<in> A \<longrightarrow> f x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
assume "A \<in> sets M"
[PROOF STATE]
proof (state)
this:
A \<in> sets M

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
have "(\<integral>\<^sup>+x. f x * indicator A x \<partial>M) = 0 \<longleftrightarrow> emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0)
[PROOF STEP]
using f \<open>A \<in> sets M\<close>
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
A \<in> sets M

goal (1 subgoal):
 1. (\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0)
[PROOF STEP]
by (intro nn_integral_0_iff) auto
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (AE x in M. f x * indicator A x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0) = (AE x in M. f x * indicator A x = 0)
[PROOF STEP]
using f \<open>A \<in> sets M\<close>
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
A \<in> sets M

goal (1 subgoal):
 1. (emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0) = (AE x in M. f x * indicator A x = 0)
[PROOF STEP]
by (intro AE_iff_measurable[OF _ refl, symmetric]) auto
[PROOF STATE]
proof (state)
this:
(emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0) = (AE x in M. f x * indicator A x = 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(emeasure M {x \<in> space M. f x * indicator A x \<noteq> 0} = 0) = (AE x in M. f x * indicator A x = 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
have "(AE x in M. f x * indicator A x = 0) \<longleftrightarrow> (AE x in M. x \<in> A \<longrightarrow> f x \<le> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (AE x in M. f x * indicator A x = 0) = (AE x\<in>A in M. f x \<le> 0)
[PROOF STEP]
by (auto simp add: indicator_def max_def split: if_split_asm)
[PROOF STATE]
proof (state)
this:
(AE x in M. f x * indicator A x = 0) = (AE x\<in>A in M. f x \<le> 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (AE x\<in>A in M. f x \<le> 0)
[PROOF STEP]
have "(\<integral>\<^sup>+x. f x * indicator A x \<partial>M) = 0 \<longleftrightarrow> (AE x in M. x \<in> A \<longrightarrow> f x \<le> 0)"
[PROOF STATE]
proof (prove)
using this:
(\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (AE x\<in>A in M. f x \<le> 0)

goal (1 subgoal):
 1. (\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (AE x\<in>A in M. f x \<le> 0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (AE x\<in>A in M. f x \<le> 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
A \<in> sets M \<Longrightarrow> (\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (AE x\<in>A in M. f x \<le> 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
with f
[PROOF STATE]
proof (chain)
picking this:
f \<in> borel_measurable M
A \<in> sets M \<Longrightarrow> (\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (AE x\<in>A in M. f x \<le> 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
A \<in> sets M \<Longrightarrow> (\<integral>\<^sup>+ x. f x * indicator A x \<partial>M = 0) = (AE x\<in>A in M. f x \<le> 0)

goal (1 subgoal):
 1. (A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))
[PROOF STEP]
by (simp add: null_sets_def emeasure_density cong: conj_cong)
[PROOF STATE]
proof (state)
this:
(A \<in> null_sets (density M f)) = (A \<in> sets M \<and> (AE x\<in>A in M. f x = 0))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Inf_as_limit:
  fixes A::"'a::{linorder_topology, first_countable_topology, complete_linorder} set"
  assumes "A \<noteq> {}"
  shows "\<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
proof (cases "Inf A \<in> A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Inf A \<in> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
 2. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Inf A \<in> A

goal (2 subgoals):
 1. Inf A \<in> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
 2. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
by (rule exI[of _ "\<lambda>n. Inf A"], auto simp add: True)
[PROOF STATE]
proof (state)
this:
\<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Inf A \<notin> A

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
obtain y where "y \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}

goal (1 subgoal):
 1. (\<And>y. y \<in> A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> A

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> A
[PROOF STEP]
have "Inf A < y"
[PROOF STATE]
proof (prove)
using this:
y \<in> A

goal (1 subgoal):
 1. Inf A < y
[PROOF STEP]
using False Inf_lower less_le
[PROOF STATE]
proof (prove)
using this:
y \<in> A
Inf A \<notin> A
?x \<in> ?A \<Longrightarrow> Inf ?A \<le> ?x
(?x < ?y) = (?x \<le> ?y \<and> ?x \<noteq> ?y)

goal (1 subgoal):
 1. Inf A < y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Inf A < y

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
obtain F :: "nat \<Rightarrow> 'a set" where F: "\<And>i. open (F i)" "\<And>i. Inf A \<in> F i"
                                       "\<And>u. (\<forall>n. u n \<in> F n) \<Longrightarrow> u \<longlonglongrightarrow> Inf A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>F. \<lbrakk>\<And>i. open (F i); \<And>i. Inf A \<in> F i; \<And>u. \<forall>n. u n \<in> F n \<Longrightarrow> u \<longlonglongrightarrow> Inf A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis first_countable_topology_class.countable_basis)
[PROOF STATE]
proof (state)
this:
open (F ?i)
Inf A \<in> F ?i
\<forall>n. ?u n \<in> F n \<Longrightarrow> ?u \<longlonglongrightarrow> Inf A

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
define u where "u = (\<lambda>n. SOME z. z \<in> F n \<and> z \<in> A)"
[PROOF STATE]
proof (state)
this:
u = (\<lambda>n. SOME z. z \<in> F n \<and> z \<in> A)

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
have "\<exists>z. z \<in> U \<and> z \<in> A" if "Inf A \<in> U" "open U" for U
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> z \<in> A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> z \<in> A
[PROOF STEP]
obtain b where "b > Inf A" "{Inf A ..<b} \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<lbrakk>Inf A < b; {Inf A..<b} \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using open_right[OF \<open>open U\<close> \<open>Inf A \<in> U\<close> \<open>Inf A < y\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>b>Inf A. {Inf A..<b} \<subseteq> U

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>Inf A < b; {Inf A..<b} \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Inf A < b
{Inf A..<b} \<subseteq> U

goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> z \<in> A
[PROOF STEP]
obtain z where "z < b" "z \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z < b; z \<in> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>Inf A < b\<close> Inf_less_iff
[PROOF STATE]
proof (prove)
using this:
Inf A < b
(Inf ?S < ?a) = (\<exists>x\<in>?S. x < ?a)

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>z < b; z \<in> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z < b
z \<in> A

goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> z \<in> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z < b
z \<in> A
[PROOF STEP]
have "z \<in> {Inf A ..<b}"
[PROOF STATE]
proof (prove)
using this:
z < b
z \<in> A

goal (1 subgoal):
 1. z \<in> {Inf A..<b}
[PROOF STEP]
by (simp add: Inf_lower)
[PROOF STATE]
proof (state)
this:
z \<in> {Inf A..<b}

goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> z \<in> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> {Inf A..<b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> {Inf A..<b}

goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> z \<in> A
[PROOF STEP]
using \<open>z \<in> A\<close> \<open>{Inf A ..<b} \<subseteq> U\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> {Inf A..<b}
z \<in> A
{Inf A..<b} \<subseteq> U

goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> z \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z. z \<in> U \<and> z \<in> A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>Inf A \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> z \<in> A

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>Inf A \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> z \<in> A
[PROOF STEP]
have *: "u n \<in> F n \<and> u n \<in> A" for n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Inf A \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> z \<in> A

goal (1 subgoal):
 1. u n \<in> F n \<and> u n \<in> A
[PROOF STEP]
using \<open>Inf A \<in> F n\<close> \<open>open (F n)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Inf A \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> z \<in> A
Inf A \<in> F n
open (F n)

goal (1 subgoal):
 1. u n \<in> F n \<and> u n \<in> A
[PROOF STEP]
unfolding u_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Inf A \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> z \<in> A
Inf A \<in> F n
open (F n)

goal (1 subgoal):
 1. (SOME z. z \<in> F n \<and> z \<in> A) \<in> F n \<and> (SOME z. z \<in> F n \<and> z \<in> A) \<in> A
[PROOF STEP]
by (metis (no_types, lifting) someI_ex)
[PROOF STATE]
proof (state)
this:
u ?n \<in> F ?n \<and> u ?n \<in> A

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u ?n \<in> F ?n \<and> u ?n \<in> A
[PROOF STEP]
have "u \<longlonglongrightarrow> Inf A"
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> F ?n \<and> u ?n \<in> A

goal (1 subgoal):
 1. u \<longlonglongrightarrow> Inf A
[PROOF STEP]
using F(3)
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> F ?n \<and> u ?n \<in> A
\<forall>n. ?u n \<in> F n \<Longrightarrow> ?u \<longlonglongrightarrow> Inf A

goal (1 subgoal):
 1. u \<longlonglongrightarrow> Inf A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u \<longlonglongrightarrow> Inf A

goal (1 subgoal):
 1. Inf A \<notin> A \<Longrightarrow> \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<longlonglongrightarrow> Inf A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> Inf A

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> Inf A
u ?n \<in> F ?n \<and> u ?n \<in> A

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>u. (\<forall>n. u n \<in> A) \<and> u \<longlonglongrightarrow> Inf A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma del_list_length[simp]:
  assumes "sorted_less ks"
  shows "length (del_list k ks) = length ks - (if k \<in> set ks then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (del_list k ks) = length ks - (if k \<in> set ks then 1 else 0)
[PROOF STEP]
using delete_list_length[of ks ins_list k]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sorted_less ks; set (ins_list k ks) = set ks - {k}; sorted_less ks \<Longrightarrow> sorted_less (ins_list k ks)\<rbrakk> \<Longrightarrow> length (ins_list k ks) = length ks - (if k \<in> set ks then 1 else 0)

goal (1 subgoal):
 1. length (del_list k ks) = length ks - (if k \<in> set ks then 1 else 0)
[PROOF STEP]
by (simp add: assms set_del_list sorted_del_list)


[STATEMENT]
lemma Compl_lemma: "(n::nat)\<le>l \<Longrightarrow> (\<exists>m. m\<le>l \<and> n=l - m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> l \<Longrightarrow> \<exists>m\<le>l. n = l - m
[PROOF STEP]
apply(rule_tac x = "l - n" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> l \<Longrightarrow> l - n \<le> l \<and> n = l - (l - n)
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma analz_insert_Nonce [simp]:
     "analz (insert (Nonce N) H) = insert (Nonce N) (analz H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (insert (Nonce N) H) = insert (Nonce N) (analz H)
[PROOF STEP]
apply (rule analz_insert_eq_I)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert (Nonce N) H) \<Longrightarrow> x \<in> insert (Nonce N) (analz H)
[PROOF STEP]
apply (erule analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma winding_number_eq_1:
  fixes z::complex
  assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
      and 0: "0 < Re(winding_number \<gamma> z)" and 2: "Re(winding_number \<gamma> z) < 2"
  shows "winding_number \<gamma> z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
have "winding_number \<gamma> z \<in> Ints"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z \<in> \<int>
[PROOF STEP]
by (simp add: \<gamma> integer_winding_number loop valid_path_imp_path z)
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z \<in> \<int>

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
winding_number \<gamma> z \<in> \<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
winding_number \<gamma> z \<in> \<int>

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
using 0 2
[PROOF STATE]
proof (prove)
using this:
winding_number \<gamma> z \<in> \<int>
0 < Re (winding_number \<gamma> z)
Re (winding_number \<gamma> z) < 2

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
by (auto simp: Ints_def)
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ncols_one_matrix[simp]: "ncols ((one_matrix n) :: ('a::zero_neq_one)matrix) = n" (is "?r = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols (one_matrix n) = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ncols (one_matrix n) = n
[PROOF STEP]
have "?r <= n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols (one_matrix n) \<le> n
[PROOF STEP]
by (simp add: ncols_le)
[PROOF STATE]
proof (state)
this:
ncols (one_matrix n) \<le> n

goal (1 subgoal):
 1. ncols (one_matrix n) = n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ncols (one_matrix n) \<le> n

goal (1 subgoal):
 1. ncols (one_matrix n) = n
[PROOF STEP]
have "n <= ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> ncols (one_matrix n)
[PROOF STEP]
by (simp add: le_ncols, arith)
[PROOF STATE]
proof (state)
this:
n \<le> ncols (one_matrix n)

goal (1 subgoal):
 1. ncols (one_matrix n) = n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ncols (one_matrix n) \<le> n
n \<le> ncols (one_matrix n)
[PROOF STEP]
show "?r = n"
[PROOF STATE]
proof (prove)
using this:
ncols (one_matrix n) \<le> n
n \<le> ncols (one_matrix n)

goal (1 subgoal):
 1. ncols (one_matrix n) = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ncols (one_matrix n) = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_mirror_o_snd_polychain_of_eq: "map (mirror_point x0 \<circ> snd) (polychain_of y xs) =
  map snd (polychain_of (mirror_point x0 y) (map uminus xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (mirror_point x0 \<circ> snd) (polychain_of y xs) = map snd (polychain_of (mirror_point x0 y) (map uminus xs))
[PROOF STEP]
by (induct xs arbitrary: x0 y) (auto simp: mirror_point_def o_def algebra_simps)


[STATEMENT]
lemma subformula_atoms: "G \<in> set (subformulae F) \<Longrightarrow> atoms G \<subseteq> atoms F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<in> set (subformulae F) \<Longrightarrow> atoms G \<subseteq> atoms F
[PROOF STEP]
by(induction F) auto


[STATEMENT]
lemma of_rat_eq_1_iff [simp]: "of_rat a = 1 \<longleftrightarrow> a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat a = (1::'a)) = (a = 1)
[PROOF STEP]
using of_rat_eq_iff [of _ 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat ?a = of_rat 1) = (?a = 1)

goal (1 subgoal):
 1. (of_rat a = (1::'a)) = (a = 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in prob_space) prob_space: "prob (space M) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (space M) = 1
[PROOF STEP]
using emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
emeasure M (space M) = 1

goal (1 subgoal):
 1. prob (space M) = 1
[PROOF STEP]
unfolding measure_def
[PROOF STATE]
proof (prove)
using this:
emeasure M (space M) = 1

goal (1 subgoal):
 1. enn2real (emeasure M (space M)) = 1
[PROOF STEP]
by (simp add: one_ennreal.rep_eq)


[STATEMENT]
lemma merge_nempty: "\<lbrakk>list_dtree (Node r xs); xs \<noteq> {||}\<rbrakk> \<Longrightarrow> sucs (merge (Node r xs)) \<noteq> {||}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_dtree (Node r xs); xs \<noteq> {||}\<rbrakk> \<Longrightarrow> sucs (merge (Node r xs)) \<noteq> {||}
[PROOF STEP]
using merge_singleton
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>list_dtree (Node ?r ?xs); ?xs \<noteq> {||}\<rbrakk> \<Longrightarrow> \<exists>t e. merge (Node ?r ?xs) = Node ?r {|(t, e)|}

goal (1 subgoal):
 1. \<lbrakk>list_dtree (Node r xs); xs \<noteq> {||}\<rbrakk> \<Longrightarrow> sucs (merge (Node r xs)) \<noteq> {||}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma const: "c \<noteq> 0 \<Longrightarrow> L F (\<lambda>_. c) = L F (\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> L F (\<lambda>_. c) = L F (\<lambda>_. 1::'b)
[PROOF STEP]
by (subst (2) cmult[symmetric]) simp_all


[STATEMENT]
lemma box01_nonempty [simp]: "box 0 One \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. box (0::'a) One \<noteq> {}
[PROOF STEP]
by (simp add: box_ne_empty inner_Basis inner_sum_left)


[STATEMENT]
lemma Amin_le:"\<lbrakk>f \<in> {j. j \<le> n} \<rightarrow>  Z\<^sub>\<infinity>; j \<in> {k. k \<le> n}\<rbrakk> \<Longrightarrow> Amin n f \<le> (f j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {j. j \<le> n} \<rightarrow> Z\<^sub>\<infinity>; j \<in> {k. k \<le> n}\<rbrakk> \<Longrightarrow> Amin n f \<le> f j
[PROOF STEP]
apply (simp add:Amin_leTr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sqrt_rat[simp]: "set (sqrt_rat x) = { y. y * y = x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (sqrt_rat x) = {y. y * y = x}
[PROOF STEP]
unfolding sqrt_rat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (root_rat 2 x) = {y. y * y = x}
[PROOF STEP]
using root_rat[of 2 x]
[PROOF STATE]
proof (prove)
using this:
2 \<noteq> 0 \<or> x \<noteq> 1 \<Longrightarrow> set (root_rat 2 x) = {y. y\<^sup>2 = x}

goal (1 subgoal):
 1. set (root_rat 2 x) = {y. y * y = x}
[PROOF STEP]
by (simp add: power2_eq_square)


[STATEMENT]
lemma Max_wrt_among_map_relation_bij:
  assumes "bij f"
  shows   "f ` Max_wrt_among le A = Max_wrt_among (map_relation (inv f) le) (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` Max_wrt_among le A = Max_wrt_among (map_relation (inv f) le) (f ` A)
[PROOF STEP]
proof (intro equalityI Max_wrt_among_map_relation_bij_subset assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Max_wrt_among (map_relation (inv f) le) (f ` A) \<subseteq> f ` Max_wrt_among le A
[PROOF STEP]
interpret R: preorder_on "f ` carrier" "map_relation (inv f) le"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Order_Predicates.preorder_on (f ` carrier) (map_relation (inv f) le)
[PROOF STEP]
using preorder_on_map[of "inv f"] assms
[PROOF STATE]
proof (prove)
using this:
Order_Predicates.preorder_on (inv f -` carrier) (map_relation (inv f) le)
bij f

goal (1 subgoal):
 1. Order_Predicates.preorder_on (f ` carrier) (map_relation (inv f) le)
[PROOF STEP]
by (simp add: bij_imp_bij_inv bij_vimage_eq_inv_image inv_inv_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Max_wrt_among (map_relation (inv f) le) (f ` A) \<subseteq> f ` Max_wrt_among le A
[PROOF STEP]
show "Max_wrt_among (map_relation (inv f) le) (f ` A) \<subseteq> f ` Max_wrt_among le A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max_wrt_among (map_relation (inv f) le) (f ` A) \<subseteq> f ` Max_wrt_among le A
[PROOF STEP]
unfolding Max_wrt_among_preorder R.Max_wrt_among_preorder
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> f ` carrier \<inter> f ` A. \<forall>y\<in>f ` carrier \<inter> f ` A. map_relation (inv f) le x y \<longrightarrow> map_relation (inv f) le y x} \<subseteq> f ` {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x}
[PROOF STEP]
using assms bij_is_inj[OF assms]
[PROOF STATE]
proof (prove)
using this:
bij f
inj f

goal (1 subgoal):
 1. {x \<in> f ` carrier \<inter> f ` A. \<forall>y\<in>f ` carrier \<inter> f ` A. map_relation (inv f) le x y \<longrightarrow> map_relation (inv f) le y x} \<subseteq> f ` {x \<in> carrier \<inter> A. \<forall>y\<in>carrier \<inter> A. le x y \<longrightarrow> le y x}
[PROOF STEP]
by (auto simp: map_relation_def inv_f_f image_Int [symmetric])
[PROOF STATE]
proof (state)
this:
Max_wrt_among (map_relation (inv f) le) (f ` A) \<subseteq> f ` Max_wrt_among le A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unat_of_bl_length:
  "unat (of_bl xs :: 'a::len word) < 2 ^ (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
proof (cases "length xs < LENGTH('a)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
 2. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
length xs < LENGTH('a)

goal (2 subgoals):
 1. length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
 2. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length xs < LENGTH('a)
[PROOF STEP]
have "(of_bl xs::'a::len word) < 2 ^ length xs"
[PROOF STATE]
proof (prove)
using this:
length xs < LENGTH('a)

goal (1 subgoal):
 1. of_bl xs < 2 ^ length xs
[PROOF STEP]
by (simp add: of_bl_length_less)
[PROOF STATE]
proof (state)
this:
of_bl xs < 2 ^ length xs

goal (2 subgoals):
 1. length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
 2. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
length xs < LENGTH('a)
of_bl xs < 2 ^ length xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length xs < LENGTH('a)
of_bl xs < 2 ^ length xs

goal (1 subgoal):
 1. unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
by (simp add: word_less_nat_alt unat_of_nat)
[PROOF STATE]
proof (state)
this:
unat (of_bl xs) < 2 ^ length xs

goal (1 subgoal):
 1. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> length xs < LENGTH('a)

goal (1 subgoal):
 1. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
have "unat (of_bl xs::'a::len word) < 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (of_bl xs) < 2 ^ LENGTH('a)
[PROOF STEP]
by (simp split: unat_split)
[PROOF STATE]
proof (state)
this:
unat (of_bl xs) < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unat (of_bl xs) < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> length xs < LENGTH('a)
[PROOF STEP]
have "LENGTH('a) \<le> length xs"
[PROOF STATE]
proof (prove)
using this:
\<not> length xs < LENGTH('a)

goal (1 subgoal):
 1. LENGTH('a) \<le> length xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LENGTH('a) \<le> length xs

goal (1 subgoal):
 1. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LENGTH('a) \<le> length xs
[PROOF STEP]
have "2 ^ LENGTH('a) \<le> (2::nat) ^ length xs"
[PROOF STATE]
proof (prove)
using this:
LENGTH('a) \<le> length xs

goal (1 subgoal):
 1. 2 ^ LENGTH('a) \<le> 2 ^ length xs
[PROOF STEP]
by (rule power_increasing) simp
[PROOF STATE]
proof (state)
this:
2 ^ LENGTH('a) \<le> 2 ^ length xs

goal (1 subgoal):
 1. \<not> length xs < LENGTH('a) \<Longrightarrow> unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
unat (of_bl xs) < 2 ^ length xs

goal (1 subgoal):
 1. unat (of_bl xs) < 2 ^ length xs
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
unat (of_bl xs) < 2 ^ length xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma swap_id_common': "a \<noteq> b \<Longrightarrow> a \<noteq> c \<Longrightarrow>
  transpose a c \<circ> transpose b c = transpose b c \<circ> transpose a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<noteq> b; a \<noteq> c\<rbrakk> \<Longrightarrow> Transposition.transpose a c \<circ> Transposition.transpose b c = Transposition.transpose b c \<circ> Transposition.transpose a b
[PROOF STEP]
by (simp add: fun_eq_iff transpose_def)


[STATEMENT]
lemma prv_imp_cnj_imp:
assumes "\<phi> \<in> fmla" and "\<chi> \<in> fmla" and "\<psi> \<in> fmla"
shows
"prv (imp (imp (cnj \<phi> \<chi>) \<psi>)
          (imp \<phi> (imp \<chi> \<psi>)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (imp (cnj \<phi> \<chi>) \<psi>) (imp \<phi> (imp \<chi> \<psi>)))
[PROOF STEP]
by (metis (no_types) assms cnj prv_prv_imp_trans prv_imp_cnjI prv_imp_com prv_imp_trans2 imp)


[STATEMENT]
lemma aasc_seq_mem:"\<lbrakk>a \<in> A; \<not> (\<exists>m. m\<in>A \<and> (\<forall>x\<in>A. x \<le> m))\<rbrakk> \<Longrightarrow>
                            (aasc_seq A a n) \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)\<rbrakk> \<Longrightarrow> aasc_seq A a n \<in> A
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)\<rbrakk> \<Longrightarrow> aasc_seq A a 0 \<in> A
 2. \<And>n. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m); aasc_seq A a n \<in> A\<rbrakk> \<Longrightarrow> aasc_seq A a (Suc n) \<in> A
[PROOF STEP]
apply (simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>a \<in> A; \<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. \<not> x \<le> m); aasc_seq A a n \<in> A\<rbrakk> \<Longrightarrow> (SOME b. b \<in> A \<and> aasc_seq A a n < b) \<in> A
[PROOF STEP]
apply (simp add:aneg_le,
        frule_tac a = "aasc_seq A a n" in forall_spec, assumption+,
        thin_tac "\<forall>m. m \<in> A \<longrightarrow> (\<exists>x\<in>A. m < x)",
        rule someI2_ex, blast, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma flip_permutes:
"flip permutes {0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flip permutes {0, 1}
[PROOF STEP]
unfolding permutes_def flip_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<notin> {0, 1} \<longrightarrow> (if x = 0 then 1 else if x = 1 then 0 else x) = x) \<and> (\<forall>y. \<exists>!x. (if x = 0 then 1 else if x = 1 then 0 else x) = y)
[PROOF STEP]
by (smt mem_simps(1))


[STATEMENT]
theorem insert_between_wf_dtree:
  "\<lbrakk>e \<notin> darcs t; v \<notin> dverts t \<rbrakk> \<Longrightarrow> wf_dtree (insert_between v e x y t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e \<notin> darcs t; v \<notin> dverts t\<rbrakk> \<Longrightarrow> wf_dtree (insert_between v e x y t)
[PROOF STEP]
by (simp add: insert_between_wf_dverts insert_between_wf_darcs wf_dtree_def)


[STATEMENT]
lemma iterate_nth[simp]:
  assumes "k < n - m" shows "iterate m n f x ! k = (f^^(m+k)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. iterate m n f x ! k = (f ^^ (m + k)) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k < n - m

goal (1 subgoal):
 1. iterate m n f x ! k = (f ^^ (m + k)) x
[PROOF STEP]
by (induct k arbitrary: m) (auto simp: iterate_def)


[STATEMENT]
lemma distinct_length_le:"finite s \<Longrightarrow> set xs \<subseteq> s \<Longrightarrow> distinct xs \<Longrightarrow> length xs \<le> card s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite s; set xs \<subseteq> s; distinct xs\<rbrakk> \<Longrightarrow> length xs \<le> card s
[PROOF STEP]
by (metis card_mono distinct_card)


[STATEMENT]
lemma sets_restrict_space_cong: "sets M = sets N \<Longrightarrow> sets (restrict_space M \<Omega>) = sets (restrict_space N \<Omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets M = sets N \<Longrightarrow> sets (restrict_space M \<Omega>) = sets (restrict_space N \<Omega>)
[PROOF STEP]
by (simp add: sets_restrict_space)


[STATEMENT]
lemma connected_sphere:
    fixes a :: "'a :: euclidean_space"
    assumes "2 \<le> DIM('a)"
      shows "connected(sphere a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (sphere a r)
[PROOF STEP]
using path_connected_sphere [OF assms]
[PROOF STATE]
proof (prove)
using this:
path_connected (sphere ?a ?r)

goal (1 subgoal):
 1. connected (sphere a r)
[PROOF STEP]
by (simp add: path_connected_imp_connected)


[STATEMENT]
lemma of_rat_eq_1_iff [simp]: "of_rat a = 1 \<longleftrightarrow> a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat a = (1::'a)) = (a = 1)
[PROOF STEP]
using of_rat_eq_iff [of _ 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat ?a = of_rat 1) = (?a = 1)

goal (1 subgoal):
 1. (of_rat a = (1::'a)) = (a = 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma lang_dual_CoPLUS_dual[simp]:
  "lang_dual n (CoPLUS_dual False xs) = (if xs = [] then lists (\<Sigma> n) else \<Inter>r \<in> set xs. lang_dual n r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lang_dual n (CoPLUS_dual False xs) = (if xs = [] then lists (\<Sigma> n) else \<Inter> (lang_dual n ` set xs))
[PROOF STEP]
by (induct xs rule: list_singleton_induct) auto


[STATEMENT]
lemma complex_Re_of_nat [simp]: "Re (of_nat n) = of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (of_nat n) = real n
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma bifunctor_proj_snd_is_functor'[cat_cs_intros]:
  assumes "\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \
" and "a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>" and "\<BB>' = \<BB>"
  shows "\<SS>\<^bsub>\<AA>,\<BB>\<^esub>(a,-)\<^sub>C\<^sub>F : \<BB>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \
"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(a,-)\<^sub>C\<^sub>F : \<BB>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(a,-)\<^sub>C\<^sub>F : \<BB>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
unfolding assms(3)
[PROOF STATE]
proof (prove)
using this:
\<SS> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<SS>\<^bsub>\<AA>,\<BB>\<^esub>(a,-)\<^sub>C\<^sub>F : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \

[PROOF STEP]
by (rule bifunctor_proj_snd_is_functor)


[STATEMENT]
lemma winding_number_unique_loop:
  assumes \<gamma>: "path \<gamma>" "z \<notin> path_image \<gamma>"
      and loop: "pathfinish \<gamma> = pathstart \<gamma>"
      and pi:
        "\<And>e. e>0 \<Longrightarrow> \<exists>p. valid_path p \<and> z \<notin> path_image p \<and>
                           pathfinish p = pathstart p \<and>
                           (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
                           contour_integral p (\<lambda>w. 1/(w - z)) = 2 * pi * \<i> * n"
   shows "winding_number \<gamma> z = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "path_image \<gamma> \<subseteq> UNIV - {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> UNIV - {z}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path \<gamma>
z \<notin> path_image \<gamma>
pathfinish \<gamma> = pathstart \<gamma>
0 < ?e \<Longrightarrow> \<exists>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < ?e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * n

goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> UNIV - {z}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> UNIV - {z}

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_image \<gamma> \<subseteq> UNIV - {z}
[PROOF STEP]
obtain e
    where e: "e>0"
      and pi_eq: "\<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2;
                    (\<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e);
                    pathfinish h1 = pathstart h1; pathfinish h2 = pathstart h2; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow>
                    contour_integral h2 f = contour_integral h1 f"
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> UNIV - {z}

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2; \<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e; pathfinish h1 = pathstart h1; pathfinish h2 = pathstart h2; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow> contour_integral h2 f = contour_integral h1 f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using contour_integral_nearby_loops [of "UNIV - {z}" \<gamma>] assms
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> UNIV - {z}
\<lbrakk>open (UNIV - {z}); path \<gamma>; path_image \<gamma> \<subseteq> UNIV - {z}\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>g h. valid_path g \<and> valid_path h \<and> (\<forall>t\<in>{0..1}. cmod (g t - \<gamma> t) < d \<and> cmod (h t - \<gamma> t) < d) \<and> pathfinish g = pathstart g \<and> pathfinish h = pathstart h \<longrightarrow> path_image g \<subseteq> UNIV - {z} \<and> path_image h \<subseteq> UNIV - {z} \<and> (\<forall>f. f holomorphic_on UNIV - {z} \<longrightarrow> contour_integral h f = contour_integral g f)
path \<gamma>
z \<notin> path_image \<gamma>
pathfinish \<gamma> = pathstart \<gamma>
0 < ?e \<Longrightarrow> \<exists>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < ?e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * n

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2; \<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e; pathfinish h1 = pathstart h1; pathfinish h2 = pathstart h2; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow> contour_integral h2 f = contour_integral h1 f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: open_delete)
[PROOF STATE]
proof (state)
this:
0 < e
\<lbrakk>valid_path ?h1.0; valid_path ?h2.0; \<forall>t\<in>{0..1}. cmod (?h1.0 t - \<gamma> t) < e \<and> cmod (?h2.0 t - \<gamma> t) < e; pathfinish ?h1.0 = pathstart ?h1.0; pathfinish ?h2.0 = pathstart ?h2.0; ?f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow> contour_integral ?h2.0 ?f = contour_integral ?h1.0 ?f

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
obtain p where p:
     "valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and>
      (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
      contour_integral p (\<lambda>w. 1/(w - z)) = 2 * pi * \<i> * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using pi [OF e]
[PROOF STATE]
proof (prove)
using this:
\<exists>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * n

goal (1 subgoal):
 1. (\<And>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * n

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
obtain q where q: "winding_number_prop \<gamma> z e q (winding_number \<gamma> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. winding_number_prop \<gamma> z e q (winding_number \<gamma> z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using winding_number [OF \<gamma> e]
[PROOF STATE]
proof (prove)
using this:
\<exists>p. winding_number_prop \<gamma> z e p (winding_number \<gamma> z)

goal (1 subgoal):
 1. (\<And>q. winding_number_prop \<gamma> z e q (winding_number \<gamma> z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
winding_number_prop \<gamma> z e q (winding_number \<gamma> z)

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * n

goal (1 subgoal):
 1. 2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "\<dots> = contour_integral q (\<lambda>w. 1 / (w - z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral p (\<lambda>w. 1 / (w - z)) = contour_integral q (\<lambda>w. 1 / (w - z))
[PROOF STEP]
proof (rule pi_eq)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. valid_path q
 2. valid_path p
 3. \<forall>t\<in>{0..1}. cmod (q t - \<gamma> t) < e \<and> cmod (p t - \<gamma> t) < e
 4. pathfinish q = pathstart q
 5. pathfinish p = pathstart p
 6. (\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}
[PROOF STEP]
show "(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}
[PROOF STEP]
by (auto intro!: holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}

goal (5 subgoals):
 1. valid_path q
 2. valid_path p
 3. \<forall>t\<in>{0..1}. cmod (q t - \<gamma> t) < e \<and> cmod (p t - \<gamma> t) < e
 4. pathfinish q = pathstart q
 5. pathfinish p = pathstart p
[PROOF STEP]
qed (use p q loop in \<open>auto simp: winding_number_prop_def norm_minus_commute\<close>)
[PROOF STATE]
proof (state)
this:
contour_integral p (\<lambda>w. 1 / (w - z)) = contour_integral q (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral p (\<lambda>w. 1 / (w - z)) = contour_integral q (\<lambda>w. 1 / (w - z))

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
have "\<dots> = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral q (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
using q
[PROOF STATE]
proof (prove)
using this:
winding_number_prop \<gamma> z e q (winding_number \<gamma> z)

goal (1 subgoal):
 1. contour_integral q (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
by (auto simp: winding_number_prop_def)
[PROOF STATE]
proof (state)
this:
contour_integral q (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
have "2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z"
[PROOF STATE]
proof (prove)
using this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. 2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. winding_number \<gamma> z = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z = n

goal:
No subgoals!
[PROOF STEP]
qed