[STATEMENT]
lemma partitions_parts_bounded:
  assumes "p partitions n"
  shows "sum p {..n} \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
assume "i \<le> n"
[PROOF STATE]
proof (state)
this:
i \<le> n

goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p partitions n
[PROOF STEP]
have "p i \<le> p i * i"
[PROOF STATE]
proof (prove)
using this:
p partitions n

goal (1 subgoal):
 1. p i \<le> p i * i
[PROOF STEP]
by (auto elim!: partitionsE)
[PROOF STATE]
proof (state)
this:
p i \<le> p i * i

goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 \<le> n \<Longrightarrow> p ?i2 \<le> p ?i2 * ?i2

goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
?i2 \<le> n \<Longrightarrow> p ?i2 \<le> p ?i2 * ?i2
[PROOF STEP]
have "sum p {..n} \<le> (\<Sum>i\<le>n. p i * i)"
[PROOF STATE]
proof (prove)
using this:
?i2 \<le> n \<Longrightarrow> p ?i2 \<le> p ?i2 * ?i2

goal (1 subgoal):
 1. sum p {..n} \<le> (\<Sum>i\<le>n. p i * i)
[PROOF STEP]
by (auto intro: sum_mono)
[PROOF STATE]
proof (state)
this:
sum p {..n} \<le> (\<Sum>i\<le>n. p i * i)

goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum p {..n} \<le> (\<Sum>i\<le>n. p i * i)

goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p partitions n
[PROOF STEP]
have n: "(\<Sum>i\<le>n. p i * i) = n"
[PROOF STATE]
proof (prove)
using this:
p partitions n

goal (1 subgoal):
 1. (\<Sum>i\<le>n. p i * i) = n
[PROOF STEP]
by (auto elim!: partitionsE)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. p i * i) = n

goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum p {..n} \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum p {..n} \<le> n

goal (1 subgoal):
 1. sum p {..n} \<le> n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum p {..n} \<le> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cscalar_prod_is_scalar_prod[simp]: "(x :: 'a :: trivial_conjugatable_ordered_field vec) \<bullet>c y = x \<bullet> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet>c y = x \<bullet> y
[PROOF STEP]
unfolding conjugate_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet>c y = x \<bullet> y
[PROOF STEP]
by (rule arg_cong[of _ _ "scalar_prod x"], auto)


[STATEMENT]
lemma content_times_primitive_part [simp]: "smult (content p) (primitive_part p) = p"
  for p :: "'a :: semiring_gcd poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (content p) (primitive_part p) = p
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> smult (content p) (primitive_part p) = p
 2. p \<noteq> 0 \<Longrightarrow> smult (content p) (primitive_part p) = p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> smult (content p) (primitive_part p) = p
 2. p \<noteq> 0 \<Longrightarrow> smult (content p) (primitive_part p) = p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. smult (content p) (primitive_part p) = p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
smult (content p) (primitive_part p) = p

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> smult (content p) (primitive_part p) = p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> smult (content p) (primitive_part p) = p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> smult (content p) (primitive_part p) = p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. smult (content p) (primitive_part p) = p
[PROOF STEP]
unfolding primitive_part_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. smult (content p) (map_poly (\<lambda>x. x div content p) p) = p
[PROOF STEP]
by (auto simp: smult_conv_map_poly map_poly_map_poly o_def content_dvd_coeffs
      intro: map_poly_idI)
[PROOF STATE]
proof (state)
this:
smult (content p) (primitive_part p) = p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma graph_ranD: "x \<in> graph m \<Longrightarrow> snd x \<in> ran m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> graph m \<Longrightarrow> snd x \<in> ran m
[PROOF STEP]
using snd_graph_ran
[PROOF STATE]
proof (prove)
using this:
snd ` graph ?m = ran ?m

goal (1 subgoal):
 1. x \<in> graph m \<Longrightarrow> snd x \<in> ran m
[PROOF STEP]
by (metis imageI)


[STATEMENT]
lemma bigo_const3: "(c::'a::linordered_field) \<noteq> 0 \<Longrightarrow> (\<lambda>x. 1) \<in> O(\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> (\<lambda>x. 1::'a) \<in> O(\<lambda>x. c)
[PROOF STEP]
apply (simp add: bigo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> \<exists>ca. (1::'a) \<le> ca * \<bar>c\<bar>
[PROOF STEP]
by (metis abs_eq_0 left_inverse order_refl)


[STATEMENT]
lemma swapidseq_cases: "swapidseq n p \<longleftrightarrow>
    n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swapidseq n p = (n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. swapidseq n p \<Longrightarrow> n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b)
 2. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply (erule swapidseq.cases[of n p])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>n = 0; p = id\<rbrakk> \<Longrightarrow> n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b)
 2. \<And>na pa a b. \<lbrakk>n = Suc na; p = Transposition.transpose a b \<circ> pa; swapidseq na pa; a \<noteq> b\<rbrakk> \<Longrightarrow> n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b)
 3. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>na pa a b. \<lbrakk>n = Suc na; p = Transposition.transpose a b \<circ> pa; swapidseq na pa; a \<noteq> b\<rbrakk> \<Longrightarrow> n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b)
 2. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply (rule disjI2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>na pa a b. \<lbrakk>n = Suc na; p = Transposition.transpose a b \<circ> pa; swapidseq na pa; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b
 2. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply (rule_tac x= "a" in exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>na pa a b. \<lbrakk>n = Suc na; p = Transposition.transpose a b \<circ> pa; swapidseq na pa; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b
 2. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply (rule_tac x= "b" in exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>na pa a b. \<lbrakk>n = Suc na; p = Transposition.transpose a b \<circ> pa; swapidseq na pa; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b
 2. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply (rule_tac x= "pa" in exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>na pa a b. \<lbrakk>n = Suc na; p = Transposition.transpose a b \<circ> pa; swapidseq na pa; a \<noteq> b\<rbrakk> \<Longrightarrow> \<exists>m. n = Suc m \<and> p = Transposition.transpose a b \<circ> pa \<and> swapidseq m pa \<and> a \<noteq> b
 2. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply (rule_tac x= "na" in exI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>na pa a b. \<lbrakk>n = Suc na; p = Transposition.transpose a b \<circ> pa; swapidseq na pa; a \<noteq> b\<rbrakk> \<Longrightarrow> n = Suc na \<and> p = Transposition.transpose a b \<circ> pa \<and> swapidseq na pa \<and> a \<noteq> b
 2. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = 0 \<and> p = id \<or> (\<exists>a b q m. n = Suc m \<and> p = Transposition.transpose a b \<circ> q \<and> swapidseq m q \<and> a \<noteq> b) \<Longrightarrow> swapidseq n p
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b q m. \<lbrakk>n = Suc m; p = Transposition.transpose a b \<circ> q; swapidseq m q; a \<noteq> b\<rbrakk> \<Longrightarrow> swapidseq (Suc m) (Transposition.transpose a b \<circ> q)
[PROOF STEP]
apply (rule comp_Suc, simp_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vec_eq:
  assumes wf1: "vec n v1"
  and wf2: "vec n v2"
  shows "(v1 = v2) = (\<forall> i < n. v1 ! i = v2 ! i)" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v1 = v2) = (\<forall>i<n. v1 ! i = v2 ! i)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v1 = v2 \<Longrightarrow> \<forall>i<n. v1 ! i = v2 ! i
 2. \<forall>i<n. v1 ! i = v2 ! i \<Longrightarrow> v1 = v2
[PROOF STEP]
assume ?l
[PROOF STATE]
proof (state)
this:
v1 = v2

goal (2 subgoals):
 1. v1 = v2 \<Longrightarrow> \<forall>i<n. v1 ! i = v2 ! i
 2. \<forall>i<n. v1 ! i = v2 ! i \<Longrightarrow> v1 = v2
[PROOF STEP]
thus ?r
[PROOF STATE]
proof (prove)
using this:
v1 = v2

goal (1 subgoal):
 1. \<forall>i<n. v1 ! i = v2 ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<n. v1 ! i = v2 ! i

goal (1 subgoal):
 1. \<forall>i<n. v1 ! i = v2 ! i \<Longrightarrow> v1 = v2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<n. v1 ! i = v2 ! i \<Longrightarrow> v1 = v2
[PROOF STEP]
assume ?r
[PROOF STATE]
proof (state)
this:
\<forall>i<n. v1 ! i = v2 ! i

goal (1 subgoal):
 1. \<forall>i<n. v1 ! i = v2 ! i \<Longrightarrow> v1 = v2
[PROOF STEP]
show ?l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v1 = v2
[PROOF STEP]
proof (rule nth_equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length v1 = length v2
 2. \<And>i. i < length v1 \<Longrightarrow> v1 ! i = v2 ! i
[PROOF STEP]
from wf1 wf2
[PROOF STATE]
proof (chain)
picking this:
vec n v1
vec n v2
[PROOF STEP]
show "length v1 = length v2"
[PROOF STATE]
proof (prove)
using this:
vec n v1
vec n v2

goal (1 subgoal):
 1. length v1 = length v2
[PROOF STEP]
unfolding vec_def
[PROOF STATE]
proof (prove)
using this:
length v1 = n
length v2 = n

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

goal (1 subgoal):
 1. \<And>i. i < length v1 \<Longrightarrow> v1 ! i = v2 ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length v1 \<Longrightarrow> v1 ! i = v2 ! i
[PROOF STEP]
from \<open>?r\<close> wf1
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<n. v1 ! i = v2 ! i
vec n v1
[PROOF STEP]
show "\<And>i. i < length v1 \<Longrightarrow> v1 ! i = v2 ! i"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<n. v1 ! i = v2 ! i
vec n v1

goal (1 subgoal):
 1. \<And>i. i < length v1 \<Longrightarrow> v1 ! i = v2 ! i
[PROOF STEP]
unfolding vec_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i<n. v1 ! i = v2 ! i
length v1 = n

goal (1 subgoal):
 1. \<And>i. i < length v1 \<Longrightarrow> v1 ! i = v2 ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i < length v1 \<Longrightarrow> v1 ! ?i = v2 ! ?i

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma are_complementary_symmetric:
  "are_complementary x y \<longleftrightarrow> are_complementary y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. are_complementary x y = are_complementary y x
[PROOF STEP]
using il_commutative
[PROOF STATE]
proof (prove)
using this:
?x \<squnion> ?y = ?y \<squnion> ?x

goal (1 subgoal):
 1. are_complementary x y = are_complementary y x
[PROOF STEP]
by auto


[STATEMENT]
lemma real_power_1_right [simp]: "d > 0 \<Longrightarrow> real_power d 1 = of_real d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d \<Longrightarrow> real_power d (1::'a) = of_real d
[PROOF STEP]
using real_power_1_right_aux[of d]
[PROOF STATE]
proof (prove)
using this:
0 < d \<Longrightarrow> real_power d (1::?'a) = d *\<^sub>R (1::?'a)

goal (1 subgoal):
 1. 0 < d \<Longrightarrow> real_power d (1::'a) = of_real d
[PROOF STEP]
by (simp add: scaleR_conv_of_real)


[STATEMENT]
lemma blaschke_unit_disc_fix [simp]:
  assumes "cmod a < 1"
  shows "unit_disc_fix (blaschke a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix (blaschke a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cmod a < 1

goal (1 subgoal):
 1. unit_disc_fix (blaschke a)
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>cmod a < 1; cmod aa < 1\<rbrakk> \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>cmod a < 1; cmod aa < 1\<rbrakk> \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
assume *: "cmod a < 1"
[PROOF STATE]
proof (state)
this:
cmod a < 1

goal (1 subgoal):
 1. \<And>a aa. \<lbrakk>cmod a < 1; cmod aa < 1\<rbrakk> \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
show "unit_disc_fix_cmat (blaschke_cmat a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
 2. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
 2. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0

goal (1 subgoal):
 1. unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
by (simp add: unitary11_gen_def mat_adj_def mat_cnj_def)
[PROOF STATE]
proof (state)
this:
unit_disc_fix_cmat (blaschke_cmat a)

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
hence "Re (a * cnj a) < 1"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. Re (a * cnj a) < 1
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
cmod a < 1

goal (1 subgoal):
 1. Re (a * cnj a) < 1
[PROOF STEP]
by (metis complex_mod_sqrt_Re_mult_cnj real_sqrt_lt_1_iff)
[PROOF STATE]
proof (state)
this:
Re (a * cnj a) < 1

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
hence "1 / Re (a * cnj a) > 1"
[PROOF STATE]
proof (prove)
using this:
Re (a * cnj a) < 1

goal (1 subgoal):
 1. 1 < 1 / Re (a * cnj a)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
Re (a * cnj a) < 1
a \<noteq> 0

goal (1 subgoal):
 1. 1 < 1 / Re (a * cnj a)
[PROOF STEP]
by (smt complex_div_gt_0 less_divide_eq_1_pos one_complex.simps(1) right_inverse_eq)
[PROOF STATE]
proof (state)
this:
1 < 1 / Re (a * cnj a)

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
hence "Re (1 / (a * cnj a)) > 1"
[PROOF STATE]
proof (prove)
using this:
1 < 1 / Re (a * cnj a)

goal (1 subgoal):
 1. 1 < Re (1 / (a * cnj a))
[PROOF STEP]
by (simp add: complex_is_Real_iff)
[PROOF STATE]
proof (state)
this:
1 < Re (1 / (a * cnj a))

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < Re (1 / (a * cnj a))

goal (1 subgoal):
 1. unit_disc_fix_cmat (blaschke_cmat a)
[PROOF STEP]
by (simp add: unitary11_gen_def mat_adj_def mat_cnj_def)
[PROOF STATE]
proof (state)
this:
unit_disc_fix_cmat (blaschke_cmat a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unit_disc_fix_cmat (blaschke_cmat a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_fold_remove1_le:
 "length (fold remove1 ys xs) \<le> length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (fold remove1 ys xs) \<le> length xs
[PROOF STEP]
proof (induct ys arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. length (fold remove1 [] xs) \<le> length xs
 2. \<And>a ys xs. (\<And>xs. length (fold remove1 ys xs) \<le> length xs) \<Longrightarrow> length (fold remove1 (a # ys) xs) \<le> length xs
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
length (fold remove1 ys ?xs) \<le> length ?xs

goal (2 subgoals):
 1. \<And>xs. length (fold remove1 [] xs) \<le> length xs
 2. \<And>a ys xs. (\<And>xs. length (fold remove1 ys xs) \<le> length xs) \<Longrightarrow> length (fold remove1 (a # ys) xs) \<le> length xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length (fold remove1 ys ?xs) \<le> length ?xs
[PROOF STEP]
have "length (fold remove1 ys (remove1 y xs)) \<le> length (remove1 y xs)"
[PROOF STATE]
proof (prove)
using this:
length (fold remove1 ys ?xs) \<le> length ?xs

goal (1 subgoal):
 1. length (fold remove1 ys (remove1 y xs)) \<le> length (remove1 y xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (fold remove1 ys (remove1 y xs)) \<le> length (remove1 y xs)

goal (2 subgoals):
 1. \<And>xs. length (fold remove1 [] xs) \<le> length xs
 2. \<And>a ys xs. (\<And>xs. length (fold remove1 ys xs) \<le> length xs) \<Longrightarrow> length (fold remove1 (a # ys) xs) \<le> length xs
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (fold remove1 ys (remove1 y xs)) \<le> length (remove1 y xs)

goal (2 subgoals):
 1. \<And>xs. length (fold remove1 [] xs) \<le> length xs
 2. \<And>a ys xs. (\<And>xs. length (fold remove1 ys xs) \<le> length xs) \<Longrightarrow> length (fold remove1 (a # ys) xs) \<le> length xs
[PROOF STEP]
have "\<dots> \<le> length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (remove1 y xs) \<le> length xs
[PROOF STEP]
by (auto simp: length_remove1)
[PROOF STATE]
proof (state)
this:
length (remove1 y xs) \<le> length xs

goal (2 subgoals):
 1. \<And>xs. length (fold remove1 [] xs) \<le> length xs
 2. \<And>a ys xs. (\<And>xs. length (fold remove1 ys xs) \<le> length xs) \<Longrightarrow> length (fold remove1 (a # ys) xs) \<le> length xs
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
length (fold remove1 ys (remove1 y xs)) \<le> length xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length (fold remove1 ys (remove1 y xs)) \<le> length xs

goal (1 subgoal):
 1. length (fold remove1 (y # ys) xs) \<le> length xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (fold remove1 (y # ys) xs) \<le> length xs

goal (1 subgoal):
 1. \<And>xs. length (fold remove1 [] xs) \<le> length xs
[PROOF STEP]
qed simp


[STATEMENT]
lemma gram_schmidt_sub_span:
  assumes w[simp]: "w : carrier_vec n"
    and us: "set us \<subseteq> carrier_vec n"
    and dist: "distinct us"
  shows "span (set ((adjuster n w us + w) # us)) = span (set (w # us))"
  (is "span (set (?v # _)) = span ?wU")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
proof (cases "w : span (set us)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w \<in> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
 2. w \<notin> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
w \<in> local.span (set us)

goal (2 subgoals):
 1. w \<in> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
 2. w \<notin> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
hence "?v : span (set us)"
[PROOF STATE]
proof (prove)
using this:
w \<in> local.span (set us)

goal (1 subgoal):
 1. adjuster n w us + w \<in> local.span (set us)
[PROOF STEP]
using adjust_preserves_span[OF assms]
[PROOF STATE]
proof (prove)
using this:
w \<in> local.span (set us)
(w \<in> local.span (set us)) = (adjuster n w us + w \<in> local.span (set us))

goal (1 subgoal):
 1. adjuster n w us + w \<in> local.span (set us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjuster n w us + w \<in> local.span (set us)

goal (2 subgoals):
 1. w \<in> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
 2. w \<notin> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
adjuster n w us + w \<in> local.span (set us)

goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
using already_in_span[OF us] True
[PROOF STATE]
proof (prove)
using this:
adjuster n w us + w \<in> local.span (set us)
?v \<in> local.span (set us) \<Longrightarrow> local.span (set us) = local.span (set us \<union> {?v})
w \<in> local.span (set us)

goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))

goal (1 subgoal):
 1. w \<notin> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<notin> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
w \<notin> local.span (set us)

goal (1 subgoal):
 1. w \<notin> local.span (set us) \<Longrightarrow> local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
 2. local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))
[PROOF STEP]
have wU: "?wU \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (w # us) \<subseteq> carrier_vec n
[PROOF STEP]
using us
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n

goal (1 subgoal):
 1. set (w # us) \<subseteq> carrier_vec n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (w # us) \<subseteq> carrier_vec n

goal (2 subgoals):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
 2. local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))
[PROOF STEP]
have vswU: "?v : span ?wU"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w us + w \<in> local.span (set (w # us))
[PROOF STEP]
using adjust_in_span[OF assms]
[PROOF STATE]
proof (prove)
using this:
adjuster n w us + w \<in> local.span (insert w (set us))

goal (1 subgoal):
 1. adjuster n w us + w \<in> local.span (set (w # us))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjuster n w us + w \<in> local.span (set (w # us))

goal (2 subgoals):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
 2. local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))
[PROOF STEP]
hence v: "?v : carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
adjuster n w us + w \<in> local.span (set (w # us))

goal (1 subgoal):
 1. adjuster n w us + w \<in> carrier_vec n
[PROOF STEP]
using span_closed[OF wU]
[PROOF STATE]
proof (prove)
using this:
adjuster n w us + w \<in> local.span (set (w # us))
?v \<in> local.span (set (w # us)) \<Longrightarrow> ?v \<in> carrier_vec n

goal (1 subgoal):
 1. adjuster n w us + w \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjuster n w us + w \<in> carrier_vec n

goal (2 subgoals):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
 2. local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))
[PROOF STEP]
have wsvU: "w : span (insert ?v (set us))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> local.span (insert (adjuster n w us + w) (set us))
[PROOF STEP]
using in_span_adjust[OF assms]
[PROOF STATE]
proof (prove)
using this:
w \<in> local.span (insert (adjuster n w us + w) (set us))

goal (1 subgoal):
 1. w \<in> local.span (insert (adjuster n w us + w) (set us))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
w \<in> local.span (insert (adjuster n w us + w) (set us))

goal (2 subgoals):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
 2. local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))
[PROOF STEP]
show "span ?wU \<subseteq> span (set (?v # us))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))
[PROOF STEP]
using span_swap[OF finite_set us w False v wsvU]
[PROOF STATE]
proof (prove)
using this:
local.span (insert w (set us)) \<subseteq> local.span (insert (adjuster n w us + w) (set us))

goal (1 subgoal):
 1. local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.span (set (w # us)) \<subseteq> local.span (set ((adjuster n w us + w) # us))

goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
[PROOF STEP]
have "?v \<notin> span (set us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w us + w \<notin> local.span (set us)
[PROOF STEP]
using False adjust_preserves_span[OF assms]
[PROOF STATE]
proof (prove)
using this:
w \<notin> local.span (set us)
(w \<in> local.span (set us)) = (adjuster n w us + w \<in> local.span (set us))

goal (1 subgoal):
 1. adjuster n w us + w \<notin> local.span (set us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjuster n w us + w \<notin> local.span (set us)

goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
[PROOF STEP]
thus "span (set (?v # us)) \<subseteq> span ?wU"
[PROOF STATE]
proof (prove)
using this:
adjuster n w us + w \<notin> local.span (set us)

goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
[PROOF STEP]
using span_swap[OF finite_set us v _ w] vswU
[PROOF STATE]
proof (prove)
using this:
adjuster n w us + w \<notin> local.span (set us)
\<lbrakk>adjuster n w us + w \<notin> local.span (set us); adjuster n w us + w \<in> local.span (insert w (set us))\<rbrakk> \<Longrightarrow> local.span (insert (adjuster n w us + w) (set us)) \<subseteq> local.span (insert w (set us))
adjuster n w us + w \<in> local.span (set (w # us))

goal (1 subgoal):
 1. local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.span (set ((adjuster n w us + w) # us)) \<subseteq> local.span (set (w # us))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
local.span (set ((adjuster n w us + w) # us)) = local.span (set (w # us))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eball_empty [simp]: "r \<le> 0 \<Longrightarrow> eball z r = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<le> 0 \<Longrightarrow> eball z r = {}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> 0; x \<in> eball z r\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> 0; x \<in> eball z r\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
assume "r \<le> 0" "x \<in> eball z r"
[PROOF STATE]
proof (state)
this:
r \<le> 0
x \<in> eball z r

goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> 0; x \<in> eball z r\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
hence "dist z x < r"
[PROOF STATE]
proof (prove)
using this:
r \<le> 0
x \<in> eball z r

goal (1 subgoal):
 1. ereal (dist z x) < r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ereal (dist z x) < r

goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> 0; x \<in> eball z r\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (dist z x) < r

goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> 0; x \<in> eball z r\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
have "\<dots> \<le> ereal 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<le> ereal 0
[PROOF STEP]
using \<open>r \<le> 0\<close>
[PROOF STATE]
proof (prove)
using this:
r \<le> 0

goal (1 subgoal):
 1. r \<le> ereal 0
[PROOF STEP]
by (simp add: zero_ereal_def)
[PROOF STATE]
proof (state)
this:
r \<le> ereal 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>r \<le> 0; x \<in> eball z r\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal (dist z x) < ereal 0
[PROOF STEP]
show "x \<in> {}"
[PROOF STATE]
proof (prove)
using this:
ereal (dist z x) < ereal 0

goal (1 subgoal):
 1. x \<in> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma single_leadsETo_I:
     "(\<And>x. x \<in> A ==> F \<in> {x} leadsTo[CC] B) \<Longrightarrow> F \<in> A leadsTo[CC] B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> F \<in> {x} leadsTo[CC] B) \<Longrightarrow> F \<in> A leadsTo[CC] B
[PROOF STEP]
by (subst UN_singleton [symmetric], rule leadsETo_UN, blast)


[STATEMENT]
lemma sorted_wrt_alls:
  "sorted_wrt (<\<^sub>r\<^sub>l\<^sub>e\<^sub>x) (map fst (alls B xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (<\<^sub>r\<^sub>l\<^sub>e\<^sub>x) (map fst (alls B xs))
[PROOF STEP]
by (induct xs) (auto simp: map_concat rlex_Cons sorted_wrt_append
      intro!: sorted_wrt_concat_map sorted_wrt_map_mono [of "(<)"])


[STATEMENT]
lemma le_imp_less_or_eq:
  assumes "x \<le>\<^sub>a y"
  shows "x <\<^sub>a y \<or> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x <\<^sub>a y \<or> x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<le>\<^sub>a y

goal (1 subgoal):
 1. x <\<^sub>a y \<or> x = y
[PROOF STEP]
by (simp add: le_less)


[STATEMENT]
lemma cartesian_product_empty_list:
"cartesian_product A {[]} = A"
"cartesian_product {[]} A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A {[]} = A &&& cartesian_product {[]} A = A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. cartesian_product A {[]} \<subseteq> A
 2. A \<subseteq> cartesian_product A {[]}
 3. cartesian_product {[]} A = A
[PROOF STEP]
show "cartesian_product A {[]} \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product A {[]} \<subseteq> A
[PROOF STEP]
apply(rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product A {[]} \<Longrightarrow> x \<in> A
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {xs. \<exists>as\<in>A. \<exists>bs\<in>{[]}. xs = as @ bs} \<Longrightarrow> x \<in> A
[PROOF STEP]
by (smt append_Nil2 empty_iff insert_iff mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
cartesian_product A {[]} \<subseteq> A

goal (2 subgoals):
 1. A \<subseteq> cartesian_product A {[]}
 2. cartesian_product {[]} A = A
[PROOF STEP]
show "A \<subseteq> cartesian_product A {[]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> cartesian_product A {[]}
[PROOF STEP]
apply(rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> cartesian_product A {[]}
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> {xs. \<exists>as\<in>A. \<exists>bs\<in>{[]}. xs = as @ bs}
[PROOF STEP]
by (smt append_Nil2 empty_iff insert_iff mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
A \<subseteq> cartesian_product A {[]}

goal (1 subgoal):
 1. cartesian_product {[]} A = A
[PROOF STEP]
show "cartesian_product {[]} A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product {[]} A = A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cartesian_product {[]} A \<subseteq> A
 2. A \<subseteq> cartesian_product {[]} A
[PROOF STEP]
show "cartesian_product {[]} A \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cartesian_product {[]} A \<subseteq> A
[PROOF STEP]
apply(rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> cartesian_product {[]} A \<Longrightarrow> x \<in> A
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {xs. \<exists>as\<in>{[]}. \<exists>bs\<in>A. xs = as @ bs} \<Longrightarrow> x \<in> A
[PROOF STEP]
by (smt append_self_conv2 bex_empty insert_compr mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
cartesian_product {[]} A \<subseteq> A

goal (1 subgoal):
 1. A \<subseteq> cartesian_product {[]} A
[PROOF STEP]
show "A \<subseteq> cartesian_product {[]} A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> cartesian_product {[]} A
[PROOF STEP]
apply(rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> cartesian_product {[]} A
[PROOF STEP]
unfolding cartesian_product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> {xs. \<exists>as\<in>{[]}. \<exists>bs\<in>A. xs = as @ bs}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<subseteq> cartesian_product {[]} A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cartesian_product {[]} A = A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(0::real) < 1 + x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + x\<^sup>2
[PROOF STEP]
by sos


[STATEMENT]
lemma mult_3: "real_of_3 (mult_3 x y) = real_of_3 x * real_of_3 y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_3 (mult_3 x y) = real_of_3 x * real_of_3 y
[PROOF STEP]
by (transfer, auto simp: mult_2)


[STATEMENT]
lemma pathstart_flow_to_path[simp]:
  shows "pathstart (flow_to_path x t t') = flow0 x t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathstart (flow_to_path x t t') = flow0 x t
[PROOF STEP]
unfolding flow_to_path_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathstart (flow0 x \<circ> linepath t t') = flow0 x t
[PROOF STEP]
by (auto simp add: pathstart_compose)


[STATEMENT]
lemma linear_order_from_list_position_antisym:
  "antisym (set (linear_order_from_list_position xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. antisym (set (linear_order_from_list_position xs))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(x, y) \<in> set (linear_order_from_list_position xs); (y, x) \<in> set (linear_order_from_list_position xs)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(x, y) \<in> set (linear_order_from_list_position xs); (y, x) \<in> set (linear_order_from_list_position xs)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume "(x, y) \<in> set (linear_order_from_list_position xs)"
          and    "(y, x) \<in> set (linear_order_from_list_position xs)"
[PROOF STATE]
proof (state)
this:
(x, y) \<in> set (linear_order_from_list_position xs)
(y, x) \<in> set (linear_order_from_list_position xs)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(x, y) \<in> set (linear_order_from_list_position xs); (y, x) \<in> set (linear_order_from_list_position xs)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> set (linear_order_from_list_position xs)
(y, x) \<in> set (linear_order_from_list_position xs)
[PROOF STEP]
have "(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)"
       and  "(y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> set (linear_order_from_list_position xs)
(y, x) \<in> set (linear_order_from_list_position xs)

goal (1 subgoal):
 1. (x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs) &&& (y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
[PROOF STEP]
unfolding linear_order_from_list_position_set
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
(y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. (x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs) &&& (y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
(y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(x, y) \<in> set (linear_order_from_list_position xs); (y, x) \<in> set (linear_order_from_list_position xs)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
(y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
[PROOF STEP]
consider (a) "(x, y) \<in> set (map (\<lambda>x. (x, x)) xs)" |
                (b) "(x, y) \<in> set (non_sym_dist_pairs xs)"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
(y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<Longrightarrow> thesis; (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<Longrightarrow> ?thesis; (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>(x, y) \<in> set (linear_order_from_list_position xs); (y, x) \<in> set (linear_order_from_list_position xs)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<Longrightarrow> ?thesis; (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "x = y"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<Longrightarrow> ?thesis; (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. x = y
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<Longrightarrow> x = y
 2. (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> x = y
[PROOF STEP]
case a
[PROOF STATE]
proof (state)
this:
(x, y) \<in> set (map (\<lambda>x. (x, x)) xs)

goal (2 subgoals):
 1. (x, y) \<in> set (map (\<lambda>x. (x, x)) xs) \<Longrightarrow> x = y
 2. (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> set (map (\<lambda>x. (x, x)) xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> set (map (\<lambda>x. (x, x)) xs)

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

goal (1 subgoal):
 1. (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> x = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> x = y
[PROOF STEP]
case b
[PROOF STATE]
proof (state)
this:
(x, y) \<in> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> set (non_sym_dist_pairs xs)
[PROOF STEP]
have "x \<noteq> y" and "(y,x) \<notin> set (non_sym_dist_pairs xs)"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. x \<noteq> y &&& (y, x) \<notin> set (non_sym_dist_pairs xs)
[PROOF STEP]
using non_sym_dist_pairs_set_iff[of x y xs]
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> set (non_sym_dist_pairs xs)
((x, y) \<in> set (non_sym_dist_pairs xs)) = (x \<noteq> y \<and> x \<in> set xs \<and> y \<in> set xs \<and> (y, x) \<notin> set (non_sym_dist_pairs xs))

goal (1 subgoal):
 1. x \<noteq> y &&& (y, x) \<notin> set (non_sym_dist_pairs xs)
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
x \<noteq> y
(y, x) \<notin> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> y
(y, x) \<notin> set (non_sym_dist_pairs xs)
[PROOF STEP]
have "(y, x) \<notin> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
(y, x) \<notin> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. (y, x) \<notin> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(y, x) \<notin> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. (x, y) \<in> set (non_sym_dist_pairs xs) \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(y, x) \<notin> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(y, x) \<notin> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using \<open>(y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)\<close>
[PROOF STATE]
proof (prove)
using this:
(y, x) \<notin> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)
(y, x) \<in> set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pi_approx2':
  fixes n :: nat assumes n: "even n" and "n > 0" and "k \<le> 46*n - 1"
  shows   "\<bar>pi - pi_approx2 n\<bar> \<le> inverse (2^k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ k)
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
k \<le> 46 * n - 1

goal (1 subgoal):
 1. \<bar>pi - pi_approx2 n\<bar> \<le> inverse (2 ^ k)
[PROOF STEP]
by (intro order.trans[OF pi_approx2[OF assms(1,2)]]) (simp_all add: field_simps)


[STATEMENT]
lemma add_sup_distrib_right: "sup a b + c = sup (a + c) (b + c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup a b + c = sup (a + c) (b + c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sup a b + c = sup (a + c) (b + c)
[PROOF STEP]
have "c + sup a b = sup (c+a) (c+b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c + sup a b = sup (c + a) (c + b)
[PROOF STEP]
by (simp add: add_sup_distrib_left)
[PROOF STATE]
proof (state)
this:
c + sup a b = sup (c + a) (c + b)

goal (1 subgoal):
 1. sup a b + c = sup (a + c) (b + c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c + sup a b = sup (c + a) (c + b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c + sup a b = sup (c + a) (c + b)

goal (1 subgoal):
 1. sup a b + c = sup (a + c) (b + c)
[PROOF STEP]
by (simp add: add.commute)
[PROOF STATE]
proof (state)
this:
sup a b + c = sup (a + c) (b + c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_Un: "span (S \<union> T) = {x + y | x y. x \<in> span S \<and> y \<in> span T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (S \<union> T) = {x + y |x y. x \<in> span S \<and> y \<in> span T}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
assume "x \<in> span (S \<union> T)"
[PROOF STATE]
proof (state)
this:
x \<in> span (S \<union> T)

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> span (S \<union> T)
[PROOF STEP]
obtain t r where t: "finite t" "t \<subseteq> S \<union> T" and x: "x = (\<Sum>a\<in>t. r a *s a)"
[PROOF STATE]
proof (prove)
using this:
x \<in> span (S \<union> T)

goal (1 subgoal):
 1. (\<And>t r. \<lbrakk>finite t; t \<subseteq> S \<union> T; x = (\<Sum>a\<in>t. r a *s a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: span_explicit)
[PROOF STATE]
proof (state)
this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
have "t \<inter> S \<union> (t - S) = t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<inter> S \<union> (t - S) = t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<inter> S \<union> (t - S) = t

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)
t \<inter> S \<union> (t - S) = t
[PROOF STEP]
show "\<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T"
[PROOF STATE]
proof (prove)
using this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)
t \<inter> S \<union> (t - S) = t

goal (1 subgoal):
 1. \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
[PROOF STEP]
unfolding x
[PROOF STATE]
proof (prove)
using this:
finite t
t \<subseteq> S \<union> T
(\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a)
t \<inter> S \<union> (t - S) = t

goal (1 subgoal):
 1. \<exists>xa y. (\<Sum>a\<in>t. r a *s a) = xa + y \<and> xa \<in> span S \<and> y \<in> span T
[PROOF STEP]
apply (rule_tac exI[of _ "\<Sum>a\<in>t \<inter> S. r a *s a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> \<exists>y. (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t \<inter> S. r a *s a) + y \<and> (\<Sum>a\<in>t \<inter> S. r a *s a) \<in> span S \<and> y \<in> span T
[PROOF STEP]
apply (rule_tac exI[of _ "\<Sum>a\<in>t - S. r a *s a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t \<inter> S. r a *s a) + (\<Sum>a\<in>t - S. r a *s a) \<and> (\<Sum>a\<in>t \<inter> S. r a *s a) \<in> span S \<and> (\<Sum>a\<in>t - S. r a *s a) \<in> span T
[PROOF STEP]
apply (subst sum.union_inter_neutral[symmetric])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> finite (t \<inter> S)
 2. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> finite (t - S)
 3. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> \<forall>x\<in>t \<inter> S \<inter> (t - S). r x *s x = (0::'b)
 4. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t \<inter> S \<union> (t - S). r a *s a) \<and> (\<Sum>a\<in>t \<inter> S. r a *s a) \<in> span S \<and> (\<Sum>a\<in>t - S. r a *s a) \<in> span T
[PROOF STEP]
apply (auto intro!: span_sum span_scale intro: span_base)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T

goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
assume"x \<in> span S" "y \<in> span T"
[PROOF STATE]
proof (state)
this:
x \<in> span S
y \<in> span T

goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> span S
y \<in> span T
[PROOF STEP]
show "x + y \<in> span (S \<union> T)"
[PROOF STATE]
proof (prove)
using this:
x \<in> span S
y \<in> span T

goal (1 subgoal):
 1. x + y \<in> span (S \<union> T)
[PROOF STEP]
using span_mono[of S "S \<union> T"] span_mono[of T "S \<union> T"]
[PROOF STATE]
proof (prove)
using this:
x \<in> span S
y \<in> span T
S \<subseteq> S \<union> T \<Longrightarrow> span S \<subseteq> span (S \<union> T)
T \<subseteq> S \<union> T \<Longrightarrow> span T \<subseteq> span (S \<union> T)

goal (1 subgoal):
 1. x + y \<in> span (S \<union> T)
[PROOF STEP]
by (auto intro!: span_add)
[PROOF STATE]
proof (state)
this:
x + y \<in> span (S \<union> T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma at_left_to_0: "at_left a = filtermap (\<lambda>x. x + a) (at_left 0)"
  for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_left a = filtermap (\<lambda>x. x + a) (at_left 0)
[PROOF STEP]
using filtermap_at_left_shift[of "-a" 0]
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. x - - a) (at_left 0) = at_left (0 - - a)

goal (1 subgoal):
 1. at_left a = filtermap (\<lambda>x. x + a) (at_left 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma poly_vars_list[simp]: "set (poly_vars_list p) = poly_vars p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (poly_vars_list p) = poly_vars p
[PROOF STEP]
unfolding poly_vars_list_def poly_vars_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (remdups (concat (map (monom_vars_list \<circ> fst) p))) = set (concat (map (monom_vars_list \<circ> fst) p))
[PROOF STEP]
by auto


[STATEMENT]
lemma embedding_map_compose:
  assumes "embedding_map X X' f" "embedding_map X' X'' g"
  shows "embedding_map X X'' (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. embedding_map X X'' (g \<circ> f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. embedding_map X X'' (g \<circ> f)
[PROOF STEP]
have hm: "homeomorphic_map X (subtopology X' (f ` topspace X)) f" "homeomorphic_map X' (subtopology X'' (g ` topspace X')) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_map X (subtopology X' (f ` topspace X)) f &&& homeomorphic_map X' (subtopology X'' (g ` topspace X')) g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
embedding_map X X' f
embedding_map X' X'' g

goal (1 subgoal):
 1. homeomorphic_map X (subtopology X' (f ` topspace X)) f &&& homeomorphic_map X' (subtopology X'' (g ` topspace X')) g
[PROOF STEP]
by (auto simp: embedding_map_def)
[PROOF STATE]
proof (state)
this:
homeomorphic_map X (subtopology X' (f ` topspace X)) f
homeomorphic_map X' (subtopology X'' (g ` topspace X')) g

goal (1 subgoal):
 1. embedding_map X X'' (g \<circ> f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_map X (subtopology X' (f ` topspace X)) f
homeomorphic_map X' (subtopology X'' (g ` topspace X')) g
[PROOF STEP]
obtain C where "g ` topspace X' \<inter> C = (g \<circ> f) ` topspace X"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map X (subtopology X' (f ` topspace X)) f
homeomorphic_map X' (subtopology X'' (g ` topspace X')) g

goal (1 subgoal):
 1. (\<And>C. g ` topspace X' \<inter> C = (g \<circ> f) ` topspace X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types) Int_absorb1 continuous_map_image_subset_topspace continuous_map_in_subtopology homeomorphic_eq_everything_map image_comp image_mono)
[PROOF STATE]
proof (state)
this:
g ` topspace X' \<inter> C = (g \<circ> f) ` topspace X

goal (1 subgoal):
 1. embedding_map X X'' (g \<circ> f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g ` topspace X' \<inter> C = (g \<circ> f) ` topspace X
[PROOF STEP]
have "homeomorphic_map (subtopology X' (f ` topspace X)) (subtopology X'' ((g \<circ> f) ` topspace X)) g"
[PROOF STATE]
proof (prove)
using this:
g ` topspace X' \<inter> C = (g \<circ> f) ` topspace X

goal (1 subgoal):
 1. homeomorphic_map (subtopology X' (f ` topspace X)) (subtopology X'' ((g \<circ> f) ` topspace X)) g
[PROOF STEP]
by (metis hm homeomorphic_imp_surjective_map homeomorphic_map_subtopologies image_comp subtopology_subtopology topspace_subtopology)
[PROOF STATE]
proof (state)
this:
homeomorphic_map (subtopology X' (f ` topspace X)) (subtopology X'' ((g \<circ> f) ` topspace X)) g

goal (1 subgoal):
 1. embedding_map X X'' (g \<circ> f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_map (subtopology X' (f ` topspace X)) (subtopology X'' ((g \<circ> f) ` topspace X)) g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map (subtopology X' (f ` topspace X)) (subtopology X'' ((g \<circ> f) ` topspace X)) g

goal (1 subgoal):
 1. embedding_map X X'' (g \<circ> f)
[PROOF STEP]
unfolding embedding_map_def
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map (subtopology X' (f ` topspace X)) (subtopology X'' ((g \<circ> f) ` topspace X)) g

goal (1 subgoal):
 1. homeomorphic_map X (subtopology X'' ((g \<circ> f) ` topspace X)) (g \<circ> f)
[PROOF STEP]
using hm(1) homeomorphic_map_compose
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map (subtopology X' (f ` topspace X)) (subtopology X'' ((g \<circ> f) ` topspace X)) g
homeomorphic_map X (subtopology X' (f ` topspace X)) f
\<lbrakk>homeomorphic_map ?X ?Y ?f; homeomorphic_map ?Y ?X'' ?g\<rbrakk> \<Longrightarrow> homeomorphic_map ?X ?X'' (?g \<circ> ?f)

goal (1 subgoal):
 1. homeomorphic_map X (subtopology X'' ((g \<circ> f) ` topspace X)) (g \<circ> f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
embedding_map X X'' (g \<circ> f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma surj_on_implies_size_eq_card:
  assumes "finite A" "finite B"
  assumes "F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B"
  assumes "univ (\<lambda>f. f ` A = B) F"
  shows "size (number_partition_of A B F) = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
from \<open>F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B\<close>
[PROOF STATE]
proof (chain)
picking this:
F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
[PROOF STEP]
obtain f where "f \<in> A \<rightarrow>\<^sub>E B"
    and F_eq: "F = domain_and_range_permutation A B `` {f}"
[PROOF STATE]
proof (prove)
using this:
F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; F = domain_and_range_permutation A B `` {f}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using quotientE
[PROOF STATE]
proof (prove)
using this:
F \<in> (A \<rightarrow>\<^sub>E B) // domain_and_range_permutation A B
\<lbrakk>?X \<in> ?A // ?r; \<And>x. \<lbrakk>?X = ?r `` {x}; x \<in> ?A\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> A \<rightarrow>\<^sub>E B; F = domain_and_range_permutation A B `` {f}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<in> A \<rightarrow>\<^sub>E B
F = domain_and_range_permutation A B `` {f}

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
have "number_partition_of A B F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. number_partition_of A B F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F
[PROOF STEP]
unfolding number_partition_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
number_partition_of A B F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
number_partition_of A B F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
have "\<dots> =  univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})
[PROOF STEP]
unfolding F_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) F = univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f})

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
have "\<dots> = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))
[PROOF STEP]
using \<open>finite B\<close> equiv_domain_and_range_permutation multiset_of_partition_cards_respects_domain_and_range_permutation \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (prove)
using this:
finite B
equiv (?A \<rightarrow>\<^sub>E ?B) (domain_and_range_permutation ?A ?B)
finite ?B \<Longrightarrow> (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> ?A. f x = b}) ` ?B - {{}}))) respects domain_and_range_permutation ?A ?B
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))
[PROOF STEP]
by (subst univ_commute') auto
[PROOF STATE]
proof (state)
this:
univ (\<lambda>f. image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) (domain_and_range_permutation A B `` {f}) = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
number_partition_of A B F = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))
[PROOF STEP]
have eq: "number_partition_of A B F = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))"
[PROOF STATE]
proof (prove)
using this:
number_partition_of A B F = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))

goal (1 subgoal):
 1. number_partition_of A B F = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
number_partition_of A B F = image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
from iffD1[OF univ_commute', OF equiv_domain_and_range_permutation, OF surjective_respects_domain_and_range_permutation, OF \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>]
    assms(4)
[PROOF STATE]
proof (chain)
picking this:
univ (\<lambda>f. f ` A = B) (domain_and_range_permutation A B `` {f}) \<Longrightarrow> f ` A = B
univ (\<lambda>f. f ` A = B) F
[PROOF STEP]
have "f ` A = B"
[PROOF STATE]
proof (prove)
using this:
univ (\<lambda>f. f ` A = B) (domain_and_range_permutation A B `` {f}) \<Longrightarrow> f ` A = B
univ (\<lambda>f. f ` A = B) F

goal (1 subgoal):
 1. f ` A = B
[PROOF STEP]
by (simp add: F_eq)
[PROOF STATE]
proof (state)
this:
f ` A = B

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
have "size (number_partition_of A B F) = size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (number_partition_of A B F) = size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})))
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) = size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
size (number_partition_of A B F) = size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})))

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
size (number_partition_of A B F) = size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})))

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
have "\<dots> = card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) = card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) = card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
size (image_mset card (mset_set ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}))) = card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
from \<open>f ` A = B\<close>
[PROOF STATE]
proof (chain)
picking this:
f ` A = B
[PROOF STEP]
have "\<dots> = card B"
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
using surjective_on_implies_card_eq
[PROOF STATE]
proof (prove)
using this:
f ` A = B
?f ` ?A = ?B \<Longrightarrow> card ((\<lambda>b. {x \<in> ?A. ?f x = b}) ` ?B - {{}}) = card ?B

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
size (number_partition_of A B F) = card B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
size (number_partition_of A B F) = card B

goal (1 subgoal):
 1. size (number_partition_of A B F) = card B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
size (number_partition_of A B F) = card B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma erfc_real_le_0_iff [simp]: "erfc (x::real) \<le> 1 \<longleftrightarrow> x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (erfc x \<le> 1) = (0 \<le> x)
[PROOF STEP]
by (simp add: erfc_def)


[STATEMENT]
lemma rtrancl_list_conv:
  "((s,t) \<in> R^*) =
  (\<exists>list. last (s # list) = t \<and> (\<forall>i. i < length list \<longrightarrow> ((s # list) ! i, (s # list) ! Suc i) \<in> R))" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((s, t) \<in> R\<^sup>*) = (\<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
 2. \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
assume ?r
[PROOF STATE]
proof (state)
this:
\<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)

goal (2 subgoals):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
 2. \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
[PROOF STEP]
obtain list where "last (s # list) = t \<and> (\<forall> i. i < length list \<longrightarrow> ((s # list) ! i, (s # list) ! Suc i) \<in> R)"
[PROOF STATE]
proof (prove)
using this:
\<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)

goal (1 subgoal):
 1. (\<And>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)

goal (2 subgoals):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
 2. \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
thus ?l
[PROOF STATE]
proof (prove)
using this:
last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)

goal (1 subgoal):
 1. (s, t) \<in> R\<^sup>*
[PROOF STEP]
proof (induct list arbitrary: s, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list s. \<lbrakk>\<And>s. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*; last (s # a # list) = t \<and> (\<forall>i<length (a # list). ((s # a # list) ! i, (s # a # list) ! Suc i) \<in> R)\<rbrakk> \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
case (Cons u ll)
[PROOF STATE]
proof (state)
this:
last (?s # ll) = t \<and> (\<forall>i<length ll. ((?s # ll) ! i, (?s # ll) ! Suc i) \<in> R) \<Longrightarrow> (?s, t) \<in> R\<^sup>*
last (s # u # ll) = t \<and> (\<forall>i<length (u # ll). ((s # u # ll) ! i, (s # u # ll) ! Suc i) \<in> R)

goal (1 subgoal):
 1. \<And>a list s. \<lbrakk>\<And>s. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*; last (s # a # list) = t \<and> (\<forall>i<length (a # list). ((s # a # list) ! i, (s # a # list) ! Suc i) \<in> R)\<rbrakk> \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
hence "last (u # ll) = t \<and> (\<forall> i. i < length ll \<longrightarrow> ((u # ll) ! i, (u # ll) ! Suc i) \<in> R)"
[PROOF STATE]
proof (prove)
using this:
last (?s # ll) = t \<and> (\<forall>i<length ll. ((?s # ll) ! i, (?s # ll) ! Suc i) \<in> R) \<Longrightarrow> (?s, t) \<in> R\<^sup>*
last (s # u # ll) = t \<and> (\<forall>i<length (u # ll). ((s # u # ll) ! i, (s # u # ll) ! Suc i) \<in> R)

goal (1 subgoal):
 1. last (u # ll) = t \<and> (\<forall>i<length ll. ((u # ll) ! i, (u # ll) ! Suc i) \<in> R)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
last (u # ll) = t \<and> (\<forall>i<length ll. ((u # ll) ! i, (u # ll) ! Suc i) \<in> R)

goal (1 subgoal):
 1. \<And>a list s. \<lbrakk>\<And>s. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*; last (s # a # list) = t \<and> (\<forall>i<length (a # list). ((s # a # list) ! i, (s # a # list) ! Suc i) \<in> R)\<rbrakk> \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
from Cons(1)[OF this]
[PROOF STATE]
proof (chain)
picking this:
(u, t) \<in> R\<^sup>*
[PROOF STEP]
have rec: "(u,t) \<in> R^*"
[PROOF STATE]
proof (prove)
using this:
(u, t) \<in> R\<^sup>*

goal (1 subgoal):
 1. (u, t) \<in> R\<^sup>*
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(u, t) \<in> R\<^sup>*

goal (1 subgoal):
 1. \<And>a list s. \<lbrakk>\<And>s. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*; last (s # a # list) = t \<and> (\<forall>i<length (a # list). ((s # a # list) ! i, (s # a # list) ! Suc i) \<in> R)\<rbrakk> \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
from Cons
[PROOF STATE]
proof (chain)
picking this:
last (?s # ll) = t \<and> (\<forall>i<length ll. ((?s # ll) ! i, (?s # ll) ! Suc i) \<in> R) \<Longrightarrow> (?s, t) \<in> R\<^sup>*
last (s # u # ll) = t \<and> (\<forall>i<length (u # ll). ((s # u # ll) ! i, (s # u # ll) ! Suc i) \<in> R)
[PROOF STEP]
have "(s, u) \<in> R"
[PROOF STATE]
proof (prove)
using this:
last (?s # ll) = t \<and> (\<forall>i<length ll. ((?s # ll) ! i, (?s # ll) ! Suc i) \<in> R) \<Longrightarrow> (?s, t) \<in> R\<^sup>*
last (s # u # ll) = t \<and> (\<forall>i<length (u # ll). ((s # u # ll) ! i, (s # u # ll) ! Suc i) \<in> R)

goal (1 subgoal):
 1. (s, u) \<in> R
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(s, u) \<in> R

goal (1 subgoal):
 1. \<And>a list s. \<lbrakk>\<And>s. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R) \<Longrightarrow> (s, t) \<in> R\<^sup>*; last (s # a # list) = t \<and> (\<forall>i<length (a # list). ((s # a # list) ! i, (s # a # list) ! Suc i) \<in> R)\<rbrakk> \<Longrightarrow> (s, t) \<in> R\<^sup>*
[PROOF STEP]
with rec
[PROOF STATE]
proof (chain)
picking this:
(u, t) \<in> R\<^sup>*
(s, u) \<in> R
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(u, t) \<in> R\<^sup>*
(s, u) \<in> R

goal (1 subgoal):
 1. (s, t) \<in> R\<^sup>*
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(s, t) \<in> R\<^sup>*

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(s, t) \<in> R\<^sup>*

goal (1 subgoal):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
[PROOF STEP]
assume ?l
[PROOF STATE]
proof (state)
this:
(s, t) \<in> R\<^sup>*

goal (1 subgoal):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
[PROOF STEP]
from rtrancl_imp_seq[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>f n. f 0 = s \<and> f n = t \<and> (\<forall>i<n. (f i, f (Suc i)) \<in> R)
[PROOF STEP]
obtain S n where s: "S 0 = s" and t: "S n = t" and steps: "\<forall> i<n. (S i, S (Suc i)) \<in> R"
[PROOF STATE]
proof (prove)
using this:
\<exists>f n. f 0 = s \<and> f n = t \<and> (\<forall>i<n. (f i, f (Suc i)) \<in> R)

goal (1 subgoal):
 1. (\<And>S n. \<lbrakk>S 0 = s; S n = t; \<forall>i<n. (S i, S (Suc i)) \<in> R\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S 0 = s
S n = t
\<forall>i<n. (S i, S (Suc i)) \<in> R

goal (1 subgoal):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
[PROOF STEP]
let ?list = "map (\<lambda> i. S (Suc i)) [0 ..< n]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (s, t) \<in> R\<^sup>* \<Longrightarrow> \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
[PROOF STEP]
show ?r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)
[PROOF STEP]
proof (rule exI[of _ ?list], intro conjI,
      cases n, simp add: s[symmetric] t[symmetric], simp add: t[symmetric])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<length (map (\<lambda>i. S (Suc i)) [0..<n]). ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
show "\<forall> i < length ?list. ((s # ?list) ! i, (s # ?list) ! Suc i) \<in> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (map (\<lambda>i. S (Suc i)) [0..<n]). ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (map (\<lambda>i. S (Suc i)) [0..<n]) \<Longrightarrow> ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length (map (\<lambda>i. S (Suc i)) [0..<n]) \<Longrightarrow> ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
assume i: "i < length ?list"
[PROOF STATE]
proof (state)
this:
i < length (map (\<lambda>i. S (Suc i)) [0..<n])

goal (1 subgoal):
 1. \<And>i. i < length (map (\<lambda>i. S (Suc i)) [0..<n]) \<Longrightarrow> ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
thus "((s # ?list) ! i, (s # ?list) ! Suc i) \<in> R"
[PROOF STATE]
proof (prove)
using this:
i < length (map (\<lambda>i. S (Suc i)) [0..<n])

goal (1 subgoal):
 1. ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
proof (cases i, simp add: s[symmetric] steps)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>i < length (map (\<lambda>i. S (Suc i)) [0..<n]); i = Suc nat\<rbrakk> \<Longrightarrow> ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
case (Suc j)
[PROOF STATE]
proof (state)
this:
i = Suc j

goal (1 subgoal):
 1. \<And>nat. \<lbrakk>i < length (map (\<lambda>i. S (Suc i)) [0..<n]); i = Suc nat\<rbrakk> \<Longrightarrow> ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
with i steps
[PROOF STATE]
proof (chain)
picking this:
i < length (map (\<lambda>i. S (Suc i)) [0..<n])
\<forall>i<n. (S i, S (Suc i)) \<in> R
i = Suc j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < length (map (\<lambda>i. S (Suc i)) [0..<n])
\<forall>i<n. (S i, S (Suc i)) \<in> R
i = Suc j

goal (1 subgoal):
 1. ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<length (map (\<lambda>i. S (Suc i)) [0..<n]). ((s # map (\<lambda>i. S (Suc i)) [0..<n]) ! i, (s # map (\<lambda>i. S (Suc i)) [0..<n]) ! Suc i) \<in> R

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>list. last (s # list) = t \<and> (\<forall>i<length list. ((s # list) ! i, (s # list) ! Suc i) \<in> R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ord_add [simp]: "\<lbrakk>Ord x; Ord y\<rbrakk> \<Longrightarrow> Ord (x+y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord x; Ord y\<rbrakk> \<Longrightarrow> Ord (x + y)
[PROOF STEP]
proof (induction y rule: eps_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>\<And>y. \<lbrakk>y \<in> elts xa; Ord x; Ord y\<rbrakk> \<Longrightarrow> Ord (x + y); Ord x; Ord xa\<rbrakk> \<Longrightarrow> Ord (x + xa)
[PROOF STEP]
case (step y)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y \<in> elts y; Ord x; Ord ?y\<rbrakk> \<Longrightarrow> Ord (x + ?y)
Ord x
Ord y

goal (1 subgoal):
 1. \<And>xa. \<lbrakk>\<And>y. \<lbrakk>y \<in> elts xa; Ord x; Ord y\<rbrakk> \<Longrightarrow> Ord (x + y); Ord x; Ord xa\<rbrakk> \<Longrightarrow> Ord (x + xa)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y \<in> elts y; Ord x; Ord ?y\<rbrakk> \<Longrightarrow> Ord (x + ?y)
Ord x
Ord y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y \<in> elts y; Ord x; Ord ?y\<rbrakk> \<Longrightarrow> Ord (x + ?y)
Ord x
Ord y

goal (1 subgoal):
 1. Ord (x + y)
[PROOF STEP]
by (metis Ord_rank rank_add_distrib rank_of_Ord)
[PROOF STATE]
proof (state)
this:
Ord (x + y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_plus_eq_left:
  assumes "f ++ h = g ++ h"
  shows "(f |` (- dom h)) = (g |` (- dom h))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f |` (- dom h) = g |` (- dom h)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f |` (- dom h) = g |` (- dom h)
[PROOF STEP]
have "h |` (- dom h) = Map.empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h |` (- dom h) = Map.empty
[PROOF STEP]
by (metis Compl_disjoint dom_eq_empty_conv dom_restrict)
[PROOF STATE]
proof (state)
this:
h |` (- dom h) = Map.empty

goal (1 subgoal):
 1. f |` (- dom h) = g |` (- dom h)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h |` (- dom h) = Map.empty
[PROOF STEP]
have f2: "f |` (- dom h) = (f ++ h) |` (- dom h)"
[PROOF STATE]
proof (prove)
using this:
h |` (- dom h) = Map.empty

goal (1 subgoal):
 1. f |` (- dom h) = (f ++ h) |` (- dom h)
[PROOF STEP]
by (simp add: map_plus_restrict_dist)
[PROOF STATE]
proof (state)
this:
f |` (- dom h) = (f ++ h) |` (- dom h)

goal (1 subgoal):
 1. f |` (- dom h) = g |` (- dom h)
[PROOF STEP]
have "h |` (- dom h) = Map.empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h |` (- dom h) = Map.empty
[PROOF STEP]
by (metis (no_types) Compl_disjoint dom_eq_empty_conv dom_restrict)
[PROOF STATE]
proof (state)
this:
h |` (- dom h) = Map.empty

goal (1 subgoal):
 1. f |` (- dom h) = g |` (- dom h)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h |` (- dom h) = Map.empty
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h |` (- dom h) = Map.empty

goal (1 subgoal):
 1. f |` (- dom h) = g |` (- dom h)
[PROOF STEP]
using f2 assms
[PROOF STATE]
proof (prove)
using this:
h |` (- dom h) = Map.empty
f |` (- dom h) = (f ++ h) |` (- dom h)
f ++ h = g ++ h

goal (1 subgoal):
 1. f |` (- dom h) = g |` (- dom h)
[PROOF STEP]
by (simp add: map_plus_restrict_dist)
[PROOF STATE]
proof (state)
this:
f |` (- dom h) = g |` (- dom h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma qfree_lift_dnf_qe: "(\<And>as. (\<forall>a\<in>set as. depends\<^sub>0 a) \<Longrightarrow> qfree(qe as))
 \<Longrightarrow> qfree(lift_dnf_qe qe \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>as. \<forall>a\<in>set as. depends\<^sub>0 a \<Longrightarrow> qfree (qe as)) \<Longrightarrow> qfree (lift_dnf_qe qe \<phi>)
[PROOF STEP]
by (induct \<phi>) (simp_all add:qelim_def)


[STATEMENT]
lemma p_intpow_inv':
  fixes n::int
  shows  "(\<pp> [^] -n) \<otimes> (\<pp> [^] n) = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> [^] - n \<otimes> \<pp> [^] n = \<one>
[PROOF STEP]
using p_intpow_inv
[PROOF STATE]
proof (prove)
using this:
\<pp> [^] ?n \<otimes> \<pp> [^] - ?n = \<one>

goal (1 subgoal):
 1. \<pp> [^] - n \<otimes> \<pp> [^] n = \<one>
[PROOF STEP]
by (metis add.commute p_intpow_add)


[STATEMENT]
lemma lexordp_lex: "(xs, ys) \<in> lex {(xs, ys). xs < ys} \<longleftrightarrow> lexordp xs ys \<and> length xs = length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((xs, ys) \<in> lex {(x, y). x < y}) = (lexordp xs ys \<and> length xs = length ys)
[PROOF STEP]
proof(induct xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. (([], ys) \<in> lex {(x, y). x < y}) = (lexordp [] ys \<and> length [] = length ys)
 2. \<And>a xs ys. (\<And>ys. ((xs, ys) \<in> lex {(x, y). x < y}) = (lexordp xs ys \<and> length xs = length ys)) \<Longrightarrow> ((a # xs, ys) \<in> lex {(x, y). x < y}) = (lexordp (a # xs) ys \<and> length (a # xs) = length ys)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>ys. (([], ys) \<in> lex {(x, y). x < y}) = (lexordp [] ys \<and> length [] = length ys)
 2. \<And>a xs ys. (\<And>ys. ((xs, ys) \<in> lex {(x, y). x < y}) = (lexordp xs ys \<and> length xs = length ys)) \<Longrightarrow> ((a # xs, ys) \<in> lex {(x, y). x < y}) = (lexordp (a # xs) ys \<and> length (a # xs) = length ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (([], ys) \<in> lex {a. case a of (x, xa) \<Rightarrow> x < xa}) = (lexordp [] ys \<and> length [] = length ys)
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
(([], ys) \<in> lex {a. case a of (x, xa) \<Rightarrow> x < xa}) = (lexordp [] ys \<and> length [] = length ys)

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. ((xs, ys) \<in> lex {(x, y). x < y}) = (lexordp xs ys \<and> length xs = length ys)) \<Longrightarrow> ((a # xs, ys) \<in> lex {(x, y). x < y}) = (lexordp (a # xs) ys \<and> length (a # xs) = length ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. ((xs, ys) \<in> lex {(x, y). x < y}) = (lexordp xs ys \<and> length xs = length ys)) \<Longrightarrow> ((a # xs, ys) \<in> lex {(x, y). x < y}) = (lexordp (a # xs) ys \<and> length (a # xs) = length ys)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
((xs_, ?ys) \<in> lex {a. case a of (x, xa) \<Rightarrow> x < xa}) = (lexordp xs_ ?ys \<and> length xs_ = length ?ys)

goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. ((xs, ys) \<in> lex {(x, y). x < y}) = (lexordp xs ys \<and> length xs = length ys)) \<Longrightarrow> ((a # xs, ys) \<in> lex {(x, y). x < y}) = (lexordp (a # xs) ys \<and> length (a # xs) = length ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
((xs_, ?ys) \<in> lex {a. case a of (x, xa) \<Rightarrow> x < xa}) = (lexordp xs_ ?ys \<and> length xs_ = length ?ys)

goal (1 subgoal):
 1. ((a_ # xs_, ys) \<in> lex {a. case a of (x, xa) \<Rightarrow> x < xa}) = (lexordp (a_ # xs_) ys \<and> length (a_ # xs_) = length ys)
[PROOF STEP]
by(cases ys)(simp_all, safe, simp)
[PROOF STATE]
proof (state)
this:
((a_ # xs_, ys) \<in> lex {a. case a of (x, xa) \<Rightarrow> x < xa}) = (lexordp (a_ # xs_) ys \<and> length (a_ # xs_) = length ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem num_eq_card_orbit:
  assumes P:"P \<in> subgroups_of_size (p ^ a)"
  shows "subgroups_of_size (p ^ a) = group_action.orbit G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroups_of_size (p ^ a) = group_action.orbit G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) P
[PROOF STEP]
proof(auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> subgroups_of_size (p ^ a) \<Longrightarrow> x \<in> group_action.orbit G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) P
 2. \<And>x. x \<in> group_action.orbit G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
from finite_G
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
[PROOF STEP]
interpret conj: group_action G "(conjugation_action (p ^ a))" "(subgroups_of_size (p ^ a))"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)

goal (1 subgoal):
 1. group_action G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a))
[PROOF STEP]
by (rule acts_on_subsets)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> subgroups_of_size (p ^ a) \<Longrightarrow> x \<in> conj.orbit P
 2. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
have "group_action.orbit G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) P = group_action.same_orbit_rel G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) `` {P}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conj.orbit P = conj.same_orbit_rel `` {P}
[PROOF STEP]
by (rule conj.orbit_def)
[PROOF STATE]
proof (state)
this:
conj.orbit P = conj.same_orbit_rel `` {P}

goal (2 subgoals):
 1. \<And>x. x \<in> subgroups_of_size (p ^ a) \<Longrightarrow> x \<in> conj.orbit P
 2. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
fix Q
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> subgroups_of_size (p ^ a) \<Longrightarrow> x \<in> conj.orbit P
 2. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> subgroups_of_size (p ^ a) \<Longrightarrow> x \<in> conj.orbit P
 2. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
assume Q:"Q \<in> subgroups_of_size (p ^ a)"
[PROOF STATE]
proof (state)
this:
Q \<in> subgroups_of_size (p ^ a)

goal (2 subgoals):
 1. \<And>x. x \<in> subgroups_of_size (p ^ a) \<Longrightarrow> x \<in> conj.orbit P
 2. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
from P Q
[PROOF STATE]
proof (chain)
picking this:
P \<in> subgroups_of_size (p ^ a)
Q \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
obtain g where g:"g \<in> carrier G" "Q = g <# (P #> inv g) "
[PROOF STATE]
proof (prove)
using this:
P \<in> subgroups_of_size (p ^ a)
Q \<in> subgroups_of_size (p ^ a)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g \<in> carrier G; Q = g <# (P #> inv g)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule sylow_conjugate)
[PROOF STATE]
proof (state)
this:
g \<in> carrier G
Q = g <# (P #> inv g)

goal (2 subgoals):
 1. \<And>x. x \<in> subgroups_of_size (p ^ a) \<Longrightarrow> x \<in> conj.orbit P
 2. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
with P conj.orbit_char
[PROOF STATE]
proof (chain)
picking this:
P \<in> subgroups_of_size (p ^ a)
?m \<in> subgroups_of_size (p ^ a) \<Longrightarrow> conj.orbit ?m = {n. \<exists>g. g \<in> carrier G \<and> conjugation_action (p ^ a) g ?m = n}
g \<in> carrier G
Q = g <# (P #> inv g)
[PROOF STEP]
show "Q \<in> group_action.orbit G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) P"
[PROOF STATE]
proof (prove)
using this:
P \<in> subgroups_of_size (p ^ a)
?m \<in> subgroups_of_size (p ^ a) \<Longrightarrow> conj.orbit ?m = {n. \<exists>g. g \<in> carrier G \<and> conjugation_action (p ^ a) g ?m = n}
g \<in> carrier G
Q = g <# (P #> inv g)

goal (1 subgoal):
 1. Q \<in> conj.orbit P
[PROOF STEP]
unfolding conjugation_action_def
[PROOF STATE]
proof (prove)
using this:
P \<in> subgroups_of_size (p ^ a)
?m \<in> subgroups_of_size (p ^ a) \<Longrightarrow> group_action.orbit G (\<lambda>g\<in>carrier G. \<lambda>P\<in>subgroups_of_size (p ^ a). g <# (P #> inv g)) (subgroups_of_size (p ^ a)) ?m = {n. \<exists>g. g \<in> carrier G \<and> (\<lambda>g\<in>carrier G. \<lambda>P\<in>subgroups_of_size (p ^ a). g <# (P #> inv g)) g ?m = n}
g \<in> carrier G
Q = g <# (P #> inv g)

goal (1 subgoal):
 1. Q \<in> group_action.orbit G (\<lambda>g\<in>carrier G. \<lambda>P\<in>subgroups_of_size (p ^ a). g <# (P #> inv g)) (subgroups_of_size (p ^ a)) P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Q \<in> conj.orbit P

goal (1 subgoal):
 1. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Q \<in> subgroups_of_size (p ^ a) \<Longrightarrow> Q \<in> conj.orbit P

goal (1 subgoal):
 1. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Q \<in> subgroups_of_size (p ^ a) \<Longrightarrow> Q \<in> conj.orbit P

goal (1 subgoal):
 1. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
assume "Q \<in> group_action.orbit G (conjugation_action (p ^ a)) (subgroups_of_size (p ^ a)) P"
[PROOF STATE]
proof (state)
this:
Q \<in> conj.orbit P

goal (1 subgoal):
 1. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
with P conj.orbit_char
[PROOF STATE]
proof (chain)
picking this:
P \<in> subgroups_of_size (p ^ a)
?m \<in> subgroups_of_size (p ^ a) \<Longrightarrow> conj.orbit ?m = {n. \<exists>g. g \<in> carrier G \<and> conjugation_action (p ^ a) g ?m = n}
Q \<in> conj.orbit P
[PROOF STEP]
obtain g where g:"g \<in> carrier G" "Q = conjugation_action (p ^ a) g P"
[PROOF STATE]
proof (prove)
using this:
P \<in> subgroups_of_size (p ^ a)
?m \<in> subgroups_of_size (p ^ a) \<Longrightarrow> conj.orbit ?m = {n. \<exists>g. g \<in> carrier G \<and> conjugation_action (p ^ a) g ?m = n}
Q \<in> conj.orbit P

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g \<in> carrier G; Q = conjugation_action (p ^ a) g P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g \<in> carrier G
Q = conjugation_action (p ^ a) g P

goal (1 subgoal):
 1. \<And>x. x \<in> conj.orbit P \<Longrightarrow> x \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
with finite_G P
[PROOF STATE]
proof (chain)
picking this:
finite (carrier G)
P \<in> subgroups_of_size (p ^ a)
g \<in> carrier G
Q = conjugation_action (p ^ a) g P
[PROOF STEP]
show "Q \<in> subgroups_of_size (p ^ a)"
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
P \<in> subgroups_of_size (p ^ a)
g \<in> carrier G
Q = conjugation_action (p ^ a) g P

goal (1 subgoal):
 1. Q \<in> subgroups_of_size (p ^ a)
[PROOF STEP]
by (metis conjugation_is_size_invariant)
[PROOF STATE]
proof (state)
this:
Q \<in> subgroups_of_size (p ^ a)

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Q \<in> conj.orbit P \<Longrightarrow> Q \<in> subgroups_of_size (p ^ a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bl_shiftr1: "to_bl (shiftr1 w) = False # butlast (to_bl w)"
  for w :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (shiftr1 w) = False # butlast (to_bl w)
[PROOF STEP]
by (simp add: shiftr1_bl word_rep_drop len_gt_0 [THEN Suc_leI])

\<comment> \<open>Generalized version of \<open>bl_shiftr1\<close>. Maybe this one should replace it?\<close>