[STATEMENT]
lemma prob_single:
  assumes "x \<in> carrier R" "y \<in> carrier R"
  shows "prob {\<omega>. hash x \<omega> = y} = 1/(real field_size)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {\<omega>. hash x \<omega> = y} = 1 / real field_size
[PROOF STEP]
using hash_prob[where K="{x}"] assms finite_carrier k_ge_0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{x} \<subseteq> carrier R; card {x} \<le> k; ?y ` {x} \<subseteq> carrier R\<rbrakk> \<Longrightarrow> prob {\<omega>. \<forall>x\<in>{x}. hash x \<omega> = ?y x} = 1 / real field_size ^ card {x}
x \<in> carrier R
y \<in> carrier R
finite (carrier R)
0 < k

goal (1 subgoal):
 1. prob {\<omega>. hash x \<omega> = y} = 1 / real field_size
[PROOF STEP]
by simp


[STATEMENT]
lemma set_vzero_eq_ord_of_nat_vone: "set {0} = 1\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set {0} = 1\<^sub>\<nat>
[PROOF STEP]
by (metis elts_1 set_of_elts ord_of_nat_vone)


[STATEMENT]
lemma (in Ring) bilinear_l_lin:"\<lbrakk>R module M1; R module M2; R module N;
      m1 \<in> carrier M1; m2 \<in> carrier M2; r \<in> carrier R;
      bilinear_map f R M1 M2 N\<rbrakk> \<Longrightarrow> f (r \<cdot>\<^sub>s\<^bsub>M1\<^esub> m1, m2) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> (f (m1, m2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R module M1; R module M2; R module N; m1 \<in> carrier M1; m2 \<in> carrier M2; r \<in> carrier R; bilinear_map f R M1 M2 N\<rbrakk> \<Longrightarrow> f (r \<cdot>\<^sub>s\<^bsub>M1\<^esub> m1, m2) = r \<cdot>\<^sub>s\<^bsub>N\<^esub> f (m1, m2)
[PROOF STEP]
by (simp add:bilinear_map_def)


[STATEMENT]
lemma reduced_letter_set_0: "reduced_letter_set A 0 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduced_letter_set A (0::'a) = {}
[PROOF STEP]
using reduced_word_for_0_imp_nil
[PROOF STATE]
proof (prove)
using this:
reduced_word_for ?A (0::'a) ?as \<Longrightarrow> ?as = []

goal (1 subgoal):
 1. reduced_letter_set A (0::'a) = {}
[PROOF STEP]
by simp


[STATEMENT]
lemma beukers_integral1_swap: "beukers_integral1 r s = beukers_integral1 s r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. beukers_integral1 r s = beukers_integral1 s r
[PROOF STEP]
by (simp add: beukers_integral1_conv_nn_integral beukers_nn_integral1_swap)


[STATEMENT]
lemma l_neq_1_exp_neq_0:
  assumes "l \<in> carrier G"
    and "l \<noteq> \<one>"
    and "l = \<^bold>g [^] (t::nat)"
  shows "t \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<noteq> 0
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (t \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
\<not> t \<noteq> 0

goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "t = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> t \<noteq> 0

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

goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "\<^bold>g [^] t = \<one>"
[PROOF STATE]
proof (prove)
using this:
t = 0

goal (1 subgoal):
 1. \<^bold>g [^] t = \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] t = \<one>

goal (1 subgoal):
 1. \<not> t \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] t = \<one>
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] t = \<one>

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] t = \<one>
l \<in> carrier G
l \<noteq> \<one>
l = \<^bold>g [^] t

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_wrt_insort [intro]:
  assumes "linorder_on A R" "set xs \<subseteq> A"
  shows   "sorted_wrt R (insort_wrt R xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (insort_wrt R xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (insort_wrt R xs)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
linorder_on A R
set xs \<subseteq> A
[PROOF STEP]
have "set (insort_wrt R xs) = set xs \<and> sorted_wrt R (insort_wrt R xs)"
[PROOF STATE]
proof (prove)
using this:
linorder_on A R
set xs \<subseteq> A

goal (1 subgoal):
 1. set (insort_wrt R xs) = set xs \<and> Linorder_Relations.sorted_wrt R (insort_wrt R xs)
[PROOF STEP]
by (induction xs) (auto simp: insort_wrt_def intro!: sorted_wrt_insert_wrt)
[PROOF STATE]
proof (state)
this:
set (insort_wrt R xs) = set xs \<and> Linorder_Relations.sorted_wrt R (insort_wrt R xs)

goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (insort_wrt R xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
set (insort_wrt R xs) = set xs \<and> Linorder_Relations.sorted_wrt R (insort_wrt R xs)

goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (insort_wrt R xs)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Linorder_Relations.sorted_wrt R (insort_wrt R xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fresh_variable_type_scheme_lists:
  "\<exists>n. new_tv n (A::type_scheme list)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. new_tv n A
[PROOF STEP]
apply (induction A)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>n. new_tv n []
 2. \<And>a A. \<exists>n. new_tv n A \<Longrightarrow> \<exists>n. new_tv n (a # A)
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a A. \<exists>n. new_tv n A \<Longrightarrow> \<exists>n. new_tv n (a # A)
[PROOF STEP]
by (metis fresh_variable_type_schemes le_cases new_tv_Cons new_tv_le)


[STATEMENT]
lemma ChainsD: "\<lbrakk> x \<in> C; C \<in> Chains r; y \<in> C \<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> C; C \<in> Chains r; y \<in> C\<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r
[PROOF STEP]
by(simp add: Chains_def)


[STATEMENT]
lemma UP_l_neg_ex:
  assumes R: "p \<in> carrier P"
  shows "\<exists>q \<in> carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q\<in>carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>q\<in>carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
let ?q = "\<lambda>i. \<ominus> (p i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>q\<in>carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
from R
[PROOF STATE]
proof (chain)
picking this:
p \<in> carrier P
[PROOF STEP]
have closed: "?q \<in> carrier P"
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier P

goal (1 subgoal):
 1. (\<lambda>i. \<ominus> p i) \<in> carrier P
[PROOF STEP]
by (simp add: UP_def P_def up_a_inv_closed)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. \<ominus> p i) \<in> carrier P

goal (1 subgoal):
 1. \<exists>q\<in>carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
from R
[PROOF STATE]
proof (chain)
picking this:
p \<in> carrier P
[PROOF STEP]
have coeff: "!!n. coeff P ?q n = \<ominus> (coeff P p n)"
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier P

goal (1 subgoal):
 1. \<And>n. coeff P (\<lambda>i. \<ominus> p i) n = \<ominus> coeff P p n
[PROOF STEP]
by (simp add: UP_def P_def up_a_inv_closed)
[PROOF STATE]
proof (state)
this:
coeff P (\<lambda>i. \<ominus> p i) ?n = \<ominus> coeff P p ?n

goal (1 subgoal):
 1. \<exists>q\<in>carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q\<in>carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
 2. ?q \<in> carrier P
[PROOF STEP]
show "?q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. \<ominus> p i) \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>
[PROOF STEP]
by (auto intro!: up_eqI simp add: R closed coeff R.l_neg)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. \<ominus> p i) \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>

goal (1 subgoal):
 1. (\<lambda>i. \<ominus> p i) \<in> carrier P
[PROOF STEP]
qed (rule closed)
[PROOF STATE]
proof (state)
this:
\<exists>q\<in>carrier P. q \<oplus>\<^bsub>P\<^esub> p = \<zero>\<^bsub>P\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma takeWhile_take_has_property:
  "n \<le> length (takeWhile P xs) \<Longrightarrow> \<forall>x \<in> set (take n xs). P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length (takeWhile P xs) \<Longrightarrow> \<forall>x\<in>set (take n xs). P x
[PROOF STEP]
by (induct xs arbitrary: n; simp split: if_split_asm) (case_tac n, simp_all)


[STATEMENT]
lemma ennreal_approx_unit:
  "(\<And>a::ennreal. 0 < a \<Longrightarrow> a < 1 \<Longrightarrow> a * z \<le> y) \<Longrightarrow> z \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>0 < a; a < 1\<rbrakk> \<Longrightarrow> a * z \<le> y) \<Longrightarrow> z \<le> y
[PROOF STEP]
apply (subst SUP_mult_right_ennreal[of "\<lambda>x. x" "{0 <..< 1}" z, simplified])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>0 < a; a < 1\<rbrakk> \<Longrightarrow> a * z \<le> y) \<Longrightarrow> (SUP i\<in>{0<..<1}. i * z) \<le> y
[PROOF STEP]
apply (auto intro: SUP_least)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Restrict_eq_mono:
     "[| A \<subseteq> B;  Restrict B r = Restrict B s |]
      ==> Restrict A r = Restrict A s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; Restrict B r = Restrict B s\<rbrakk> \<Longrightarrow> Restrict A r = Restrict A s
[PROOF STEP]
by (unfold Restrict_def, blast)


[STATEMENT]
lemma not_iTrigger: "
  (\<not> (P t'. t' \<T> t I. Q t)) =
  ((\<diamond> t I. \<not> Q t) \<and> (\<box> t I. \<not> P t \<or> (\<diamond> t I \<down>\<ge> t. \<not> Q t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (P t'. t' \<T> t I. Q t)) = ((\<diamond> t I. \<not> Q t) \<and> (\<box> t I. \<not> P t \<or> (\<diamond> t I \<down>\<ge> t. \<not> Q t)))
[PROOF STEP]
by (simp add: iTrigger_def)


[STATEMENT]
lemma karatsuba_single_sided: fixes f :: "'a :: comm_ring_1 poly"
  assumes "f = monom_mult n f1 + f0"
  shows "monom_mult n (f1 * g) + f0 * g = f * g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom_mult n (f1 * g) + f0 * g = f * g
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom_mult n (f1 * g) + f0 * g = (monom_mult n f1 + f0) * g
[PROOF STEP]
by (auto simp: field_simps mult_monom monom_mult_def)


[STATEMENT]
lemma borel_measurable_ereal_iff:
  shows "(\<lambda>x. ereal (f x)) \<in> borel_measurable M \<longleftrightarrow> f \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. ereal (f x)) \<in> borel_measurable M) = (f \<in> borel_measurable M)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. ereal (f x)) \<in> borel_measurable M \<Longrightarrow> f \<in> borel_measurable M
 2. f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. ereal (f x)) \<in> borel_measurable M
[PROOF STEP]
assume "(\<lambda>x. ereal (f x)) \<in> borel_measurable M"
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (f x)) \<in> borel_measurable M

goal (2 subgoals):
 1. (\<lambda>x. ereal (f x)) \<in> borel_measurable M \<Longrightarrow> f \<in> borel_measurable M
 2. f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. ereal (f x)) \<in> borel_measurable M
[PROOF STEP]
from borel_measurable_real_of_ereal[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. real_of_ereal (ereal (f x))) \<in> borel_measurable M
[PROOF STEP]
show "f \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. real_of_ereal (ereal (f x))) \<in> borel_measurable M

goal (1 subgoal):
 1. f \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> borel_measurable M

goal (1 subgoal):
 1. f \<in> borel_measurable M \<Longrightarrow> (\<lambda>x. ereal (f x)) \<in> borel_measurable M
[PROOF STEP]
qed auto


[STATEMENT]
lemma exp_2dist_positive:
  assumes "a \<in> hyp2" and "b \<in> hyp2"
  shows "exp_2dist a b > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < exp_2dist a b
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 < exp_2dist a b
 2. \<not> ?P \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
assume "a = b"
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. ?P \<Longrightarrow> 0 < exp_2dist a b
 2. \<not> ?P \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
thus "exp_2dist a b > 0"
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. 0 < exp_2dist a b
[PROOF STEP]
by (unfold exp_2dist_def) simp
[PROOF STATE]
proof (state)
this:
0 < exp_2dist a b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
assume "a \<noteq> b"
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
let ?p = "endpoint_in_S a b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
let ?q = "endpoint_in_S b a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
from \<open>a \<noteq> b\<close> and \<open>a \<in> hyp2\<close> and \<open>b \<in> hyp2\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
a \<in> hyp2
b \<in> hyp2
[PROOF STEP]
have "are_endpoints_in_S ?p ?q a b"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
a \<in> hyp2
b \<in> hyp2

goal (1 subgoal):
 1. are_endpoints_in_S (endpoint_in_S a b) (endpoint_in_S b a) a b
[PROOF STEP]
by (rule endpoints_in_S_are_endpoints_in_S)
[PROOF STATE]
proof (state)
this:
are_endpoints_in_S (endpoint_in_S a b) (endpoint_in_S b a) a b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
hence "cross_ratio ?p ?q a b > 0"
[PROOF STATE]
proof (prove)
using this:
are_endpoints_in_S (endpoint_in_S a b) (endpoint_in_S b a) a b

goal (1 subgoal):
 1. 0 < cross_ratio (endpoint_in_S a b) (endpoint_in_S b a) a b
[PROOF STEP]
by (rule cross_ratio_S_S_hyp2_hyp2_positive)
[PROOF STATE]
proof (state)
this:
0 < cross_ratio (endpoint_in_S a b) (endpoint_in_S b a) a b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> 0 < exp_2dist a b
[PROOF STEP]
with \<open>a \<noteq> b\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
0 < cross_ratio (endpoint_in_S a b) (endpoint_in_S b a) a b
[PROOF STEP]
show "exp_2dist a b > 0"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
0 < cross_ratio (endpoint_in_S a b) (endpoint_in_S b a) a b

goal (1 subgoal):
 1. 0 < exp_2dist a b
[PROOF STEP]
by (unfold exp_2dist_def) simp
[PROOF STATE]
proof (state)
this:
0 < exp_2dist a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mem_is_interval_1_I:
  fixes a b c::real
  assumes "is_interval S"
  assumes "a \<in> S" "c \<in> S"
  assumes "a \<le> b" "b \<le> c"
  shows "b \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> S
[PROOF STEP]
using assms is_interval_1
[PROOF STATE]
proof (prove)
using this:
is_interval S
a \<in> S
c \<in> S
a \<le> b
b \<le> c
is_interval ?s = (\<forall>a\<in>?s. \<forall>b\<in>?s. \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> x \<in> ?s)

goal (1 subgoal):
 1. b \<in> S
[PROOF STEP]
by blast


[STATEMENT]
lemma unit_disc_fix_moebius_comp [simp]:
  assumes "unit_disc_fix M1" and "unit_disc_fix M2"
  shows "unit_disc_fix (moebius_comp M1 M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix (moebius_comp M1 M2)
[PROOF STEP]
using unit_disc_fix_moebius_add[OF assms]
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix (M1 + M2)

goal (1 subgoal):
 1. unit_disc_fix (moebius_comp M1 M2)
[PROOF STEP]
by simp


[STATEMENT]
lemma field_poly_irreducible_imp_prime:
  "prime_elem p" if "irreducible p" for p :: "'a :: field poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_elem p
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
irreducible p

goal (1 subgoal):
 1. prime_elem p
[PROOF STEP]
by (fact field_poly.irreducible_imp_prime_elem)


[STATEMENT]
lemma reduce_below_abs_preserves_dimensions:
 shows [simp]: "dim_row (reduce_below_abs a xs D A) = dim_row A"
    and [simp]: "dim_col (reduce_below_abs a xs D A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (reduce_below_abs a xs D A) = dim_row A &&& dim_col (reduce_below_abs a xs D A) = dim_col A
[PROOF STEP]
using reduce_below_abs[of A "dim_row A" "dim_col A"]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_row A) (dim_col A) \<Longrightarrow> reduce_below_abs ?a ?xs ?D A \<in> carrier_mat (dim_row A) (dim_col A)

goal (1 subgoal):
 1. dim_row (reduce_below_abs a xs D A) = dim_row A &&& dim_col (reduce_below_abs a xs D A) = dim_col A
[PROOF STEP]
by auto


[STATEMENT]
lemma card_of_Fpow[simp]: "|A| \<le>o |Fpow A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A| \<le>o |Fpow A|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A| \<le>o |Fpow A|
[PROOF STEP]
let ?h = "\<lambda> a. {a}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A| \<le>o |Fpow A|
[PROOF STEP]
have "inj_on ?h A \<and> ?h ` A \<le> Fpow A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>a. {a}) A \<and> (\<lambda>a. {a}) ` A \<subseteq> Fpow A
[PROOF STEP]
unfolding inj_on_def Fpow_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A. \<forall>y\<in>A. {x} = {y} \<longrightarrow> x = y) \<and> (\<lambda>a. {a}) ` A \<subseteq> {X. X \<subseteq> A \<and> finite X}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>a. {a}) A \<and> (\<lambda>a. {a}) ` A \<subseteq> Fpow A

goal (1 subgoal):
 1. |A| \<le>o |Fpow A|
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>a. {a}) A \<and> (\<lambda>a. {a}) ` A \<subseteq> Fpow A

goal (1 subgoal):
 1. |A| \<le>o |Fpow A|
[PROOF STEP]
using card_of_ordLeq
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>a. {a}) A \<and> (\<lambda>a. {a}) ` A \<subseteq> Fpow A
(\<exists>f. inj_on f ?A \<and> f ` ?A \<subseteq> ?B) = (|?A| \<le>o |?B|)

goal (1 subgoal):
 1. |A| \<le>o |Fpow A|
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
|A| \<le>o |Fpow A|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem universal_domain: "domain {n. True} = {x. True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain {n. True} = {x. True}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. domain {n. True} = {x. True}
[PROOF STEP]
have "\<forall>x. x = Det True \<or> x = Det False \<or> x \<in> range Indet"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x = Det True \<or> x = Det False \<or> x \<in> range Indet
[PROOF STEP]
using range_eqI tv.exhaust tv.inject
[PROOF STATE]
proof (prove)
using this:
?b = ?f ?x \<Longrightarrow> ?b \<in> range ?f
\<lbrakk>\<And>x1. ?y = Det x1 \<Longrightarrow> ?P; \<And>x2. ?y = Indet x2 \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
(Det ?x1.0 = Det ?y1.0) = (?x1.0 = ?y1.0)
(Indet ?x2.0 = Indet ?y2.0) = (?x2.0 = ?y2.0)

goal (1 subgoal):
 1. \<forall>x. x = Det True \<or> x = Det False \<or> x \<in> range Indet
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>x. x = Det True \<or> x = Det False \<or> x \<in> range Indet

goal (1 subgoal):
 1. domain {n. True} = {x. True}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. x = Det True \<or> x = Det False \<or> x \<in> range Indet
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x = Det True \<or> x = Det False \<or> x \<in> range Indet

goal (1 subgoal):
 1. domain {n. True} = {x. True}
[PROOF STEP]
unfolding domain_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. x = Det True \<or> x = Det False \<or> x \<in> range Indet

goal (1 subgoal):
 1. {Det True, Det False} \<union> Indet ` {n. True} = {x. True}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
domain {n. True} = {x. True}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma drop_last_in: "\<And>n. n < length ls \<Longrightarrow> last ls \<in> set (drop n ls)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < |ls| \<Longrightarrow> last ls \<in> set (drop n ls)
[PROOF STEP]
apply (frule_tac last_drop)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>n < |ls|; last (drop n ls) = last ls\<rbrakk> \<Longrightarrow> last ls \<in> set (drop n ls)
[PROOF STEP]
apply(erule subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < |ls| \<Longrightarrow> last (drop n ls) \<in> set (drop n ls)
[PROOF STEP]
apply (case_tac "drop n ls" rule: rev_exhaust)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>n < |ls|; drop n ls = []\<rbrakk> \<Longrightarrow> last (drop n ls) \<in> set (drop n ls)
 2. \<And>n ys y. \<lbrakk>n < |ls|; drop n ls = ys @ [y]\<rbrakk> \<Longrightarrow> last (drop n ls) \<in> set (drop n ls)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma wf_bs_polyneg: "wf_bs bs p \<Longrightarrow> wf_bs bs (~\<^sub>p p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_bs bs p \<Longrightarrow> wf_bs bs (~\<^sub>p p)
[PROOF STEP]
unfolding wf_bs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. maxindex p \<le> length bs \<Longrightarrow> maxindex (~\<^sub>p p) \<le> length bs
[PROOF STEP]
by (induct p rule: polyneg.induct) auto


[STATEMENT]
lemma bigo_lesseq3: "f =o O(h) \<Longrightarrow> \<forall>x. 0 <= g x \<Longrightarrow> \<forall>x. g x <= f x \<Longrightarrow>
      g =o O(h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> O(h); \<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> g \<in> O(h)
[PROOF STEP]
apply (erule bigo_lesseq2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> \<forall>x. \<bar>g x\<bar> \<le> f x
[PROOF STEP]
apply (rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> \<bar>g x\<bar> \<le> f x
[PROOF STEP]
apply (subst abs_of_nonneg)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> (0::'b) \<le> g x
 2. \<And>x. \<lbrakk>\<forall>x. (0::'b) \<le> g x; \<forall>x. g x \<le> f x\<rbrakk> \<Longrightarrow> g x \<le> f x
[PROOF STEP]
apply (erule spec)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bounded_closed_interval [simp]:
  fixes a :: "'a::ordered_euclidean_space"
  shows "bounded {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded {a..b}
[PROOF STEP]
using bounded_cbox[of a b]
[PROOF STATE]
proof (prove)
using this:
bounded (cbox a b)

goal (1 subgoal):
 1. bounded {a..b}
[PROOF STEP]
by (metis interval_cbox)


[STATEMENT]
lemma lift_01_mat_simp[simp]: "dim_row (lift_01_mat M) = dim_row M"
  "dim_col (lift_01_mat M) = dim_col M"
  "i < dim_row M \<Longrightarrow> j < dim_col M \<Longrightarrow> (lift_01_mat M) $$ (i, j) = of_zero_neq_one (M $$ (i, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (lift_01_mat M) = dim_row M &&& dim_col (lift_01_mat M) = dim_col M &&& (\<lbrakk>i < dim_row M; j < dim_col M\<rbrakk> \<Longrightarrow> lift_01_mat M $$ (i, j) = of_zero_neq_one (M $$ (i, j)))
[PROOF STEP]
by (simp_all add: lift_01_mat_def)


[STATEMENT]
lemma inext_le_mono_infin_fin_rev: "
  \<lbrakk> inext a I \<le> inext b I; a \<in> I; b \<in> I; inext a I \<noteq> Max I \<or> infinite I \<rbrakk> \<Longrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inext a I \<le> inext b I; a \<in> I; b \<in> I; inext a I \<noteq> Max I \<or> infinite I\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
by (blast intro: inext_le_mono_infin_rev inext_le_mono_fin_rev)


[STATEMENT]
lemma eval_dioph_mult:
  "eval_dioph ks xs * int n = eval_dioph ks (map (\<lambda>x. x * n) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_dioph ks xs * int n = eval_dioph ks (map (\<lambda>x. x * n) xs)
[PROOF STEP]
by(induct ks xs rule: eval_dioph.induct) (simp_all add: distrib_right)


[STATEMENT]
lemma term_pp_rel_sym: "symp r \<Longrightarrow> term_pp_rel r a b \<Longrightarrow> term_pp_rel r b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>symp r; term_pp_rel r a b\<rbrakk> \<Longrightarrow> term_pp_rel r b a
[PROOF STEP]
by (auto simp: term_pp_rel_def symp_def)


[STATEMENT]
lemma arr_char:
    shows "S.arr f \<longleftrightarrow> f \<noteq> S.Null \<and> Setp (S.Dom f) \<and> Setp (S.Cod f) \<and>
                       S.Map f \<in> extensional (S.Dom f) \<inter> (S.Dom f \<rightarrow> S.Cod f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S.arr f = (f \<noteq> S.Null \<and> Setp (S.Dom f) \<and> Setp (S.Cod f) \<and> S.Map f \<in> extensional (S.Dom f) \<inter> (S.Dom f \<rightarrow> S.Cod f))
[PROOF STEP]
using S.arr_char
[PROOF STATE]
proof (prove)
using this:
S.arr ?f = (?f \<noteq> S.Null \<and> S.Dom ?f \<in> Collect Setp \<and> S.Cod ?f \<in> Collect Setp \<and> S.Map ?f \<in> extensional (S.Dom ?f) \<inter> (S.Dom ?f \<rightarrow> S.Cod ?f))

goal (1 subgoal):
 1. S.arr f = (f \<noteq> S.Null \<and> Setp (S.Dom f) \<and> Setp (S.Cod f) \<and> S.Map f \<in> extensional (S.Dom f) \<inter> (S.Dom f \<rightarrow> S.Cod f))
[PROOF STEP]
by auto


[STATEMENT]
lemma "ipv6addr_toString (ipv6preferred_to_int
           (IPv6AddrPreferred 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff)) =
              ''ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ipv6addr_toString (ipv6preferred_to_int (IPv6AddrPreferred 65535 65535 65535 65535 65535 65535 65535 65535)) = ''ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff''
[PROOF STEP]
by eval


[STATEMENT]
lemma (in equivalence) disjoint_sum:
  assumes "finite (carrier S)"
  shows "(\<Sum>c\<in>classes. \<Sum>x\<in>c. f x) = (\<Sum>x\<in>(carrier S). f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (sum f) classes = sum f (carrier S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum (sum f) classes = sum f (carrier S)
[PROOF STEP]
have "finite classes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite classes
[PROOF STEP]
unfolding eq_classes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {class_of x |x. x \<in> carrier S}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (carrier S)

goal (1 subgoal):
 1. finite {class_of x |x. x \<in> carrier S}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite classes

goal (1 subgoal):
 1. sum (sum f) classes = sum f (carrier S)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite classes

goal (1 subgoal):
 1. sum (sum f) classes = sum f (carrier S)
[PROOF STEP]
using disjoint_sum assms partition_from_equivalence
[PROOF STATE]
proof (prove)
using this:
finite classes
\<lbrakk>finite ?B; finite ?A; Congruence.partition ?A ?B\<rbrakk> \<Longrightarrow> sum (sum ?f) ?B = sum ?f ?A
finite (carrier S)
Congruence.partition (carrier S) classes

goal (1 subgoal):
 1. sum (sum f) classes = sum f (carrier S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum (sum f) classes = sum f (carrier S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_rbt_baliL: "inv2 l \<Longrightarrow> inv2 r \<Longrightarrow> inv1l l \<Longrightarrow> inv1 r \<Longrightarrow> bheight l = bheight r \<Longrightarrow>
  inv1 (rbt_baliL l a b r) \<and> inv2 (rbt_baliL l a b r) \<and> bheight (rbt_baliL l a b r) = Suc (bheight l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inv2 l; inv2 r; inv1l l; inv1 r; bheight l = bheight r\<rbrakk> \<Longrightarrow> inv1 (rbt_baliL l a b r) \<and> inv2 (rbt_baliL l a b r) \<and> bheight (rbt_baliL l a b r) = Suc (bheight l)
[PROOF STEP]
by (induct l a b r rule: rbt_baliL.induct) auto


[STATEMENT]
lemma mcp'_intro :
  assumes "mcp z W p"
shows "mcp' z W = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mcp' z W = p
[PROOF STEP]
using assms mcp_unique
[PROOF STATE]
proof (prove)
using this:
mcp z W p
\<lbrakk>mcp ?z ?W ?p; mcp ?z ?W ?p'\<rbrakk> \<Longrightarrow> ?p = ?p'

goal (1 subgoal):
 1. mcp' z W = p
[PROOF STEP]
by (metis mcp'.elims theI_unique)


[STATEMENT]
lemma card_order_cexp:
  assumes "card_order r1" "card_order r2"
  shows "card_order (r1 ^c r2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card_order (r1 ^c r2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card_order (r1 ^c r2)
[PROOF STEP]
have "Field r1 = UNIV" "Field r2 = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field r1 = UNIV &&& Field r2 = UNIV
[PROOF STEP]
using assms card_order_on_Card_order
[PROOF STATE]
proof (prove)
using this:
card_order r1
card_order r2
card_order_on ?A ?r \<Longrightarrow> ?A = Field ?r \<and> Card_order ?r

goal (1 subgoal):
 1. Field r1 = UNIV &&& Field r2 = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Field r1 = UNIV
Field r2 = UNIV

goal (1 subgoal):
 1. card_order (r1 ^c r2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Field r1 = UNIV
Field r2 = UNIV

goal (1 subgoal):
 1. card_order (r1 ^c r2)
[PROOF STEP]
unfolding cexp_def Func_def
[PROOF STATE]
proof (prove)
using this:
Field r1 = UNIV
Field r2 = UNIV

goal (1 subgoal):
 1. card_order |{f. (\<forall>a\<in>Field r2. f a \<in> Field r1) \<and> (\<forall>a. a \<notin> Field r2 \<longrightarrow> f a = undefined)}|
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card_order (r1 ^c r2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma step_eps_closure_set_q0: "step_eps_closure_set {q0} bs \<subseteq> {q0, qf} \<union>
  (nfa'.step_eps_closure_set {q0'} bs \<inter> nfa'.SQ)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. step_eps_closure_set {q0} bs \<subseteq> {q0, qf} \<union> nfa'.step_eps_closure_set {q0'} bs \<inter> nfa'.SQ
[PROOF STEP]
unfolding NFA.step_eps_closure_set_def NFA.step_eps_closure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>q\<in>{q0}. Collect ((step_eps bs)\<^sup>*\<^sup>* q)) \<subseteq> {q0, qf} \<union> (\<Union>q\<in>{q0'}. Collect ((nfa'.step_eps bs)\<^sup>*\<^sup>* q)) \<inter> nfa'.SQ
[PROOF STEP]
using rtranclp_step_eps_q0_q0'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(step_eps ?bs)\<^sup>*\<^sup>* ?q ?q'; ?q = q0\<rbrakk> \<Longrightarrow> ?q' \<in> {q0, qf} \<or> ?q' \<in> nfa'.SQ \<and> (nfa'.step_eps ?bs)\<^sup>*\<^sup>* q0' ?q'

goal (1 subgoal):
 1. (\<Union>q\<in>{q0}. Collect ((step_eps bs)\<^sup>*\<^sup>* q)) \<subseteq> {q0, qf} \<union> (\<Union>q\<in>{q0'}. Collect ((nfa'.step_eps bs)\<^sup>*\<^sup>* q)) \<inter> nfa'.SQ
[PROOF STEP]
by auto


[STATEMENT]
lemma sets_distinct6: "(s::int) < g \<Longrightarrow> {(a::int, b::int).  g < a} \<noteq> {(a::int, b::int).  a = s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s < g \<Longrightarrow> {(a, b). g < a} \<noteq> {(a, b). a = s}
[PROOF STEP]
apply (rule not_sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s < g \<Longrightarrow> {(a, b). a = s} \<noteq> {(a, b). g < a}
[PROOF STEP]
apply (rule sets_distinct5)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s < g \<Longrightarrow> s < g
[PROOF STEP]
by simp


[STATEMENT]
lemma term_variants_pred_fv_eq:
  assumes "term_variants_pred P s t"
  shows "fv s = fv t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv s = fv t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
term_variants_pred P s t

goal (1 subgoal):
 1. fv s = fv t
[PROOF STEP]
by (induct rule: term_variants_pred.induct)
   (metis, metis fv_eq_FunI, metis fv_eq_FunI)


[STATEMENT]
lemma lm082:
  assumes "X\<inter>Y = {}"
  shows "(P outside Y)``X=P``X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P outside Y) `` X = P `` X
[PROOF STEP]
using assms Outside_def
[PROOF STATE]
proof (prove)
using this:
X \<inter> Y = {}
?R outside ?X = ?R - ?X \<times> Range ?R

goal (1 subgoal):
 1. (P outside Y) `` X = P `` X
[PROOF STEP]
by blast


[STATEMENT]
lemma import_rel2_pure_conv: "import_rel2 R (pure A) (pure B) = pure (\<langle>A,B\<rangle>R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. import_rel2 R (pure A) (pure B) = pure (\<langle>A, B\<rangle>R)
[PROOF STEP]
unfolding import_rel2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>c ci. \<up> (is_pure (pure A) \<and> is_pure (pure B) \<and> (ci, c) \<in> \<langle>the_pure (pure A), the_pure (pure B)\<rangle>R)) = pure (\<langle>A, B\<rangle>R)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>c ci. \<up> ((ci, c) \<in> \<langle>A, B\<rangle>R)) = pure (\<langle>A, B\<rangle>R)
[PROOF STEP]
apply (simp add: pure_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hypnat_one_not_prime [simp]: "1 \<notin> starprime"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<notin> starprime
[PROOF STEP]
using hypnat_of_nat_one_not_prime
[PROOF STATE]
proof (prove)
using this:
hypnat_of_nat 1 \<notin> starprime

goal (1 subgoal):
 1. 1 \<notin> starprime
[PROOF STEP]
by simp


[STATEMENT]
lemma totient_prod_coprime:
  assumes "pairwise coprime (f ` A)" "inj_on f A"
  shows   "totient (prod f A) = (\<Prod>a\<in>A. totient (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
pairwise coprime (f ` A)
inj_on f A

goal (1 subgoal):
 1. totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
[PROOF STEP]
proof (induction A rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
case (insert x A)
[PROOF STATE]
proof (state)
this:
finite A
x \<notin> A
\<lbrakk>pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
pairwise coprime (f ` insert x A)
inj_on f (insert x A)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
have *: "coprime (prod f A) (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (prod f A) (f x)
[PROOF STEP]
proof (rule prod_coprime_left)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> coprime (f i) (f x)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> coprime (f i) (f x)
[PROOF STEP]
assume "y \<in> A"
[PROOF STATE]
proof (state)
this:
y \<in> A

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> coprime (f i) (f x)
[PROOF STEP]
with \<open>x \<notin> A\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<notin> A
y \<in> A
[PROOF STEP]
have "y \<noteq> x"
[PROOF STATE]
proof (prove)
using this:
x \<notin> A
y \<in> A

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

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> coprime (f i) (f x)
[PROOF STEP]
with \<open>x \<notin> A\<close> \<open>y \<in> A\<close> \<open>inj_on f (insert x A)\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<notin> A
y \<in> A
inj_on f (insert x A)
y \<noteq> x
[PROOF STEP]
have "f y \<noteq> f x"
[PROOF STATE]
proof (prove)
using this:
x \<notin> A
y \<in> A
inj_on f (insert x A)
y \<noteq> x

goal (1 subgoal):
 1. f y \<noteq> f x
[PROOF STEP]
using inj_onD [of f "insert x A" y x]
[PROOF STATE]
proof (prove)
using this:
x \<notin> A
y \<in> A
inj_on f (insert x A)
y \<noteq> x
\<lbrakk>inj_on f (insert x A); f y = f x; y \<in> insert x A; x \<in> insert x A\<rbrakk> \<Longrightarrow> y = x

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

goal (1 subgoal):
 1. \<And>i. i \<in> A \<Longrightarrow> coprime (f i) (f x)
[PROOF STEP]
with \<open>y \<in> A\<close>
[PROOF STATE]
proof (chain)
picking this:
y \<in> A
f y \<noteq> f x
[PROOF STEP]
show "coprime (f y) (f x)"
[PROOF STATE]
proof (prove)
using this:
y \<in> A
f y \<noteq> f x

goal (1 subgoal):
 1. coprime (f y) (f x)
[PROOF STEP]
using pairwiseD [OF \<open>pairwise coprime (f ` insert x A)\<close>]
[PROOF STATE]
proof (prove)
using this:
y \<in> A
f y \<noteq> f x
\<lbrakk>?x \<in> f ` insert x A; ?y \<in> f ` insert x A; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> coprime ?x ?y

goal (1 subgoal):
 1. coprime (f y) (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (f y) (f x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (prod f A) (f x)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
from insert.hyps
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
[PROOF STEP]
have "prod f (insert x A) = prod f A * f x"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. prod f (insert x A) = prod f A * f x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod f (insert x A) = prod f A * f x

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod f (insert x A) = prod f A * f x

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
have "totient \<dots> = totient (prod f A) * totient (f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (prod f A * f x) = totient (prod f A) * totient (f x)
[PROOF STEP]
using insert.hyps insert.prems
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A
pairwise coprime (f ` insert x A)
inj_on f (insert x A)

goal (1 subgoal):
 1. totient (prod f A * f x) = totient (prod f A) * totient (f x)
[PROOF STEP]
by (intro totient_mult_coprime *)
[PROOF STATE]
proof (state)
this:
totient (prod f A * f x) = totient (prod f A) * totient (f x)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
totient (prod f A * f x) = totient (prod f A) * totient (f x)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
have "totient (prod f A) = (\<Prod>a\<in>A. totient (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
[PROOF STEP]
using insert.prems
[PROOF STATE]
proof (prove)
using this:
pairwise coprime (f ` insert x A)
inj_on f (insert x A)

goal (1 subgoal):
 1. totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
[PROOF STEP]
by (intro insert.IH) (auto dest: pairwise_subset)
[PROOF STATE]
proof (state)
this:
totient (prod f A) = (\<Prod>a\<in>A. totient (f a))

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
totient (prod f A) = (\<Prod>a\<in>A. totient (f a))

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
from insert.hyps
[PROOF STATE]
proof (chain)
picking this:
finite A
x \<notin> A
[PROOF STEP]
have "\<dots> * totient (f x) = (\<Prod>a\<in>insert x A. totient (f a))"
[PROOF STATE]
proof (prove)
using this:
finite A
x \<notin> A

goal (1 subgoal):
 1. (\<Prod>a\<in>A. totient (f a)) * totient (f x) = (\<Prod>a\<in>insert x A. totient (f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Prod>a\<in>A. totient (f a)) * totient (f x) = (\<Prod>a\<in>insert x A. totient (f a))

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>pairwise coprime (f ` F); inj_on f F\<rbrakk> \<Longrightarrow> totient (prod f F) = (\<Prod>a\<in>F. totient (f a)); pairwise coprime (f ` insert x F); inj_on f (insert x F)\<rbrakk> \<Longrightarrow> totient (prod f (insert x F)) = (\<Prod>a\<in>insert x F. totient (f a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
totient (prod f (insert x A)) = (\<Prod>a\<in>insert x A. totient (f a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
totient (prod f (insert x A)) = (\<Prod>a\<in>insert x A. totient (f a))

goal (1 subgoal):
 1. totient (prod f (insert x A)) = (\<Prod>a\<in>insert x A. totient (f a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
totient (prod f (insert x A)) = (\<Prod>a\<in>insert x A. totient (f a))

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; pairwise coprime (f ` A); inj_on f A\<rbrakk> \<Longrightarrow> totient (prod f A) = (\<Prod>a\<in>A. totient (f a))
 2. \<lbrakk>pairwise coprime (f ` {}); inj_on f {}\<rbrakk> \<Longrightarrow> totient (prod f {}) = (\<Prod>a\<in>{}. totient (f a))
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma poly_reflect_eq_0_iff:
  "poly (reflect_poly p) (x :: 'a :: field) = 0 \<longleftrightarrow> p = 0 \<or> x \<noteq> 0 \<and> poly p (1 / x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (reflect_poly p) x = (0::'a)) = (p = 0 \<or> x \<noteq> (0::'a) \<and> poly p ((1::'a) / x) = (0::'a))
[PROOF STEP]
by (cases "x = 0") (auto simp: poly_reflect_poly_nz inverse_eq_divide)


[STATEMENT]
lemma foldl_set: "foldl (\<union>) {} l = \<Union>{x. x\<in>set l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<union>) {} l = \<Union> {x. x \<in> set l}
[PROOF STEP]
apply (induct l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. foldl (\<union>) {} [] = \<Union> {x. x \<in> set []}
 2. \<And>a l. foldl (\<union>) {} l = \<Union> {x. x \<in> set l} \<Longrightarrow> foldl (\<union>) {} (a # l) = \<Union> {x. x \<in> set (a # l)}
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l. foldl (\<union>) {} l = \<Union> (set l) \<Longrightarrow> foldl (\<union>) a l = \<Union> {x. x = a \<or> x \<in> set l}
[PROOF STEP]
apply (subst foldl_un_empty_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l. foldl (\<union>) {} l = \<Union> (set l) \<Longrightarrow> a \<union> foldl (\<union>) {} l = \<Union> {x. x = a \<or> x \<in> set l}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma two_diff: "\<exists> x y :: 'a. x \<noteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y
[PROOF STEP]
obtain A where "finite A" "card A = 2" "A \<subseteq> (UNIV :: 'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "infinite (UNIV :: 'a set)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis; infinite UNIV\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis; \<not> infinite UNIV\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
infinite UNIV

goal (2 subgoals):
 1. \<lbrakk>\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis; infinite UNIV\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis; \<not> infinite UNIV\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with infinite_arbitrarily_large[of "UNIV :: 'a set" 2] that
[PROOF STATE]
proof (chain)
picking this:
infinite UNIV \<Longrightarrow> \<exists>B. finite B \<and> card B = 2 \<and> B \<subseteq> UNIV
\<lbrakk>finite ?A; card ?A = 2; ?A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis
infinite UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite UNIV \<Longrightarrow> \<exists>B. finite B \<and> card B = 2 \<and> B \<subseteq> UNIV
\<lbrakk>finite ?A; card ?A = 2; ?A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis
infinite UNIV

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

goal (1 subgoal):
 1. \<lbrakk>\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis; \<not> infinite UNIV\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis; \<not> infinite UNIV\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> infinite UNIV

goal (1 subgoal):
 1. \<lbrakk>\<And>A. \<lbrakk>finite A; card A = 2; A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis; \<not> infinite UNIV\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with card_two that
[PROOF STATE]
proof (chain)
picking this:
infinite UNIV \<or> 2 \<le> card UNIV
\<lbrakk>finite ?A; card ?A = 2; ?A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis
\<not> infinite UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite UNIV \<or> 2 \<le> card UNIV
\<lbrakk>finite ?A; card ?A = 2; ?A \<subseteq> UNIV\<rbrakk> \<Longrightarrow> thesis
\<not> infinite UNIV

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (metis UNIV_bool card_UNIV_bool card_image card_le_inj finite.intros(1) finite_insert finite_subset)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite A
card A = 2
A \<subseteq> UNIV

goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
card A = 2
A \<subseteq> UNIV

goal (1 subgoal):
 1. \<exists>x y. x \<noteq> y
[PROOF STEP]
by (metis (full_types) One_nat_def Suc_1 UNIV_eq_I card.empty card.insert finite.intros(1) insertCI nat.inject nat.simps(3))
[PROOF STATE]
proof (state)
this:
\<exists>x y. x \<noteq> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sf_at_1: "sf 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sf 1 = 1
[PROOF STEP]
by (simp add: sf_def)


[STATEMENT]
lemma Lindelof_space_perfect_map_image:
   "\<lbrakk>Lindelof_space X; perfect_map X Y f\<rbrakk> \<Longrightarrow> Lindelof_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Lindelof_space X; perfect_map X Y f\<rbrakk> \<Longrightarrow> Lindelof_space Y
[PROOF STEP]
using Lindelof_space_quotient_map_image perfect_imp_quotient_map
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>quotient_map ?X ?Y ?q; Lindelof_space ?X\<rbrakk> \<Longrightarrow> Lindelof_space ?Y
perfect_map ?X ?Y ?f \<Longrightarrow> quotient_map ?X ?Y ?f

goal (1 subgoal):
 1. \<lbrakk>Lindelof_space X; perfect_map X Y f\<rbrakk> \<Longrightarrow> Lindelof_space Y
[PROOF STEP]
by blast


[STATEMENT]
lemma frequently_at_top_realE:
  fixes P::"nat \<Rightarrow> real \<Rightarrow> bool"
  assumes "\<forall>n. \<exists>\<^sub>F t in at_top. P n t"
  obtains s::"nat\<Rightarrow>real"
  where "\<And>i. P i (s i)" "filterlim s at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. \<lbrakk>\<And>i. P i (s i); filterlim s at_top sequentially\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms frequently_at_top_at_topE[OF _ filterlim_real_sequentially])


[STATEMENT]
lemma invertible_right_inverse:
  fixes A :: "'a::{field}^'n^'n"
  shows "invertible A \<longleftrightarrow> (\<exists>(B::'a^'n^'n). A** B = mat 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible A = (\<exists>B. A ** B = mat (1::'a))
[PROOF STEP]
by (metis invertible_def matrix_left_right_inverse)


[STATEMENT]
lemma exp_Lambert_W': "x \<in> {-exp (-1)..<0} \<Longrightarrow> exp (Lambert_W' x) = x / Lambert_W' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {- exp (- 1)..<0} \<Longrightarrow> exp (Lambert_W' x) = x / Lambert_W' x
[PROOF STEP]
using Lambert_W'_times_exp_self[of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> {- exp (- 1)..<0} \<Longrightarrow> Lambert_W' x * exp (Lambert_W' x) = x

goal (1 subgoal):
 1. x \<in> {- exp (- 1)..<0} \<Longrightarrow> exp (Lambert_W' x) = x / Lambert_W' x
[PROOF STEP]
by (auto simp add: divide_simps mult_ac)


[STATEMENT]
lemma diag_block_mat_last: "diag_block_mat (As @ [B]) =
  (let A = diag_block_mat As
  in four_block_mat A (0\<^sub>m (dim_row A) (dim_col B)) (0\<^sub>m (dim_row B) (dim_col A)) B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (As @ [B]) = (let A = diag_block_mat As in four_block_mat A (0\<^sub>m (dim_row A) (dim_col B)) (0\<^sub>m (dim_row B) (dim_col A)) B)
[PROOF STEP]
unfolding diag_block_mat_append diag_block_mat_singleton
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let A = diag_block_mat As; B = B in four_block_mat A (0\<^sub>m (dim_row A) (dim_col B)) (0\<^sub>m (dim_row B) (dim_col A)) B) = (let A = diag_block_mat As in four_block_mat A (0\<^sub>m (dim_row A) (dim_col B)) (0\<^sub>m (dim_row B) (dim_col A)) B)
[PROOF STEP]
by auto


[STATEMENT]
lemma p_collinear_p_isometry_pt [simp]:
  shows "p_collinear (p_isometry_pt M ` A) \<longleftrightarrow> p_collinear A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p_collinear (p_isometry_pt M ` A) = p_collinear A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p_collinear (p_isometry_pt M ` A) = p_collinear A
[PROOF STEP]
have *: "\<forall> M A.  ((\<lambda>x. moebius_pt M (conjugate x)) ` A = moebius_pt M ` (conjugate ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>M A. (\<lambda>x. moebius_pt M (conjugate x)) ` A = moebius_pt M ` conjugate ` A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>M A. (\<lambda>x. moebius_pt M (conjugate x)) ` A = moebius_pt M ` conjugate ` A

goal (1 subgoal):
 1. p_collinear (p_isometry_pt M ` A) = p_collinear A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p_collinear (p_isometry_pt M ` A) = p_collinear A
[PROOF STEP]
by transfer (auto simp add: unit_disc_fix_f_def *)
[PROOF STATE]
proof (state)
this:
p_collinear (p_isometry_pt M ` A) = p_collinear A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_zero [simp]: "0\<^sup>\<star> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a)\<^sup>\<star> = (1::'a)
[PROOF STEP]
by (rule local.conway.zero_dagger)


[STATEMENT]
lemma adm_cart_prod [intro, simp]:
  assumes X: "adm (\<lambda>x. x \<in> X)"
  assumes Y: "adm (\<lambda>x. x \<in> Y)"
  shows "adm (\<lambda>x. x \<in> X \<times> Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adm (\<lambda>x. x \<in> X \<times> Y)
[PROOF STEP]
proof(rule admI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ya. \<lbrakk>chain Ya; \<forall>i. Ya i \<in> X \<times> Y\<rbrakk> \<Longrightarrow> (\<Squnion>i. Ya i) \<in> X \<times> Y
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Ya. \<lbrakk>chain Ya; \<forall>i. Ya i \<in> X \<times> Y\<rbrakk> \<Longrightarrow> (\<Squnion>i. Ya i) \<in> X \<times> Y
[PROOF STEP]
assume A: "chain A" and Ai: "\<forall>i. A i \<in> X \<times> Y"
[PROOF STATE]
proof (state)
this:
chain A
\<forall>i. A i \<in> X \<times> Y

goal (1 subgoal):
 1. \<And>Ya. \<lbrakk>chain Ya; \<forall>i. Ya i \<in> X \<times> Y\<rbrakk> \<Longrightarrow> (\<Squnion>i. Ya i) \<in> X \<times> Y
[PROOF STEP]
from Ai
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. A i \<in> X \<times> Y
[PROOF STEP]
have "\<forall>i. fst (A i) \<in> X" and "\<forall>i. snd (A i) \<in> Y"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. A i \<in> X \<times> Y

goal (1 subgoal):
 1. \<forall>i. fst (A i) \<in> X &&& \<forall>i. snd (A i) \<in> Y
[PROOF STEP]
by (auto simp: mem_Times_iff)
[PROOF STATE]
proof (state)
this:
\<forall>i. fst (A i) \<in> X
\<forall>i. snd (A i) \<in> Y

goal (1 subgoal):
 1. \<And>Ya. \<lbrakk>chain Ya; \<forall>i. Ya i \<in> X \<times> Y\<rbrakk> \<Longrightarrow> (\<Squnion>i. Ya i) \<in> X \<times> Y
[PROOF STEP]
with A X Y
[PROOF STATE]
proof (chain)
picking this:
chain A
adm (\<lambda>x. x \<in> X)
adm (\<lambda>x. x \<in> Y)
\<forall>i. fst (A i) \<in> X
\<forall>i. snd (A i) \<in> Y
[PROOF STEP]
show "Lub A \<in> X \<times> Y"
[PROOF STATE]
proof (prove)
using this:
chain A
adm (\<lambda>x. x \<in> X)
adm (\<lambda>x. x \<in> Y)
\<forall>i. fst (A i) \<in> X
\<forall>i. snd (A i) \<in> Y

goal (1 subgoal):
 1. Lub A \<in> X \<times> Y
[PROOF STEP]
by (auto intro: admD intro!: adm_subst simp: lub_prod)
[PROOF STATE]
proof (state)
this:
Lub A \<in> X \<times> Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma partition_on_mset_count_eq: "partition_on_mset A P \<Longrightarrow> a \<in># A \<Longrightarrow>
    (\<Sum>x \<in># P. count x a) = count A a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>partition_on_mset A P; a \<in># A\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>#P. count x a) = count A a
[PROOF STEP]
by (metis count_sum_mset partition_on_msetD1)


[STATEMENT]
theorem Hmap_id: "Hmap id id = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hmap id id = id
[PROOF STEP]
unfolding G.map_id0 F1.map_id0 F2.map_id0 F3.map_id0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. id = id
[PROOF STEP]
..


[STATEMENT]
lemma is_infinity_uminus [simp]: "is_infinity (- a) = is_infinity a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_infinity (- a) = is_infinity a
[PROOF STEP]
by (simp add: is_infinity_def)


[STATEMENT]
lemma biQuot_rQuot_lQuot: "biQuot x y A = rQuot y (lQuot x A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. biQuot x y A = rQuot y (lQuot x A)
[PROOF STEP]
unfolding biQuot_def rQuot_def lQuot_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. x # xs @ [y] \<in> A} = {xs. xs @ [y] \<in> {xs. x # xs \<in> A}}
[PROOF STEP]
by auto


[STATEMENT]
lemma Interp_as_UNION: "Interp C = (\<Union>D \<in> {D. D \<le> C}. production D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Interp C = \<Union> (production ` {D. D \<le> C})
[PROOF STEP]
unfolding Interp_def interp_def less_eq_multiset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (production ` {D. D < C}) \<union> production C = \<Union> (production ` {D. D < C \<or> D = C})
[PROOF STEP]
by fast


[STATEMENT]
lemma rel_list_all2_antisym:
  "\<lbrakk> (\<And>x y. \<lbrakk>(x,y) \<in> S; (y,x) \<in> T\<rbrakk> \<Longrightarrow> x = y);
     list_all2 (fun_of S) xs ys; list_all2 (fun_of T) ys xs \<rbrakk> \<Longrightarrow> xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. \<lbrakk>(x, y) \<in> S; (y, x) \<in> T\<rbrakk> \<Longrightarrow> x = y; list_all2 (fun_of S) xs ys; list_all2 (fun_of T) ys xs\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. \<lbrakk>(x, y) \<in> S; (y, x) \<in> T\<rbrakk> \<Longrightarrow> x = y; list_all2 (fun_of S) xs ys; list_all2 (fun_of T) ys xs\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
by (rule list_all2_antisym) auto


[STATEMENT]
lemma coeff_linear_power_neg[simp]:
  fixes a :: "'a::comm_ring_1"
  shows "coeff ([:a, -1:] ^ n) n = (-1)^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff ([:a, - (1::'a):] ^ n) n = (- (1::'a)) ^ n
[PROOF STEP]
apply (induct n, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. coeff ([:a, - (1::'a):] ^ n) n = (- (1::'a)) ^ n \<Longrightarrow> a * coeff ([:a, - (1::'a):] ^ n) (Suc n) = (0::'a)
[PROOF STEP]
apply (subst coeff_eq_0)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. coeff ([:a, - (1::'a):] ^ n) n = (- (1::'a)) ^ n \<Longrightarrow> degree ([:a, - (1::'a):] ^ n) < Suc n
 2. \<And>n. coeff ([:a, - (1::'a):] ^ n) n = (- (1::'a)) ^ n \<Longrightarrow> a * (0::'a) = (0::'a)
[PROOF STEP]
apply (auto intro: le_less_trans degree_power_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subst_word_append [simp]: "subst_word f (xs @ ys) = subst_word f xs @ subst_word f ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_word f (xs @ ys) = subst_word f xs @ subst_word f ys
[PROOF STEP]
by (simp add: subst_word_def)


[STATEMENT]
lemma less_oSuc0 [iff]: "(x < oSuc 0) = (x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x < oSuc 0) = (x = 0)
[PROOF STEP]
by (simp add: less_oSuc_eq_le)


[STATEMENT]
lemma pderiv_add: "pderiv (p + q) = pderiv p + pderiv q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (p + q) = pderiv p + pderiv q
[PROOF STEP]
by (rule poly_eqI) (simp add: coeff_pderiv algebra_simps)


[STATEMENT]
lemma dg_prod_2_Dom_vdomain[dg_cs_simps]:
  "\<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Dom\<rparr>) = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>
[PROOF STEP]
unfolding dg_prod_2_def dg_prod_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<lambda>f\<in>\<^sub>\<circ>\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>. \<lambda>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Dom\<rparr>\<lparr>f\<lparr>i\<rparr>\<rparr>) = (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>2\<^sub>\<nat>. (if i = []\<^sub>\<circ> \<Rightarrow> \<AA> | otherwise \<Rightarrow> \<BB>)\<lparr>Arr\<rparr>)
[PROOF STEP]
by simp


[STATEMENT]
lemma card_ord_of_nat [simp]: "card (elts (ord_of_nat m)) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (elts (ord_of_nat m)) = m
[PROOF STEP]
by (induction m) (auto simp: \<omega>_def finite_Ord_omega)


[STATEMENT]
lemma Arcsin_unique:
    "\<lbrakk>sin z = w; \<bar>Re z\<bar> < pi/2 \<or> (\<bar>Re z\<bar> = pi/2 \<and> Im z = 0)\<rbrakk> \<Longrightarrow> Arcsin w = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sin z = w; \<bar>Re z\<bar> < pi / 2 \<or> \<bar>Re z\<bar> = pi / 2 \<and> Im z = 0\<rbrakk> \<Longrightarrow> Arcsin w = z
[PROOF STEP]
by (metis Arcsin_sin)


[STATEMENT]
lemma uminus_one_gbinomial [simp]: "(- 1::int) gchoose k = (- 1) ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 gchoose k = (- 1) ^ k
[PROOF STEP]
by (simp add: gbinomial_int_binomial)


[STATEMENT]
lemma Pi_not_0[simp]: "Pi n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Pi n
[PROOF STEP]
using Pi_gr_1[of n]
[PROOF STATE]
proof (prove)
using this:
Suc 0 < Pi n

goal (1 subgoal):
 1. 0 < Pi n
[PROOF STEP]
by arith


[STATEMENT]
lemma set_of_subset_iff':
  "set_of a \<subseteq> set_of (b :: 'a :: linorder interval) \<longleftrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set_of a \<subseteq> set_of b) = (a \<le> b)
[PROOF STEP]
unfolding less_eq_interval_def set_of_subset_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lower b \<le> lower a \<and> upper a \<le> upper b) = (lower b \<le> lower a \<and> upper a \<le> upper b)
[PROOF STEP]
..


[STATEMENT]
lemma prod_mset_delta': "prod_mset (image_mset (\<lambda>x. if y = x then c else 1) A) = c ^ count A y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_mset {#if y = x then c else (1::'a). x \<in># A#} = c ^ count A y
[PROOF STEP]
by (induction A) simp_all


[STATEMENT]
lemma Re_Reals_divide: "r \<in> \<real> \<Longrightarrow> Re (r / z) = Re r * Re z / (norm z)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<in> \<real> \<Longrightarrow> Re (r / z) = Re r * Re z / (cmod z)\<^sup>2
[PROOF STEP]
by (simp add: Re_divide complex_is_Real_iff cmod_power2)


[STATEMENT]
lemma "Gale_Shapley
  [[3,0,1,2], [1,2,0,3], [1,3,2,0], [2,0,3,1]]
  [[3,0,2,1], [0,2,1,3], [0,1,2,3], [3,0,2,1]]
  = Some[0,1,0,1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gale_Shapley [[3, 0, 1, 2], [1, 2, 0, 3], [1, 3, 2, 0], [2, 0, 3, 1]] [[3, 0, 2, 1], [0, 2, 1, 3], [0, 1, 2, 3], [3, 0, 2, 1]] = Some [0, 1, 0, 1]
[PROOF STEP]
by eval


[STATEMENT]
lemma monic_Prod: "monic ((\<Prod>(a, i)\<in>as. a ^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (\<Prod>(a, i)\<in>as. a ^ i)
[PROOF STEP]
by (rule monic_prod, insert as_monic, auto intro: monic_power)


[STATEMENT]
lemma mult_comp_cls_val_process0:
  assumes "portfolio pf1"
  shows "\<forall>w. cls_val_process Mkt (qty_mult_comp pf1 qty) 0 w =
  ((cls_val_process Mkt pf1) 0 w) * (qty (Suc 0) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>w. cls_val_process Mkt (qty_mult_comp pf1 qty) 0 w = cls_val_process Mkt pf1 0 w * qty (Suc 0) w
[PROOF STEP]
unfolding cls_val_process_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>w. (if \<not> portfolio (qty_mult_comp pf1 qty) then \<lambda>n w. 0 else up_cl_proc Mkt (qty_mult_comp pf1 qty)) 0 w = (if \<not> portfolio pf1 then \<lambda>n w. 0 else up_cl_proc Mkt pf1) 0 w * qty (Suc 0) w
[PROOF STEP]
by (simp add: assms mult_comp_portfolio mult_comp_val_process)


[STATEMENT]
lemma monic_0_iff: "(monic p = 0) \<longleftrightarrow> (p = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (monic p = 0) = (p = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. monic p = 0 \<Longrightarrow> p = 0
 2. p = 0 \<Longrightarrow> monic p = 0
[PROOF STEP]
assume "monic p = 0"
[PROOF STATE]
proof (state)
this:
monic p = 0

goal (2 subgoals):
 1. monic p = 0 \<Longrightarrow> p = 0
 2. p = 0 \<Longrightarrow> monic p = 0
[PROOF STEP]
show "p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "p \<noteq> 0"
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "lookup (monic p) (lt p) = 1"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. lookup (monic p) (lt p) = (1::'b)
[PROOF STEP]
by (rule lookup_monic_lt)
[PROOF STATE]
proof (state)
this:
lookup (monic p) (lt p) = (1::'b)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
with \<open>monic p = 0\<close>
[PROOF STATE]
proof (chain)
picking this:
monic p = 0
lookup (monic p) (lt p) = (1::'b)
[PROOF STEP]
have "lookup 0 (lt p) = (1::'b)"
[PROOF STATE]
proof (prove)
using this:
monic p = 0
lookup (monic p) (lt p) = (1::'b)

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

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
lookup 0 (lt p) = (1::'b)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p = 0

goal (1 subgoal):
 1. p = 0 \<Longrightarrow> monic p = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = 0 \<Longrightarrow> monic p = 0
[PROOF STEP]
assume p0: "p = 0"
[PROOF STATE]
proof (state)
this:
p = 0

goal (1 subgoal):
 1. p = 0 \<Longrightarrow> monic p = 0
[PROOF STEP]
show "monic p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic p = 0
[PROOF STEP]
unfolding p0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic 0 = 0
[PROOF STEP]
by (fact monic_0)
[PROOF STATE]
proof (state)
this:
monic p = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma takeWhile_prefix: "\<exists>ys. takeWhile P xs @ ys = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ys. takeWhile P xs @ ys = xs
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>ys. takeWhile P [] @ ys = []
 2. \<And>a xs. \<exists>ys. takeWhile P xs @ ys = xs \<Longrightarrow> \<exists>ys. takeWhile P (a # xs) @ ys = a # xs
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma diagvector_mult_right: "A ** diagvector x = (\<chi> i j. A $ i $ j * x j)" (is "?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A ** diagvector x = (\<chi>i j. A $h i $h j * x j)
[PROOF STEP]
unfolding vec_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i ia. (A ** diagvector x) $h i $h ia = (\<chi>i j. A $h i $h j * x j) $h i $h ia
[PROOF STEP]
proof (intro allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i ia. (A ** diagvector x) $h i $h ia = (\<chi>i j. A $h i $h j * x j) $h i $h ia
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i ia. (A ** diagvector x) $h i $h ia = (\<chi>i j. A $h i $h j * x j) $h i $h ia
[PROOF STEP]
show "?A $h i $h j = ?B $h i $h j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A ** diagvector x) $h i $h j = (\<chi>i j. A $h i $h j * x j) $h i $h j
[PROOF STEP]
unfolding map_vector_def diagvector_def matrix_matrix_mult_def vec_lambda_beta
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>UNIV. A $h i $h k * (if k = j then x k else (0::'a))) = A $h i $h j * x j
[PROOF STEP]
by (subst sum.remove[of _ j], auto)
[PROOF STATE]
proof (state)
this:
(A ** diagvector x) $h i $h j = (\<chi>i j. A $h i $h j * x j) $h i $h j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_XDp_foldr_nth [simp]: "foldr (\<lambda>c r. fps_XDp c \<circ> r) cs (\<lambda>c. fps_XDp c a) c0 $ n =
    foldr (\<lambda>c r. (c + of_nat n) * r) cs (c0 + of_nat n) * a$n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>c. (\<circ>) (fps_XDp c)) cs (\<lambda>c. fps_XDp c a) c0 $ n = foldr (\<lambda>c. (*) (c + of_nat n)) cs (c0 + of_nat n) * a $ n
[PROOF STEP]
by (induct cs arbitrary: c0) (simp_all add: algebra_simps)


[STATEMENT]
lemma chordal_circle_det_positive:
  fixes x y :: real
  assumes "x * y < 0"
  shows "x / (x - y) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x / (x - y)
[PROOF STEP]
proof (cases "x > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 0 < x / (x - y)
 2. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < x

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 0 < x / (x - y)
 2. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
hence "y < 0"
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. y < 0
[PROOF STEP]
using \<open>x * y < 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x
x * y < 0

goal (1 subgoal):
 1. y < 0
[PROOF STEP]
by (smt mult_nonneg_nonneg)
[PROOF STATE]
proof (state)
this:
y < 0

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 0 < x / (x - y)
 2. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
have "x - y > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x - y
[PROOF STEP]
using \<open>x > 0\<close> \<open>y < 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x
y < 0

goal (1 subgoal):
 1. 0 < x - y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < x - y

goal (2 subgoals):
 1. 0 < x \<Longrightarrow> 0 < x / (x - y)
 2. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < x - y

goal (1 subgoal):
 1. 0 < x / (x - y)
[PROOF STEP]
using \<open>x > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x - y
0 < x

goal (1 subgoal):
 1. 0 < x / (x - y)
[PROOF STEP]
by (metis zero_less_divide_iff)
[PROOF STATE]
proof (state)
this:
0 < x / (x - y)

goal (1 subgoal):
 1. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < x

goal (1 subgoal):
 1. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
hence *: "y > 0 \<and> x < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < x

goal (1 subgoal):
 1. 0 < y \<and> x < 0
[PROOF STEP]
using \<open>x * y < 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < x
x * y < 0

goal (1 subgoal):
 1. 0 < y \<and> x < 0
[PROOF STEP]
using mult_nonpos_nonpos[of x y]
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < x
x * y < 0
\<lbrakk>x \<le> 0; y \<le> 0\<rbrakk> \<Longrightarrow> 0 \<le> x * y

goal (1 subgoal):
 1. 0 < y \<and> x < 0
[PROOF STEP]
by (cases "x=0") force+
[PROOF STATE]
proof (state)
this:
0 < y \<and> x < 0

goal (1 subgoal):
 1. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
have "x - y < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - y < 0
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
0 < y \<and> x < 0

goal (1 subgoal):
 1. x - y < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x - y < 0

goal (1 subgoal):
 1. \<not> 0 < x \<Longrightarrow> 0 < x / (x - y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x - y < 0

goal (1 subgoal):
 1. 0 < x / (x - y)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
x - y < 0
0 < y \<and> x < 0

goal (1 subgoal):
 1. 0 < x / (x - y)
[PROOF STEP]
by (metis zero_less_divide_iff)
[PROOF STATE]
proof (state)
this:
0 < x / (x - y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_equivalence:
  fixes A::"real^'n^'m"
  shows "((transpose A) *v (A *v x) = 0) \<longleftrightarrow> (A *v x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Finite_Cartesian_Product.transpose A *v (A *v x) = 0) = (A *v x = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Finite_Cartesian_Product.transpose A *v (A *v x) = 0) = (A *v x = 0)
[PROOF STEP]
have "A *v x = 0" if "transpose A *v (A *v x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
have eq: "(x v* (transpose A)) = (A *v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x v* Finite_Cartesian_Product.transpose A = A *v x
[PROOF STEP]
by (metis transpose_transpose transpose_vector)
[PROOF STATE]
proof (state)
this:
x v* Finite_Cartesian_Product.transpose A = A *v x

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
have eq_0: "0 = (x v* (transpose A)) * (A *v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = x v* Finite_Cartesian_Product.transpose A * (A *v x)
[PROOF STEP]
by auto (metis that dot_lmul_matrix inner_eq_zero_iff inner_zero_left mult_not_zero transpose_vector)
[PROOF STATE]
proof (state)
this:
0 = x v* Finite_Cartesian_Product.transpose A * (A *v x)

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
hence "0 = norm ((x v* (transpose A)) * (A *v x))"
[PROOF STATE]
proof (prove)
using this:
0 = x v* Finite_Cartesian_Product.transpose A * (A *v x)

goal (1 subgoal):
 1. 0 = norm (x v* Finite_Cartesian_Product.transpose A * (A *v x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 = norm (x v* Finite_Cartesian_Product.transpose A * (A *v x))

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = norm (x v* Finite_Cartesian_Product.transpose A * (A *v x))

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
have "... = norm ((A *v x)*(A *v x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x v* Finite_Cartesian_Product.transpose A * (A *v x)) = norm (A *v x * (A *v x))
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (A *v x * (A *v x)) = norm (A *v x * (A *v x))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
norm (x v* Finite_Cartesian_Product.transpose A * (A *v x)) = norm (A *v x * (A *v x))

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (x v* Finite_Cartesian_Product.transpose A * (A *v x)) = norm (A *v x * (A *v x))

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
have "... = norm ((A *v x) \<bullet> (A *v x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (A *v x * (A *v x)) = norm ((A *v x) \<bullet> (A *v x))
[PROOF STEP]
by (metis eq_0 that dot_lmul_matrix eq inner_zero_right norm_zero)
[PROOF STATE]
proof (state)
this:
norm (A *v x * (A *v x)) = norm ((A *v x) \<bullet> (A *v x))

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

goal (1 subgoal):
 1. A *v x = 0
[PROOF STEP]
have "... = norm (A *v x)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((A *v x) \<bullet> (A *v x)) = (norm (A *v x))\<^sup>2
[PROOF STEP]
unfolding norm_mult_vec[of "(A *v x)"] power2_eq_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (A *v x) * norm (A *v x) = norm (A *v x) * norm (A *v x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
norm ((A *v x) \<bullet> (A *v x)) = (norm (A *v x))\<^sup>2

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Finite_Cartesian_Product.transpose A *v (A *v x) = 0 \<Longrightarrow> A *v x = 0

goal (1 subgoal):
 1. (Finite_Cartesian_Product.transpose A *v (A *v x) = 0) = (A *v x = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Finite_Cartesian_Product.transpose A *v (A *v x) = 0 \<Longrightarrow> A *v x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Finite_Cartesian_Product.transpose A *v (A *v x) = 0 \<Longrightarrow> A *v x = 0

goal (1 subgoal):
 1. (Finite_Cartesian_Product.transpose A *v (A *v x) = 0) = (A *v x = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Finite_Cartesian_Product.transpose A *v (A *v x) = 0) = (A *v x = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_segment_commute: "closed_segment a b = closed_segment b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b = closed_segment b a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed_segment a b = closed_segment b a
[PROOF STEP]
have "{a, b} = {b, a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a, b} = {b, a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a, b} = {b, a}

goal (1 subgoal):
 1. closed_segment a b = closed_segment b a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{a, b} = {b, a}

goal (1 subgoal):
 1. closed_segment a b = closed_segment b a
[PROOF STEP]
by (simp add: segment_convex_hull)
[PROOF STATE]
proof (state)
this:
closed_segment a b = closed_segment b a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l8_20_2:
  assumes "P Midpoint C' D" and
    "A Midpoint C' C" and
    "B Midpoint D C" and
    "B \<noteq> C"
  shows "A \<noteq> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> P
[PROOF STEP]
using assms(1) assms(2) assms(3) assms(4) l7_3 symmetric_point_uniqueness
[PROOF STATE]
proof (prove)
using this:
P Midpoint C' D
A Midpoint C' C
B Midpoint D C
B \<noteq> C
?M Midpoint ?A ?A \<Longrightarrow> ?M = ?A
\<lbrakk>?P Midpoint ?A ?P1.0; ?P Midpoint ?A ?P2.0\<rbrakk> \<Longrightarrow> ?P1.0 = ?P2.0

goal (1 subgoal):
 1. A \<noteq> P
[PROOF STEP]
by blast


[STATEMENT]
lemma degree_pdevs_of_list_le_length[intro, simp]: "degree (pdevs_of_list xs) \<le> length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (pdevs_of_list xs) \<le> length xs
[PROOF STEP]
by (metis less_irrefl_nat le_less_linear less_degree_pdevs_of_list_imp_less_length)


[STATEMENT]
lemma geodesic_segment_dist_le:
  assumes "geodesic_segment_between G x y" "a \<in> G" "b \<in> G"
  shows "dist a b \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist a b \<le> dist x y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist a b \<le> dist x y
[PROOF STEP]
obtain g where g: "g 0 = x" "g (dist x y) = y" "isometry_on {0..dist x y} g" "G = g`{0..dist x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g 0 = x; g (dist x y) = y; isometry_on {0..dist x y} g; G = g ` {0..dist x y}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson \<open>geodesic_segment_between G x y\<close> geodesic_segment_between_def)
[PROOF STATE]
proof (state)
this:
g 0 = x
g (dist x y) = y
isometry_on {0..dist x y} g
G = g ` {0..dist x y}

goal (1 subgoal):
 1. dist a b \<le> dist x y
[PROOF STEP]
obtain s t where st: "s \<in> {0..dist x y}" "t \<in> {0..dist x y}" "a = g s" "b = g t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s t. \<lbrakk>s \<in> {0..dist x y}; t \<in> {0..dist x y}; a = g s; b = g t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using g(4) assms
[PROOF STATE]
proof (prove)
using this:
G = g ` {0..dist x y}
geodesic_segment_between G x y
a \<in> G
b \<in> G

goal (1 subgoal):
 1. (\<And>s t. \<lbrakk>s \<in> {0..dist x y}; t \<in> {0..dist x y}; a = g s; b = g t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s \<in> {0..dist x y}
t \<in> {0..dist x y}
a = g s
b = g t

goal (1 subgoal):
 1. dist a b \<le> dist x y
[PROOF STEP]
have "dist a b = abs(s-t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist a b = \<bar>s - t\<bar>
[PROOF STEP]
using isometry_onD[OF g(3) st(1) st(2)]
[PROOF STATE]
proof (prove)
using this:
dist (g s) (g t) = dist s t

goal (1 subgoal):
 1. dist a b = \<bar>s - t\<bar>
[PROOF STEP]
unfolding st(3) st(4) dist_real_def
[PROOF STATE]
proof (prove)
using this:
dist (g s) (g t) = \<bar>s - t\<bar>

goal (1 subgoal):
 1. dist (g s) (g t) = \<bar>s - t\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist a b = \<bar>s - t\<bar>

goal (1 subgoal):
 1. dist a b \<le> dist x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist a b = \<bar>s - t\<bar>
[PROOF STEP]
show "dist a b \<le> dist x y"
[PROOF STATE]
proof (prove)
using this:
dist a b = \<bar>s - t\<bar>

goal (1 subgoal):
 1. dist a b \<le> dist x y
[PROOF STEP]
using st(1) st(2)
[PROOF STATE]
proof (prove)
using this:
dist a b = \<bar>s - t\<bar>
s \<in> {0..dist x y}
t \<in> {0..dist x y}

goal (1 subgoal):
 1. dist a b \<le> dist x y
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
dist a b = \<bar>s - t\<bar>
s \<in> {0..dist x y}
t \<in> {0..dist x y}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_find_indices :
  "sorted (find_indices P xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (find_indices P xs)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sorted (find_indices P [])
 2. \<And>a xs. sorted (find_indices P xs) \<Longrightarrow> sorted (find_indices P (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. sorted (find_indices P [])
 2. \<And>a xs. sorted (find_indices P xs) \<Longrightarrow> sorted (find_indices P (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted (find_indices P [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sorted (find_indices P [])

goal (1 subgoal):
 1. \<And>a xs. sorted (find_indices P xs) \<Longrightarrow> sorted (find_indices P (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. sorted (find_indices P xs) \<Longrightarrow> sorted (find_indices P (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
sorted (find_indices P xs)

goal (1 subgoal):
 1. \<And>a xs. sorted (find_indices P xs) \<Longrightarrow> sorted (find_indices P (a # xs))
[PROOF STEP]
from sorted_map_suc[OF this]
[PROOF STATE]
proof (chain)
picking this:
sorted (map Suc (find_indices P xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sorted (map Suc (find_indices P xs))

goal (1 subgoal):
 1. sorted (find_indices P (x # xs))
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
sorted (find_indices P (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_blocks_const_inter:
  assumes "bl \<in># \<B>"
  assumes "multiplicity bl > 1"
  assumes "\<b> \<ge> 2"
  shows "\<m> = card bl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<m> = card bl
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<m> \<noteq> card bl \<Longrightarrow> False
[PROOF STEP]
assume "\<m> \<noteq> card bl"
[PROOF STATE]
proof (state)
this:
\<m> \<noteq> card bl

goal (1 subgoal):
 1. \<m> \<noteq> card bl \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<m> \<noteq> card bl
[PROOF STEP]
have "\<m> < card bl"
[PROOF STATE]
proof (prove)
using this:
\<m> \<noteq> card bl

goal (1 subgoal):
 1. \<m> < card bl
[PROOF STEP]
using inter_num_le_block_size assms
[PROOF STATE]
proof (prove)
using this:
\<m> \<noteq> card bl
\<lbrakk>?bl \<in># \<B>; 2 \<le> \<b>\<rbrakk> \<Longrightarrow> \<m> \<le> card ?bl
bl \<in># \<B>
1 < multiplicity bl
2 \<le> \<b>

goal (1 subgoal):
 1. \<m> < card bl
[PROOF STEP]
using nat_less_le
[PROOF STATE]
proof (prove)
using this:
\<m> \<noteq> card bl
\<lbrakk>?bl \<in># \<B>; 2 \<le> \<b>\<rbrakk> \<Longrightarrow> \<m> \<le> card ?bl
bl \<in># \<B>
1 < multiplicity bl
2 \<le> \<b>
(?m < ?n) = (?m \<le> ?n \<and> ?m \<noteq> ?n)

goal (1 subgoal):
 1. \<m> < card bl
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<m> < card bl

goal (1 subgoal):
 1. \<m> \<noteq> card bl \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<m> < card bl
[PROOF STEP]
have "multiplicity bl = 1"
[PROOF STATE]
proof (prove)
using this:
\<m> < card bl

goal (1 subgoal):
 1. multiplicity bl = 1
[PROOF STEP]
using const_inter_multiplicity_one assms
[PROOF STATE]
proof (prove)
using this:
\<m> < card bl
\<lbrakk>?bl \<in># \<B>; \<m> < card ?bl\<rbrakk> \<Longrightarrow> multiplicity ?bl = 1
bl \<in># \<B>
1 < multiplicity bl
2 \<le> \<b>

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

goal (1 subgoal):
 1. \<m> \<noteq> card bl \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
multiplicity bl = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
multiplicity bl = 1
1 < multiplicity bl

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reduction_pres_fv: fixes e::exp assumes r: "e \<longrightarrow>* e'" and fv: "FV e = {}" shows "FV e' = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FV e' = {}
[PROOF STEP]
using r fv
[PROOF STATE]
proof (prove)
using this:
e \<longrightarrow>* e'
FV e = {}

goal (1 subgoal):
 1. FV e' = {}
[PROOF STEP]
proof (induction)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. FV e = {} \<Longrightarrow> FV e = {}
 2. \<And>e1 e2 e3. \<lbrakk>e1 \<longrightarrow> e2; e2 \<longrightarrow>* e3; FV e2 = {} \<Longrightarrow> FV e3 = {}; FV e1 = {}\<rbrakk> \<Longrightarrow> FV e3 = {}
[PROOF STEP]
case (ms_nil e)
[PROOF STATE]
proof (state)
this:
FV e = {}

goal (2 subgoals):
 1. \<And>e. FV e = {} \<Longrightarrow> FV e = {}
 2. \<And>e1 e2 e3. \<lbrakk>e1 \<longrightarrow> e2; e2 \<longrightarrow>* e3; FV e2 = {} \<Longrightarrow> FV e3 = {}; FV e1 = {}\<rbrakk> \<Longrightarrow> FV e3 = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FV e = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
FV e = {}

goal (1 subgoal):
 1. FV e = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
FV e = {}

goal (1 subgoal):
 1. \<And>e1 e2 e3. \<lbrakk>e1 \<longrightarrow> e2; e2 \<longrightarrow>* e3; FV e2 = {} \<Longrightarrow> FV e3 = {}; FV e1 = {}\<rbrakk> \<Longrightarrow> FV e3 = {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e1 e2 e3. \<lbrakk>e1 \<longrightarrow> e2; e2 \<longrightarrow>* e3; FV e2 = {} \<Longrightarrow> FV e3 = {}; FV e1 = {}\<rbrakk> \<Longrightarrow> FV e3 = {}
[PROOF STEP]
case (ms_cons e1 e2 e3)
[PROOF STATE]
proof (state)
this:
e1 \<longrightarrow> e2
e2 \<longrightarrow>* e3
FV e2 = {} \<Longrightarrow> FV e3 = {}
FV e1 = {}

goal (1 subgoal):
 1. \<And>e1 e2 e3. \<lbrakk>e1 \<longrightarrow> e2; e2 \<longrightarrow>* e3; FV e2 = {} \<Longrightarrow> FV e3 = {}; FV e1 = {}\<rbrakk> \<Longrightarrow> FV e3 = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e1 \<longrightarrow> e2
e2 \<longrightarrow>* e3
FV e2 = {} \<Longrightarrow> FV e3 = {}
FV e1 = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
e1 \<longrightarrow> e2
e2 \<longrightarrow>* e3
FV e2 = {} \<Longrightarrow> FV e3 = {}
FV e1 = {}

goal (1 subgoal):
 1. FV e3 = {}
[PROOF STEP]
using red_pres_fv
[PROOF STATE]
proof (prove)
using this:
e1 \<longrightarrow> e2
e2 \<longrightarrow>* e3
FV e2 = {} \<Longrightarrow> FV e3 = {}
FV e1 = {}
\<lbrakk>?e \<longrightarrow> ?e'; FV ?e = {}\<rbrakk> \<Longrightarrow> FV ?e' = {}

goal (1 subgoal):
 1. FV e3 = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FV e3 = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_Times: "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
have "S \<times> T = (fst -` S) \<inter> (snd -` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<times> T = fst -` S \<inter> snd -` T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<times> T = fst -` S \<inter> snd -` T

goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<times> T = fst -` S \<inter> snd -` T
[PROOF STEP]
show "closed S \<Longrightarrow> closed T \<Longrightarrow> closed (S \<times> T)"
[PROOF STATE]
proof (prove)
using this:
S \<times> T = fst -` S \<inter> snd -` T

goal (1 subgoal):
 1. \<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)
[PROOF STEP]
by (simp add: closed_vimage_fst closed_vimage_snd closed_Int)
[PROOF STATE]
proof (state)
this:
\<lbrakk>closed S; closed T\<rbrakk> \<Longrightarrow> closed (S \<times> T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vrange_small[simp]: "small {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. small {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
have ss: "{b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> vsnd ` elts r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> vsnd ` elts r
[PROOF STEP]
using image_iff
[PROOF STATE]
proof (prove)
using this:
(?z \<in> ?f ` ?A) = (\<exists>x\<in>?A. ?z = ?f x)

goal (1 subgoal):
 1. {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> vsnd ` elts r
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r} \<subseteq> vsnd ` elts r

goal (1 subgoal):
 1. small {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
have small: "small (vsnd ` elts r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small (vsnd ` elts r)
[PROOF STEP]
by (rule replacement) simp
[PROOF STATE]
proof (state)
this:
small (vsnd ` elts r)

goal (1 subgoal):
 1. small {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. small {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
by (rule smaller_than_small, rule small, rule ss)
[PROOF STATE]
proof (state)
this:
small {b. \<exists>a. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_mtx2: "(1::2 sq_mtx) = diag2 1 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = diag2 1 1
[PROOF STEP]
apply(subst sq_mtx_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. 1 $$ i $ j = diag2 1 1 $$ i $ j
[PROOF STEP]
using exhaust_2
[PROOF STATE]
proof (prove)
using this:
?x = 1 \<or> ?x = 2

goal (1 subgoal):
 1. \<forall>i j. 1 $$ i $ j = diag2 1 1 $$ i $ j
[PROOF STEP]
by force


[STATEMENT]
theorem exprel_imp_eq_freevars: "U \<sim> V \<Longrightarrow> freevars U = freevars V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<sim> V \<Longrightarrow> freevars U = freevars V
[PROOF STEP]
proof (induct set: exprel)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>X Y Z. freevars (PLUS X (PLUS Y Z)) = freevars (PLUS (PLUS X Y) Z)
 2. \<And>N. freevars (VAR N) = freevars (VAR N)
 3. \<And>X X' Y Y'. \<lbrakk>X \<sim> X'; freevars X = freevars X'; Y \<sim> Y'; freevars Y = freevars Y'\<rbrakk> \<Longrightarrow> freevars (PLUS X Y) = freevars (PLUS X' Y')
 4. \<And>Xs Xs' F. (Xs, Xs') \<in> listrel (exprel \<inter> {(b, a). freevars b = freevars a}) \<Longrightarrow> freevars (FNCALL F Xs) = freevars (FNCALL F Xs')
 5. \<And>X Y. \<lbrakk>X \<sim> Y; freevars X = freevars Y\<rbrakk> \<Longrightarrow> freevars Y = freevars X
 6. \<And>X Y Z. \<lbrakk>X \<sim> Y; freevars X = freevars Y; Y \<sim> Z; freevars Y = freevars Z\<rbrakk> \<Longrightarrow> freevars X = freevars Z
[PROOF STEP]
case (FNCALL Xs Xs' F)
[PROOF STATE]
proof (state)
this:
(Xs, Xs') \<in> listrel (exprel \<inter> {(b, a). freevars b = freevars a})

goal (6 subgoals):
 1. \<And>X Y Z. freevars (PLUS X (PLUS Y Z)) = freevars (PLUS (PLUS X Y) Z)
 2. \<And>N. freevars (VAR N) = freevars (VAR N)
 3. \<And>X X' Y Y'. \<lbrakk>X \<sim> X'; freevars X = freevars X'; Y \<sim> Y'; freevars Y = freevars Y'\<rbrakk> \<Longrightarrow> freevars (PLUS X Y) = freevars (PLUS X' Y')
 4. \<And>Xs Xs' F. (Xs, Xs') \<in> listrel (exprel \<inter> {(b, a). freevars b = freevars a}) \<Longrightarrow> freevars (FNCALL F Xs) = freevars (FNCALL F Xs')
 5. \<And>X Y. \<lbrakk>X \<sim> Y; freevars X = freevars Y\<rbrakk> \<Longrightarrow> freevars Y = freevars X
 6. \<And>X Y Z. \<lbrakk>X \<sim> Y; freevars X = freevars Y; Y \<sim> Z; freevars Y = freevars Z\<rbrakk> \<Longrightarrow> freevars X = freevars Z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(Xs, Xs') \<in> listrel (exprel \<inter> {(b, a). freevars b = freevars a})
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(Xs, Xs') \<in> listrel (exprel \<inter> {(b, a). freevars b = freevars a})

goal (1 subgoal):
 1. freevars (FNCALL F Xs) = freevars (FNCALL F Xs')
[PROOF STEP]
by (induct rule: listrel.induct) auto
[PROOF STATE]
proof (state)
this:
freevars (FNCALL F Xs) = freevars (FNCALL F Xs')

goal (5 subgoals):
 1. \<And>X Y Z. freevars (PLUS X (PLUS Y Z)) = freevars (PLUS (PLUS X Y) Z)
 2. \<And>N. freevars (VAR N) = freevars (VAR N)
 3. \<And>X X' Y Y'. \<lbrakk>X \<sim> X'; freevars X = freevars X'; Y \<sim> Y'; freevars Y = freevars Y'\<rbrakk> \<Longrightarrow> freevars (PLUS X Y) = freevars (PLUS X' Y')
 4. \<And>X Y. \<lbrakk>X \<sim> Y; freevars X = freevars Y\<rbrakk> \<Longrightarrow> freevars Y = freevars X
 5. \<And>X Y Z. \<lbrakk>X \<sim> Y; freevars X = freevars Y; Y \<sim> Z; freevars Y = freevars Z\<rbrakk> \<Longrightarrow> freevars X = freevars Z
[PROOF STEP]
qed (simp_all add: Un_assoc)