[STATEMENT]
lemma QR_decomposition_iarrays_efficient[code]:
  "QR_decomposition_iarrays (matrix_to_iarray A)
  = QR_decomposition_iarrays_efficient (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. QR_decomposition_iarrays (matrix_to_iarray A) = QR_decomposition_iarrays_efficient (matrix_to_iarray A)
[PROOF STEP]
unfolding QR_decomposition_iarrays_def QR_decomposition_iarrays_efficient_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A)), transpose_iarray (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A))) **i matrix_to_iarray A) = (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays_efficient (matrix_to_iarray A)), transpose_iarray (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays_efficient (matrix_to_iarray A))) **i matrix_to_iarray A)
[PROOF STEP]
unfolding matrix_to_iarray_Gram_Schmidt_matrix_efficient[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A)), transpose_iarray (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A))) **i matrix_to_iarray A) = (divide_by_norm_iarray (matrix_to_iarray (Gram_Schmidt_matrix A)), transpose_iarray (divide_by_norm_iarray (matrix_to_iarray (Gram_Schmidt_matrix A))) **i matrix_to_iarray A)
[PROOF STEP]
unfolding matrix_to_iarray_Gram_Schmidt_matrix
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A)), transpose_iarray (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A))) **i matrix_to_iarray A) = (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A)), transpose_iarray (divide_by_norm_iarray (Gram_Schmidt_matrix_iarrays (matrix_to_iarray A))) **i matrix_to_iarray A)
[PROOF STEP]
..


[STATEMENT]
lemma filtermap_linear_at_left:
  fixes c::"'a::{linordered_field,linorder_topology,real_normed_field}"
  assumes "c\<noteq>0"
  shows "filtermap (\<lambda>x. c*x+b) (at_left x) = (if c>0 then at_left (c*x+b) else at_right (c*x+b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
let ?f = "\<lambda>x. c*x+b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
have "filtermap (\<lambda>x. c*x+b) (at_left x) = (at (?f x) within ?f ` {..<x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
[PROOF STEP]
proof (subst filtermap_linear_at_within)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. bij (\<lambda>x. c * x + b)
 2. isCont (\<lambda>x. c * x + b) x
 3. \<And>S. open S \<Longrightarrow> open ((\<lambda>x. c * x + b) ` S)
 4. at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x} = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
[PROOF STEP]
show "bij ?f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij (\<lambda>x. c * x + b)
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'a)

goal (1 subgoal):
 1. bij (\<lambda>x. c * x + b)
[PROOF STEP]
by (auto intro!: o_bij[of "\<lambda>x. (x-b)/c"])
[PROOF STATE]
proof (state)
this:
bij (\<lambda>x. c * x + b)

goal (3 subgoals):
 1. isCont (\<lambda>x. c * x + b) x
 2. \<And>S. open S \<Longrightarrow> open ((\<lambda>x. c * x + b) ` S)
 3. at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x} = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
[PROOF STEP]
show "isCont ?f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. c * x + b) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. c * x + b) x

goal (2 subgoals):
 1. \<And>S. open S \<Longrightarrow> open ((\<lambda>x. c * x + b) ` S)
 2. at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x} = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
[PROOF STEP]
show "\<And>S. open S \<Longrightarrow> open (?f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S. open S \<Longrightarrow> open ((\<lambda>x. c * x + b) ` S)
[PROOF STEP]
using open_times_image[OF _ \<open>c\<noteq>0\<close>,THEN open_translation,of _ b]
[PROOF STATE]
proof (prove)
using this:
open ?S1 \<Longrightarrow> open ((+) b ` (*) c ` ?S1)

goal (1 subgoal):
 1. \<And>S. open S \<Longrightarrow> open ((\<lambda>x. c * x + b) ` S)
[PROOF STEP]
by (simp add:image_image add.commute)
[PROOF STATE]
proof (state)
this:
open ?S \<Longrightarrow> open ((\<lambda>x. c * x + b) ` ?S)

goal (1 subgoal):
 1. at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x} = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
[PROOF STEP]
show "at (?f x) within ?f ` {..<x} = at (?f x) within ?f ` {..<x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x} = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x} = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
filtermap (\<lambda>x. c * x + b) (at_left x) = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}

goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
filtermap (\<lambda>x. c * x + b) (at_left x) = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}

goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
have "?f ` {..<x} =  {..<?f x}" when "c>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * x + b) ` {..<x} = {..<c * x + b}
[PROOF STEP]
using image_linear_lessThan[OF \<open>c\<noteq>0\<close>,of b x] that
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. c * x + b) ` {..<x} = (if (0::'a) < c then {..<c * x + b} else {c * x + b<..})
(0::'a) < c

goal (1 subgoal):
 1. (\<lambda>x. c * x + b) ` {..<x} = {..<c * x + b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) < c \<Longrightarrow> (\<lambda>x. c * x + b) ` {..<x} = {..<c * x + b}

goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(0::'a) < c \<Longrightarrow> (\<lambda>x. c * x + b) ` {..<x} = {..<c * x + b}

goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
have "?f ` {..<x} =  {?f x<..}" when "\<not> c>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * x + b) ` {..<x} = {c * x + b<..}
[PROOF STEP]
using image_linear_lessThan[OF \<open>c\<noteq>0\<close>,of b x] that
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. c * x + b) ` {..<x} = (if (0::'a) < c then {..<c * x + b} else {c * x + b<..})
\<not> (0::'a) < c

goal (1 subgoal):
 1. (\<lambda>x. c * x + b) ` {..<x} = {c * x + b<..}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> (0::'a) < c \<Longrightarrow> (\<lambda>x. c * x + b) ` {..<x} = {c * x + b<..}

goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
filtermap (\<lambda>x. c * x + b) (at_left x) = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
(0::'a) < c \<Longrightarrow> (\<lambda>x. c * x + b) ` {..<x} = {..<c * x + b}
\<not> (0::'a) < c \<Longrightarrow> (\<lambda>x. c * x + b) ` {..<x} = {c * x + b<..}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. c * x + b) (at_left x) = at (c * x + b) within (\<lambda>x. c * x + b) ` {..<x}
(0::'a) < c \<Longrightarrow> (\<lambda>x. c * x + b) ` {..<x} = {..<c * x + b}
\<not> (0::'a) < c \<Longrightarrow> (\<lambda>x. c * x + b) ` {..<x} = {c * x + b<..}

goal (1 subgoal):
 1. filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap (\<lambda>x. c * x + b) (at_left x) = (if (0::'a) < c then at_left (c * x + b) else at_right (c * x + b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma erlang_CDF_nonneg[simp]: assumes "0 < l" shows "0 \<le> erlang_CDF k l x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> erlang_CDF k l x
[PROOF STEP]
unfolding erlang_CDF_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (if x < 0 then 0 else 1 - (\<Sum>n\<le>k. (l * x) ^ n * exp (- l * x) / fact n))
[PROOF STEP]
proof (clarsimp simp: not_less)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
assume "0 \<le> x"
[PROOF STATE]
proof (state)
this:
0 \<le> x

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
have "(\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) =
    exp (- (l * x)) * (\<Sum>n\<le>k. (l * x) ^ n / fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) = exp (- (l * x)) * (\<Sum>n\<le>k. (l * x) ^ n / fact n)
[PROOF STEP]
unfolding sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) = (\<Sum>n\<le>k. exp (- (l * x)) * ((l * x) ^ n / fact n))
[PROOF STEP]
by (intro sum.cong) (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) = exp (- (l * x)) * (\<Sum>n\<le>k. (l * x) ^ n / fact n)

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) = exp (- (l * x)) * (\<Sum>n\<le>k. (l * x) ^ n / fact n)

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
have "\<dots> = (\<Sum>n\<le>k. (l * x) ^ n / fact n) / exp (l * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- (l * x)) * (\<Sum>n\<le>k. (l * x) ^ n / fact n) = (\<Sum>n\<le>k. (l * x) ^ n / fact n) / exp (l * x)
[PROOF STEP]
by (simp add: exp_minus field_simps)
[PROOF STATE]
proof (state)
this:
exp (- (l * x)) * (\<Sum>n\<le>k. (l * x) ^ n / fact n) = (\<Sum>n\<le>k. (l * x) ^ n / fact n) / exp (l * x)

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (- (l * x)) * (\<Sum>n\<le>k. (l * x) ^ n / fact n) = (\<Sum>n\<le>k. (l * x) ^ n / fact n) / exp (l * x)

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
have "\<dots> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<le>k. (l * x) ^ n / fact n) / exp (l * x) \<le> 1
[PROOF STEP]
proof (subst divide_le_eq_1_pos)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < exp (l * x)
 2. (\<Sum>n\<le>k. (l * x) ^ n / fact n) \<le> exp (l * x)
[PROOF STEP]
show "(\<Sum>n\<le>k. (l * x) ^ n / fact n) \<le> exp (l * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<le>k. (l * x) ^ n / fact n) \<le> exp (l * x)
[PROOF STEP]
using \<open>0 < l\<close> \<open>0 \<le> x\<close> summable_exp_generic[of "l * x"]
[PROOF STATE]
proof (prove)
using this:
0 < l
0 \<le> x
summable (\<lambda>n. (l * x) ^ n /\<^sub>R fact n)

goal (1 subgoal):
 1. (\<Sum>n\<le>k. (l * x) ^ n / fact n) \<le> exp (l * x)
[PROOF STEP]
by (auto simp: exp_def divide_inverse ac_simps intro!: sum_le_suminf)
[PROOF STATE]
proof (state)
this:
(\<Sum>n\<le>k. (l * x) ^ n / fact n) \<le> exp (l * x)

goal (1 subgoal):
 1. 0 < exp (l * x)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n\<le>k. (l * x) ^ n / fact n) / exp (l * x) \<le> 1

goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
show "(\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1

goal (1 subgoal):
 1. (\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>n\<le>k. (l * x) ^ n * exp (- (l * x)) / fact n) \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_gen2:
  "set (gen2 A B m n) = {(x, y). length x = m \<and> length y = n \<and> (\<forall>i<m. x ! i \<le> A) \<and> (\<forall>j<n. y ! j \<le> B)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (gen2 A B m n) = {(x, y). length x = m \<and> length y = n \<and> (\<forall>i<m. x ! i \<le> A) \<and> (\<forall>j<n. y ! j \<le> B)}
[PROOF STEP]
by (auto simp: set_gen)


[STATEMENT]
lemma LIM_equal: "\<forall>x. x \<noteq> a \<longrightarrow> f x = g x \<Longrightarrow> (f \<midarrow>a\<rightarrow> l) \<longleftrightarrow> (g \<midarrow>a\<rightarrow> l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<noteq> a \<longrightarrow> f x = g x \<Longrightarrow> f \<midarrow>a\<rightarrow> l = g \<midarrow>a\<rightarrow> l
[PROOF STEP]
by (simp add: tendsto_def eventually_at_topological)


[STATEMENT]
lemma AE_cong_simp: "M = N \<Longrightarrow> (\<And>x. x \<in> space N =simp=> P x = Q x) \<Longrightarrow> (AE x in M. P x) \<longleftrightarrow> (AE x in N. Q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>M = N; \<And>x. x \<in> space N =simp=> P x = Q x\<rbrakk> \<Longrightarrow> almost_everywhere M P = almost_everywhere N Q
[PROOF STEP]
by (auto simp: simp_implies_def)


[STATEMENT]
lemma epred_inject: "\<lbrakk> x \<noteq> 0; y \<noteq> 0 \<rbrakk> \<Longrightarrow> epred x = epred y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> 0; y \<noteq> 0\<rbrakk> \<Longrightarrow> (epred x = epred y) = (x = y)
[PROOF STEP]
by(cases x y rule: enat.exhaust[case_product enat.exhaust])(auto simp add: zero_enat_def)


[STATEMENT]
lemma unwrapExist : "eval (ExN (j + 1) A) L = eval (ExQ (ExN j A)) L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (ExN (j + 1) A) L = eval (ExQ (ExN j A)) L
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>l. length l = Suc j \<and> eval A (l @ L)) = (\<exists>x l. length l = j \<and> eval A (l @ x # L))
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l. \<lbrakk>length l = Suc j; eval A (l @ L)\<rbrakk> \<Longrightarrow> \<exists>x l. length l = j \<and> eval A (l @ x # L)
 2. \<And>x l. \<lbrakk>eval A (l @ x # L); j = length l\<rbrakk> \<Longrightarrow> \<exists>la. length la = Suc (length l) \<and> eval A (la @ L)
[PROOF STEP]
subgoal for l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length l = Suc j; eval A (l @ L)\<rbrakk> \<Longrightarrow> \<exists>x l. length l = j \<and> eval A (l @ x # L)
[PROOF STEP]
apply(rule exI[where x="nth l j"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length l = Suc j; eval A (l @ L)\<rbrakk> \<Longrightarrow> \<exists>la. length la = j \<and> eval A (la @ l ! j # L)
[PROOF STEP]
apply(rule exI[where x="take j l"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length l = Suc j; eval A (l @ L)\<rbrakk> \<Longrightarrow> length (take j l) = j \<and> eval A (take j l @ l ! j # L)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length l = Suc j; eval A (l @ L)\<rbrakk> \<Longrightarrow> eval A (take j l @ l ! j # L)
[PROOF STEP]
by (metis Cons_nth_drop_Suc append.assoc append_Cons append_eq_append_conv_if append_take_drop_id lessI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x l. \<lbrakk>eval A (l @ x # L); j = length l\<rbrakk> \<Longrightarrow> \<exists>la. length la = Suc (length l) \<and> eval A (la @ L)
[PROOF STEP]
subgoal for x l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>eval A (l @ x # L); j = length l\<rbrakk> \<Longrightarrow> \<exists>la. length la = Suc (length l) \<and> eval A (la @ L)
[PROOF STEP]
apply(rule exI[where x="l @ [x]"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>eval A (l @ x # L); j = length l\<rbrakk> \<Longrightarrow> length (l @ [x]) = Suc (length l) \<and> eval A ((l @ [x]) @ L)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma h_Sup: "\<forall>x \<in> X. x \<cdot> w \<le> z \<Longrightarrow> \<Squnion>X \<cdot> w \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>X. x \<cdot> w \<le> z \<Longrightarrow> \<Squnion> X \<cdot> w \<le> z
[PROOF STEP]
by (simp add: Sup_least fres_galois)


[STATEMENT]
lemma congs_pres_nodes: "F\<^sub>1 \<cong> F\<^sub>2 \<Longrightarrow> set F\<^sub>1 = set F\<^sub>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F\<^sub>1 \<cong> F\<^sub>2 \<Longrightarrow> set F\<^sub>1 = set F\<^sub>2
[PROOF STEP]
by(clarsimp simp:congs_def)


[STATEMENT]
lemma set_times_mono2 [intro]: "C \<subseteq> D \<Longrightarrow> E \<subseteq> F \<Longrightarrow> C * E \<subseteq> D * F"
  for C D E F :: "'a::times set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C \<subseteq> D; E \<subseteq> F\<rbrakk> \<Longrightarrow> C * E \<subseteq> D * F
[PROOF STEP]
by (auto simp add: set_times_def)


[STATEMENT]
lemma vars_Un_nointer:
  \<open>keys (mapping_of p) \<inter>  keys (mapping_of q) = {} \<Longrightarrow> vars (p + q) = vars p \<union> vars q\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (mapping_of p) \<inter> keys (mapping_of q) = {} \<Longrightarrow> vars (p + q) = vars p \<union> vars q
[PROOF STEP]
by (auto simp: vars_def plus_mpoly.rep_eq simp flip: More_MPoly_Type.keys_add dest!: keys_add')


[STATEMENT]
lemma monic_poly_pow:
  assumes "monic_poly R f"
  shows "monic_poly R (f [^]\<^bsub>P\<^esub> (n::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic_poly R (f [^]\<^bsub>P\<^esub> n)
[PROOF STEP]
using assms monic_poly_one monic_poly_mult
[PROOF STATE]
proof (prove)
using this:
monic_poly R f
monic_poly R \<one>\<^bsub>P\<^esub>
\<lbrakk>monic_poly R ?f; monic_poly R ?g\<rbrakk> \<Longrightarrow> monic_poly R (?f \<otimes>\<^bsub>P\<^esub> ?g)

goal (1 subgoal):
 1. monic_poly R (f [^]\<^bsub>P\<^esub> n)
[PROOF STEP]
by (induction n, auto)


[STATEMENT]
lemma intersect_segment_xline_None_iff:
  fixes p0 p1::"real * real"
  shows "intersect_segment_xline prec (p0, p1) x = None \<longleftrightarrow> closed_segment p0 p1 \<inter> {p. fst p = x} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (intersect_segment_xline prec (p0, p1) x = None) = (closed_segment p0 p1 \<inter> {p. fst p = x} = {})
[PROOF STEP]
by (auto intro!: intersect_segment_xline_eq_empty dest!: intersect_segment_xline_eq_None)


[STATEMENT]
lemma sigma_finite_lborel: "sigma_finite_measure lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_measure lborel
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets lborel \<and> \<Union> A = space lborel \<and> (\<forall>a\<in>A. emeasure lborel a \<noteq> \<infinity>)
[PROOF STEP]
show "\<exists>A::'a set set. countable A \<and> A \<subseteq> sets lborel \<and> \<Union>A = space lborel \<and> (\<forall>a\<in>A. emeasure lborel a \<noteq> \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A. countable A \<and> A \<subseteq> sets lborel \<and> \<Union> A = space lborel \<and> (\<forall>a\<in>A. emeasure lborel a \<noteq> \<infinity>)
[PROOF STEP]
by (intro exI[of _ "range (\<lambda>n::nat. box (- real n *\<^sub>R One) (real n *\<^sub>R One))"])
       (auto simp: emeasure_lborel_cbox_eq UN_box_eq_UNIV)
[PROOF STATE]
proof (state)
this:
\<exists>A. countable A \<and> A \<subseteq> sets lborel \<and> \<Union> A = space lborel \<and> (\<forall>a\<in>A. emeasure lborel a \<noteq> \<infinity>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Kdelta_in_Zinf:"\<lbrakk>j \<le> (Suc n); k \<le> (Suc n)\<rbrakk>  \<Longrightarrow>
                 z *\<^sub>a (\<delta>\<^bsub>j k\<^esub>) \<in> Z\<^sub>\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j \<le> Suc n; k \<le> Suc n\<rbrakk> \<Longrightarrow> z *\<^sub>a (\<delta>\<^bsub>j k\<^esub>) \<in> Z\<^sub>\<infinity>
[PROOF STEP]
apply (simp add:Kronecker_delta_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j \<le> Suc n; k \<le> Suc n\<rbrakk> \<Longrightarrow> (j = k \<longrightarrow> ant z \<in> Z\<^sub>\<infinity>) \<and> (j \<noteq> k \<longrightarrow> z *\<^sub>a 0 \<in> Z\<^sub>\<infinity>)
[PROOF STEP]
apply (simp add:z_in_aug_inf Zero_in_aug_inf)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>j \<le> Suc n; k \<le> Suc n\<rbrakk> \<Longrightarrow> j \<noteq> k \<longrightarrow> z *\<^sub>a 0 \<in> Z\<^sub>\<infinity>
[PROOF STEP]
apply (simp add:asprod_n_0 Zero_in_aug_inf)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ladder_cut_prefix_ix:
  assumes index_bound: "index < length L"
  assumes length_L: "length L > 0"
  shows "ladder_ix (ladder_cut_prefix d L) index = ladder_ix L index"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_ix (ladder_cut_prefix d L) index = ladder_ix L index
[PROOF STEP]
apply (simp add: ladder_cut_prefix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_ix ((ladder_shift_j d L)[0 := (ladder_n L 0, ladder_j L 0 - d, ladder_i L 0 - d)]) index = ladder_ix L index
[PROOF STEP]
apply (cases index)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. index = 0 \<Longrightarrow> ladder_ix ((ladder_shift_j d L)[0 := (ladder_n L 0, ladder_j L 0 - d, ladder_i L 0 - d)]) index = ladder_ix L index
 2. \<And>nat. index = Suc nat \<Longrightarrow> ladder_ix ((ladder_shift_j d L)[0 := (ladder_n L 0, ladder_j L 0 - d, ladder_i L 0 - d)]) index = ladder_ix L index
[PROOF STEP]
apply (auto simp add: ladder_ix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. index = Suc nat \<Longrightarrow> deriv_ix (ladder_shift_j d L ! Suc nat) = deriv_ix (L ! Suc nat)
[PROOF STEP]
apply (rule_tac deriv_ix_ladder_shift_j)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. index = Suc nat \<Longrightarrow> Suc nat < length L
[PROOF STEP]
using index_bound
[PROOF STATE]
proof (prove)
using this:
index < length L

goal (1 subgoal):
 1. \<And>nat. index = Suc nat \<Longrightarrow> Suc nat < length L
[PROOF STEP]
by arith


[STATEMENT]
lemma (in finite_comm_group) character_restrict_card:
  assumes "subgroup H G" "character G a" "character G b"
  shows   "card {\<chi>'\<in>characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>'\<in>characters G. \<forall>x\<in>H. \<chi>' x = b x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
interpret H: subgroup H G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup H G
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
interpret H: finite_comm_group "G\<lparr>carrier := H\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
subgroup H G

goal (1 subgoal):
 1. finite_comm_group (G\<lparr>carrier := H\<rparr>)
[PROOF STEP]
by (simp add: subgroup_imp_finite_comm_group)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
interpret CG: finite_comm_group "Characters G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
using finite_comm_group_Characters
[PROOF STATE]
proof (prove)
using this:
finite_comm_group (Characters G)

goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
interpret a: character G a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G a
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
interpret b: character G b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G b
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
have ac: "a \<in> carrier (Characters G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier (Characters G)
[PROOF STEP]
unfolding Characters_def characters_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> carrier \<lparr>carrier = Collect (character G), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subgroup H G
character G a
character G b

goal (1 subgoal):
 1. a \<in> carrier \<lparr>carrier = Collect (character G), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<in> carrier (Characters G)

goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
have bc: "b \<in> carrier (Characters G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> carrier (Characters G)
[PROOF STEP]
unfolding Characters_def characters_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> carrier \<lparr>carrier = Collect (character G), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subgroup H G
character G a
character G b

goal (1 subgoal):
 1. b \<in> carrier \<lparr>carrier = Collect (character G), monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b \<in> carrier (Characters G)

goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
define f where f: "f = (\<lambda>c. b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a \<otimes>\<^bsub>Characters G\<^esub> c)"
[PROOF STATE]
proof (state)
this:
f = (\<otimes>\<^bsub>Characters G\<^esub>) (b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a)

goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
define g where g: "g = (\<lambda>c. a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b \<otimes>\<^bsub>Characters G\<^esub> c)"
[PROOF STATE]
proof (state)
this:
g = (\<otimes>\<^bsub>Characters G\<^esub>) (a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b)

goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
let ?A = "{\<chi>'\<in>characters G. \<forall>x\<in>H. \<chi>' x = a x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
let ?B = "{\<chi>'\<in>characters G. \<forall>x\<in>H. \<chi>' x = b x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
have "bij_betw f ?A ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
proof(intro bij_betwI[of _ _ _ g])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<rightarrow> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
 2. g \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<rightarrow> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
 3. \<And>x. x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<Longrightarrow> g (f x) = x
 4. \<And>y. y \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<Longrightarrow> f (g y) = y
[PROOF STEP]
show "f \<in> ?A \<rightarrow> ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<rightarrow> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<Longrightarrow> f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
show "f x \<in> ?B" if x: "x \<in> ?A" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
interpret xc: character G x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal (1 subgoal):
 1. character G x
[PROOF STEP]
unfolding characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> Collect (character G). \<forall>x\<in>H. \<chi>' x = a x}

goal (1 subgoal):
 1. character G x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
have xc: "x \<in> carrier (Characters G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
unfolding Characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal (1 subgoal):
 1. x \<in> carrier \<lparr>carrier = characters G, monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
have "f x y = b y" if y: "y \<in> H" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x y = b y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x y = b y
[PROOF STEP]
have "(inv\<^bsub>Characters G\<^esub> a) y * a y =  1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inv\<^bsub>Characters G\<^esub> a) y * a y = 1
[PROOF STEP]
by (simp add: a.inv_Characters a.mult_inv_character mult.commute principal_char_def y)
[PROOF STATE]
proof (state)
this:
(inv\<^bsub>Characters G\<^esub> a) y * a y = 1

goal (1 subgoal):
 1. f x y = b y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(inv\<^bsub>Characters G\<^esub> a) y * a y = 1

goal (1 subgoal):
 1. f x y = b y
[PROOF STEP]
unfolding f mult_Characters
[PROOF STATE]
proof (prove)
using this:
(inv\<^bsub>Characters G\<^esub> a) y * a y = 1

goal (1 subgoal):
 1. b y * (inv\<^bsub>Characters G\<^esub> a) y * x y = b y
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
(inv\<^bsub>Characters G\<^esub> a) y * a y = 1
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
y \<in> H

goal (1 subgoal):
 1. b y * (inv\<^bsub>Characters G\<^esub> a) y * x y = b y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
f x y = b y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y2 \<in> H \<Longrightarrow> f x ?y2 = b ?y2

goal (1 subgoal):
 1. f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
thus "f x \<in> ?B"
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> H \<Longrightarrow> f x ?y2 = b ?y2

goal (1 subgoal):
 1. f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
unfolding f carrier_Characters[symmetric]
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> H \<Longrightarrow> (b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a \<otimes>\<^bsub>Characters G\<^esub> x) ?y2 = b ?y2

goal (1 subgoal):
 1. b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a \<otimes>\<^bsub>Characters G\<^esub> x \<in> {\<chi>' \<in> carrier (Characters G). \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
using ac bc xc
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> H \<Longrightarrow> (b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a \<otimes>\<^bsub>Characters G\<^esub> x) ?y2 = b ?y2
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a \<otimes>\<^bsub>Characters G\<^esub> x \<in> {\<chi>' \<in> carrier (Characters G). \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<Longrightarrow> f ?x2 \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<rightarrow> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (3 subgoals):
 1. g \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<rightarrow> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
 2. \<And>x. x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<Longrightarrow> g (f x) = x
 3. \<And>y. y \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<Longrightarrow> f (g y) = y
[PROOF STEP]
show "g \<in> ?B \<rightarrow> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<rightarrow> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<Longrightarrow> g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
show "g x \<in> ?A" if x: "x \<in> ?B" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
interpret xc: character G x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character G x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. character G x
[PROOF STEP]
unfolding characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> Collect (character G). \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. character G x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
have xc: "x \<in> carrier (Characters G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
unfolding Characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. x \<in> carrier \<lparr>carrier = characters G, monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
have "g x y = a y" if y: "y \<in> H" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g x y = a y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g x y = a y
[PROOF STEP]
have "(inv\<^bsub>Characters G\<^esub> b) y * x y = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inv\<^bsub>Characters G\<^esub> b) y * x y = 1
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
y \<in> H

goal (1 subgoal):
 1. (inv\<^bsub>Characters G\<^esub> b) y * x y = 1
[PROOF STEP]
by (simp add: b.inv_Characters b.mult_inv_character mult.commute principal_char_def)
[PROOF STATE]
proof (state)
this:
(inv\<^bsub>Characters G\<^esub> b) y * x y = 1

goal (1 subgoal):
 1. g x y = a y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(inv\<^bsub>Characters G\<^esub> b) y * x y = 1

goal (1 subgoal):
 1. g x y = a y
[PROOF STEP]
unfolding g mult_Characters
[PROOF STATE]
proof (prove)
using this:
(inv\<^bsub>Characters G\<^esub> b) y * x y = 1

goal (1 subgoal):
 1. a y * (inv\<^bsub>Characters G\<^esub> b) y * x y = a y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g x y = a y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y2 \<in> H \<Longrightarrow> g x ?y2 = a ?y2

goal (1 subgoal):
 1. g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
thus "g x \<in> ?A"
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> H \<Longrightarrow> g x ?y2 = a ?y2

goal (1 subgoal):
 1. g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
unfolding g carrier_Characters[symmetric]
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> H \<Longrightarrow> (a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b \<otimes>\<^bsub>Characters G\<^esub> x) ?y2 = a ?y2

goal (1 subgoal):
 1. a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b \<otimes>\<^bsub>Characters G\<^esub> x \<in> {\<chi>' \<in> carrier (Characters G). \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
using ac bc xc
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> H \<Longrightarrow> (a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b \<otimes>\<^bsub>Characters G\<^esub> x) ?y2 = a ?y2
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b \<otimes>\<^bsub>Characters G\<^esub> x \<in> {\<chi>' \<in> carrier (Characters G). \<forall>x\<in>H. \<chi>' x = a x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
g x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<Longrightarrow> g ?x2 \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<rightarrow> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal (2 subgoals):
 1. \<And>x. x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<Longrightarrow> g (f x) = x
 2. \<And>y. y \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<Longrightarrow> f (g y) = y
[PROOF STEP]
show "g (f x) = x" if x: "x \<in> ?A" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (f x) = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g (f x) = x
[PROOF STEP]
have xc: "x \<in> carrier (Characters G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
unfolding Characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x}

goal (1 subgoal):
 1. x \<in> carrier \<lparr>carrier = characters G, monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. g (f x) = x
[PROOF STEP]
with ac bc
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. g (f x) = x
[PROOF STEP]
unfolding f g
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b \<otimes>\<^bsub>Characters G\<^esub> (b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a \<otimes>\<^bsub>Characters G\<^esub> x) = x
[PROOF STEP]
by (auto simp: CG.m_assoc[symmetric],
            metis CG.inv_closed CG.inv_comm CG.l_inv CG.m_assoc CG.r_one)
[PROOF STATE]
proof (state)
this:
g (f x) = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} \<Longrightarrow> g (f ?x2) = ?x2

goal (1 subgoal):
 1. \<And>y. y \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<Longrightarrow> f (g y) = y
[PROOF STEP]
show "f (g x) = x" if x: "x \<in> ?B" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (g x) = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (g x) = x
[PROOF STEP]
have xc: "x \<in> carrier (Characters G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. x \<in> carrier (Characters G)
[PROOF STEP]
unfolding Characters_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. x \<in> carrier \<lparr>carrier = characters G, monoid.mult = \<lambda>\<chi>\<^sub>1 \<chi>\<^sub>2 k. \<chi>\<^sub>1 k * \<chi>\<^sub>2 k, one = principal_char G\<rparr>
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. f (g x) = x
[PROOF STEP]
with ac bc
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. f (g x) = x
[PROOF STEP]
unfolding f g
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Characters G)
b \<in> carrier (Characters G)
x \<in> carrier (Characters G)

goal (1 subgoal):
 1. b \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> a \<otimes>\<^bsub>Characters G\<^esub> (a \<otimes>\<^bsub>Characters G\<^esub> inv\<^bsub>Characters G\<^esub> b \<otimes>\<^bsub>Characters G\<^esub> x) = x
[PROOF STEP]
by (auto simp: CG.m_assoc[symmetric],
            metis CG.inv_closed CG.inv_comm CG.l_inv CG.m_assoc CG.r_one)
[PROOF STATE]
proof (state)
this:
f (g x) = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x2 \<in> {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x} \<Longrightarrow> f (g ?x2) = ?x2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bij_betw f {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw f {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
using bij_betw_same_card
[PROOF STATE]
proof (prove)
using this:
bij_betw f {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
bij_betw ?f ?A ?B \<Longrightarrow> card ?A = card ?B

goal (1 subgoal):
 1. card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = a x} = card {\<chi>' \<in> characters G. \<forall>x\<in>H. \<chi>' x = b x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_ulgraph_rel: "ulgraph_rel V adj_relation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ulgraph_rel V adj_relation
[PROOF STEP]
using adj_relation_wf adj_relation_sym
[PROOF STATE]
proof (prove)
using this:
(?u, ?v) \<in> adj_relation \<Longrightarrow> {?u, ?v} \<subseteq> V
sym adj_relation

goal (1 subgoal):
 1. ulgraph_rel V adj_relation
[PROOF STEP]
by (unfold_locales) auto


[STATEMENT]
lemma comm_rev_iff: "rev u \<cdot> rev v = rev v \<cdot> rev u \<longleftrightarrow> u \<cdot> v = v \<cdot> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rev u \<cdot> rev v = rev v \<cdot> rev u) = (u \<cdot> v = v \<cdot> u)
[PROOF STEP]
unfolding rev_append[symmetric] rev_is_rev_conv eq_ac(1)[of "u \<cdot> v"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v \<cdot> u = u \<cdot> v) = (v \<cdot> u = u \<cdot> v)
[PROOF STEP]
by blast


[STATEMENT]
lemma nsets_doubleton_2_eq [simp]: "[{x, y}]\<^bsup>2\<^esup> = (if x=y then {} else {{x, y}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [{x, y}]\<^bsup>2\<^esup> = (if x = y then {} else {{x, y}})
[PROOF STEP]
by (auto simp: nsets_2_eq)


[STATEMENT]
lemma rsd_winners_subset:
  assumes "set agents' \<subseteq> agents"
  shows   "rsd_winners R alts' agents' \<subseteq> alts'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
assume "i \<in> agents"
[PROOF STATE]
proof (state)
this:
i \<in> agents

goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> agents
[PROOF STEP]
interpret total_preorder_on alts "R i"
[PROOF STATE]
proof (prove)
using this:
i \<in> agents

goal (1 subgoal):
 1. total_preorder_on alts (R i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
have "Max_wrt_among (R i) A \<subseteq> A" for A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max_wrt_among (R i) A \<subseteq> A
[PROOF STEP]
using Max_wrt_among_subset
[PROOF STATE]
proof (prove)
using this:
Max_wrt_among (R i) ?A \<subseteq> alts
Max_wrt_among (R i) ?A \<subseteq> ?A

goal (1 subgoal):
 1. Max_wrt_among (R i) A \<subseteq> A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Max_wrt_among (R i) ?A \<subseteq> ?A

goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i3 \<in> agents \<Longrightarrow> Max_wrt_among (R ?i3) ?A \<subseteq> ?A

goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
note A = this
[PROOF STATE]
proof (state)
this:
?i3 \<in> agents \<Longrightarrow> Max_wrt_among (R ?i3) ?A \<subseteq> ?A

goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
from \<open>set agents' \<subseteq> agents\<close>
[PROOF STATE]
proof (chain)
picking this:
set agents' \<subseteq> agents
[PROOF STEP]
show "rsd_winners R alts' agents' \<subseteq> alts'"
[PROOF STATE]
proof (prove)
using this:
set agents' \<subseteq> agents

goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
set agents' \<subseteq> agents
?i3 \<in> agents \<Longrightarrow> Max_wrt_among (R ?i3) ?A \<subseteq> ?A

goal (1 subgoal):
 1. rsd_winners R alts' agents' \<subseteq> alts'
[PROOF STEP]
by (induction agents') auto
[PROOF STATE]
proof (state)
this:
rsd_winners R alts' agents' \<subseteq> alts'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gauge_ball_dependent: "\<forall>x. 0 < e x \<Longrightarrow> gauge (\<lambda>x. ball x (e x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 < e x \<Longrightarrow> gauge (\<lambda>x. ball x (e x))
[PROOF STEP]
unfolding gauge_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 < e x \<Longrightarrow> \<forall>x. x \<in> ball x (e x) \<and> open (ball x (e x))
[PROOF STEP]
by auto


[STATEMENT]
lemma f_join_length: "length (xs \<Join>\<^sub>f I) = card (I \<down>< length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs \<Join>\<^sub> I) = card (I \<down>< length xs)
[PROOF STEP]
by (simp add: f_join_def f_join_aux_length atLeast0LessThan cut_less_Int_conv)


[STATEMENT]
lemma iMin_remove: "n \<in> I \<Longrightarrow> iMin I = (if I - {n} = {} then n else min n (iMin (I - {n})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> I \<Longrightarrow> iMin I = (if I - {n} = {} then n else min n (iMin (I - {n})))
[PROOF STEP]
by (metis iMin_insert_remove insert_absorb)


[STATEMENT]
lemma vint_inverses_law_addition:
  assumes [simp]: "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "x +\<^sub>\<int> (-\<^sub>\<int> x) = 0\<^sub>\<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x +\<^sub>\<int> -\<^sub>\<int> x = 0\<^sub>\<int>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x +\<^sub>\<int> -\<^sub>\<int> x = 0\<^sub>\<int>
[PROOF STEP]
have "x' + (-x') = 0" for x' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' + - x' = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' + - ?x' = 0

goal (1 subgoal):
 1. x +\<^sub>\<int> -\<^sub>\<int> x = 0\<^sub>\<int>
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x +\<^sub>\<int> -\<^sub>\<int> x = 0\<^sub>\<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x +\<^sub>\<int> -\<^sub>\<int> x = 0\<^sub>\<int>

goal (1 subgoal):
 1. x +\<^sub>\<int> -\<^sub>\<int> x = 0\<^sub>\<int>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x +\<^sub>\<int> -\<^sub>\<int> x = 0\<^sub>\<int>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_emptyI[simp]:
  fixes a b::real
  shows  "a \<ge> b \<Longrightarrow> integral {a..b} f = 0" "a > b \<Longrightarrow> integral {a..b} f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<le> a \<Longrightarrow> integral {a..b} f = (0::'a)) &&& (b < a \<Longrightarrow> integral {a..b} f = (0::'a))
[PROOF STEP]
by (cases "a = b") auto


[STATEMENT]
lemma path_components_of_disjoint:
     "\<lbrakk>C \<in> path_components_of X; C' \<in> path_components_of X\<rbrakk> \<Longrightarrow> disjnt C C' \<longleftrightarrow> C \<noteq> C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>C \<in> path_components_of X; C' \<in> path_components_of X\<rbrakk> \<Longrightarrow> disjnt C C' = (C \<noteq> C')
[PROOF STEP]
by (auto simp: path_components_of_def path_component_of_disjoint path_component_of_equiv)


[STATEMENT]
lemma point_to_polysE:
  assumes "i < length as"
  shows "(point_to_polys as) ! i = (pvar_trans (length as) i (as ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. point_to_polys as ! i = pvar_trans (length as) i (as ! i)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. point_to_polys as ! i = pvar_trans (length as) i (as ! i)
[PROOF STEP]
have " (zip as (index_list (length as)))!i =  ((as!i), i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip as (index_list (length as)) ! i = (as ! i, i)
[PROOF STEP]
by (metis assms index_list_indices index_list_length nth_zip)
[PROOF STATE]
proof (state)
this:
zip as (index_list (length as)) ! i = (as ! i, i)

goal (1 subgoal):
 1. point_to_polys as ! i = pvar_trans (length as) i (as ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
zip as (index_list (length as)) ! i = (as ! i, i)
[PROOF STEP]
have 0: "(point_to_polys as) ! i = (\<lambda> x. pvar_trans (length as) (snd x) (fst x)) ((as!i), i)"
[PROOF STATE]
proof (prove)
using this:
zip as (index_list (length as)) ! i = (as ! i, i)

goal (1 subgoal):
 1. point_to_polys as ! i = pvar_trans (length as) (snd (as ! i, i)) (fst (as ! i, i))
[PROOF STEP]
unfolding point_to_polys_def
[PROOF STATE]
proof (prove)
using this:
zip as (index_list (length as)) ! i = (as ! i, i)

goal (1 subgoal):
 1. map (\<lambda>x. pvar_trans (length as) (snd x) (fst x)) (zip as (index_list (length as))) ! i = pvar_trans (length as) (snd (as ! i, i)) (fst (as ! i, i))
[PROOF STEP]
using  assms nth_map[of i "(zip as (index_list (length as)))" "(\<lambda>x. pvar_trans (length as) (snd x) (fst x))" ]
[PROOF STATE]
proof (prove)
using this:
zip as (index_list (length as)) ! i = (as ! i, i)
i < length as
i < length (zip as (index_list (length as))) \<Longrightarrow> map (\<lambda>x. pvar_trans (length as) (snd x) (fst x)) (zip as (index_list (length as))) ! i = pvar_trans (length as) (snd (zip as (index_list (length as)) ! i)) (fst (zip as (index_list (length as)) ! i))

goal (1 subgoal):
 1. map (\<lambda>x. pvar_trans (length as) (snd x) (fst x)) (zip as (index_list (length as))) ! i = pvar_trans (length as) (snd (as ! i, i)) (fst (as ! i, i))
[PROOF STEP]
by (metis index_list_length length_map map_fst_zip)
[PROOF STATE]
proof (state)
this:
point_to_polys as ! i = pvar_trans (length as) (snd (as ! i, i)) (fst (as ! i, i))

goal (1 subgoal):
 1. point_to_polys as ! i = pvar_trans (length as) i (as ! i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
point_to_polys as ! i = pvar_trans (length as) (snd (as ! i, i)) (fst (as ! i, i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
point_to_polys as ! i = pvar_trans (length as) (snd (as ! i, i)) (fst (as ! i, i))

goal (1 subgoal):
 1. point_to_polys as ! i = pvar_trans (length as) i (as ! i)
[PROOF STEP]
by (metis fst_conv snd_conv)
[PROOF STATE]
proof (state)
this:
point_to_polys as ! i = pvar_trans (length as) i (as ! i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fold_pderiv_set_flatten_PLUS:
  "\<lbrakk>w \<noteq> []; finite X\<rbrakk> \<Longrightarrow> fold pderiv_set w {flatten PLUS X} = fold pderiv_set w X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<noteq> []; finite X\<rbrakk> \<Longrightarrow> fold pderiv_set w {flatten PLUS X} = fold pderiv_set w X
[PROOF STEP]
by (induct w arbitrary: X) (simp_all add: pderiv_set_flatten_PLUS)


[STATEMENT]
lemma in_set_conv_iff:
  "x \<in> set (take n xs) \<longleftrightarrow> (\<exists>i<n. i < length xs \<and> xs ! i = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> set (take n xs)) = (\<exists>i<n. i < length xs \<and> xs ! i = x)
[PROOF STEP]
by (metis in_set_conv_nth length_take min_less_iff_conj nth_take)


[STATEMENT]
lemma card_funcset:
  assumes "finite A" "finite B"
  shows "card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (extensionalD d {} \<inter> ({} \<rightarrow> B)) = card B ^ card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (extensionalD d F \<inter> (F \<rightarrow> B)) = card B ^ card F\<rbrakk> \<Longrightarrow> card (extensionalD d (insert x F) \<inter> (insert x F \<rightarrow> B)) = card B ^ card (insert x F)
[PROOF STEP]
case (insert a A)
[PROOF STATE]
proof (state)
this:
finite A
a \<notin> A
card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A

goal (2 subgoals):
 1. card (extensionalD d {} \<inter> ({} \<rightarrow> B)) = card B ^ card {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; card (extensionalD d F \<inter> (F \<rightarrow> B)) = card B ^ card F\<rbrakk> \<Longrightarrow> card (extensionalD d (insert x F) \<inter> (insert x F \<rightarrow> B)) = card B ^ card (insert x F)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A

goal (1 subgoal):
 1. card (extensionalD d (insert a A) \<inter> (insert a A \<rightarrow> B)) = card B ^ card (insert a A)
[PROOF STEP]
unfolding extensionalD_insert[OF \<open>a \<notin> A\<close>]
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A

goal (1 subgoal):
 1. card (\<Union>f\<in>extensionalD d A \<inter> (A \<rightarrow> B). fun_upd f a ` B) = card B ^ card (insert a A)
[PROOF STEP]
proof (subst card_UN_disjoint, safe, simp_all)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> finite (extensionalD d A \<inter> (A \<rightarrow> B))
 2. \<And>i. \<lbrakk>i \<in> extensionalD d A; i \<in> A \<rightarrow> B; finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> finite (fun_upd i a ` B)
 3. \<And>i j xa xb. \<lbrakk>i \<in> extensionalD d A; i \<in> A \<rightarrow> B; j \<in> extensionalD d A; j \<in> A \<rightarrow> B; i \<noteq> j; xa \<in> B; i(a := xa) = j(a := xb); xb \<in> B; finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> False
 4. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
show "finite (extensionalD d A \<inter> (A \<rightarrow> B))" "\<And>f. finite (fun_upd f a ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (extensionalD d A \<inter> (A \<rightarrow> B)) &&& (\<And>f. finite (fun_upd f a ` B))
[PROOF STEP]
using \<open>finite B\<close> \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite B
finite A

goal (1 subgoal):
 1. finite (extensionalD d A \<inter> (A \<rightarrow> B)) &&& (\<And>f. finite (fun_upd f a ` B))
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
finite (extensionalD d A \<inter> (A \<rightarrow> B))
finite (fun_upd ?f a ` B)

goal (2 subgoals):
 1. \<And>i j xa xb. \<lbrakk>i \<in> extensionalD d A; i \<in> A \<rightarrow> B; j \<in> extensionalD d A; j \<in> A \<rightarrow> B; i \<noteq> j; xa \<in> B; i(a := xa) = j(a := xb); xb \<in> B; finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j xa xb. \<lbrakk>i \<in> extensionalD d A; i \<in> A \<rightarrow> B; j \<in> extensionalD d A; j \<in> A \<rightarrow> B; i \<noteq> j; xa \<in> B; i(a := xa) = j(a := xb); xb \<in> B; finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
fix f g b b'
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j xa xb. \<lbrakk>i \<in> extensionalD d A; i \<in> A \<rightarrow> B; j \<in> extensionalD d A; j \<in> A \<rightarrow> B; i \<noteq> j; xa \<in> B; i(a := xa) = j(a := xb); xb \<in> B; finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
assume "f \<noteq> g" and eq: "f(a := b) = g(a := b')" and
      ext: "f \<in> extensionalD d A" "g \<in> extensionalD d A"
[PROOF STATE]
proof (state)
this:
f \<noteq> g
f(a := b) = g(a := b')
f \<in> extensionalD d A
g \<in> extensionalD d A

goal (2 subgoals):
 1. \<And>i j xa xb. \<lbrakk>i \<in> extensionalD d A; i \<in> A \<rightarrow> B; j \<in> extensionalD d A; j \<in> A \<rightarrow> B; i \<noteq> j; xa \<in> B; i(a := xa) = j(a := xb); xb \<in> B; finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
have "f a = d" "g a = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a = d &&& g a = d
[PROOF STEP]
using ext \<open>a \<notin> A\<close>
[PROOF STATE]
proof (prove)
using this:
f \<in> extensionalD d A
g \<in> extensionalD d A
a \<notin> A

goal (1 subgoal):
 1. f a = d &&& g a = d
[PROOF STEP]
by (auto simp add: extensionalD_def)
[PROOF STATE]
proof (state)
this:
f a = d
g a = d

goal (2 subgoals):
 1. \<And>i j xa xb. \<lbrakk>i \<in> extensionalD d A; i \<in> A \<rightarrow> B; j \<in> extensionalD d A; j \<in> A \<rightarrow> B; i \<noteq> j; xa \<in> B; i(a := xa) = j(a := xb); xb \<in> B; finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
with \<open>f \<noteq> g\<close> eq
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> g
f(a := b) = g(a := b')
f a = d
g a = d
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
f \<noteq> g
f(a := b) = g(a := b')
f a = d
g a = d

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding fun_upd_eq_iff[of _ _ b _ _ d]
[PROOF STATE]
proof (prove)
using this:
f \<noteq> g
b = b' \<and> f(a := d) = g(a := d)
f a = d
g a = d

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

goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
assume "f \<in> extensionalD d A \<inter> (A \<rightarrow> B)"
[PROOF STATE]
proof (state)
this:
f \<in> extensionalD d A \<inter> (A \<rightarrow> B)

goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
have "card (fun_upd f a ` B) = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (fun_upd f a ` B) = card B
[PROOF STEP]
proof (auto intro!: card_image inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> B; y \<in> B; f(a := x) = f(a := y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix b b'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> B; y \<in> B; f(a := x) = f(a := y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "f(a := b) = f(a := b')"
[PROOF STATE]
proof (state)
this:
f(a := b) = f(a := b')

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> B; y \<in> B; f(a := x) = f(a := y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from fun_upd_eq_iff[THEN iffD1, OF this]
[PROOF STATE]
proof (chain)
picking this:
b = b' \<and> f(a := ?d1) = f(a := ?d1)
[PROOF STEP]
show "b = b'"
[PROOF STATE]
proof (prove)
using this:
b = b' \<and> f(a := ?d1) = f(a := ?d1)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (fun_upd f a ` B) = card B

goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?f2 \<in> extensionalD d A \<inter> (A \<rightarrow> B) \<Longrightarrow> card (fun_upd ?f2 a ` B) = card B

goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?f2 \<in> extensionalD d A \<inter> (A \<rightarrow> B) \<Longrightarrow> card (fun_upd ?f2 a ` B) = card B
[PROOF STEP]
show "(\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A"
[PROOF STATE]
proof (prove)
using this:
?f2 \<in> extensionalD d A \<inter> (A \<rightarrow> B) \<Longrightarrow> card (fun_upd ?f2 a ` B) = card B

goal (1 subgoal):
 1. (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
?f2 \<in> extensionalD d A \<inter> (A \<rightarrow> B) \<Longrightarrow> card (fun_upd ?f2 a ` B) = card B
finite A
a \<notin> A
card (extensionalD d A \<inter> (A \<rightarrow> B)) = card B ^ card A

goal (1 subgoal):
 1. (\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>extensionalD d A \<inter> (A \<rightarrow> B). card (fun_upd i a ` B)) = card B * card B ^ card A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (extensionalD d (insert a A) \<inter> (insert a A \<rightarrow> B)) = card B ^ card (insert a A)

goal (1 subgoal):
 1. card (extensionalD d {} \<inter> ({} \<rightarrow> B)) = card B ^ card {}
[PROOF STEP]
qed simp


[STATEMENT]
lemma H_loop_inv: "\<tt>\<tt> p \<le> \<tt>\<tt> i \<Longrightarrow> H i x i \<Longrightarrow> \<tt>\<tt> i \<le> \<tt>\<tt> q \<Longrightarrow> H p (loop x inv i) q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<tt>\<tt> p \<le> \<tt>\<tt> i; H i x i; \<tt>\<tt> i \<le> \<tt>\<tt> q\<rbrakk> \<Longrightarrow> H p (loop x inv i ) q
[PROOF STEP]
unfolding kat_loop_inv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<tt>\<tt> p \<le> \<tt>\<tt> i; H i x i; \<tt>\<tt> i \<le> \<tt>\<tt> q\<rbrakk> \<Longrightarrow> H p (x\<^sup>\<star>) q
[PROOF STEP]
using H_star_inv
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<tt>\<tt> ?p \<le> \<tt>\<tt> ?i; H ?i ?x ?i; \<tt>\<tt> ?i \<le> \<tt>\<tt> ?q\<rbrakk> \<Longrightarrow> H ?p (?x\<^sup>\<star>) ?q

goal (1 subgoal):
 1. \<lbrakk>\<tt>\<tt> p \<le> \<tt>\<tt> i; H i x i; \<tt>\<tt> i \<le> \<tt>\<tt> q\<rbrakk> \<Longrightarrow> H p (x\<^sup>\<star>) q
[PROOF STEP]
by blast

\<comment> \<open> Invariants \<close>


[STATEMENT]
lemma extending_INT:
     "[| !!i. i \<in> I ==> extending C h F (Y' i) (Y i) |]
      ==> extending C h F (\<Inter>i \<in> I. Y' i) (\<Inter>i \<in> I. Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> extending C h F (Y' i) (Y i)) \<Longrightarrow> extending C h F (\<Inter> (Y' ` I)) (\<Inter> (Y ` I))
[PROOF STEP]
by (unfold extending_def, blast)


[STATEMENT]
lemma fls_of_int_nonneg: "(of_int (int n) :: 'a::ring_1 fls) = fls_const (of_int (int n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (int n) = fls_const (of_int (int n))
[PROOF STEP]
by (induct n) (auto intro: fls_eqI)


[STATEMENT]
lemma pmf_mix: "a \<in> {0..1} \<Longrightarrow> pmf (mix_pmf a p q) x = a * pmf p x + (1 - a) * pmf q x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> {0..1} \<Longrightarrow> pmf (mix_pmf a p q) x = a * pmf p x + (1 - a) * pmf q x
[PROOF STEP]
by (simp add: mix_pmf_def pmf_bind)


[STATEMENT]
lemma LIM_equal: "\<forall>x. x \<noteq> a \<longrightarrow> f x = g x \<Longrightarrow> (f \<midarrow>a\<rightarrow> l) \<longleftrightarrow> (g \<midarrow>a\<rightarrow> l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<noteq> a \<longrightarrow> f x = g x \<Longrightarrow> f \<midarrow>a\<rightarrow> l = g \<midarrow>a\<rightarrow> l
[PROOF STEP]
by (simp add: tendsto_def eventually_at_topological)


[STATEMENT]
lemma register_tensor_apply[simp]:
  fixes F :: "'a::domain update \<Rightarrow> 'b::domain update" and G :: "'c::domain update \<Rightarrow> 'd::domain update"
  assumes \<open>register F\<close> and \<open>register G\<close>
  shows "(F \<otimes>\<^sub>r G) (a \<otimes>\<^sub>u b) = F a \<otimes>\<^sub>u G b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<otimes>\<^sub>r G) (a \<otimes>\<^sub>u b) = F a \<otimes>\<^sub>u G b
[PROOF STEP]
unfolding register_tensor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. F a \<otimes>\<^sub>u id_update;\<lambda>b. id_update \<otimes>\<^sub>u G b) (a \<otimes>\<^sub>u b) = F a \<otimes>\<^sub>u G b
[PROOF STEP]
apply (subst register_pair_apply)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. register (\<lambda>a. F a \<otimes>\<^sub>u id_update)
 2. register (\<lambda>b. id_update \<otimes>\<^sub>u G b)
 3. \<And>a b. F a \<otimes>\<^sub>u id_update *\<^sub>u id_update \<otimes>\<^sub>u G b = id_update \<otimes>\<^sub>u G b *\<^sub>u F a \<otimes>\<^sub>u id_update
 4. F a \<otimes>\<^sub>u id_update *\<^sub>u id_update \<otimes>\<^sub>u G b = F a \<otimes>\<^sub>u G b
[PROOF STEP]
unfolding register_tensor_def
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. register (\<lambda>a. F a \<otimes>\<^sub>u id_update)
 2. register (\<lambda>b. id_update \<otimes>\<^sub>u G b)
 3. \<And>a b. F a \<otimes>\<^sub>u id_update *\<^sub>u id_update \<otimes>\<^sub>u G b = id_update \<otimes>\<^sub>u G b *\<^sub>u F a \<otimes>\<^sub>u id_update
 4. F a \<otimes>\<^sub>u id_update *\<^sub>u id_update \<otimes>\<^sub>u G b = F a \<otimes>\<^sub>u G b
[PROOF STEP]
by (simp_all add: assms tensor_update_mult)


[STATEMENT]
lemma abs_infty_q_definite:
  "abs_infty_q x = 0 \<longleftrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (abs_infty_q x = 0) = (x = 0)
[PROOF STEP]
proof (auto simp add: abs_infty_q_def
  mod_plus_minus_zero'[OF q_gt_zero q_odd])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_int_mod_ring x mod+- q = 0 \<Longrightarrow> x = 0
[PROOF STEP]
assume "to_int_mod_ring x mod+- q = 0"
[PROOF STATE]
proof (state)
this:
to_int_mod_ring x mod+- q = 0

goal (1 subgoal):
 1. to_int_mod_ring x mod+- q = 0 \<Longrightarrow> x = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
to_int_mod_ring x mod+- q = 0
[PROOF STEP]
have "to_int_mod_ring x mod q = 0"
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring x mod+- q = 0

goal (1 subgoal):
 1. to_int_mod_ring x mod q = 0
[PROOF STEP]
using mod_plus_minus_zero[of "to_int_mod_ring x" q]
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring x mod+- q = 0
to_int_mod_ring x mod+- q = 0 \<Longrightarrow> to_int_mod_ring x mod q = 0

goal (1 subgoal):
 1. to_int_mod_ring x mod q = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
to_int_mod_ring x mod q = 0

goal (1 subgoal):
 1. to_int_mod_ring x mod+- q = 0 \<Longrightarrow> x = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
to_int_mod_ring x mod q = 0
[PROOF STEP]
have "to_int_mod_ring x = 0"
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring x mod q = 0

goal (1 subgoal):
 1. to_int_mod_ring x = 0
[PROOF STEP]
using to_int_mod_ring_range CARD_a
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring x mod q = 0
range to_int_mod_ring = {0..<q}
int CARD('a) = q

goal (1 subgoal):
 1. to_int_mod_ring x = 0
[PROOF STEP]
by (metis mod_rangeE range_eqI)
[PROOF STATE]
proof (state)
this:
to_int_mod_ring x = 0

goal (1 subgoal):
 1. to_int_mod_ring x mod+- q = 0 \<Longrightarrow> x = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
to_int_mod_ring x = 0
[PROOF STEP]
show "x = 0"
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring x = 0

goal (1 subgoal):
 1. x = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simple_packet_set_toSet_alt: "simple_packet_set_toSet ms = (\<Union> m \<in> set ms. {p. simple_matches m p})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_packet_set_toSet ms = (\<Union>m\<in>set ms. {p. simple_matches m p})
[PROOF STEP]
unfolding simple_packet_set_toSet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. \<exists>m\<in>set ms. simple_matches m p} = (\<Union>m\<in>set ms. {p. simple_matches m p})
[PROOF STEP]
by blast


[STATEMENT]
lemma expectation_pair_pmf_snd [simp]:
  fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}"
  shows "measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f
[PROOF STEP]
have "measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) =
          measure_pmf.expectation (map_pmf snd (pair_pmf p q)) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation (map_pmf snd (pair_pmf p q)) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation (map_pmf snd (pair_pmf p q)) f

goal (1 subgoal):
 1. measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation (map_pmf snd (pair_pmf p q)) f

goal (1 subgoal):
 1. measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f
[PROOF STEP]
have "map_pmf snd (pair_pmf p q) = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_pmf snd (pair_pmf p q) = q
[PROOF STEP]
by (simp add: map_snd_pair_pmf)
[PROOF STATE]
proof (state)
this:
map_pmf snd (pair_pmf p q) = q

goal (1 subgoal):
 1. measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f

goal (1 subgoal):
 1. measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation (pair_pmf p q) (\<lambda>x. f (snd x)) = measure_pmf.expectation q f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_mult_left_mono: assumes C0: "C \<ge>\<^sub>m 0\<^sub>m n n"
  and AB: "A \<ge>\<^sub>m (B :: 'a :: ordered_semiring_0 mat)"
  and carr: "A \<in> carrier_mat n n" "B \<in> carrier_mat n n" "C \<in> carrier_mat n n"
  shows "A * C \<ge>\<^sub>m B * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
assume i: "i < n" "j < n"
[PROOF STATE]
proof (state)
this:
i < n
j < n

goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
have "row A i \<bullet> col C j \<ge> row B i \<bullet> col C j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row B i \<bullet> col C j \<le> row A i \<bullet> col C j
[PROOF STEP]
by (rule scalar_left_mono[of _ n], insert C0 AB carr i, auto)
[PROOF STATE]
proof (state)
this:
row B i \<bullet> col C j \<le> row A i \<bullet> col C j

goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> row B ?i2 \<bullet> col C ?j2 \<le> row A ?i2 \<bullet> col C ?j2

goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> row B ?i2 \<bullet> col C ?j2 \<le> row A ?i2 \<bullet> col C ?j2

goal (1 subgoal):
 1. A * C \<ge>\<^sub>m B * C
[PROOF STEP]
by (intro mat_geI[of _ n n], insert carr, auto)
[PROOF STATE]
proof (state)
this:
A * C \<ge>\<^sub>m B * C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordered_complement: "ordered_incidence_system \<V>s (map block_complement \<B>s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s (map block_complement \<B>s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s (map block_complement \<B>s)
[PROOF STEP]
interpret inc: finite_incidence_system \<V> "complement_blocks"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_incidence_system \<V> complement_blocks
[PROOF STEP]
by (simp add: complement_finite)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s (map inc.block_complement \<B>s)
[PROOF STEP]
have "map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks
[PROOF STEP]
using complement_image
[PROOF STATE]
proof (prove)
using this:
complement_blocks = image_mset inc.block_complement \<B>

goal (1 subgoal):
 1. map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks
[PROOF STEP]
by (simp add: permutations_of_multiset_def)
[PROOF STATE]
proof (state)
this:
map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks

goal (1 subgoal):
 1. ordered_incidence_system \<V>s (map inc.block_complement \<B>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks

goal (1 subgoal):
 1. ordered_incidence_system \<V>s (map inc.block_complement \<B>s)
[PROOF STEP]
using ordered_incidence_sysI[of "\<V>" "complement_blocks" "\<V>s" "(map block_complement \<B>s)"]
[PROOF STATE]
proof (prove)
using this:
map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks
\<lbrakk>finite_incidence_system \<V> complement_blocks; \<V>s \<in> permutations_of_set \<V>; map inc.block_complement \<B>s \<in> permutations_of_multiset complement_blocks\<rbrakk> \<Longrightarrow> ordered_incidence_system \<V>s (map inc.block_complement \<B>s)

goal (1 subgoal):
 1. ordered_incidence_system \<V>s (map inc.block_complement \<B>s)
[PROOF STEP]
by (simp add: inc.finite_incidence_system_axioms points_indexing)
[PROOF STATE]
proof (state)
this:
ordered_incidence_system \<V>s (map inc.block_complement \<B>s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_Collect_conj:
  assumes "closed {x. P x}" "closed {x. Q x}"
  shows "closed {x. P x \<and> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x \<and> Q x}
[PROOF STEP]
using closed_Int[OF assms]
[PROOF STATE]
proof (prove)
using this:
closed ({x. P x} \<inter> {x. Q x})

goal (1 subgoal):
 1. closed {x. P x \<and> Q x}
[PROOF STEP]
by (simp add: Int_def)


[STATEMENT]
lemma at_left_minus: "at_left a = filtermap (\<lambda>x. - x) (at_right (- a))"
  for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_left a = filtermap uminus (at_right (- a))
[PROOF STEP]
by (simp add: filter_eq_iff eventually_filtermap eventually_at_filter filtermap_nhds_minus[symmetric])


[STATEMENT]
lemma ZFSucZero: "Nat2nat (SucNat Empty) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
have "nat2Nat 0 = Empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat2Nat 0 = Empty
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat2Nat 0 = Empty

goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
hence "(SucNat Empty) = nat2Nat (Suc 0)"
[PROOF STATE]
proof (prove)
using this:
nat2Nat 0 = Empty

goal (1 subgoal):
 1. SucNat Empty = nat2Nat (Suc 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
SucNat Empty = nat2Nat (Suc 0)

goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
hence "Nat2nat (SucNat Empty) = Nat2nat (nat2Nat (Suc 0))"
[PROOF STATE]
proof (prove)
using this:
SucNat Empty = nat2Nat (Suc 0)

goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = Nat2nat (nat2Nat (Suc 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Nat2nat (SucNat Empty) = Nat2nat (nat2Nat (Suc 0))

goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Nat2nat (SucNat Empty) = Nat2nat (nat2Nat (Suc 0))

goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
have "... = Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Nat2nat (nat2Nat (Suc 0)) = Suc 0
[PROOF STEP]
using Nat2nat_nat2Nat[of "Suc 0"]
[PROOF STATE]
proof (prove)
using this:
Nat2nat (nat2Nat (Suc 0)) = Suc 0

goal (1 subgoal):
 1. Nat2nat (nat2Nat (Suc 0)) = Suc 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Nat2nat (nat2Nat (Suc 0)) = Suc 0

goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Nat2nat (SucNat Empty) = Suc 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Nat2nat (SucNat Empty) = Suc 0

goal (1 subgoal):
 1. Nat2nat (SucNat Empty) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Nat2nat (SucNat Empty) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_on_pminusx_E: "inj_on (\<lambda>x. p - x) E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((-) (int p)) E
[PROOF STEP]
apply (auto simp add: E_def C_def B_def A_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((-) (int p)) ((\<lambda>x. x mod int p) ` (\<lambda>x. x * a) ` {0<..(int p - 1) div 2} \<inter> {(int p - 1) div 2<..})
[PROOF STEP]
apply (rule inj_on_inverseI [where g = "(-) (int p)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. x mod int p) ` (\<lambda>x. x * a) ` {0<..(int p - 1) div 2} \<inter> {(int p - 1) div 2<..} \<Longrightarrow> int p - (int p - x) = x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma oproj_Field2:
assumes f: "oproj r s f" and a: "b \<in> Field s"
shows "\<exists> a \<in> Field r. f a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a\<in>Field r. f a = b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
oproj r s f
b \<in> Field s

goal (1 subgoal):
 1. \<exists>a\<in>Field r. f a = b
[PROOF STEP]
unfolding oproj_def
[PROOF STATE]
proof (prove)
using this:
Field s \<subseteq> f ` Field r \<and> compat r s f
b \<in> Field s

goal (1 subgoal):
 1. \<exists>a\<in>Field r. f a = b
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_remdups_gen_ident: "mset (remdups_gen (\<lambda>x. x) xs) = mset_set (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (remdups_gen (\<lambda>x. x) xs) = mset_set (set xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mset (remdups_gen (\<lambda>x. x) xs) = mset_set (set xs)
[PROOF STEP]
have "f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f xs) = mset_set (set xs)" for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f xs) = mset_set (set xs)
[PROOF STEP]
proof (induct f xs rule: remdups_gen.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f []) = mset_set (set [])
 2. \<And>f x xs. \<lbrakk>f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f (filter (\<lambda>y. f x \<noteq> f y) xs)) = mset_set (set (filter (\<lambda>y. f x \<noteq> f y) xs)); f = (\<lambda>x. x)\<rbrakk> \<Longrightarrow> mset (remdups_gen f (x # xs)) = mset_set (set (x # xs))
[PROOF STEP]
case (2 f x xs)
[PROOF STATE]
proof (state)
this:
f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f (filter (\<lambda>y. f x \<noteq> f y) xs)) = mset_set (set (filter (\<lambda>y. f x \<noteq> f y) xs))
f = (\<lambda>x. x)

goal (2 subgoals):
 1. \<And>f. f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f []) = mset_set (set [])
 2. \<And>f x xs. \<lbrakk>f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f (filter (\<lambda>y. f x \<noteq> f y) xs)) = mset_set (set (filter (\<lambda>y. f x \<noteq> f y) xs)); f = (\<lambda>x. x)\<rbrakk> \<Longrightarrow> mset (remdups_gen f (x # xs)) = mset_set (set (x # xs))
[PROOF STEP]
note ih = this(1) and f = this(2)
[PROOF STATE]
proof (state)
this:
f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f (filter (\<lambda>y. f x \<noteq> f y) xs)) = mset_set (set (filter (\<lambda>y. f x \<noteq> f y) xs))
f = (\<lambda>x. x)

goal (2 subgoals):
 1. \<And>f. f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f []) = mset_set (set [])
 2. \<And>f x xs. \<lbrakk>f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f (filter (\<lambda>y. f x \<noteq> f y) xs)) = mset_set (set (filter (\<lambda>y. f x \<noteq> f y) xs)); f = (\<lambda>x. x)\<rbrakk> \<Longrightarrow> mset (remdups_gen f (x # xs)) = mset_set (set (x # xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (remdups_gen f (x # xs)) = mset_set (set (x # xs))
[PROOF STEP]
unfolding f remdups_gen.simps ih[OF f, unfolded f] mset.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. add_mset x (mset_set (set (filter ((\<noteq>) x) xs))) = mset_set (set (x # xs))
[PROOF STEP]
by (metis finite_set list.simps(15) mset_set.insert_remove removeAll_filter_not_eq
          remove_code(1) remove_def)
[PROOF STATE]
proof (state)
this:
mset (remdups_gen f (x # xs)) = mset_set (set (x # xs))

goal (1 subgoal):
 1. \<And>f. f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen f []) = mset_set (set [])
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
?f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen ?f xs) = mset_set (set xs)

goal (1 subgoal):
 1. mset (remdups_gen (\<lambda>x. x) xs) = mset_set (set xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen ?f xs) = mset_set (set xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?f = (\<lambda>x. x) \<Longrightarrow> mset (remdups_gen ?f xs) = mset_set (set xs)

goal (1 subgoal):
 1. mset (remdups_gen (\<lambda>x. x) xs) = mset_set (set xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset (remdups_gen (\<lambda>x. x) xs) = mset_set (set xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infs_bex_le_nat[iff]: "infs (\<lambda> a. \<exists> k < n :: nat. P k a) w \<longleftrightarrow> (\<exists> k < n. infs (P k) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
have "infs (\<lambda> a. \<exists> k < n. P k a) w \<longleftrightarrow> infs (\<lambda> a. \<exists> k \<in> {k. k < n}. P k a) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = infs (\<lambda>a. \<exists>k\<in>{k. k < n}. P k a) w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
infs (\<lambda>a. \<exists>k<n. P k a) w = infs (\<lambda>a. \<exists>k\<in>{k. k < n}. P k a) w

goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infs (\<lambda>a. \<exists>k<n. P k a) w = infs (\<lambda>a. \<exists>k\<in>{k. k < n}. P k a) w

goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<exists> k \<in> {k. k < n}. infs (P k) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k\<in>{k. k < n}. P k a) w = (\<exists>k\<in>{k. k < n}. infs (P k) w)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
infs (\<lambda>a. \<exists>k\<in>{k. k < n}. P k a) w = (\<exists>k\<in>{k. k < n}. infs (P k) w)

goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infs (\<lambda>a. \<exists>k\<in>{k. k < n}. P k a) w = (\<exists>k\<in>{k. k < n}. infs (P k) w)

goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (\<exists> k < n. infs (P k) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>k\<in>{k. k < n}. infs (P k) w) = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>k\<in>{k. k < n}. infs (P k) w) = (\<exists>k<n. infs (P k) w)

goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)

goal (1 subgoal):
 1. infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
infs (\<lambda>a. \<exists>k<n. P k a) w = (\<exists>k<n. infs (P k) w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_poss: "finite (poss s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (poss s)
[PROOF STEP]
proof (induct s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. finite (poss (Var x))
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> finite (poss x2a)) \<Longrightarrow> finite (poss (Fun x1a x2))
[PROOF STEP]
case (Fun f ts)
[PROOF STATE]
proof (state)
this:
?x2a \<in> set ts \<Longrightarrow> finite (poss ?x2a)

goal (2 subgoals):
 1. \<And>x. finite (poss (Var x))
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> finite (poss x2a)) \<Longrightarrow> finite (poss (Fun x1a x2))
[PROOF STEP]
have "poss (Fun f ts) = insert [] (\<Union> (set (map2 (\<lambda> i p. ((#) i) ` p) [0..< length ts] (map poss ts))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poss (Fun f ts) = insert [] (\<Union> (set (map2 (\<lambda>x. (`) ((#) x)) [0..<length ts] (map poss ts))))
[PROOF STEP]
by (auto simp: image_iff set_zip split: prod.splits)
[PROOF STATE]
proof (state)
this:
poss (Fun f ts) = insert [] (\<Union> (set (map2 (\<lambda>x. (`) ((#) x)) [0..<length ts] (map poss ts))))

goal (2 subgoals):
 1. \<And>x. finite (poss (Var x))
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> finite (poss x2a)) \<Longrightarrow> finite (poss (Fun x1a x2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poss (Fun f ts) = insert [] (\<Union> (set (map2 (\<lambda>x. (`) ((#) x)) [0..<length ts] (map poss ts))))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
poss (Fun f ts) = insert [] (\<Union> (set (map2 (\<lambda>x. (`) ((#) x)) [0..<length ts] (map poss ts))))

goal (1 subgoal):
 1. finite (poss (Fun f ts))
[PROOF STEP]
using Fun
[PROOF STATE]
proof (prove)
using this:
poss (Fun f ts) = insert [] (\<Union> (set (map2 (\<lambda>x. (`) ((#) x)) [0..<length ts] (map poss ts))))
?x2a \<in> set ts \<Longrightarrow> finite (poss ?x2a)

goal (1 subgoal):
 1. finite (poss (Fun f ts))
[PROOF STEP]
by (auto simp del: poss.simps dest!: set_zip_rightD)
[PROOF STATE]
proof (state)
this:
finite (poss (Fun f ts))

goal (1 subgoal):
 1. \<And>x. finite (poss (Var x))
[PROOF STEP]
qed simp


[STATEMENT]
lemma (in group) carrier_subgroup_generated_subset:
   "carrier (subgroup_generated G A) \<subseteq> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (subgroup_generated G A) \<subseteq> carrier G
[PROOF STEP]
apply (clarsimp simp: carrier_subgroup_generated)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> generate G (carrier G \<inter> A) \<Longrightarrow> x \<in> carrier G
[PROOF STEP]
by (meson Int_lower1 generate_in_carrier)


[STATEMENT]
lemma NegPos_map_append: "NegPos_map C (as @ bs) = NegPos_map C as @ NegPos_map C bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NegPos_map C (as @ bs) = NegPos_map C as @ NegPos_map C bs
[PROOF STEP]
by(induction as rule: getNeg.induct) (simp_all)


[STATEMENT]
lemma time_take_tm:
  "time (take_tm n xs) = min n (length xs) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. time (take_tm n xs) = min n (length xs) + 1
[PROOF STEP]
by (induction xs arbitrary: n) (auto simp: time_simps split: nat.split)


[STATEMENT]
lemma VInf_vempty[simp]: "\<Sqinter>{} = (0::V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> {} = 0
[PROOF STEP]
by (simp add: Inf_V_def)