[STATEMENT]
lemma ord_of_nat_mult: "ord_of_nat (m*n) = ord_of_nat m * ord_of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_of_nat (m * n) = ord_of_nat m * ord_of_nat n
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ord_of_nat (m * 0) = ord_of_nat m * ord_of_nat 0
 2. \<And>n. ord_of_nat (m * n) = ord_of_nat m * ord_of_nat n \<Longrightarrow> ord_of_nat (m * Suc n) = ord_of_nat m * ord_of_nat (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
ord_of_nat (m * n) = ord_of_nat m * ord_of_nat n

goal (2 subgoals):
 1. ord_of_nat (m * 0) = ord_of_nat m * ord_of_nat 0
 2. \<And>n. ord_of_nat (m * n) = ord_of_nat m * ord_of_nat n \<Longrightarrow> ord_of_nat (m * Suc n) = ord_of_nat m * ord_of_nat (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord_of_nat (m * n) = ord_of_nat m * ord_of_nat n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ord_of_nat (m * n) = ord_of_nat m * ord_of_nat n

goal (1 subgoal):
 1. ord_of_nat (m * Suc n) = ord_of_nat m * ord_of_nat (Suc n)
[PROOF STEP]
by (simp add: add.commute [of m]) (simp add: ord_of_nat_add mult_succ)
[PROOF STATE]
proof (state)
this:
ord_of_nat (m * Suc n) = ord_of_nat m * ord_of_nat (Suc n)

goal (1 subgoal):
 1. ord_of_nat (m * 0) = ord_of_nat m * ord_of_nat 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma card_number_partitions_with_only_parts_1_eq_0:
  assumes "x < n"
  shows "card {N. (\<forall>n. n\<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = 0" (is "card ?N = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = 0
[PROOF STEP]
have "\<forall>N \<in> {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N}. size N = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>N\<in>{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N}. size N = n
[PROOF STEP]
unfolding number_partition1_eq_replicate_mset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>N\<in>{replicate_mset n 1}. size N = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>N\<in>{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N}. size N = n

goal (1 subgoal):
 1. card {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = 0
[PROOF STEP]
from this number_partition1_eq_replicate_mset\<open>x < n\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>N\<in>{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N}. size N = n
{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition ?n N} = {replicate_mset ?n 1}
x < n
[PROOF STEP]
have "?N = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>N\<in>{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N}. size N = n
{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition ?n N} = {replicate_mset ?n 1}
x < n

goal (1 subgoal):
 1. {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = {}

goal (1 subgoal):
 1. card {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = 0
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = {}

goal (1 subgoal):
 1. card {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = 0
[PROOF STEP]
by (simp only: card.empty)
[PROOF STATE]
proof (state)
this:
card {N. (\<forall>n. n \<in># N \<longrightarrow> n = 1) \<and> number_partition n N \<and> size N \<le> x} = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma col_swaprows:
  "l < n \<Longrightarrow> col (swaprows_mat n l l) l = unit_vec n l"
  "i \<noteq> k \<Longrightarrow> i \<noteq> l \<Longrightarrow> i < n \<Longrightarrow> col (swaprows_mat n k l) i = unit_vec n i"
  "k < n \<Longrightarrow> l < n \<Longrightarrow> col (swaprows_mat n k l) l = unit_vec n k"
  "k < n \<Longrightarrow> l < n \<Longrightarrow> col (swaprows_mat n k l) k = unit_vec n l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((l < n \<Longrightarrow> col (swaprows_mat n l l) l = unit_vec n l) &&& (\<lbrakk>i \<noteq> k; i \<noteq> l; i < n\<rbrakk> \<Longrightarrow> col (swaprows_mat n k l) i = unit_vec n i)) &&& (\<lbrakk>k < n; l < n\<rbrakk> \<Longrightarrow> col (swaprows_mat n k l) l = unit_vec n k) &&& (\<lbrakk>k < n; l < n\<rbrakk> \<Longrightarrow> col (swaprows_mat n k l) k = unit_vec n l)
[PROOF STEP]
by (rule eq_vecI, auto)


[STATEMENT]
lemma eventually_at_left_field:
  "eventually P (at_left x) \<longleftrightarrow> (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)"
  for x :: "'a::{linordered_field, linorder_topology}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
using linordered_field_no_lb[rule_format, of x]
[PROOF STATE]
proof (prove)
using this:
\<exists>y. y < x

goal (1 subgoal):
 1. eventually P (at_left x) = (\<exists>b<x. \<forall>y>b. y < x \<longrightarrow> P y)
[PROOF STEP]
by (auto simp: eventually_at_left)


[STATEMENT]
theorem per_lemma_relaxed:
  assumes "period w p" and  "period w q" and  "p + q \<le> \<^bold>|w\<^bold>|"
  shows "(take p w)\<cdot>(take q w) = (take q w)\<cdot>(take p w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take p w \<cdot> take q w = take q w \<cdot> take p w
[PROOF STEP]
using   two_pers_root[OF
      \<open>period w p\<close>[unfolded period_def[of w p]]
      \<open>period w q\<close>[unfolded period_def[of w q]], unfolded
      take_len[OF add_leD1[OF \<open>p + q \<le> \<^bold>|w\<^bold>|\<close>]]
      take_len[OF add_leD2[OF \<open>p + q \<le> \<^bold>|w\<^bold>|\<close>]], OF \<open>p + q \<le> \<^bold>|w\<^bold>|\<close>]
[PROOF STATE]
proof (prove)
using this:
take p w \<cdot> take q w = take q w \<cdot> take p w

goal (1 subgoal):
 1. take p w \<cdot> take q w = take q w \<cdot> take p w
[PROOF STEP]
.


[STATEMENT]
lemma [smt_arith_multiplication]:
  fixes A B :: real and p n :: int
  assumes "A < B" "0 < n" "p > 0"
  shows "(A / n) * p < (B / n) * p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A / real_of_int n * real_of_int p < B / real_of_int n * real_of_int p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A < B
0 < n
0 < p

goal (1 subgoal):
 1. A / real_of_int n * real_of_int p < B / real_of_int n * real_of_int p
[PROOF STEP]
by (auto simp: field_simps)


[STATEMENT]
lemma list_all2_rsp:
  assumes r: "\<forall>x y. R x y \<longrightarrow> (\<forall>a b. R a b \<longrightarrow> S x a = T y b)"
  and l1: "list_all2 R x y"
  and l2: "list_all2 R a b"
  shows "list_all2 S x a = list_all2 T y b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 S x a = list_all2 T y b
[PROOF STEP]
using l1 l2
[PROOF STATE]
proof (prove)
using this:
list_all2 R x y
list_all2 R a b

goal (1 subgoal):
 1. list_all2 S x a = list_all2 T y b
[PROOF STEP]
by (induct arbitrary: a b rule: list_all2_induct,
    auto simp: list_all2_Cons1 list_all2_Cons2 r)


[STATEMENT]
lemma (in subgroup) mult_in_cancel_right:
  assumes "x \<in> carrier G" "y \<in> H" "group G"
  shows   "x \<otimes> y \<in> H \<longleftrightarrow> x \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes> y \<in> H) = (x \<in> H)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> x \<in> H
 2. x \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
assume "x \<otimes> y \<in> H"
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<in> H

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> x \<in> H
 2. x \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
hence "(x \<otimes> y) \<otimes> inv y \<in> H"
[PROOF STATE]
proof (prove)
using this:
x \<otimes> y \<in> H

goal (1 subgoal):
 1. x \<otimes> y \<otimes> inv y \<in> H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<otimes> y \<in> H
x \<in> carrier G
y \<in> H
Group.group G

goal (1 subgoal):
 1. x \<otimes> y \<otimes> inv y \<in> H
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<otimes> inv y \<in> H

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> x \<in> H
 2. x \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<otimes> inv y \<in> H

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> x \<in> H
 2. x \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
have "(x \<otimes> y) \<otimes> inv y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<otimes> y \<otimes> inv y = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> H
Group.group G

goal (1 subgoal):
 1. x \<otimes> y \<otimes> inv y = x
[PROOF STEP]
by (simp add: \<open>x \<otimes> y \<in> H\<close> group.inv_solve_right')
[PROOF STATE]
proof (state)
this:
x \<otimes> y \<otimes> inv y = x

goal (2 subgoals):
 1. x \<otimes> y \<in> H \<Longrightarrow> x \<in> H
 2. x \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<in> H
[PROOF STEP]
show "x \<in> H"
[PROOF STATE]
proof (prove)
using this:
x \<in> H

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

goal (1 subgoal):
 1. x \<in> H \<Longrightarrow> x \<otimes> y \<in> H
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma scaleC_2:
  fixes x :: "'a::complex_vector"
  shows "scaleC 2 x = x + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 *\<^sub>C x = x + x
[PROOF STEP]
unfolding one_add_one [symmetric] scaleC_add_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 *\<^sub>C x + 1 *\<^sub>C x = x + x
[PROOF STEP]
by simp


[STATEMENT]
lemma mset_set_subseteq_mset_set:
  assumes "finite B" "A \<subseteq> B"
  shows "mset_set A \<subseteq># mset_set B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
from \<open>A \<subseteq> B\<close> \<open>finite B\<close>
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> B
finite B
[PROOF STEP]
have "finite A"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
finite B

goal (1 subgoal):
 1. finite A
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
finite B
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

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

goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
finite A

goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
have "count (mset_set A) x \<le> count (mset_set B) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (mset_set A) x \<le> count (mset_set B) x
[PROOF STEP]
using \<open>finite A\<close> \<open>finite B\<close> \<open>A \<subseteq> B\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
A \<subseteq> B

goal (1 subgoal):
 1. count (mset_set A) x \<le> count (mset_set B) x
[PROOF STEP]
by (metis count_mset_set(1, 3) eq_iff subsetCE zero_le_one)
[PROOF STATE]
proof (state)
this:
count (mset_set A) x \<le> count (mset_set B) x

goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
count (mset_set A) ?x2 \<le> count (mset_set B) ?x2

goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
count (mset_set A) ?x2 \<le> count (mset_set B) ?x2
[PROOF STEP]
show "mset_set A \<subseteq># mset_set B"
[PROOF STATE]
proof (prove)
using this:
count (mset_set A) ?x2 \<le> count (mset_set B) ?x2

goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
using mset_subset_eqI
[PROOF STATE]
proof (prove)
using this:
count (mset_set A) ?x2 \<le> count (mset_set B) ?x2
(\<And>a. count ?A a \<le> count ?B a) \<Longrightarrow> ?A \<subseteq># ?B

goal (1 subgoal):
 1. mset_set A \<subseteq># mset_set B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
mset_set A \<subseteq># mset_set B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hf_deriv_int_poly:
  "(deriv^^k) (hf n) = (\<lambda>x. (1/fact n) * (\<Sum>i=0..2*n-k. of_int (int(\<Prod>{i<..i+k}) * cf n (i+k)) * x^i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i))
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (deriv ^^ 0) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - 0. real_of_int (int (\<Prod>{i<..i + 0}) * cf n (i + 0)) * x ^ i))
 2. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (deriv ^^ 0) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - 0. real_of_int (int (\<Prod>{i<..i + 0}) * cf n (i + 0)) * x ^ i))
 2. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ 0) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - 0. real_of_int (int (\<Prod>{i<..i + 0}) * cf n (i + 0)) * x ^ i))
[PROOF STEP]
by (simp add: hf_int_poly)
[PROOF STATE]
proof (state)
this:
(deriv ^^ 0) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - 0. real_of_int (int (\<Prod>{i<..i + 0}) * cf n (i + 0)) * x ^ i))

goal (1 subgoal):
 1. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
(deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i))

goal (1 subgoal):
 1. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
define F where "F \<equiv> \<lambda>x. (\<Sum>i = 0..2*n - k. real_of_int (int(\<Prod>{i<..i+k}) * cf n (i+k)) * x^i)"
[PROOF STATE]
proof (state)
this:
F \<equiv> \<lambda>x. \<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i

goal (1 subgoal):
 1. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
have Fd: "F field_differentiable at x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F field_differentiable at x
[PROOF STEP]
unfolding field_differentiable_def F_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f'. ((\<lambda>x. \<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i) has_real_derivative f') (at x)
[PROOF STEP]
by (rule derivative_eq_intros exI | force)+
[PROOF STATE]
proof (state)
this:
F field_differentiable at ?x

goal (1 subgoal):
 1. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
have [simp]: "prod int {i<..Suc (i + k)} = (1 + int i) * prod int {Suc i<..Suc (i + k)}" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod int {i<..Suc (i + k)} = (1 + int i) * prod int {Suc i<..Suc (i + k)}
[PROOF STEP]
by (metis Suc_le_mono atLeastSucAtMost_greaterThanAtMost le_add1 of_nat_Suc prod.head)
[PROOF STATE]
proof (state)
this:
prod int {?i<..Suc (?i + k)} = (1 + int ?i) * prod int {Suc ?i<..Suc (?i + k)}

goal (1 subgoal):
 1. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
have "deriv (\<lambda>x. F x / fact n) x
      = (\<Sum>i = 0..2 * n - Suc k. of_int (int(\<Prod>{i<..i+ Suc k}) * cf n (Suc (i+k))) * x^i) / fact n" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. F x / fact n) x = (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (Suc (i + k))) * x ^ i) / fact n
[PROOF STEP]
unfolding deriv_cdivide_right [OF Fd]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv F x / fact n = (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (Suc (i + k))) * x ^ i) / fact n
[PROOF STEP]
by (fastforce simp add: F_def deriv_sum_int cf_def simp flip: of_int_mult intro: sum.cong)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. F x / fact n) ?x = (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (Suc (i + k))) * ?x ^ i) / fact n

goal (1 subgoal):
 1. \<And>k. (deriv ^^ k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - k. real_of_int (int (\<Prod>{i<..i + k}) * cf n (i + k)) * x ^ i)) \<Longrightarrow> (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. F x / fact n) ?x = (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (Suc (i + k))) * ?x ^ i) / fact n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. F x / fact n) ?x = (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (Suc (i + k))) * ?x ^ i) / fact n

goal (1 subgoal):
 1. (deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))
[PROOF STEP]
by (simp add: Suc F_def)
[PROOF STATE]
proof (state)
this:
(deriv ^^ Suc k) (hf n) = (\<lambda>x. 1 / fact n * (\<Sum>i = 0..2 * n - Suc k. real_of_int (int (\<Prod>{i<..i + Suc k}) * cf n (i + Suc k)) * x ^ i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_NTT:
  assumes n_def: "length numbers = n"
  shows "length (NTT numbers) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (NTT numbers) = n
[PROOF STEP]
unfolding NTT_def ntt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (map (\<lambda>i. \<Sum>j = 0..<n. numbers ! j * \<omega> ^ (i * j)) [0..<n]) = n
[PROOF STEP]
using n_def length_map[of _ "[0..<n]"]
[PROOF STATE]
proof (prove)
using this:
length numbers = n
length (map ?f [0..<n]) = length [0..<n]

goal (1 subgoal):
 1. length (map (\<lambda>i. \<Sum>j = 0..<n. numbers ! j * \<omega> ^ (i * j)) [0..<n]) = n
[PROOF STEP]
by simp


[STATEMENT]
lemma hyperpow_le: "\<And>x y n. (0::'a::{linordered_semidom} star) < x \<Longrightarrow> x \<le> y \<Longrightarrow> x pow n \<le> y pow n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y n. \<lbrakk>0 < x; x \<le> y\<rbrakk> \<Longrightarrow> x pow n \<le> y pow n
[PROOF STEP]
by transfer (rule power_mono [OF _ order_less_imp_le])


[STATEMENT]
theorem invertible_is_bijective:
  assumes dom: "\<alpha> \<in> S \<rightarrow>\<^sub>E S"
  shows "invertible \<alpha> \<longleftrightarrow> bij_betw \<alpha> S S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible \<alpha> = bij_betw \<alpha> S S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. invertible \<alpha> = bij_betw \<alpha> S S
[PROOF STEP]
from dom
[PROOF STATE]
proof (chain)
picking this:
\<alpha> \<in> S \<rightarrow>\<^sub>E S
[PROOF STEP]
interpret map \<alpha> S S
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> S \<rightarrow>\<^sub>E S

goal (1 subgoal):
 1. map \<alpha> S S
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. invertible \<alpha> = bij_betw \<alpha> S S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible \<alpha> = bij_betw \<alpha> S S
[PROOF STEP]
by (auto simp add: bij_betw_iff_has_inverse invertible_def)
[PROOF STATE]
proof (state)
this:
invertible \<alpha> = bij_betw \<alpha> S S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_matrix_mult_inner_mult:
  shows "(A ** B) $ i $ j = row i A \<bullet> column j B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A ** B) $ i $ j = row i A \<bullet> column j B
[PROOF STEP]
unfolding inner_vec_def matrix_matrix_mult_def row_def column_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. \<Sum>k\<in>UNIV. A $ i $ k * B $ k $ j) $ i $ j = (\<Sum>ia\<in>UNIV. vec_lambda (($) (A $ i)) $ ia \<bullet> (\<chi>i. B $ i $ j) $ ia)
[PROOF STEP]
by auto


[STATEMENT]
lemma homotopic_nearby_paths:
  fixes g h :: "real \<Rightarrow> 'a::euclidean_space"
  assumes "path g" "open S" "path_image g \<subseteq> S"
    shows "\<exists>e. 0 < e \<and>
               (\<forall>h. path h \<and>
                    pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and>
                    (\<forall>t \<in> {0..1}. norm(h t - g t) < e) \<longrightarrow> homotopic_paths S g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>h. path h \<and> pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and> (\<forall>t\<in>{0..1}. norm (h t - g t) < e) \<longrightarrow> homotopic_paths S g h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>h. path h \<and> pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and> (\<forall>t\<in>{0..1}. norm (h t - g t) < e) \<longrightarrow> homotopic_paths S g h
[PROOF STEP]
obtain e where "e > 0" and e: "\<And>x y. x \<in> path_image g \<Longrightarrow> y \<in> - S \<Longrightarrow> e \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<And>x y. \<lbrakk>x \<in> path_image g; y \<in> - S\<rbrakk> \<Longrightarrow> e \<le> dist x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using separate_compact_closed [of "path_image g" "-S"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact (path_image g); closed (- S); path_image g \<inter> - S = {}\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x\<in>path_image g. \<forall>y\<in>- S. d \<le> dist x y
path g
open S
path_image g \<subseteq> S

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; \<And>x y. \<lbrakk>x \<in> path_image g; y \<in> - S\<rbrakk> \<Longrightarrow> e \<le> dist x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < e
\<lbrakk>?x \<in> path_image g; ?y \<in> - S\<rbrakk> \<Longrightarrow> e \<le> dist ?x ?y

goal (1 subgoal):
 1. \<exists>e>0. \<forall>h. path h \<and> pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and> (\<forall>t\<in>{0..1}. norm (h t - g t) < e) \<longrightarrow> homotopic_paths S g h
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. \<forall>h. path h \<and> pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and> (\<forall>t\<in>{0..1}. norm (h t - g t) < e) \<longrightarrow> homotopic_paths S g h
[PROOF STEP]
using e [unfolded dist_norm] \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> path_image g; ?y \<in> - S\<rbrakk> \<Longrightarrow> e \<le> norm (?x - ?y)
0 < e

goal (1 subgoal):
 1. \<exists>e>0. \<forall>h. path h \<and> pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and> (\<forall>t\<in>{0..1}. norm (h t - g t) < e) \<longrightarrow> homotopic_paths S g h
[PROOF STEP]
by (fastforce simp: path_image_def intro!: homotopic_paths_nearby_explicit assms exI)
[PROOF STATE]
proof (state)
this:
\<exists>e>0. \<forall>h. path h \<and> pathstart h = pathstart g \<and> pathfinish h = pathfinish g \<and> (\<forall>t\<in>{0..1}. norm (h t - g t) < e) \<longrightarrow> homotopic_paths S g h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fls_pow_subdegree_ge:
  "f^n \<noteq> 0 \<Longrightarrow> fls_subdegree (f^n) \<ge> n * fls_subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ^ n \<noteq> 0 \<Longrightarrow> int n * fls_subdegree f \<le> fls_subdegree (f ^ n)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ^ 0 \<noteq> 0 \<Longrightarrow> int 0 * fls_subdegree f \<le> fls_subdegree (f ^ 0)
 2. \<And>n. \<lbrakk>f ^ n \<noteq> 0 \<Longrightarrow> int n * fls_subdegree f \<le> fls_subdegree (f ^ n); f ^ Suc n \<noteq> 0\<rbrakk> \<Longrightarrow> int (Suc n) * fls_subdegree f \<le> fls_subdegree (f ^ Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
f ^ n \<noteq> 0 \<Longrightarrow> int n * fls_subdegree f \<le> fls_subdegree (f ^ n)
f ^ Suc n \<noteq> 0

goal (2 subgoals):
 1. f ^ 0 \<noteq> 0 \<Longrightarrow> int 0 * fls_subdegree f \<le> fls_subdegree (f ^ 0)
 2. \<And>n. \<lbrakk>f ^ n \<noteq> 0 \<Longrightarrow> int n * fls_subdegree f \<le> fls_subdegree (f ^ n); f ^ Suc n \<noteq> 0\<rbrakk> \<Longrightarrow> int (Suc n) * fls_subdegree f \<le> fls_subdegree (f ^ Suc n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
f ^ n \<noteq> 0 \<Longrightarrow> int n * fls_subdegree f \<le> fls_subdegree (f ^ n)
f ^ Suc n \<noteq> 0

goal (1 subgoal):
 1. int (Suc n) * fls_subdegree f \<le> fls_subdegree (f ^ Suc n)
[PROOF STEP]
using fls_mult_subdegree_ge[of f "f^n"]
[PROOF STATE]
proof (prove)
using this:
f ^ n \<noteq> 0 \<Longrightarrow> int n * fls_subdegree f \<le> fls_subdegree (f ^ n)
f ^ Suc n \<noteq> 0
f * f ^ n \<noteq> 0 \<Longrightarrow> fls_subdegree f + fls_subdegree (f ^ n) \<le> fls_subdegree (f * f ^ n)

goal (1 subgoal):
 1. int (Suc n) * fls_subdegree f \<le> fls_subdegree (f ^ Suc n)
[PROOF STEP]
by (fastforce simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
int (Suc n) * fls_subdegree f \<le> fls_subdegree (f ^ Suc n)

goal (1 subgoal):
 1. f ^ 0 \<noteq> 0 \<Longrightarrow> int 0 * fls_subdegree f \<le> fls_subdegree (f ^ 0)
[PROOF STEP]
qed simp


[STATEMENT]
lemma vle_antisym: "\<lbrakk>x \<unlhd> y; y \<unlhd> x\<rbrakk> \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<unlhd> y; y \<unlhd> x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by (metis V_equalityI plus_eq_lift sup_ge1 vle_def vsubsetD)


[STATEMENT]
lemma locally_path_connected_space:
   "locally_path_connected_space X
   \<longleftrightarrow> (\<forall>V x. openin X V \<and> x \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> path_connectedin X U \<and> x \<in> U \<and> U \<subseteq> V))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_path_connected_space X = (\<forall>V x. openin X V \<and> x \<in> V \<longrightarrow> (\<exists>U. openin X U \<and> path_connectedin X U \<and> x \<in> U \<and> U \<subseteq> V))
[PROOF STEP]
by (simp add: locally_path_connected_space_alt open_neighbourhood_base_of)


[STATEMENT]
lemma finite_polyhedron_extreme_points:
  fixes S :: "'a :: euclidean_space set"
  assumes "polyhedron S" shows "finite {v. v extreme_point_of S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {v. v extreme_point_of S}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {v. v extreme_point_of S}
[PROOF STEP]
have "finite {v. {v} face_of S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {v. {v} face_of S}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
polyhedron S

goal (1 subgoal):
 1. finite {v. {v} face_of S}
[PROOF STEP]
by (intro finite_subset [OF _ finite_vimageI [OF finite_polyhedron_faces]], auto)
[PROOF STATE]
proof (state)
this:
finite {v. {v} face_of S}

goal (1 subgoal):
 1. finite {v. v extreme_point_of S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {v. {v} face_of S}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {v. {v} face_of S}

goal (1 subgoal):
 1. finite {v. v extreme_point_of S}
[PROOF STEP]
by (simp add: face_of_singleton)
[PROOF STATE]
proof (state)
this:
finite {v. v extreme_point_of S}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_rel_mono[relator_props]: "\<lbrakk> R1\<subseteq>R2; R3\<subseteq>R4 \<rbrakk> \<Longrightarrow> R2\<rightarrow>R3 \<subseteq> R1\<rightarrow>R4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R1 \<subseteq> R2; R3 \<subseteq> R4\<rbrakk> \<Longrightarrow> R2 \<rightarrow> R3 \<subseteq> R1 \<rightarrow> R4
[PROOF STEP]
by (force simp: fun_rel_def)


[STATEMENT]
lemma pSum_test_expression:
  "(\<forall>n . t n \<in> Test_expression) \<Longrightarrow> pSum t m \<in> Test_expression"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. t n \<in> Test_expression \<Longrightarrow> pSum t m \<in> Test_expression
[PROOF STEP]
apply (induct m)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>n. t n \<in> Test_expression \<Longrightarrow> pSum t 0 \<in> Test_expression
 2. \<And>m. \<lbrakk>\<forall>n. t n \<in> Test_expression \<Longrightarrow> pSum t m \<in> Test_expression; \<forall>n. t n \<in> Test_expression\<rbrakk> \<Longrightarrow> pSum t (Suc m) \<in> Test_expression
[PROOF STEP]
apply (simp add: zero_test_expression)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<forall>n. t n \<in> Test_expression \<Longrightarrow> pSum t m \<in> Test_expression; \<forall>n. t n \<in> Test_expression\<rbrakk> \<Longrightarrow> pSum t (Suc m) \<in> Test_expression
[PROOF STEP]
by (simp add: disj_test)


[STATEMENT]
lemma norm_ket_k_lt_K:
  "k < K \<Longrightarrow> inner_prod (ket_k k) (ket_k k) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < K \<Longrightarrow> inner_prod (ket_k k) (ket_k k) = 1
[PROOF STEP]
unfolding ket_k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < K \<Longrightarrow> inner_prod (Matrix.vec K (\<lambda>ka. if ka = k then 1 else 0)) (Matrix.vec K (\<lambda>ka. if ka = k then 1 else 0)) = 1
[PROOF STEP]
apply (simp add: scalar_prod_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < K \<Longrightarrow> (\<Sum>i = 0..<K. (if i = k then 1 else 0) * cnj (if i = k then 1 else 0)) = 1
[PROOF STEP]
using sum_only_one_neq_0[of "{0..<K}" k "\<lambda>i. (if i = k then 1 else 0) * cnj (if i = k then 1 else 0)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {0..<K}; k \<in> {0..<K}; \<And>i. \<lbrakk>i \<in> {0..<K}; i \<noteq> k\<rbrakk> \<Longrightarrow> (if i = k then 1 else 0) * cnj (if i = k then 1 else 0) = 0\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<K. (if i = k then 1 else 0) * cnj (if i = k then 1 else 0)) = (if k = k then 1 else 0) * cnj (if k = k then 1 else 0)

goal (1 subgoal):
 1. k < K \<Longrightarrow> (\<Sum>i = 0..<K. (if i = k then 1 else 0) * cnj (if i = k then 1 else 0)) = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma partition_without_covers:
  fixes elem::'a
    and P::"'a set set"
  shows "\<Union> (partition_without elem P) = (\<Union> P) - {elem}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (partition_without elem P) = \<Union> P - {elem}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Union> (partition_without elem P) = \<Union> P - {elem}
[PROOF STEP]
have "\<Union> (partition_without elem P) = \<Union> ((\<lambda>x . x - {elem}) ` P - {{}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (partition_without elem P) = \<Union> ((\<lambda>x. x - {elem}) ` P - {{}})
[PROOF STEP]
unfolding partition_without_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> ((\<lambda>X. X - {elem}) ` P - {{}}) = \<Union> ((\<lambda>x. x - {elem}) ` P - {{}})
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<Union> (partition_without elem P) = \<Union> ((\<lambda>x. x - {elem}) ` P - {{}})

goal (1 subgoal):
 1. \<Union> (partition_without elem P) = \<Union> P - {elem}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Union> (partition_without elem P) = \<Union> ((\<lambda>x. x - {elem}) ` P - {{}})

goal (1 subgoal):
 1. \<Union> (partition_without elem P) = \<Union> P - {elem}
[PROOF STEP]
have "\<dots> = \<Union> P - {elem}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> ((\<lambda>x. x - {elem}) ` P - {{}}) = \<Union> P - {elem}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> ((\<lambda>x. x - {elem}) ` P - {{}}) = \<Union> P - {elem}

goal (1 subgoal):
 1. \<Union> (partition_without elem P) = \<Union> P - {elem}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Union> (partition_without elem P) = \<Union> P - {elem}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Union> (partition_without elem P) = \<Union> P - {elem}

goal (1 subgoal):
 1. \<Union> (partition_without elem P) = \<Union> P - {elem}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Union> (partition_without elem P) = \<Union> P - {elem}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem real_mon_conv_dom:
  assumes xy: "x\<up>(y::real)" and mon: "\<And>n. c n \<le> c (Suc n)"
  and dom: "c \<le> x"
  shows "\<exists>l. c\<up>l \<and> l\<le>y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
from dom
[PROOF STATE]
proof (chain)
picking this:
c \<le> x
[PROOF STEP]
have "\<And>n. c n \<le> x n"
[PROOF STATE]
proof (prove)
using this:
c \<le> x

goal (1 subgoal):
 1. \<And>n. c n \<le> x n
[PROOF STEP]
by (simp add: le_fun_def)
[PROOF STATE]
proof (state)
this:
c ?n \<le> x ?n

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c ?n \<le> x ?n

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
from xy
[PROOF STATE]
proof (chain)
picking this:
x\<up>y
[PROOF STEP]
have "\<And>n. x n \<le> y"
[PROOF STATE]
proof (prove)
using this:
x\<up>y

goal (1 subgoal):
 1. \<And>n. x n \<le> y
[PROOF STEP]
by (simp add: real_mon_conv_le)
[PROOF STATE]
proof (state)
this:
x ?n \<le> y

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ?n \<le> y

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
note mon
[PROOF STATE]
proof (state)
this:
c ?n \<le> c (Suc ?n)

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c ?n1 \<le> y
c ?n \<le> c (Suc ?n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c ?n1 \<le> y
c ?n \<le> c (Suc ?n)

goal (1 subgoal):
 1. \<exists>l. c\<up>l \<and> l \<le> y
[PROOF STEP]
by (simp add: real_mon_conv_bound)
[PROOF STATE]
proof (state)
this:
\<exists>l. c\<up>l \<and> l \<le> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sums_infsetsum_nat:
  assumes "f abs_summable_on A"
  shows   "(\<lambda>n. if n \<in> A then f n else 0) sums infsetsum f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f abs_summable_on A
[PROOF STEP]
have "summable (\<lambda>n. if n \<in> A then norm (f n) else 0)"
[PROOF STATE]
proof (prove)
using this:
f abs_summable_on A

goal (1 subgoal):
 1. summable (\<lambda>n. if n \<in> A then norm (f n) else 0)
[PROOF STEP]
by (simp add: abs_summable_on_nat_iff)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. if n \<in> A then norm (f n) else 0)

goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. if n \<in> A then norm (f n) else 0)

goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A
[PROOF STEP]
have "(\<lambda>n. if n \<in> A then norm (f n) else 0) = (\<lambda>n. norm (if n \<in> A then f n else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then norm (f n) else 0) = (\<lambda>n. norm (if n \<in> A then f n else (0::'a)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n \<in> A then norm (f n) else 0) = (\<lambda>n. norm (if n \<in> A then f n else (0::'a)))

goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. norm (if n \<in> A then f n else (0::'a)))
[PROOF STEP]
have "summable (\<lambda>n. if n \<in> A then f n else 0)"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (if n \<in> A then f n else (0::'a)))

goal (1 subgoal):
 1. summable (\<lambda>n. if n \<in> A then f n else (0::'a))
[PROOF STEP]
by (rule summable_norm_cancel)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. if n \<in> A then f n else (0::'a))

goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
f abs_summable_on A
summable (\<lambda>n. if n \<in> A then f n else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f abs_summable_on A
summable (\<lambda>n. if n \<in> A then f n else (0::'a))

goal (1 subgoal):
 1. (\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A
[PROOF STEP]
by (auto simp: sums_iff infsetsum_nat)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n \<in> A then f n else (0::'a)) sums infsetsum f A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma surjective_on_implies_card_eq:
  assumes "f ` A = B"
  shows "card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
from \<open>f ` A = B\<close>
[PROOF STATE]
proof (chain)
picking this:
f ` A = B
[PROOF STEP]
have "{} \<notin> (\<lambda>b. {x \<in> A. f x = b}) ` B"
[PROOF STATE]
proof (prove)
using this:
f ` A = B

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

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
from \<open>f ` A = B\<close>
[PROOF STATE]
proof (chain)
picking this:
f ` A = B
[PROOF STEP]
have "inj_on (\<lambda>b. {x \<in> A. f x = b}) B"
[PROOF STATE]
proof (prove)
using this:
f ` A = B

goal (1 subgoal):
 1. inj_on (\<lambda>b. {x \<in> A. f x = b}) B
[PROOF STEP]
by (fastforce intro: inj_onI)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>b. {x \<in> A. f x = b}) B

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

goal (1 subgoal):
 1. card ((\<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:
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card ((\<lambda>b. {x \<in> A. f x = b}) ` B)

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

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
have "\<dots> = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B) = card B
[PROOF STEP]
using \<open>inj_on (\<lambda>b. {x \<in> A. f x = b}) B\<close>
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>b. {x \<in> A. f x = b}) B

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B) = card B
[PROOF STEP]
by (rule card_image)
[PROOF STATE]
proof (state)
this:
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]
finally
[PROOF STATE]
proof (chain)
picking this:
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
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]
.
[PROOF STATE]
proof (state)
this:
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_times_vec_leqI[intro]:
  assumes "dim_row A = dim_vec b"
  assumes "dim_col A = dim_vec x"
  assumes "\<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x)$i \<le> b$i"
  shows "[A *\<^sub>v x]\<le>b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A*\<^sub>vx]\<le>b
[PROOF STEP]
unfolding mat_times_vec_leq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i) \<and> dim_row A = dim_vec b \<and> dim_col A = dim_vec x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dim_row A = dim_vec b
dim_col A = dim_vec x
?i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ ?i \<le> b $ ?i

goal (1 subgoal):
 1. (\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i) \<and> dim_row A = dim_vec b \<and> dim_col A = dim_vec x
[PROOF STEP]
by auto


[STATEMENT]
lemma tan_inverse: "1 / (tan y) = tan (pi/2 - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / tan y = tan (pi / 2 - y)
[PROOF STEP]
unfolding tan_def sin_cos_eq[of y] cos_sin_eq[of y]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (cos (of_real pi / 2 - y) / sin (of_real pi / 2 - y)) = sin (pi / 2 - y) / cos (pi / 2 - y)
[PROOF STEP]
by auto


[STATEMENT]
lemma iso_hom_relboundary_contractible:
  assumes "contractible_space X" "contractible_space(subtopology X T)" "T \<subseteq> S" "topspace X \<inter> T \<noteq> {}"
  shows "hom_relboundary p X S T
         \<in> iso (relative_homology_group p X S) (relative_homology_group (p - 1) (subtopology X S) T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom_relboundary p X S T \<in> Group.iso (relative_homology_group p X S) (relative_homology_group (p - 1) (subtopology X S) T)
[PROOF STEP]
proof (rule very_short_exact_sequence)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. exact_seq ([?D, relative_homology_group (p - 1) (subtopology X S) T, relative_homology_group p X S, ?A], [?h, hom_relboundary p X S T, ?f])
 2. trivial_group ?A
 3. trivial_group ?D
[PROOF STEP]
show "exact_seq
         ([relative_homology_group (p - 1) X T, relative_homology_group (p - 1) (subtopology X S) T, relative_homology_group p X S, relative_homology_group p X T],
          [hom_induced (p - 1) (subtopology X S) T X T id, hom_relboundary p X S T, hom_induced p X T X S id])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exact_seq ([relative_homology_group (p - 1) X T, relative_homology_group (p - 1) (subtopology X S) T, relative_homology_group p X S, relative_homology_group p X T], [hom_induced (p - 1) (subtopology X S) T X T id, hom_relboundary p X S T, hom_induced p X T X S id])
[PROOF STEP]
using homology_exactness_triple_1 [OF \<open>T \<subseteq> S\<close>] homology_exactness_triple_2 [OF \<open>T \<subseteq> S\<close>]
[PROOF STATE]
proof (prove)
using this:
exact_seq ([relative_homology_group (?p - 1) (subtopology ?X S) T, relative_homology_group ?p ?X S, relative_homology_group ?p ?X T], [hom_relboundary ?p ?X S T, hom_induced ?p ?X T ?X S id])
exact_seq ([relative_homology_group (?p - 1) ?X T, relative_homology_group (?p - 1) (subtopology ?X S) T, relative_homology_group ?p ?X S], [hom_induced (?p - 1) (subtopology ?X S) T ?X T id, hom_relboundary ?p ?X S T])

goal (1 subgoal):
 1. exact_seq ([relative_homology_group (p - 1) X T, relative_homology_group (p - 1) (subtopology X S) T, relative_homology_group p X S, relative_homology_group p X T], [hom_induced (p - 1) (subtopology X S) T X T id, hom_relboundary p X S T, hom_induced p X T X S id])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exact_seq ([relative_homology_group (p - 1) X T, relative_homology_group (p - 1) (subtopology X S) T, relative_homology_group p X S, relative_homology_group p X T], [hom_induced (p - 1) (subtopology X S) T X T id, hom_relboundary p X S T, hom_induced p X T X S id])

goal (2 subgoals):
 1. trivial_group (relative_homology_group p X T)
 2. trivial_group (relative_homology_group (p - 1) X T)
[PROOF STEP]
show "trivial_group (relative_homology_group p X T)" "trivial_group (relative_homology_group (p - 1) X T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group (relative_homology_group p X T) &&& trivial_group (relative_homology_group (p - 1) X T)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
contractible_space X
contractible_space (subtopology X T)
T \<subseteq> S
topspace X \<inter> T \<noteq> {}

goal (1 subgoal):
 1. trivial_group (relative_homology_group p X T) &&& trivial_group (relative_homology_group (p - 1) X T)
[PROOF STEP]
by (auto simp: subtopology_subtopology topspace_subtopology intro!: trivial_relative_homology_group_contractible_spaces)
[PROOF STATE]
proof (state)
this:
trivial_group (relative_homology_group p X T)
trivial_group (relative_homology_group (p - 1) X T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_eq_nth_conv:
  "map f xs = map g ys \<longleftrightarrow> length xs = length ys \<and> (\<forall> i < length ys. f (xs ! i) = g (ys ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f xs = map g ys) = (length xs = length ys \<and> (\<forall>i<length ys. f (xs ! i) = g (ys ! i)))
[PROOF STEP]
using map_eq_imp_length_eq[of f xs g ys]
[PROOF STATE]
proof (prove)
using this:
map f xs = map g ys \<Longrightarrow> length xs = length ys

goal (1 subgoal):
 1. (map f xs = map g ys) = (length xs = length ys \<and> (\<forall>i<length ys. f (xs ! i) = g (ys ! i)))
[PROOF STEP]
by (auto intro: nth_equalityI) (metis nth_map)


[STATEMENT]
lemma set_set_to_list: "finite xs \<Longrightarrow> set (set_to_list xs) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite xs \<Longrightarrow> set (set_to_list xs) = xs
[PROOF STEP]
proof (induction rule: finite.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (set_to_list {}) = {}
 2. \<And>A a. \<lbrakk>finite A; set (set_to_list A) = A\<rbrakk> \<Longrightarrow> set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
case (emptyI)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. set (set_to_list {}) = {}
 2. \<And>A a. \<lbrakk>finite A; set (set_to_list A) = A\<rbrakk> \<Longrightarrow> set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
have "set [] = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set [] = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set [] = {}

goal (2 subgoals):
 1. set (set_to_list {}) = {}
 2. \<And>A a. \<lbrakk>finite A; set (set_to_list A) = A\<rbrakk> \<Longrightarrow> set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set [] = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
set [] = {}

goal (1 subgoal):
 1. set (set_to_list {}) = {}
[PROOF STEP]
unfolding set_to_list_def inv_into_def
[PROOF STATE]
proof (prove)
using this:
set [] = {}

goal (1 subgoal):
 1. set (SOME y. y \<in> UNIV \<and> set y = {}) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (set_to_list {}) = {}

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; set (set_to_list A) = A\<rbrakk> \<Longrightarrow> set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; set (set_to_list A) = A\<rbrakk> \<Longrightarrow> set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
case (insertI A a)
[PROOF STATE]
proof (state)
this:
finite A
set (set_to_list A) = A

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; set (set_to_list A) = A\<rbrakk> \<Longrightarrow> set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite A
set (set_to_list A) = A
[PROOF STEP]
have "set (a#set_to_list A) = insert a A"
[PROOF STATE]
proof (prove)
using this:
finite A
set (set_to_list A) = A

goal (1 subgoal):
 1. set (a # set_to_list A) = insert a A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (a # set_to_list A) = insert a A

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; set (set_to_list A) = A\<rbrakk> \<Longrightarrow> set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (a # set_to_list A) = insert a A
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
set (a # set_to_list A) = insert a A

goal (1 subgoal):
 1. set (set_to_list (insert a A)) = insert a A
[PROOF STEP]
unfolding set_to_list_def inv_into_def
[PROOF STATE]
proof (prove)
using this:
set (a # (SOME y. y \<in> UNIV \<and> set y = A)) = insert a A

goal (1 subgoal):
 1. set (SOME y. y \<in> UNIV \<and> set y = insert a A) = insert a A
[PROOF STEP]
by (metis (mono_tags, lifting) UNIV_I someI)
[PROOF STATE]
proof (state)
this:
set (set_to_list (insert a A)) = insert a A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma total_finite_trans_max:
  "X \<noteq> {} \<Longrightarrow> finite X \<Longrightarrow> total_on X r \<Longrightarrow> trans r \<Longrightarrow> \<exists> x \<in> X. \<forall> y \<in> X. x \<noteq> y \<longrightarrow> (y, x) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
proof (induction "card X" arbitrary: X)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r; Suc x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 = card X
X \<noteq> {}
finite X
total_on X r
trans r

goal (2 subgoals):
 1. \<And>X. \<lbrakk>0 = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
 2. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r; Suc x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 = card X
X \<noteq> {}
finite X
total_on X r
trans r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 = card X
X \<noteq> {}
finite X
total_on X r
trans r

goal (1 subgoal):
 1. \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal (1 subgoal):
 1. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r; Suc x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r; Suc x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>n = card ?X; ?X \<noteq> {}; finite ?X; total_on ?X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>?X. \<forall>y\<in>?X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
Suc n = card X
X \<noteq> {}
finite X
total_on X r
trans r

goal (1 subgoal):
 1. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r; Suc x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>n = card ?X; ?X \<noteq> {}; finite ?X; total_on ?X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>?X. \<forall>y\<in>?X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
Suc n = card X
X \<noteq> {}
finite X
total_on X r
trans r
[PROOF STEP]
obtain x where x: "x \<in> X"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n = card ?X; ?X \<noteq> {}; finite ?X; total_on ?X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>?X. \<forall>y\<in>?X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
Suc n = card X
X \<noteq> {}
finite X
total_on X r
trans r

goal (1 subgoal):
 1. (\<And>x. x \<in> X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (1 subgoal):
 1. \<And>x X. \<lbrakk>\<And>X. \<lbrakk>x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r; Suc x = card X; X \<noteq> {}; finite X; total_on X r; trans r\<rbrakk> \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
 2. n \<noteq> 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
 2. n \<noteq> 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
with Suc.hyps(2) \<open>finite X\<close> x
[PROOF STATE]
proof (chain)
picking this:
Suc n = card X
finite X
x \<in> X
n = 0
[PROOF STEP]
have "X = {x}"
[PROOF STATE]
proof (prove)
using this:
Suc n = card X
finite X
x \<in> X
n = 0

goal (1 subgoal):
 1. X = {x}
[PROOF STEP]
by (metis card_Suc_eq empty_iff insertE)
[PROOF STATE]
proof (state)
this:
X = {x}

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
 2. n \<noteq> 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X = {x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X = {x}

goal (1 subgoal):
 1. \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
proof (cases "\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
 2. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal (2 subgoals):
 1. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
 2. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> X
\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal (1 subgoal):
 1. \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r)

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r)
[PROOF STEP]
obtain y where y: "y \<in> X" "x \<noteq> y" "\<not> (y, x) \<in> r"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> X; x \<noteq> y; (y, x) \<notin> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> X
x \<noteq> y
(y, x) \<notin> r

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
with x Suc.prems(3)
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
total_on X r
y \<in> X
x \<noteq> y
(y, x) \<notin> r
[PROOF STEP]
have "(x, y) \<in> r"
[PROOF STATE]
proof (prove)
using this:
x \<in> X
total_on X r
y \<in> X
x \<noteq> y
(y, x) \<notin> r

goal (1 subgoal):
 1. (x, y) \<in> r
[PROOF STEP]
unfolding total_on_def
[PROOF STATE]
proof (prove)
using this:
x \<in> X
\<forall>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r
y \<in> X
x \<noteq> y
(y, x) \<notin> r

goal (1 subgoal):
 1. (x, y) \<in> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x, y) \<in> r

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
let ?X = "X - {x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
have tot: "total_on ?X r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_on (X - {x}) r
[PROOF STEP]
using \<open>total_on X r\<close>
[PROOF STATE]
proof (prove)
using this:
total_on X r

goal (1 subgoal):
 1. total_on (X - {x}) r
[PROOF STEP]
unfolding total_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r

goal (1 subgoal):
 1. \<forall>xa\<in>X - {x}. \<forall>y\<in>X - {x}. xa \<noteq> y \<longrightarrow> (xa, y) \<in> r \<or> (y, xa) \<in> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
total_on (X - {x}) r

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
from x Suc.hyps(2) \<open>finite X\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
Suc n = card X
finite X
[PROOF STEP]
have card: "n = card ?X"
[PROOF STATE]
proof (prove)
using this:
x \<in> X
Suc n = card X
finite X

goal (1 subgoal):
 1. n = card (X - {x})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = card (X - {x})

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
with \<open>finite X\<close> \<open>n \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
finite X
n \<noteq> 0
n = card (X - {x})
[PROOF STEP]
have "?X \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
finite X
n \<noteq> 0
n = card (X - {x})

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

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
from Suc.hyps(1)[OF card this _ tot \<open>trans r\<close>] \<open>finite X\<close>
[PROOF STATE]
proof (chain)
picking this:
finite (X - {x}) \<Longrightarrow> \<exists>xa\<in>X - {x}. \<forall>y\<in>X - {x}. xa \<noteq> y \<longrightarrow> (y, xa) \<in> r
finite X
[PROOF STEP]
obtain x' where
        IH: "x' \<in> ?X" "\<forall> y \<in> ?X. x' \<noteq> y \<longrightarrow> (y, x') \<in> r"
[PROOF STATE]
proof (prove)
using this:
finite (X - {x}) \<Longrightarrow> \<exists>xa\<in>X - {x}. \<forall>y\<in>X - {x}. xa \<noteq> y \<longrightarrow> (y, xa) \<in> r
finite X

goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>x' \<in> X - {x}; \<forall>y\<in>X - {x}. x' \<noteq> y \<longrightarrow> (y, x') \<in> r\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' \<in> X - {x}
\<forall>y\<in>X - {x}. x' \<noteq> y \<longrightarrow> (y, x') \<in> r

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
have "(x', x) \<notin> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x', x) \<notin> r
[PROOF STEP]
proof (rule ccontr, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (x', x) \<in> r \<Longrightarrow> False
[PROOF STEP]
assume A: "(x', x) \<in> r"
[PROOF STATE]
proof (state)
this:
(x', x) \<in> r

goal (1 subgoal):
 1. (x', x) \<in> r \<Longrightarrow> False
[PROOF STEP]
with y(3)
[PROOF STATE]
proof (chain)
picking this:
(y, x) \<notin> r
(x', x) \<in> r
[PROOF STEP]
have "x' \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
(y, x) \<notin> r
(x', x) \<in> r

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

goal (1 subgoal):
 1. (x', x) \<in> r \<Longrightarrow> False
[PROOF STEP]
with y IH
[PROOF STATE]
proof (chain)
picking this:
y \<in> X
x \<noteq> y
(y, x) \<notin> r
x' \<in> X - {x}
\<forall>y\<in>X - {x}. x' \<noteq> y \<longrightarrow> (y, x') \<in> r
x' \<noteq> y
[PROOF STEP]
have "(y, x') \<in> r"
[PROOF STATE]
proof (prove)
using this:
y \<in> X
x \<noteq> y
(y, x) \<notin> r
x' \<in> X - {x}
\<forall>y\<in>X - {x}. x' \<noteq> y \<longrightarrow> (y, x') \<in> r
x' \<noteq> y

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

goal (1 subgoal):
 1. (x', x) \<in> r \<Longrightarrow> False
[PROOF STEP]
with \<open>trans r\<close> A
[PROOF STATE]
proof (chain)
picking this:
trans r
(x', x) \<in> r
(y, x') \<in> r
[PROOF STEP]
have "(y, x) \<in> r"
[PROOF STATE]
proof (prove)
using this:
trans r
(x', x) \<in> r
(y, x') \<in> r

goal (1 subgoal):
 1. (y, x) \<in> r
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y z. (x, y) \<in> r \<longrightarrow> (y, z) \<in> r \<longrightarrow> (x, z) \<in> r
(x', x) \<in> r
(y, x') \<in> r

goal (1 subgoal):
 1. (y, x) \<in> r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(y, x) \<in> r

goal (1 subgoal):
 1. (x', x) \<in> r \<Longrightarrow> False
[PROOF STEP]
with y
[PROOF STATE]
proof (chain)
picking this:
y \<in> X
x \<noteq> y
(y, x) \<notin> r
(y, x) \<in> r
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y \<in> X
x \<noteq> y
(y, x) \<notin> r
(y, x) \<in> r

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(x', x) \<notin> r

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
with \<open>x \<in> X\<close> \<open>x' \<in> ?X\<close> \<open>total_on X r\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> X
x' \<in> X - {x}
total_on X r
(x', x) \<notin> r
[PROOF STEP]
have "(x, x') \<in> r"
[PROOF STATE]
proof (prove)
using this:
x \<in> X
x' \<in> X - {x}
total_on X r
(x', x) \<notin> r

goal (1 subgoal):
 1. (x, x') \<in> r
[PROOF STEP]
unfolding total_on_def
[PROOF STATE]
proof (prove)
using this:
x \<in> X
x' \<in> X - {x}
\<forall>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r
(x', x) \<notin> r

goal (1 subgoal):
 1. (x, x') \<in> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x, x') \<in> r

goal (1 subgoal):
 1. \<not> (\<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r) \<Longrightarrow> \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
with IH
[PROOF STATE]
proof (chain)
picking this:
x' \<in> X - {x}
\<forall>y\<in>X - {x}. x' \<noteq> y \<longrightarrow> (y, x') \<in> r
(x, x') \<in> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x' \<in> X - {x}
\<forall>y\<in>X - {x}. x' \<noteq> y \<longrightarrow> (y, x') \<in> r
(x, x') \<in> r

goal (1 subgoal):
 1. \<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>X. \<forall>y\<in>X. x \<noteq> y \<longrightarrow> (y, x) \<in> r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_linorder_rank:
  assumes "linorder_on B R" "finite A" "A \<subseteq> B"
  shows   "bij_betw (linorder_rank R A) A {..<card A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (linorder_rank R A) A {..<card A}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw (linorder_rank R A) A {..<card A}
[PROOF STEP]
define xs where "xs = sorted_wrt_list_of_set R A"
[PROOF STATE]
proof (state)
this:
xs = sorted_wrt_list_of_set R A

goal (1 subgoal):
 1. bij_betw (linorder_rank R A) A {..<card A}
[PROOF STEP]
note xs = linorder_sorted_wrt_list_of_set[OF assms, folded xs_def]
[PROOF STATE]
proof (state)
this:
set xs = A
distinct xs
Linorder_Relations.sorted_wrt R xs

goal (1 subgoal):
 1. bij_betw (linorder_rank R A) A {..<card A}
[PROOF STEP]
from \<open>distinct xs\<close>
[PROOF STATE]
proof (chain)
picking this:
distinct xs
[PROOF STEP]
have len_xs: "length xs = card A"
[PROOF STATE]
proof (prove)
using this:
distinct xs

goal (1 subgoal):
 1. length xs = card A
[PROOF STEP]
by (subst \<open>set xs = A\<close> [symmetric]) (auto simp: distinct_card)
[PROOF STATE]
proof (state)
this:
length xs = card A

goal (1 subgoal):
 1. bij_betw (linorder_rank R A) A {..<card A}
[PROOF STEP]
have rank: "linorder_rank R (set xs) x = index xs x" if "x \<in> A" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linorder_rank R (set xs) x = index xs x
[PROOF STEP]
using linorder_rank_set_sorted_wrt[OF assms(1), of xs x] assms that xs
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set xs \<subseteq> B; Linorder_Relations.sorted_wrt R xs; x \<in> set xs; distinct xs\<rbrakk> \<Longrightarrow> linorder_rank R (set xs) x = index xs x
linorder_on B R
finite A
A \<subseteq> B
x \<in> A
set xs = A
distinct xs
Linorder_Relations.sorted_wrt R xs

goal (1 subgoal):
 1. linorder_rank R (set xs) x = index xs x
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Longrightarrow> linorder_rank R (set xs) ?x = index xs ?x

goal (1 subgoal):
 1. bij_betw (linorder_rank R A) A {..<card A}
[PROOF STEP]
from xs len_xs
[PROOF STATE]
proof (chain)
picking this:
set xs = A
distinct xs
Linorder_Relations.sorted_wrt R xs
length xs = card A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set xs = A
distinct xs
Linorder_Relations.sorted_wrt R xs
length xs = card A

goal (1 subgoal):
 1. bij_betw (linorder_rank R A) A {..<card A}
[PROOF STEP]
by (intro bij_betw_byWitness[where f' = "\<lambda>i. xs ! i"])
       (auto simp: rank index_nth_id intro!: nth_mem)
[PROOF STATE]
proof (state)
this:
bij_betw (linorder_rank R A) A {..<card A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Radon_v_lemma:
  assumes "finite S"
    and "sum f S = 0"
    and "\<forall>x. g x = (0::real) \<longrightarrow> f x = (0::'a::euclidean_space)"
  shows "(sum f {x\<in>S. 0 < g x}) = - sum f {x\<in>S. g x < 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {x \<in> S. 0 < g x} = - sum f {x \<in> S. g x < 0}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {x \<in> S. 0 < g x} = - sum f {x \<in> S. g x < 0}
[PROOF STEP]
have *: "\<And>x. (if 0 < g x then f x else 0) + (if g x < 0 then f x else 0) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (if 0 < g x then f x else (0::'a)) + (if g x < 0 then f x else (0::'a)) = f x
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
\<forall>x. g x = 0 \<longrightarrow> f x = (0::'a)

goal (1 subgoal):
 1. \<And>x. (if 0 < g x then f x else (0::'a)) + (if g x < 0 then f x else (0::'a)) = f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if 0 < g ?x then f ?x else (0::'a)) + (if g ?x < 0 then f ?x else (0::'a)) = f ?x

goal (1 subgoal):
 1. sum f {x \<in> S. 0 < g x} = - sum f {x \<in> S. g x < 0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {x \<in> S. 0 < g x} = - sum f {x \<in> S. g x < 0}
[PROOF STEP]
unfolding eq_neg_iff_add_eq_0 and sum.inter_filter[OF assms(1)]
      and sum.distrib[symmetric] and *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f S = (0::'a)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
sum f S = (0::'a)

goal (1 subgoal):
 1. sum f S = (0::'a)
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
sum f {x \<in> S. 0 < g x} = - sum f {x \<in> S. g x < 0}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_elem_power_dvd_cases:
  assumes "p ^ c dvd m * n" and "a + b = Suc c" and "prime_elem p"
  shows "p ^ a dvd m \<or> p ^ b dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ a dvd m \<or> p ^ b dvd n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p ^ a dvd m \<or> p ^ b dvd n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p ^ c dvd m * n
a + b = Suc c
prime_elem p
[PROOF STEP]
obtain r s
    where "r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n"
[PROOF STATE]
proof (prove)
using this:
p ^ c dvd m * n
a + b = Suc c
prime_elem p

goal (1 subgoal):
 1. (\<And>r s. r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast dest: prime_elem_power_dvd_prod)
[PROOF STATE]
proof (state)
this:
r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n

goal (1 subgoal):
 1. p ^ a dvd m \<or> p ^ b dvd n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n

goal (1 subgoal):
 1. p ^ a dvd m \<or> p ^ b dvd n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
p ^ c dvd m * n
a + b = Suc c
prime_elem p
r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n
[PROOF STEP]
have
    "a \<le> r \<or> b \<le> s"
[PROOF STATE]
proof (prove)
using this:
p ^ c dvd m * n
a + b = Suc c
prime_elem p
r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n

goal (1 subgoal):
 1. a \<le> r \<or> b \<le> s
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
a \<le> r \<or> b \<le> s

goal (1 subgoal):
 1. p ^ a dvd m \<or> p ^ b dvd n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n
a \<le> r \<or> b \<le> s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r + s = c \<and> p ^ r dvd m \<and> p ^ s dvd n
a \<le> r \<or> b \<le> s

goal (1 subgoal):
 1. p ^ a dvd m \<or> p ^ b dvd n
[PROOF STEP]
by (auto intro: power_le_dvd)
[PROOF STATE]
proof (state)
this:
p ^ a dvd m \<or> p ^ b dvd n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ell2_norm_smult:
  assumes "has_ell2_norm x"
  shows "has_ell2_norm (\<lambda>i. c * x i)" and "ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_ell2_norm (\<lambda>i. c * x i) &&& ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. has_ell2_norm (\<lambda>i. c * x i)
 2. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
have L2_set_mul: "L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F" for F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
have "L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = L2_set (\<lambda>i. (cmod c * (cmod o x) i)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = L2_set (\<lambda>i. cmod c * (cmod \<circ> x) i) F
[PROOF STEP]
by (metis comp_def norm_mult)
[PROOF STATE]
proof (state)
this:
L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = L2_set (\<lambda>i. cmod c * (cmod \<circ> x) i) F

goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = L2_set (\<lambda>i. cmod c * (cmod \<circ> x) i) F

goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
have "\<dots> = cmod c * L2_set (cmod o x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L2_set (\<lambda>i. cmod c * (cmod \<circ> x) i) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
by (metis norm_ge_zero L2_set_right_distrib)
[PROOF STATE]
proof (state)
this:
L2_set (\<lambda>i. cmod c * (cmod \<circ> x) i) F = cmod c * L2_set (cmod \<circ> x) F

goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F

goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
L2_set (cmod \<circ> (\<lambda>i. c * x i)) F = cmod c * L2_set (cmod \<circ> x) F

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
L2_set (cmod \<circ> (\<lambda>i. c * x i)) ?F = cmod c * L2_set (cmod \<circ> x) ?F

goal (2 subgoals):
 1. has_ell2_norm (\<lambda>i. c * x i)
 2. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
has_ell2_norm x
[PROOF STEP]
obtain M where M: "M \<ge> L2_set (cmod o x) F" if "finite F" for F
[PROOF STATE]
proof (prove)
using this:
has_ell2_norm x

goal (1 subgoal):
 1. (\<And>M. (\<And>F. finite F \<Longrightarrow> L2_set (cmod \<circ> x) F \<le> M) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding has_ell2_norm_L2_set bdd_above_def
[PROOF STATE]
proof (prove)
using this:
\<exists>M. \<forall>x\<in>L2_set (cmod \<circ> x) ` Collect finite. x \<le> M

goal (1 subgoal):
 1. (\<And>M. (\<And>F. finite F \<Longrightarrow> L2_set (cmod \<circ> x) F \<le> M) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ?F \<Longrightarrow> L2_set (cmod \<circ> x) ?F \<le> M

goal (2 subgoals):
 1. has_ell2_norm (\<lambda>i. c * x i)
 2. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
hence "cmod c * M \<ge> L2_set (cmod o (\<lambda>i. c * x i)) F" if "finite F" for F
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> L2_set (cmod \<circ> x) ?F \<le> M

goal (1 subgoal):
 1. L2_set (cmod \<circ> (\<lambda>i. c * x i)) F \<le> cmod c * M
[PROOF STEP]
unfolding L2_set_mul
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> L2_set (cmod \<circ> x) ?F \<le> M

goal (1 subgoal):
 1. cmod c * L2_set (cmod \<circ> x) F \<le> cmod c * M
[PROOF STEP]
by (simp add: ordered_comm_semiring_class.comm_mult_left_mono that)
[PROOF STATE]
proof (state)
this:
finite ?F \<Longrightarrow> L2_set (cmod \<circ> (\<lambda>i. c * x i)) ?F \<le> cmod c * M

goal (2 subgoals):
 1. has_ell2_norm (\<lambda>i. c * x i)
 2. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
thus has: "has_ell2_norm (\<lambda>i. c * x i)"
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> L2_set (cmod \<circ> (\<lambda>i. c * x i)) ?F \<le> cmod c * M

goal (1 subgoal):
 1. has_ell2_norm (\<lambda>i. c * x i)
[PROOF STEP]
unfolding has_ell2_norm_L2_set bdd_above_def
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> L2_set (cmod \<circ> (\<lambda>i. c * x i)) ?F \<le> cmod c * M

goal (1 subgoal):
 1. \<exists>M. \<forall>x\<in>L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite. x \<le> M
[PROOF STEP]
using L2_set_mul[symmetric]
[PROOF STATE]
proof (prove)
using this:
finite ?F \<Longrightarrow> L2_set (cmod \<circ> (\<lambda>i. c * x i)) ?F \<le> cmod c * M
cmod c * L2_set (cmod \<circ> x) ?F = L2_set (cmod \<circ> (\<lambda>i. c * x i)) ?F

goal (1 subgoal):
 1. \<exists>M. \<forall>x\<in>L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite. x \<le> M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
has_ell2_norm (\<lambda>i. c * x i)

goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
have "ell2_norm (\<lambda>i. c * x i) = (SUP F \<in> Collect finite. (L2_set (cmod \<circ> (\<lambda>i. c * x i)) F))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = \<Squnion> (L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite)
[PROOF STEP]
by (simp add: ell2_norm_L2_set has)
[PROOF STATE]
proof (state)
this:
ell2_norm (\<lambda>i. c * x i) = \<Squnion> (L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite)

goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ell2_norm (\<lambda>i. c * x i) = \<Squnion> (L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite)

goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
have "\<dots> = (SUP F \<in> Collect finite. (cmod c * L2_set (cmod \<circ> x) F))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite) = (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F)
[PROOF STEP]
using L2_set_mul
[PROOF STATE]
proof (prove)
using this:
L2_set (cmod \<circ> (\<lambda>i. c * x i)) ?F = cmod c * L2_set (cmod \<circ> x) ?F

goal (1 subgoal):
 1. \<Squnion> (L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite) = (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Squnion> (L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite) = (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F)

goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Squnion> (L2_set (cmod \<circ> (\<lambda>i. c * x i)) ` Collect finite) = (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F)

goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
have "\<dots> = cmod c * ell2_norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = cmod c * ell2_norm x
[PROOF STEP]
proof (subst ell2_norm_L2_set)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. has_ell2_norm x
 2. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = cmod c * \<Squnion> (L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
show "has_ell2_norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_ell2_norm x
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
has_ell2_norm x

goal (1 subgoal):
 1. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = cmod c * \<Squnion> (L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
show "(SUP F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = cmod c * \<Squnion> (L2_set (cmod \<circ> x) ` Collect finite)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = cmod c * \<Squnion> (L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
proof (subst continuous_at_Sup_mono [where f = "\<lambda>x. cmod c * x"])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. mono ((*) (cmod c))
 2. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) ((*) (cmod c))
 3. L2_set (cmod \<circ> x) ` Collect finite \<noteq> {}
 4. bdd_above (L2_set (cmod \<circ> x) ` Collect finite)
 5. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
show "mono ((*) (cmod c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono ((*) (cmod c))
[PROOF STEP]
by (simp add: mono_def ordered_comm_semiring_class.comm_mult_left_mono)
[PROOF STATE]
proof (state)
this:
mono ((*) (cmod c))

goal (4 subgoals):
 1. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) ((*) (cmod c))
 2. L2_set (cmod \<circ> x) ` Collect finite \<noteq> {}
 3. bdd_above (L2_set (cmod \<circ> x) ` Collect finite)
 4. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
show "continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) ((*) (cmod c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) ((*) (cmod c))
[PROOF STEP]
proof (rule continuous_mult)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. cmod c)
 2. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. x)
[PROOF STEP]
show "continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. cmod c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. cmod c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. cmod c)

goal (1 subgoal):
 1. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. x)
[PROOF STEP]
show "continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) (\<lambda>x. x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous (at_left (\<Squnion> (L2_set (cmod \<circ> x) ` Collect finite))) ((*) (cmod c))

goal (3 subgoals):
 1. L2_set (cmod \<circ> x) ` Collect finite \<noteq> {}
 2. bdd_above (L2_set (cmod \<circ> x) ` Collect finite)
 3. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
show "L2_set (cmod \<circ> x) ` Collect finite \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L2_set (cmod \<circ> x) ` Collect finite \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L2_set (cmod \<circ> x) ` Collect finite \<noteq> {}

goal (2 subgoals):
 1. bdd_above (L2_set (cmod \<circ> x) ` Collect finite)
 2. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
show "bdd_above (L2_set (cmod \<circ> x) ` Collect finite)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above (L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
by (meson assms has_ell2_norm_L2_set)
[PROOF STATE]
proof (state)
this:
bdd_above (L2_set (cmod \<circ> x) ` Collect finite)

goal (1 subgoal):
 1. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
show "(SUP F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)
[PROOF STEP]
by (metis image_image)
[PROOF STATE]
proof (state)
this:
(\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = \<Squnion> ((*) (cmod c) ` L2_set (cmod \<circ> x) ` Collect finite)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = cmod c * \<Squnion> (L2_set (cmod \<circ> x) ` Collect finite)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Squnion>F\<in>Collect finite. cmod c * L2_set (cmod \<circ> x) F) = cmod c * ell2_norm x

goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
show "ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x"
[PROOF STATE]
proof (prove)
using this:
ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x

goal (1 subgoal):
 1. ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ell2_norm (\<lambda>i. c * x i) = cmod c * ell2_norm x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma edges_of_graph_from_list:
  assumes valid: "valid_graph_repr l"
  shows "edges (graph_from_list l) = set l \<union> (set l)\<inverse>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges (graph_from_list l) = set l \<union> (set l)\<inverse>
[PROOF STEP]
using valid
[PROOF STATE]
proof (prove)
using this:
valid_graph_repr l

goal (1 subgoal):
 1. edges (graph_from_list l) = set l \<union> (set l)\<inverse>
[PROOF STEP]
apply (induction l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. valid_graph_repr [] \<Longrightarrow> edges (graph_from_list []) = set [] \<union> (set [])\<inverse>
 2. \<And>a l. \<lbrakk>valid_graph_repr l \<Longrightarrow> edges (graph_from_list l) = set l \<union> (set l)\<inverse>; valid_graph_repr (a # l)\<rbrakk> \<Longrightarrow> edges (graph_from_list (a # l)) = set (a # l) \<union> (set (a # l))\<inverse>
[PROOF STEP]
unfolding graph_from_list_def valid_graph_repr_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>(u, v)\<in>set []. u \<noteq> v \<Longrightarrow> edges (foldr ins_edge [] graph_empty) = set [] \<union> (set [])\<inverse>
 2. \<And>a l. \<lbrakk>\<forall>(u, v)\<in>set l. u \<noteq> v \<Longrightarrow> edges (foldr ins_edge l graph_empty) = set l \<union> (set l)\<inverse>; \<forall>(u, v)\<in>set (a # l). u \<noteq> v\<rbrakk> \<Longrightarrow> edges (foldr ins_edge (a # l) graph_empty) = set (a # l) \<union> (set (a # l))\<inverse>
[PROOF STEP]
by auto


[STATEMENT]
lemma perfect_Esigma:
  assumes "Esigma m = 2*m" and "m \<ge>1"
  shows "perfect_number m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perfect_number m
[PROOF STEP]
using Esigma_properdiv_set assms perfect_number_def
[PROOF STATE]
proof (prove)
using this:
1 \<le> ?m \<Longrightarrow> Esigma ?m = aliquot_sum ?m + ?m
Esigma m = 2 * m
1 \<le> m
perfect_number ?n \<equiv> ?n = aliquot_sum ?n

goal (1 subgoal):
 1. perfect_number m
[PROOF STEP]
by auto


[STATEMENT]
lemma set_less_eq_aux_code:
  assumes "sorted xs" "distinct xs" "sorted ys" "distinct ys"
  shows "set xs \<sqsubseteq>' set ys \<longleftrightarrow> ord.lexordp_eq (>) xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set xs \<sqsubseteq>' set ys) = ord.lexordp_eq (\<lambda>x y. y < x) xs ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (set xs \<sqsubseteq>' set ys) = ord.lexordp_eq (\<lambda>x y. y < x) xs ys
[PROOF STEP]
have dual: "class.linorder (\<ge>) (>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)
[PROOF STEP]
by(rule linorder.dual_linorder) unfold_locales
[PROOF STATE]
proof (state)
this:
class.linorder (\<lambda>x y. y \<le> x) (\<lambda>x y. y < x)

goal (1 subgoal):
 1. (set xs \<sqsubseteq>' set ys) = ord.lexordp_eq (\<lambda>x y. y < x) xs ys
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
sorted xs
distinct xs
sorted ys
distinct ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sorted xs
distinct xs
sorted ys
distinct ys

goal (1 subgoal):
 1. (set xs \<sqsubseteq>' set ys) = ord.lexordp_eq (\<lambda>x y. y < x) xs ys
[PROOF STEP]
by(auto simp add: set_less_eq_aux_def finite_complement_partition linorder.lexordp_eq_conv_lexord[OF dual] set_less_aux_code intro: sorted_distinct_set_unique)
[PROOF STATE]
proof (state)
this:
(set xs \<sqsubseteq>' set ys) = ord.lexordp_eq (\<lambda>x y. y < x) xs ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_subset_eq:
  fixes a::"'a::linorder"
  assumes non_empty: "a \<le> b"
  shows "({a..b} \<subseteq> {c..d}) = (c \<le> a \<and> b \<le> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({a..b} \<subseteq> {c..d}) = (c \<le> a \<and> b \<le> d)
[PROOF STEP]
apply (insert non_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> ({a..b} \<subseteq> {c..d}) = (c \<le> a \<and> b \<le> d)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; {a..b} \<subseteq> {c..d}\<rbrakk> \<Longrightarrow> c \<le> a \<and> b \<le> d
 2. \<lbrakk>a \<le> b; c \<le> a \<and> b \<le> d\<rbrakk> \<Longrightarrow> {a..b} \<subseteq> {c..d}
[PROOF STEP]
apply (frule range_subset_lower [where x=a], simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; {a..b} \<subseteq> {c..d}; c \<le> a\<rbrakk> \<Longrightarrow> c \<le> a \<and> b \<le> d
 2. \<lbrakk>a \<le> b; c \<le> a \<and> b \<le> d\<rbrakk> \<Longrightarrow> {a..b} \<subseteq> {c..d}
[PROOF STEP]
apply (drule range_subset_upper [where x=a], simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; c \<le> a; b \<le> d\<rbrakk> \<Longrightarrow> c \<le> a \<and> b \<le> d
 2. \<lbrakk>a \<le> b; c \<le> a \<and> b \<le> d\<rbrakk> \<Longrightarrow> {a..b} \<subseteq> {c..d}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; c \<le> a \<and> b \<le> d\<rbrakk> \<Longrightarrow> {a..b} \<subseteq> {c..d}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done