[STATEMENT]
theorem nat_to_set_inj: "nat_to_set u = nat_to_set v \<Longrightarrow> u = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
assume A: "nat_to_set u = nat_to_set v"
[PROOF STATE]
proof (state)
this:
nat_to_set u = nat_to_set v

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
let ?P = "\<lambda> (n::nat). (\<forall> (D::nat set). finite D \<and> card D \<le> n \<longrightarrow> (\<forall> u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
have P_at_0: "?P 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>D. finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>D. finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
fix D
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>D. finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
show "finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
proof (rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite D \<and> card D \<le> 0 \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
assume A1: "finite D \<and> card D \<le> 0"
[PROOF STATE]
proof (state)
this:
finite D \<and> card D \<le> 0

goal (1 subgoal):
 1. finite D \<and> card D \<le> 0 \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
finite D \<and> card D \<le> 0
[PROOF STEP]
have S1: "finite D"
[PROOF STATE]
proof (prove)
using this:
finite D \<and> card D \<le> 0

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

goal (1 subgoal):
 1. finite D \<and> card D \<le> 0 \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
finite D \<and> card D \<le> 0
[PROOF STEP]
have S2: "card D = 0"
[PROOF STATE]
proof (prove)
using this:
finite D \<and> card D \<le> 0

goal (1 subgoal):
 1. card D = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card D = 0

goal (1 subgoal):
 1. finite D \<and> card D \<le> 0 \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
finite D
card D = 0
[PROOF STEP]
have S3: "D = {}"
[PROOF STATE]
proof (prove)
using this:
finite D
card D = 0

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

goal (1 subgoal):
 1. finite D \<and> card D \<le> 0 \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
show "(\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
proof (rule allI, rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
fix u v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
show "nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
assume A2: " nat_to_set u = D \<and> nat_to_set v = D"
[PROOF STATE]
proof (state)
this:
nat_to_set u = D \<and> nat_to_set v = D

goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D \<and> nat_to_set v = D
[PROOF STEP]
have L1: "nat_to_set u = D"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D \<and> nat_to_set v = D

goal (1 subgoal):
 1. nat_to_set u = D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set u = D

goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D \<and> nat_to_set v = D
[PROOF STEP]
have L2: "nat_to_set v = D"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D \<and> nat_to_set v = D

goal (1 subgoal):
 1. nat_to_set v = D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set v = D

goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
from L1 S3
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D
D = {}
[PROOF STEP]
have "nat_to_set u = {}"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D
D = {}

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

goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = {}
[PROOF STEP]
have u_z: "u = 0"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = {}

goal (1 subgoal):
 1. u = 0
[PROOF STEP]
by (rule empty_is_zero)
[PROOF STATE]
proof (state)
this:
u = 0

goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
from L2 S3
[PROOF STATE]
proof (chain)
picking this:
nat_to_set v = D
D = {}
[PROOF STEP]
have "nat_to_set v = {}"
[PROOF STATE]
proof (prove)
using this:
nat_to_set v = D
D = {}

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

goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_set v = {}
[PROOF STEP]
have v_z: "v = 0"
[PROOF STATE]
proof (prove)
using this:
nat_to_set v = {}

goal (1 subgoal):
 1. v = 0
[PROOF STEP]
by (rule empty_is_zero)
[PROOF STATE]
proof (state)
this:
v = 0

goal (1 subgoal):
 1. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
from u_z v_z
[PROOF STATE]
proof (chain)
picking this:
u = 0
v = 0
[PROOF STEP]
show "u=v"
[PROOF STATE]
proof (prove)
using this:
u = 0
v = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>D. finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
have P_at_Suc: "\<And> n. ?P n \<Longrightarrow> ?P (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v) \<Longrightarrow> \<forall>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v) \<Longrightarrow> \<forall>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v) \<Longrightarrow> \<forall>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
assume A_n: "?P n"
[PROOF STATE]
proof (state)
this:
\<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal (1 subgoal):
 1. \<And>n. \<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v) \<Longrightarrow> \<forall>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
show "?P (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
fix D
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
show "finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
proof (rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite D \<and> card D \<le> Suc n \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
assume A1: "finite D \<and> card D \<le> Suc n"
[PROOF STATE]
proof (state)
this:
finite D \<and> card D \<le> Suc n

goal (1 subgoal):
 1. finite D \<and> card D \<le> Suc n \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
finite D \<and> card D \<le> Suc n
[PROOF STEP]
have S1: "finite D"
[PROOF STATE]
proof (prove)
using this:
finite D \<and> card D \<le> Suc n

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

goal (1 subgoal):
 1. finite D \<and> card D \<le> Suc n \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
finite D \<and> card D \<le> Suc n
[PROOF STEP]
have S2: "card D \<le> Suc n"
[PROOF STATE]
proof (prove)
using this:
finite D \<and> card D \<le> Suc n

goal (1 subgoal):
 1. card D \<le> Suc n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card D \<le> Suc n

goal (1 subgoal):
 1. finite D \<and> card D \<le> Suc n \<Longrightarrow> \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
show "(\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
proof (rule allI, rule allI, rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
fix u v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u v. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
assume A2: " nat_to_set u = D \<and> nat_to_set v = D"
[PROOF STATE]
proof (state)
this:
nat_to_set u = D \<and> nat_to_set v = D

goal (1 subgoal):
 1. \<And>u v. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D \<and> nat_to_set v = D
[PROOF STEP]
have d_u_d: "nat_to_set u = D"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D \<and> nat_to_set v = D

goal (1 subgoal):
 1. nat_to_set u = D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set u = D

goal (1 subgoal):
 1. \<And>u v. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
from A2
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D \<and> nat_to_set v = D
[PROOF STEP]
have d_v_d: "nat_to_set v = D"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D \<and> nat_to_set v = D

goal (1 subgoal):
 1. nat_to_set v = D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set v = D

goal (1 subgoal):
 1. \<And>u v. nat_to_set u = D \<and> nat_to_set v = D \<Longrightarrow> u = v
[PROOF STEP]
show "u = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = v
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> u = v
 2. \<not> ?P \<Longrightarrow> u = v
[PROOF STEP]
assume A3: "D = {}"
[PROOF STATE]
proof (state)
this:
D = {}

goal (2 subgoals):
 1. ?P \<Longrightarrow> u = v
 2. \<not> ?P \<Longrightarrow> u = v
[PROOF STEP]
from A3 d_u_d
[PROOF STATE]
proof (chain)
picking this:
D = {}
nat_to_set u = D
[PROOF STEP]
have "nat_to_set u = {}"
[PROOF STATE]
proof (prove)
using this:
D = {}
nat_to_set u = D

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> u = v
 2. \<not> ?P \<Longrightarrow> u = v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = {}
[PROOF STEP]
have u_z: "u = 0"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = {}

goal (1 subgoal):
 1. u = 0
[PROOF STEP]
by (rule empty_is_zero)
[PROOF STATE]
proof (state)
this:
u = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> u = v
 2. \<not> ?P \<Longrightarrow> u = v
[PROOF STEP]
from A3 d_v_d
[PROOF STATE]
proof (chain)
picking this:
D = {}
nat_to_set v = D
[PROOF STEP]
have "nat_to_set v = {}"
[PROOF STATE]
proof (prove)
using this:
D = {}
nat_to_set v = D

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> u = v
 2. \<not> ?P \<Longrightarrow> u = v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_set v = {}
[PROOF STEP]
have v_z: "v = 0"
[PROOF STATE]
proof (prove)
using this:
nat_to_set v = {}

goal (1 subgoal):
 1. v = 0
[PROOF STEP]
by (rule empty_is_zero)
[PROOF STATE]
proof (state)
this:
v = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> u = v
 2. \<not> ?P \<Longrightarrow> u = v
[PROOF STEP]
from u_z v_z
[PROOF STATE]
proof (chain)
picking this:
u = 0
v = 0
[PROOF STEP]
show "u = v"
[PROOF STATE]
proof (prove)
using this:
u = 0
v = 0

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

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
assume A3: "D \<noteq> {}"
[PROOF STATE]
proof (state)
this:
D \<noteq> {}

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from A3 d_u_d
[PROOF STATE]
proof (chain)
picking this:
D \<noteq> {}
nat_to_set u = D
[PROOF STEP]
have "nat_to_set u \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
D \<noteq> {}
nat_to_set u = D

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

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u \<noteq> {}
[PROOF STEP]
have u_pos: "u > 0"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u \<noteq> {}

goal (1 subgoal):
 1. 0 < u
[PROOF STEP]
by (rule ne_imp_pos)
[PROOF STATE]
proof (state)
this:
0 < u

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from A3 d_v_d
[PROOF STATE]
proof (chain)
picking this:
D \<noteq> {}
nat_to_set v = D
[PROOF STEP]
have "nat_to_set v \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
D \<noteq> {}
nat_to_set v = D

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

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_set v \<noteq> {}
[PROOF STEP]
have v_pos: "v > 0"
[PROOF STATE]
proof (prove)
using this:
nat_to_set v \<noteq> {}

goal (1 subgoal):
 1. 0 < v
[PROOF STEP]
by (rule ne_imp_pos)
[PROOF STATE]
proof (state)
this:
0 < v

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
define m where "m = Max D"
[PROOF STATE]
proof (state)
this:
m = Max D

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from S1 m_def A3
[PROOF STATE]
proof (chain)
picking this:
finite D
m = Max D
D \<noteq> {}
[PROOF STEP]
have m_in: "m \<in> D"
[PROOF STATE]
proof (prove)
using this:
finite D
m = Max D
D \<noteq> {}

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

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from d_u_d m_def
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D
m = Max D
[PROOF STEP]
have m_u: "m = Max (nat_to_set u)"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D
m = Max D

goal (1 subgoal):
 1. m = Max (nat_to_set u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = Max (nat_to_set u)

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from d_v_d m_def
[PROOF STATE]
proof (chain)
picking this:
nat_to_set v = D
m = Max D
[PROOF STEP]
have m_v: "m = Max (nat_to_set v)"
[PROOF STATE]
proof (prove)
using this:
nat_to_set v = D
m = Max D

goal (1 subgoal):
 1. m = Max (nat_to_set v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = Max (nat_to_set v)

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from u_pos m_u log2_is_max
[PROOF STATE]
proof (chain)
picking this:
0 < u
m = Max (nat_to_set u)
0 < ?u \<Longrightarrow> log2 ?u = Max (nat_to_set ?u)
[PROOF STEP]
have m_log_u: "m = log2 u"
[PROOF STATE]
proof (prove)
using this:
0 < u
m = Max (nat_to_set u)
0 < ?u \<Longrightarrow> log2 ?u = Max (nat_to_set ?u)

goal (1 subgoal):
 1. m = log2 u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = log2 u

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from v_pos m_v log2_is_max
[PROOF STATE]
proof (chain)
picking this:
0 < v
m = Max (nat_to_set v)
0 < ?u \<Longrightarrow> log2 ?u = Max (nat_to_set ?u)
[PROOF STEP]
have m_log_v: "m = log2 v"
[PROOF STATE]
proof (prove)
using this:
0 < v
m = Max (nat_to_set v)
0 < ?u \<Longrightarrow> log2 ?u = Max (nat_to_set ?u)

goal (1 subgoal):
 1. m = log2 v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m = log2 v

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
define D1 where "D1 = D - {m}"
[PROOF STATE]
proof (state)
this:
D1 = D - {m}

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
define u1 where "u1 = u - 2^m"
[PROOF STATE]
proof (state)
this:
u1 = u - 2 ^ m

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
define v1 where "v1 = v - 2^m"
[PROOF STATE]
proof (state)
this:
v1 = v - 2 ^ m

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
have card_D1: "card D1 \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card D1 \<le> n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card D1 \<le> n
[PROOF STEP]
from D1_def S1 m_in
[PROOF STATE]
proof (chain)
picking this:
D1 = D - {m}
finite D
m \<in> D
[PROOF STEP]
have "card D1 = (card D) - 1"
[PROOF STATE]
proof (prove)
using this:
D1 = D - {m}
finite D
m \<in> D

goal (1 subgoal):
 1. card D1 = card D - 1
[PROOF STEP]
by (simp add: card_Diff_singleton)
[PROOF STATE]
proof (state)
this:
card D1 = card D - 1

goal (1 subgoal):
 1. card D1 \<le> n
[PROOF STEP]
with S2
[PROOF STATE]
proof (chain)
picking this:
card D \<le> Suc n
card D1 = card D - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card D \<le> Suc n
card D1 = card D - 1

goal (1 subgoal):
 1. card D1 \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card D1 \<le> n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card D1 \<le> n

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
have u_u1: "u = u1 + 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = u1 + 2 ^ m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u = u1 + 2 ^ m
[PROOF STEP]
from u_pos
[PROOF STATE]
proof (chain)
picking this:
0 < u
[PROOF STEP]
have L1: "2 ^ log2 u \<le> u"
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. 2 ^ log2 u \<le> u
[PROOF STEP]
by (rule log2_le)
[PROOF STATE]
proof (state)
this:
2 ^ log2 u \<le> u

goal (1 subgoal):
 1. u = u1 + 2 ^ m
[PROOF STEP]
with m_log_u
[PROOF STATE]
proof (chain)
picking this:
m = log2 u
2 ^ log2 u \<le> u
[PROOF STEP]
have L2: "2 ^ m \<le> u"
[PROOF STATE]
proof (prove)
using this:
m = log2 u
2 ^ log2 u \<le> u

goal (1 subgoal):
 1. 2 ^ m \<le> u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ m \<le> u

goal (1 subgoal):
 1. u = u1 + 2 ^ m
[PROOF STEP]
with u1_def
[PROOF STATE]
proof (chain)
picking this:
u1 = u - 2 ^ m
2 ^ m \<le> u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u1 = u - 2 ^ m
2 ^ m \<le> u

goal (1 subgoal):
 1. u = u1 + 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u = u1 + 2 ^ m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u = u1 + 2 ^ m

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
have u1_d1: "nat_to_set u1 = D1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
from m_log_u log2_gt
[PROOF STATE]
proof (chain)
picking this:
m = log2 u
?x < 2 ^ (log2 ?x + 1)
[PROOF STEP]
have "u < 2^(m+1)"
[PROOF STATE]
proof (prove)
using this:
m = log2 u
?x < 2 ^ (log2 ?x + 1)

goal (1 subgoal):
 1. u < 2 ^ (m + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u < 2 ^ (m + 1)

goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
with u_u1
[PROOF STATE]
proof (chain)
picking this:
u = u1 + 2 ^ m
u < 2 ^ (m + 1)
[PROOF STEP]
have u1_lt_2_m: "u1 < 2^m"
[PROOF STATE]
proof (prove)
using this:
u = u1 + 2 ^ m
u < 2 ^ (m + 1)

goal (1 subgoal):
 1. u1 < 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u1 < 2 ^ m

goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
with u_u1
[PROOF STATE]
proof (chain)
picking this:
u = u1 + 2 ^ m
u1 < 2 ^ m
[PROOF STEP]
have L1: "nat_to_set u = nat_to_set u1 \<union> {m}"
[PROOF STATE]
proof (prove)
using this:
u = u1 + 2 ^ m
u1 < 2 ^ m

goal (1 subgoal):
 1. nat_to_set u = nat_to_set u1 \<union> {m}
[PROOF STEP]
by (simp add: add_power)
[PROOF STATE]
proof (state)
this:
nat_to_set u = nat_to_set u1 \<union> {m}

goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
have m_notin: "m \<notin> nat_to_set u1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<notin> nat_to_set u1
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set u1 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> m \<notin> nat_to_set u1"
[PROOF STATE]
proof (state)
this:
\<not> m \<notin> nat_to_set u1

goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set u1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> m \<notin> nat_to_set u1
[PROOF STEP]
have "m \<in> nat_to_set u1"
[PROOF STATE]
proof (prove)
using this:
\<not> m \<notin> nat_to_set u1

goal (1 subgoal):
 1. m \<in> nat_to_set u1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m \<in> nat_to_set u1

goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set u1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<in> nat_to_set u1
[PROOF STEP]
have "2^m \<le> u1"
[PROOF STATE]
proof (prove)
using this:
m \<in> nat_to_set u1

goal (1 subgoal):
 1. 2 ^ m \<le> u1
[PROOF STEP]
by (rule nat_to_set_upper_bound)
[PROOF STATE]
proof (state)
this:
2 ^ m \<le> u1

goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set u1 \<Longrightarrow> False
[PROOF STEP]
with u1_lt_2_m
[PROOF STATE]
proof (chain)
picking this:
u1 < 2 ^ m
2 ^ m \<le> u1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
u1 < 2 ^ m
2 ^ m \<le> u1

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:
m \<notin> nat_to_set u1

goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
from L1 m_notin
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = nat_to_set u1 \<union> {m}
m \<notin> nat_to_set u1
[PROOF STEP]
have "nat_to_set u1 = nat_to_set u - {m}"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = nat_to_set u1 \<union> {m}
m \<notin> nat_to_set u1

goal (1 subgoal):
 1. nat_to_set u1 = nat_to_set u - {m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set u1 = nat_to_set u - {m}

goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
with d_u_d
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D
nat_to_set u1 = nat_to_set u - {m}
[PROOF STEP]
have "nat_to_set u1 = D - {m}"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D
nat_to_set u1 = nat_to_set u - {m}

goal (1 subgoal):
 1. nat_to_set u1 = D - {m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set u1 = D - {m}

goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
with D1_def
[PROOF STATE]
proof (chain)
picking this:
D1 = D - {m}
nat_to_set u1 = D - {m}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
D1 = D - {m}
nat_to_set u1 = D - {m}

goal (1 subgoal):
 1. nat_to_set u1 = D1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set u1 = D1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nat_to_set u1 = D1

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
have v_v1: "v = v1 + 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = v1 + 2 ^ m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v = v1 + 2 ^ m
[PROOF STEP]
from v_pos
[PROOF STATE]
proof (chain)
picking this:
0 < v
[PROOF STEP]
have L1: "2 ^ log2 v \<le> v"
[PROOF STATE]
proof (prove)
using this:
0 < v

goal (1 subgoal):
 1. 2 ^ log2 v \<le> v
[PROOF STEP]
by (rule log2_le)
[PROOF STATE]
proof (state)
this:
2 ^ log2 v \<le> v

goal (1 subgoal):
 1. v = v1 + 2 ^ m
[PROOF STEP]
with m_log_v
[PROOF STATE]
proof (chain)
picking this:
m = log2 v
2 ^ log2 v \<le> v
[PROOF STEP]
have L2: "2 ^ m \<le> v"
[PROOF STATE]
proof (prove)
using this:
m = log2 v
2 ^ log2 v \<le> v

goal (1 subgoal):
 1. 2 ^ m \<le> v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ m \<le> v

goal (1 subgoal):
 1. v = v1 + 2 ^ m
[PROOF STEP]
with v1_def
[PROOF STATE]
proof (chain)
picking this:
v1 = v - 2 ^ m
2 ^ m \<le> v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v1 = v - 2 ^ m
2 ^ m \<le> v

goal (1 subgoal):
 1. v = v1 + 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = v1 + 2 ^ m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v = v1 + 2 ^ m

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
have v1_d1: "nat_to_set v1 = D1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
from m_log_v log2_gt
[PROOF STATE]
proof (chain)
picking this:
m = log2 v
?x < 2 ^ (log2 ?x + 1)
[PROOF STEP]
have "v < 2^(m+1)"
[PROOF STATE]
proof (prove)
using this:
m = log2 v
?x < 2 ^ (log2 ?x + 1)

goal (1 subgoal):
 1. v < 2 ^ (m + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v < 2 ^ (m + 1)

goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
with v_v1
[PROOF STATE]
proof (chain)
picking this:
v = v1 + 2 ^ m
v < 2 ^ (m + 1)
[PROOF STEP]
have v1_lt_2_m: "v1 < 2^m"
[PROOF STATE]
proof (prove)
using this:
v = v1 + 2 ^ m
v < 2 ^ (m + 1)

goal (1 subgoal):
 1. v1 < 2 ^ m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v1 < 2 ^ m

goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
with v_v1
[PROOF STATE]
proof (chain)
picking this:
v = v1 + 2 ^ m
v1 < 2 ^ m
[PROOF STEP]
have L1: "nat_to_set v = nat_to_set v1 \<union> {m}"
[PROOF STATE]
proof (prove)
using this:
v = v1 + 2 ^ m
v1 < 2 ^ m

goal (1 subgoal):
 1. nat_to_set v = nat_to_set v1 \<union> {m}
[PROOF STEP]
by (simp add: add_power)
[PROOF STATE]
proof (state)
this:
nat_to_set v = nat_to_set v1 \<union> {m}

goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
have m_notin: "m \<notin> nat_to_set v1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<notin> nat_to_set v1
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set v1 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> m \<notin> nat_to_set v1"
[PROOF STATE]
proof (state)
this:
\<not> m \<notin> nat_to_set v1

goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set v1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> m \<notin> nat_to_set v1
[PROOF STEP]
have "m \<in> nat_to_set v1"
[PROOF STATE]
proof (prove)
using this:
\<not> m \<notin> nat_to_set v1

goal (1 subgoal):
 1. m \<in> nat_to_set v1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m \<in> nat_to_set v1

goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set v1 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<in> nat_to_set v1
[PROOF STEP]
have "2^m \<le> v1"
[PROOF STATE]
proof (prove)
using this:
m \<in> nat_to_set v1

goal (1 subgoal):
 1. 2 ^ m \<le> v1
[PROOF STEP]
by (rule nat_to_set_upper_bound)
[PROOF STATE]
proof (state)
this:
2 ^ m \<le> v1

goal (1 subgoal):
 1. \<not> m \<notin> nat_to_set v1 \<Longrightarrow> False
[PROOF STEP]
with v1_lt_2_m
[PROOF STATE]
proof (chain)
picking this:
v1 < 2 ^ m
2 ^ m \<le> v1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v1 < 2 ^ m
2 ^ m \<le> v1

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:
m \<notin> nat_to_set v1

goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
from L1 m_notin
[PROOF STATE]
proof (chain)
picking this:
nat_to_set v = nat_to_set v1 \<union> {m}
m \<notin> nat_to_set v1
[PROOF STEP]
have "nat_to_set v1 = nat_to_set v - {m}"
[PROOF STATE]
proof (prove)
using this:
nat_to_set v = nat_to_set v1 \<union> {m}
m \<notin> nat_to_set v1

goal (1 subgoal):
 1. nat_to_set v1 = nat_to_set v - {m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set v1 = nat_to_set v - {m}

goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
with d_v_d
[PROOF STATE]
proof (chain)
picking this:
nat_to_set v = D
nat_to_set v1 = nat_to_set v - {m}
[PROOF STEP]
have "nat_to_set v1 = D - {m}"
[PROOF STATE]
proof (prove)
using this:
nat_to_set v = D
nat_to_set v1 = nat_to_set v - {m}

goal (1 subgoal):
 1. nat_to_set v1 = D - {m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set v1 = D - {m}

goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
with D1_def
[PROOF STATE]
proof (chain)
picking this:
D1 = D - {m}
nat_to_set v1 = D - {m}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
D1 = D - {m}
nat_to_set v1 = D - {m}

goal (1 subgoal):
 1. nat_to_set v1 = D1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set v1 = D1

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

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from S1 D1_def
[PROOF STATE]
proof (chain)
picking this:
finite D
D1 = D - {m}
[PROOF STEP]
have P1: "finite D1"
[PROOF STATE]
proof (prove)
using this:
finite D
D1 = D - {m}

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

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
with card_D1
[PROOF STATE]
proof (chain)
picking this:
card D1 \<le> n
finite D1
[PROOF STEP]
have P2: "finite D1 \<and> card D1 \<le> n"
[PROOF STATE]
proof (prove)
using this:
card D1 \<le> n
finite D1

goal (1 subgoal):
 1. finite D1 \<and> card D1 \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite D1 \<and> card D1 \<le> n

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
from A_n P2
[PROOF STATE]
proof (chain)
picking this:
\<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
finite D1 \<and> card D1 \<le> n
[PROOF STEP]
have "(\<forall>u v. nat_to_set u = D1 \<and> nat_to_set v = D1 \<longrightarrow> u = v)"
[PROOF STATE]
proof (prove)
using this:
\<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
finite D1 \<and> card D1 \<le> n

goal (1 subgoal):
 1. \<forall>u v. nat_to_set u = D1 \<and> nat_to_set v = D1 \<longrightarrow> u = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>u v. nat_to_set u = D1 \<and> nat_to_set v = D1 \<longrightarrow> u = v

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
with u1_d1 v1_d1
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u1 = D1
nat_to_set v1 = D1
\<forall>u v. nat_to_set u = D1 \<and> nat_to_set v = D1 \<longrightarrow> u = v
[PROOF STEP]
have "u1 = v1"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u1 = D1
nat_to_set v1 = D1
\<forall>u v. nat_to_set u = D1 \<and> nat_to_set v = D1 \<longrightarrow> u = v

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

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> u = v
[PROOF STEP]
with u_u1 v_v1
[PROOF STATE]
proof (chain)
picking this:
u = u1 + 2 ^ m
v = v1 + 2 ^ m
u1 = v1
[PROOF STEP]
show "u = v"
[PROOF STATE]
proof (prove)
using this:
u = u1 + 2 ^ m
v = v1 + 2 ^ m
u1 = v1

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

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>D. finite D \<and> card D \<le> Suc n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>D. finite D \<and> card D \<le> ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v) \<Longrightarrow> \<forall>D. finite D \<and> card D \<le> Suc ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
from P_at_0 P_at_Suc
[PROOF STATE]
proof (chain)
picking this:
\<forall>D. finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
\<forall>D. finite D \<and> card D \<le> ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v) \<Longrightarrow> \<forall>D. finite D \<and> card D \<le> Suc ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
have main: "\<And> n. ?P n"
[PROOF STATE]
proof (prove)
using this:
\<forall>D. finite D \<and> card D \<le> 0 \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
\<forall>D. finite D \<and> card D \<le> ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v) \<Longrightarrow> \<forall>D. finite D \<and> card D \<le> Suc ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal (1 subgoal):
 1. \<And>n. \<forall>D. finite D \<and> card D \<le> n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
[PROOF STEP]
by (rule nat.induct)
[PROOF STATE]
proof (state)
this:
\<forall>D. finite D \<and> card D \<le> ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
define D where "D = nat_to_set u"
[PROOF STATE]
proof (state)
this:
D = nat_to_set u

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
from D_def A
[PROOF STATE]
proof (chain)
picking this:
D = nat_to_set u
nat_to_set u = nat_to_set v
[PROOF STEP]
have P1: "nat_to_set u = D"
[PROOF STATE]
proof (prove)
using this:
D = nat_to_set u
nat_to_set u = nat_to_set v

goal (1 subgoal):
 1. nat_to_set u = D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set u = D

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
from D_def A
[PROOF STATE]
proof (chain)
picking this:
D = nat_to_set u
nat_to_set u = nat_to_set v
[PROOF STEP]
have P2: "nat_to_set v = D"
[PROOF STATE]
proof (prove)
using this:
D = nat_to_set u
nat_to_set u = nat_to_set v

goal (1 subgoal):
 1. nat_to_set v = D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_set v = D

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
from D_def nat_to_set_is_finite
[PROOF STATE]
proof (chain)
picking this:
D = nat_to_set u
finite (nat_to_set ?u)
[PROOF STEP]
have d_finite: "finite D"
[PROOF STATE]
proof (prove)
using this:
D = nat_to_set u
finite (nat_to_set ?u)

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

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
define n where "n = card D"
[PROOF STATE]
proof (state)
this:
n = card D

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
from n_def d_finite
[PROOF STATE]
proof (chain)
picking this:
n = card D
finite D
[PROOF STEP]
have card_le: "card D \<le> n"
[PROOF STATE]
proof (prove)
using this:
n = card D
finite D

goal (1 subgoal):
 1. card D \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card D \<le> n

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
from d_finite card_le
[PROOF STATE]
proof (chain)
picking this:
finite D
card D \<le> n
[PROOF STEP]
have P3: "finite D \<and> card D \<le> n"
[PROOF STATE]
proof (prove)
using this:
finite D
card D \<le> n

goal (1 subgoal):
 1. finite D \<and> card D \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite D \<and> card D \<le> n

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
with main
[PROOF STATE]
proof (chain)
picking this:
\<forall>D. finite D \<and> card D \<le> ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
finite D \<and> card D \<le> n
[PROOF STEP]
have P4: "\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v"
[PROOF STATE]
proof (prove)
using this:
\<forall>D. finite D \<and> card D \<le> ?n \<longrightarrow> (\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v)
finite D \<and> card D \<le> n

goal (1 subgoal):
 1. \<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v

goal (1 subgoal):
 1. nat_to_set u = nat_to_set v \<Longrightarrow> u = v
[PROOF STEP]
with P1 P2
[PROOF STATE]
proof (chain)
picking this:
nat_to_set u = D
nat_to_set v = D
\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v
[PROOF STEP]
show "u = v"
[PROOF STATE]
proof (prove)
using this:
nat_to_set u = D
nat_to_set v = D
\<forall>u v. nat_to_set u = D \<and> nat_to_set v = D \<longrightarrow> u = v

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bintrunc_pos_eq: "x \<ge> 0 \<Longrightarrow> take_bit n x = x \<longleftrightarrow> x < 2^n" for x :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> (take_bit n x = x) = (x < 2 ^ n)
[PROOF STEP]
by (simp add: take_bit_int_eq_self_iff)


[STATEMENT]
lemma [simp]: "(a \<sqinter> b) + c = (a + c) \<sqinter> (b + c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sqinter> b + c = (a + c) \<sqinter> (b + c)
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<sqinter> b + c \<le> (a + c) \<sqinter> (b + c)
 2. (a + c) \<sqinter> (b + c) \<le> a \<sqinter> b + c
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<sqinter> b + c \<le> a + c \<and> a \<sqinter> b + c \<le> b + c
 2. (a + c) \<sqinter> (b + c) \<le> a \<sqinter> b + c
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a \<sqinter> b + c \<le> a + c
 2. a \<sqinter> b + c \<le> b + c
 3. (a + c) \<sqinter> (b + c) \<le> a \<sqinter> b + c
[PROOF STEP]
apply (rule add_order_preserving_right)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a \<sqinter> b \<le> a
 2. a \<sqinter> b + c \<le> b + c
 3. (a + c) \<sqinter> (b + c) \<le> a \<sqinter> b + c
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<sqinter> b + c \<le> b + c
 2. (a + c) \<sqinter> (b + c) \<le> a \<sqinter> b + c
[PROOF STEP]
apply (rule add_order_preserving_right)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<sqinter> b \<le> b
 2. (a + c) \<sqinter> (b + c) \<le> a \<sqinter> b + c
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + c) \<sqinter> (b + c) \<le> a \<sqinter> b + c
[PROOF STEP]
apply (rule right_move_to_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + c) \<sqinter> (b + c) + - c \<le> a \<sqinter> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + c) \<sqinter> (b + c) - c \<le> a \<and> (a + c) \<sqinter> (b + c) - c \<le> b
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (a + c) \<sqinter> (b + c) - c \<le> a
 2. (a + c) \<sqinter> (b + c) - c \<le> b
[PROOF STEP]
apply (simp_all only: diff_conv_add_uminus)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (a + c) \<sqinter> (b + c) + - c \<le> a
 2. (a + c) \<sqinter> (b + c) + - c \<le> b
[PROOF STEP]
apply (rule right_move_to_right)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (a + c) \<sqinter> (b + c) \<le> a + - (- c)
 2. (a + c) \<sqinter> (b + c) + - c \<le> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + c) \<sqinter> (b + c) + - c \<le> b
[PROOF STEP]
apply (rule right_move_to_right)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + c) \<sqinter> (b + c) \<le> b + - (- c)
[PROOF STEP]
by simp


[STATEMENT]
lemma sorted_pivot_positions:
  shows "sorted_wrt (<) (map fst (pivot_positions A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (<) (map fst (pivot_positions A))
[PROOF STEP]
using pivot_positions_form_helper_2
[PROOF STATE]
proof (prove)
using this:
sorted_wrt (<) (map fst (pivot_positions_main_gen ?z ?A ?nr ?nc ?i ?j))

goal (1 subgoal):
 1. sorted_wrt (<) (map fst (pivot_positions A))
[PROOF STEP]
by (simp add: pivot_positions_form_helper_2 pivot_positions_gen_def)


[STATEMENT]
lemma card_map_to_set :
  "card (map_to_set m) = card (dom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (map_to_set m) = card (dom m)
[PROOF STEP]
unfolding map_to_set_def map_to_set_dom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(k, v). m k = Some v} = card (fst ` {(k, v). m k = Some v})
[PROOF STEP]
apply (rule card_image[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on fst {(k, v). m k = Some v}
[PROOF STEP]
apply (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dvd_Lcm_nat [simp]:
  fixes M :: "nat set"
  assumes "m \<in> M"
  shows "m dvd Lcm M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m dvd Lcm M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m dvd Lcm M
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
m \<in> M
[PROOF STEP]
have "insert m M = M"
[PROOF STATE]
proof (prove)
using this:
m \<in> M

goal (1 subgoal):
 1. insert m M = M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
insert m M = M

goal (1 subgoal):
 1. m dvd Lcm M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
insert m M = M

goal (1 subgoal):
 1. m dvd Lcm M
[PROOF STEP]
have "m dvd Lcm (insert m M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m dvd Lcm (insert m M)
[PROOF STEP]
by (simp add: Lcm_nat_insert)
[PROOF STATE]
proof (state)
this:
m dvd Lcm (insert m M)

goal (1 subgoal):
 1. m dvd Lcm M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
insert m M = M
m dvd Lcm (insert m M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
insert m M = M
m dvd Lcm (insert m M)

goal (1 subgoal):
 1. m dvd Lcm M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m dvd Lcm M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_psi_aux2:
  assumes "psi m = ln (real (numeral x))" "pre_mangoldt n = y" "m + 1 = n" "numeral x * y = z"
  shows   "psi n = ln (real z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
from assms(2) [symmetric]
[PROOF STATE]
proof (chain)
picking this:
y = pre_mangoldt n
[PROOF STEP]
have [simp]: "y > 0"
[PROOF STATE]
proof (prove)
using this:
y = pre_mangoldt n

goal (1 subgoal):
 1. 0 < y
[PROOF STEP]
by (simp add: pre_mangoldt_pos)
[PROOF STATE]
proof (state)
this:
0 < y

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
have "psi n = psi (Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi n = psi (Suc m)
[PROOF STEP]
by (simp add: assms(3) [symmetric])
[PROOF STATE]
proof (state)
this:
psi n = psi (Suc m)

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psi n = psi (Suc m)

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
have "\<dots> = ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi (Suc m) = ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x)))
[PROOF STEP]
using assms(2,3) [symmetric]
[PROOF STATE]
proof (prove)
using this:
y = pre_mangoldt n
n = m + 1

goal (1 subgoal):
 1. psi (Suc m) = ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x)))
[PROOF STEP]
by (simp add: psi_conv_pre_mangoldt prod.nat_ivl_Suc' mult_ac)
[PROOF STATE]
proof (state)
this:
psi (Suc m) = ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x)))

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psi (Suc m) = ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x)))

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
have "\<dots> = ln (real y) + psi m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x))) = ln (real y) + psi m
[PROOF STEP]
by (subst ln_mult) (simp_all add: pre_mangoldt_pos prod_pos psi_conv_pre_mangoldt)
[PROOF STATE]
proof (state)
this:
ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x))) = ln (real y) + psi m

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (real y * (\<Prod>x = Suc 0..m. real (pre_mangoldt x))) = ln (real y) + psi m

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
have "psi m = ln (real (numeral x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi m = ln (real (numeral x))
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
psi m = ln (real (numeral x))

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psi m = ln (real (numeral x))

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
have "ln (real y) + \<dots> = ln (real (numeral x * y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (real y) + ln (real (numeral x)) = ln (real (numeral x * y))
[PROOF STEP]
by (simp add: ln_mult)
[PROOF STATE]
proof (state)
this:
ln (real y) + ln (real (numeral x)) = ln (real (numeral x * y))

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
psi n = ln (real (numeral x * y))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
psi n = ln (real (numeral x * y))

goal (1 subgoal):
 1. psi n = ln (real z)
[PROOF STEP]
by (simp add: assms(4) [symmetric])
[PROOF STATE]
proof (state)
this:
psi n = ln (real z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reals_Archimedean:
  fixes x :: "'a::archimedean_field"
  assumes "0 < x"
  shows "\<exists>n. inverse (of_nat (Suc n)) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
from \<open>0 < x\<close>
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < x
[PROOF STEP]
have "0 < inverse x"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < x

goal (1 subgoal):
 1. (0::'a) < inverse x
[PROOF STEP]
by (rule positive_imp_inverse_positive)
[PROOF STATE]
proof (state)
this:
(0::'a) < inverse x

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
obtain n where "inverse x < of_nat n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. inverse x < of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using reals_Archimedean2
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x < of_nat n

goal (1 subgoal):
 1. (\<And>n. inverse x < of_nat n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
inverse x < of_nat n

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse x < of_nat n
[PROOF STEP]
obtain m where "inverse x < of_nat (Suc m)"
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat n

goal (1 subgoal):
 1. (\<And>m. inverse x < of_nat (Suc m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>0 < inverse x\<close>
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat n
(0::'a) < inverse x

goal (1 subgoal):
 1. (\<And>m. inverse x < of_nat (Suc m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases n) (simp_all del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
inverse x < of_nat (Suc m)

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse x < of_nat (Suc m)
[PROOF STEP]
have "inverse (of_nat (Suc m)) < inverse (inverse x)"
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat (Suc m)

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < inverse (inverse x)
[PROOF STEP]
using \<open>0 < inverse x\<close>
[PROOF STATE]
proof (prove)
using this:
inverse x < of_nat (Suc m)
(0::'a) < inverse x

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < inverse (inverse x)
[PROOF STEP]
by (rule less_imp_inverse_less)
[PROOF STATE]
proof (state)
this:
inverse (of_nat (Suc m)) < inverse (inverse x)

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (of_nat (Suc m)) < inverse (inverse x)
[PROOF STEP]
have "inverse (of_nat (Suc m)) < x"
[PROOF STATE]
proof (prove)
using this:
inverse (of_nat (Suc m)) < inverse (inverse x)

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < x
[PROOF STEP]
using \<open>0 < x\<close>
[PROOF STATE]
proof (prove)
using this:
inverse (of_nat (Suc m)) < inverse (inverse x)
(0::'a) < x

goal (1 subgoal):
 1. inverse (of_nat (Suc m)) < x
[PROOF STEP]
by (simp add: nonzero_inverse_inverse_eq)
[PROOF STATE]
proof (state)
this:
inverse (of_nat (Suc m)) < x

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (of_nat (Suc m)) < x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inverse (of_nat (Suc m)) < x

goal (1 subgoal):
 1. \<exists>n. inverse (of_nat (Suc n)) < x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>n. inverse (of_nat (Suc n)) < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all2_induct [consumes 1, case_names Nil Cons]:
  assumes lall: "list_all2 Q xs ys"
  and     nilr: "P [] []"
  and    consr: "\<And>x xs y ys. \<lbrakk>list_all2 Q xs ys; Q x y; P xs ys\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)"
  shows  "P xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
using lall
[PROOF STATE]
proof (prove)
using this:
list_all2 Q xs ys

goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
proof (induct rule: list_induct2 [OF list_all2_lengthD [OF lall]])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. list_all2 Q [] [] \<Longrightarrow> P [] []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; list_all2 Q xs ys \<Longrightarrow> P xs ys; list_all2 Q (x # xs) (y # ys)\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
list_all2 Q [] []

goal (2 subgoals):
 1. list_all2 Q [] [] \<Longrightarrow> P [] []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; list_all2 Q xs ys \<Longrightarrow> P xs ys; list_all2 Q (x # xs) (y # ys)\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all2 Q [] []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
list_all2 Q [] []

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

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; list_all2 Q xs ys \<Longrightarrow> P xs ys; list_all2 Q (x # xs) (y # ys)\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; list_all2 Q xs ys \<Longrightarrow> P xs ys; list_all2 Q (x # xs) (y # ys)\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)
[PROOF STEP]
case (2 x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
list_all2 Q xs ys \<Longrightarrow> P xs ys
list_all2 Q (x # xs) (y # ys)

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; list_all2 Q xs ys \<Longrightarrow> P xs ys; list_all2 Q (x # xs) (y # ys)\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (x # xs) (y # ys)
[PROOF STEP]
proof (rule consr)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. list_all2 Q xs ys
 2. Q x y
 3. P xs ys
[PROOF STEP]
from "2.prems"
[PROOF STATE]
proof (chain)
picking this:
list_all2 Q (x # xs) (y # ys)
[PROOF STEP]
show "list_all2 Q xs ys" and "Q x y"
[PROOF STATE]
proof (prove)
using this:
list_all2 Q (x # xs) (y # ys)

goal (1 subgoal):
 1. list_all2 Q xs ys &&& Q x y
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
list_all2 Q xs ys
Q x y

goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
list_all2 Q xs ys
Q x y
[PROOF STEP]
show "P xs ys"
[PROOF STATE]
proof (prove)
using this:
list_all2 Q xs ys
Q x y

goal (1 subgoal):
 1. P xs ys
[PROOF STEP]
by (intro "2.hyps")
[PROOF STATE]
proof (state)
this:
P xs ys

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P (x # xs) (y # ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compute_Float_of_double[code]:
  "Float_of_double x =
    map_option (\<lambda>(m, e). Float (int_of_integer m) (int_of_integer e)) (man_exp_of_double x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Float_of_double x = map_option (\<lambda>(m, e). Float (int_of_integer m) (int_of_integer e)) (man_exp_of_double x)
[PROOF STEP]
apply (rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_option (\<lambda>(m, e). Float (int_of_integer m) (int_of_integer e)) (man_exp_of_double x) = Float_of_double x
[PROOF STEP]
by transfer (auto simp: man_exp_of_double_def Let_def mantissa_exponent[symmetric]
      Float_mantissa_exponent)


[STATEMENT]
lemma poly_gcd_pderiv_iff:
  fixes p::"'a::{semiring_char_0,factorial_ring_gcd,semiring_gcd_mult_normalize} poly"
  shows "poly (p div (gcd p (pderiv p))) x =0 \<longleftrightarrow> poly p x=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
proof (cases "pderiv p=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pderiv p = 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
 2. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
pderiv p = 0

goal (2 subgoals):
 1. pderiv p = 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
 2. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pderiv p = 0
[PROOF STEP]
obtain a where "p=[:a:]"
[PROOF STATE]
proof (prove)
using this:
pderiv p = 0

goal (1 subgoal):
 1. (\<And>a. p = [:a:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using pderiv_iszero
[PROOF STATE]
proof (prove)
using this:
pderiv p = 0
pderiv ?p = 0 \<Longrightarrow> \<exists>h. ?p = [:h:]

goal (1 subgoal):
 1. (\<And>a. p = [:a:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p = [:a:]

goal (2 subgoals):
 1. pderiv p = 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
 2. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = [:a:]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = [:a:]

goal (1 subgoal):
 1. (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
by (auto simp add: unit_factor_poly_def)
[PROOF STATE]
proof (state)
this:
(poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))

goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
pderiv p \<noteq> 0

goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pderiv p \<noteq> 0
[PROOF STEP]
have "p\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
pderiv p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
using pderiv_0
[PROOF STATE]
proof (prove)
using this:
pderiv p \<noteq> 0
pderiv 0 = 0

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
define q where "q = p div (gcd p (pderiv p))"
[PROOF STATE]
proof (state)
this:
q = p div gcd p (pderiv p)

goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
have "q\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<noteq> 0
[PROOF STEP]
unfolding q_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p div gcd p (pderiv p) \<noteq> 0
[PROOF STEP]
by (simp add: \<open>p\<noteq>0\<close> dvd_div_eq_0_iff)
[PROOF STATE]
proof (state)
this:
q \<noteq> 0

goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
have order_pq:"order x p = order x q + min (order x p) (order x (pderiv p))" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x p = order x q + min (order x p) (order x (pderiv p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order x p = order x q + min (order x p) (order x (pderiv p))
[PROOF STEP]
have *:"p = q * gcd p (pderiv p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = q * gcd p (pderiv p)
[PROOF STEP]
unfolding q_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = p div gcd p (pderiv p) * gcd p (pderiv p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = q * gcd p (pderiv p)

goal (1 subgoal):
 1. order x p = order x q + min (order x p) (order x (pderiv p))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x p = order x q + min (order x p) (order x (pderiv p))
[PROOF STEP]
apply (subst *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x (q * gcd p (pderiv p)) = order x q + min (order x p) (order x (pderiv p))
[PROOF STEP]
using \<open>q\<noteq>0\<close> \<open>p\<noteq>0\<close> \<open>pderiv p\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
q \<noteq> 0
p \<noteq> 0
pderiv p \<noteq> 0

goal (1 subgoal):
 1. order x (q * gcd p (pderiv p)) = order x q + min (order x p) (order x (pderiv p))
[PROOF STEP]
by (simp add:order_mult order_gcd)
[PROOF STATE]
proof (state)
this:
order x p = order x q + min (order x p) (order x (pderiv p))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
order ?x p = order ?x q + min (order ?x p) (order ?x (pderiv p))

goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
have "order x q =0 \<longleftrightarrow> order x p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (order x q = 0) = (order x p = 0)
[PROOF STEP]
proof (cases "poly p x=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly p x = (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
 2. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
poly p x = (0::'a)

goal (2 subgoals):
 1. poly p x = (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
 2. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
from order_pderiv[OF \<open>p\<noteq>0\<close> this]
[PROOF STATE]
proof (chain)
picking this:
order x p = Suc (order x (pderiv p))
[PROOF STEP]
have "order x p = order x (pderiv p) + 1"
[PROOF STATE]
proof (prove)
using this:
order x p = Suc (order x (pderiv p))

goal (1 subgoal):
 1. order x p = order x (pderiv p) + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
order x p = order x (pderiv p) + 1

goal (2 subgoals):
 1. poly p x = (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
 2. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
order x p = order x (pderiv p) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
order x p = order x (pderiv p) + 1

goal (1 subgoal):
 1. (order x q = 0) = (order x p = 0)
[PROOF STEP]
using order_pq[of x]
[PROOF STATE]
proof (prove)
using this:
order x p = order x (pderiv p) + 1
order x p = order x q + min (order x p) (order x (pderiv p))

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

goal (1 subgoal):
 1. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
poly p x \<noteq> (0::'a)

goal (1 subgoal):
 1. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly p x \<noteq> (0::'a)
[PROOF STEP]
have "order x p = 0"
[PROOF STATE]
proof (prove)
using this:
poly p x \<noteq> (0::'a)

goal (1 subgoal):
 1. order x p = 0
[PROOF STEP]
by (simp add: order_0I)
[PROOF STATE]
proof (state)
this:
order x p = 0

goal (1 subgoal):
 1. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
order x p = 0
[PROOF STEP]
have "order x q = 0"
[PROOF STATE]
proof (prove)
using this:
order x p = 0

goal (1 subgoal):
 1. order x q = 0
[PROOF STEP]
using order_pq[of x]
[PROOF STATE]
proof (prove)
using this:
order x p = 0
order x p = order x q + min (order x p) (order x (pderiv p))

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

goal (1 subgoal):
 1. poly p x \<noteq> (0::'a) \<Longrightarrow> (order x q = 0) = (order x p = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
order x q = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
order x q = 0

goal (1 subgoal):
 1. (order x q = 0) = (order x p = 0)
[PROOF STEP]
using \<open>order x p = 0\<close>
[PROOF STATE]
proof (prove)
using this:
order x q = 0
order x p = 0

goal (1 subgoal):
 1. (order x q = 0) = (order x p = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(order x q = 0) = (order x p = 0)

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

goal (1 subgoal):
 1. pderiv p \<noteq> 0 \<Longrightarrow> (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(order x q = 0) = (order x p = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(order x q = 0) = (order x p = 0)

goal (1 subgoal):
 1. (poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
apply (fold q_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (order x q = 0) = (order x p = 0) \<Longrightarrow> (poly q x = (0::'a)) = (poly p x = (0::'a))
[PROOF STEP]
unfolding order_root
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (order x q = 0) = (order x p = 0) \<Longrightarrow> (q = 0 \<or> order x q \<noteq> 0) = (p = 0 \<or> order x p \<noteq> 0)
[PROOF STEP]
using \<open>p\<noteq>0\<close> \<open>q\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
q \<noteq> 0

goal (1 subgoal):
 1. (order x q = 0) = (order x p = 0) \<Longrightarrow> (q = 0 \<or> order x q \<noteq> 0) = (p = 0 \<or> order x p \<noteq> 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(poly (p div gcd p (pderiv p)) x = (0::'a)) = (poly p x = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma FINITE_valid_states:
  fixes PROB :: "'a problem"
  shows "finite PROB \<Longrightarrow> finite ((valid_states PROB) :: 'a state set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite PROB \<Longrightarrow> finite (valid_states PROB)
[PROOF STEP]
proof (induction PROB rule: finite.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (valid_states {})
 2. \<And>A a. \<lbrakk>finite A; finite (valid_states A)\<rbrakk> \<Longrightarrow> finite (valid_states (insert a A))
[PROOF STEP]
case emptyI
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. finite (valid_states {})
 2. \<And>A a. \<lbrakk>finite A; finite (valid_states A)\<rbrakk> \<Longrightarrow> finite (valid_states (insert a A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
have "valid_states {} = {fmempty}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_states {} = {fmempty}
[PROOF STEP]
unfolding valid_states_def prob_dom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {s. fmdom' s = (\<Union>(s1, s2)\<in>{}. action_dom s1 s2)} = {fmempty}
[PROOF STEP]
using empty_domain_fmap_set
[PROOF STATE]
proof (prove)
using this:
{s. fmdom' s = {}} = {fmempty}

goal (1 subgoal):
 1. {s. fmdom' s = (\<Union>(s1, s2)\<in>{}. action_dom s1 s2)} = {fmempty}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
valid_states {} = {fmempty}

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

goal (1 subgoal):
 1. finite (valid_states {})
[PROOF STEP]
by(subst \<open>valid_states {} = {fmempty}\<close>) auto
[PROOF STATE]
proof (state)
this:
finite (valid_states {})

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

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finite (valid_states A)\<rbrakk> \<Longrightarrow> finite (valid_states (insert a A))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
finite A
finite (valid_states A)

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

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

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

goal (1 subgoal):
 1. finite (prob_dom (insert a A))
[PROOF STEP]
using FINITE_prob_dom
[PROOF STATE]
proof (prove)
using this:
finite (insert a A)
finite ?PROB \<Longrightarrow> finite (prob_dom ?PROB)

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

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finite (valid_states A)\<rbrakk> \<Longrightarrow> finite (valid_states (insert a A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (prob_dom (insert a A))
[PROOF STEP]
have "finite {s :: 'a state. fmdom' s = prob_dom (insert a A)}"
[PROOF STATE]
proof (prove)
using this:
finite (prob_dom (insert a A))

goal (1 subgoal):
 1. finite {s. fmdom' s = prob_dom (insert a A)}
[PROOF STEP]
using FINITE_states
[PROOF STATE]
proof (prove)
using this:
finite (prob_dom (insert a A))
finite ?X \<Longrightarrow> finite {s. fmdom' s = ?X}

goal (1 subgoal):
 1. finite {s. fmdom' s = prob_dom (insert a A)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {s. fmdom' s = prob_dom (insert a A)}

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finite (valid_states A)\<rbrakk> \<Longrightarrow> finite (valid_states (insert a A))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
finite {s. fmdom' s = prob_dom (insert a A)}

goal (1 subgoal):
 1. \<And>A a. \<lbrakk>finite A; finite (valid_states A)\<rbrakk> \<Longrightarrow> finite (valid_states (insert a A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {s. fmdom' s = prob_dom (insert a A)}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite {s. fmdom' s = prob_dom (insert a A)}

goal (1 subgoal):
 1. finite (valid_states (insert a A))
[PROOF STEP]
unfolding valid_states_def
[PROOF STATE]
proof (prove)
using this:
finite {s. fmdom' s = prob_dom (insert a A)}

goal (1 subgoal):
 1. finite {s. fmdom' s = prob_dom (insert a A)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (valid_states (insert a A))

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE type of 'PROB' had to be fixed for use of 'FINITE\_valid\_states'.\<close>


[STATEMENT]
lemma Complexs_of_real [simp]: "of_real r \<in> \<complex>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_real r \<in> \<complex>
[PROOF STEP]
unfolding Complexs_def of_real_def of_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r *\<^sub>R (1::'a) \<in> range (\<lambda>c. c *\<^sub>C (1::'a))
[PROOF STEP]
apply (subst scaleR_scaleC)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real r *\<^sub>C (1::'a) \<in> range (\<lambda>c. c *\<^sub>C (1::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma connectedI_app_iso:
  assumes c: "connected G" and hom: "digraph_isomorphism hom"
  shows "connected (app_iso hom G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
have *: "symcl (arcs_ends (app_iso hom G)) = (\<lambda>(u,v). (iso_verts hom u, iso_verts hom v)) ` symcl (arcs_ends G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arcs_ends (app_iso hom G))\<^sup>s = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` (arcs_ends G)\<^sup>s
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. (arcs_ends (app_iso hom G))\<^sup>s = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` (arcs_ends G)\<^sup>s
[PROOF STEP]
by (auto simp add: app_iso_eq symcl_def)
[PROOF STATE]
proof (state)
this:
(arcs_ends (app_iso hom G))\<^sup>s = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` (arcs_ends G)\<^sup>s

goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(arcs_ends (app_iso hom G))\<^sup>s = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` (arcs_ends G)\<^sup>s

goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
fix u v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
assume "(u,v) \<in> rtrancl_on (verts G) (symcl (arcs_ends G))"
[PROOF STATE]
proof (state)
this:
(u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)

goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)
[PROOF STEP]
have "(iso_verts hom u, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) (symcl (arcs_ends (app_iso hom G)))"
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)

goal (1 subgoal):
 1. (iso_verts hom u, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v \<in> verts G \<Longrightarrow> (iso_verts hom v, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
 2. \<And>x y. \<lbrakk>(x, y) \<in> (arcs_ends G)\<^sup>s; (y, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s); x \<in> verts G; y \<in> verts G; (iso_verts hom y, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)\<rbrakk> \<Longrightarrow> (iso_verts hom x, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
case (step x y)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> (arcs_ends G)\<^sup>s
(y, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)
x \<in> verts G
y \<in> verts G
(iso_verts hom y, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (2 subgoals):
 1. v \<in> verts G \<Longrightarrow> (iso_verts hom v, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
 2. \<And>x y. \<lbrakk>(x, y) \<in> (arcs_ends G)\<^sup>s; (y, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s); x \<in> verts G; y \<in> verts G; (iso_verts hom y, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)\<rbrakk> \<Longrightarrow> (iso_verts hom x, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
have "(iso_verts hom x, iso_verts hom y)
          \<in> rtrancl_on (verts (app_iso hom G)) (symcl (arcs_ends (app_iso hom G)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (iso_verts hom x, iso_verts hom y) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
using step
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> (arcs_ends G)\<^sup>s
(y, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s)
x \<in> verts G
y \<in> verts G
(iso_verts hom y, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (1 subgoal):
 1. (iso_verts hom x, iso_verts hom y) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
by (rule_tac rtrancl_on_into_rtrancl_on[where b="iso_verts hom x"]) (auto simp: *)
[PROOF STATE]
proof (state)
this:
(iso_verts hom x, iso_verts hom y) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (2 subgoals):
 1. v \<in> verts G \<Longrightarrow> (iso_verts hom v, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
 2. \<And>x y. \<lbrakk>(x, y) \<in> (arcs_ends G)\<^sup>s; (y, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s); x \<in> verts G; y \<in> verts G; (iso_verts hom y, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)\<rbrakk> \<Longrightarrow> (iso_verts hom x, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(iso_verts hom x, iso_verts hom y) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(iso_verts hom x, iso_verts hom y) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (1 subgoal):
 1. (iso_verts hom x, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
by (rule rtrancl_on_trans) (rule step)
[PROOF STATE]
proof (state)
this:
(iso_verts hom x, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (1 subgoal):
 1. v \<in> verts G \<Longrightarrow> (iso_verts hom v, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(iso_verts hom u, iso_verts hom v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?u4, ?v4) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s) \<Longrightarrow> (iso_verts hom ?u4, iso_verts hom ?v4) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
Digraph_Component.connected G
(?u4, ?v4) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s) \<Longrightarrow> (iso_verts hom ?u4, iso_verts hom ?v4) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Digraph_Component.connected G
(?u4, ?v4) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s) \<Longrightarrow> (iso_verts hom ?u4, iso_verts hom ?v4) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (1 subgoal):
 1. Digraph_Component.connected (app_iso hom G)
[PROOF STEP]
unfolding connected_conv
[PROOF STATE]
proof (prove)
using this:
verts G \<noteq> {} \<and> (\<forall>u\<in>verts G. \<forall>v\<in>verts G. (u, v) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s))
(?u4, ?v4) \<in> rtrancl_on (verts G) ((arcs_ends G)\<^sup>s) \<Longrightarrow> (iso_verts hom ?u4, iso_verts hom ?v4) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s)

goal (1 subgoal):
 1. verts (app_iso hom G) \<noteq> {} \<and> (\<forall>u\<in>verts (app_iso hom G). \<forall>v\<in>verts (app_iso hom G). (u, v) \<in> rtrancl_on (verts (app_iso hom G)) ((arcs_ends (app_iso hom G))\<^sup>s))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Digraph_Component.connected (app_iso hom G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uminus_carrier_vec[simp]:
  "(- v \<in> carrier_vec n) = (v \<in> carrier_vec n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- v \<in> carrier_vec n) = (v \<in> carrier_vec n)
[PROOF STEP]
unfolding carrier_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- v \<in> {v. dim_vec v = n}) = (v \<in> {v. dim_vec v = n})
[PROOF STEP]
by auto


[STATEMENT]
lemma ev1:
  "negl (\<lambda>x. (1 + c * inverse b * ln x powr (-(1+e))) powr p - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have "((\<lambda>x. c * inverse b * ln x powr (-(1+e))) \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. ((\<lambda>x. c * inverse b * ln x powr - (1 + e)) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (simp add: tendsto_0_smallo_1)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. c * inverse b * ln x powr - (1 + e)) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
have "(\<lambda>x. (1 + c * inverse b * ln x powr (-(1+e))) powr p - 1)
           \<in> O(\<lambda>x. c * inverse b * ln x powr - (1 + e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> O(\<lambda>x. c * inverse b * ln x powr - (1 + e))
[PROOF STEP]
using bep
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> O(\<lambda>x. c * inverse b * ln x powr - (1 + e))
[PROOF STEP]
by (intro one_plus_x_powr_Taylor1_bigo) (simp add: tendsto_0_smallo_1)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> O(\<lambda>x. c * inverse b * ln x powr - (1 + e))

goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> O(\<lambda>x. c * inverse b * ln x powr - (1 + e))

goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have "negl (\<lambda>x. c * inverse b * ln x powr - (1 + e))"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. (\<lambda>x. c * inverse b * ln x powr - (1 + e)) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. c * inverse b * ln x powr - (1 + e)) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))

goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))

goal (1 subgoal):
 1. (\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + c * inverse b * ln x powr - (1 + e)) powr p - 1) \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ListSum_V_F_eq_ListSum_F:
assumes pl: "inv g"
and pS: "separated g (set V)" and dist: "distinct V"
and V_subset: "set V \<subseteq> set (vertices g)"
and noex: "\<forall>f \<in> Collect P. |vertices f| \<le> 4"
shows "(\<Sum>\<^bsub>v \<in> V\<^esub> \<Sum>\<^bsub>f \<in> filter P (facesAt g v)\<^esub> (w::face \<Rightarrow> nat) f)
       = (\<Sum>\<^bsub>f \<in> [f\<leftarrow>faces g . \<exists>v \<in> set V. f \<in> set (facesAt g v) \<inter> Collect P]\<^esub> w f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
have s: "separating (set V) (\<lambda>v. set (facesAt g v) \<inter> Collect P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. separating (set V) (\<lambda>v. set (facesAt g v) \<inter> Collect P)
[PROOF STEP]
by (rule separated_separating[OF V_subset pS noex])
[PROOF STATE]
proof (state)
this:
separating (set V) (\<lambda>v. set (facesAt g v) \<inter> Collect P)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
separating (set V) (\<lambda>v. set (facesAt g v) \<inter> Collect P)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
note dist
[PROOF STATE]
proof (state)
this:
distinct V

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
distinct V

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
from pl V_subset
[PROOF STATE]
proof (chain)
picking this:
Invariants.inv g
set V \<subseteq> \<V> g
[PROOF STEP]
have "\<And>v. v \<in> set V \<Longrightarrow> distinct (facesAt g v)"
[PROOF STATE]
proof (prove)
using this:
Invariants.inv g
set V \<subseteq> \<V> g

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> distinct (facesAt g v)
[PROOF STEP]
by(blast intro:mgp_dist_facesAt[OF inv_mgp])
[PROOF STATE]
proof (state)
this:
?v \<in> set V \<Longrightarrow> distinct (facesAt g ?v)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
hence v: "\<And>v. v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g v))"
[PROOF STATE]
proof (prove)
using this:
?v \<in> set V \<Longrightarrow> distinct (facesAt g ?v)

goal (1 subgoal):
 1. \<And>v. v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g v))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g ?v))

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g ?v))

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
have "distinct [f\<leftarrow>faces g . \<exists>v \<in> set V. f \<in> set (facesAt g v) \<inter> Collect P]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g))
[PROOF STEP]
by (intro distinct_filter minGraphProps11'[OF inv_mgp[OF pl]])
[PROOF STATE]
proof (state)
this:
distinct (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g))

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
distinct (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g))

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
from pl
[PROOF STATE]
proof (chain)
picking this:
Invariants.inv g
[PROOF STEP]
have "{x. x \<in> \<F> g \<and> (\<exists>v \<in> set V. x \<in> set (facesAt g v) \<and> P x)} =
      (\<Union>v\<in>set V. set (facesAt g v) \<inter> Collect P)"
[PROOF STATE]
proof (prove)
using this:
Invariants.inv g

goal (1 subgoal):
 1. {x \<in> \<F> g. \<exists>v\<in>set V. x \<in> set (facesAt g v) \<and> P x} = (\<Union>\<^bsub>v\<in>set V\<^esub> set (facesAt g v) \<inter> Collect P)
[PROOF STEP]
using V_subset
[PROOF STATE]
proof (prove)
using this:
Invariants.inv g
set V \<subseteq> \<V> g

goal (1 subgoal):
 1. {x \<in> \<F> g. \<exists>v\<in>set V. x \<in> set (facesAt g v) \<and> P x} = (\<Union>\<^bsub>v\<in>set V\<^esub> set (facesAt g v) \<inter> Collect P)
[PROOF STEP]
by (blast intro:minGraphProps inv_mgp)
[PROOF STATE]
proof (state)
this:
{x \<in> \<F> g. \<exists>v\<in>set V. x \<in> set (facesAt g v) \<and> P x} = (\<Union>\<^bsub>v\<in>set V\<^esub> set (facesAt g v) \<inter> Collect P)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{x \<in> \<F> g. \<exists>v\<in>set V. x \<in> set (facesAt g v) \<and> P x} = (\<Union>\<^bsub>v\<in>set V\<^esub> set (facesAt g v) \<inter> Collect P)

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
from v
[PROOF STATE]
proof (chain)
picking this:
?v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g ?v))
[PROOF STEP]
have "(\<Sum>v\<in>set V. ListSum (filter P (facesAt g v)) w) = (\<Sum>v\<in>set V. sum w (set(facesAt g v) \<inter> Collect P))"
[PROOF STATE]
proof (prove)
using this:
?v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g ?v))

goal (1 subgoal):
 1. (\<Sum>v\<in>set V. ListSum (filter P (facesAt g v)) w) = (\<Sum>v\<in>set V. sum w (set (facesAt g v) \<inter> Collect P))
[PROOF STEP]
by (auto simp add: ListSum_conv_sum Int_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>set V. ListSum (filter P (facesAt g v)) w) = (\<Sum>v\<in>set V. sum w (set (facesAt g v) \<inter> Collect P))

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
separating (set V) (\<lambda>v. set (facesAt g v) \<inter> Collect P)
distinct V
?v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g ?v))
distinct (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g))
{x \<in> \<F> g. \<exists>v\<in>set V. x \<in> set (facesAt g v) \<and> P x} = (\<Union>\<^bsub>v\<in>set V\<^esub> set (facesAt g v) \<inter> Collect P)
(\<Sum>v\<in>set V. ListSum (filter P (facesAt g v)) w) = (\<Sum>v\<in>set V. sum w (set (facesAt g v) \<inter> Collect P))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
separating (set V) (\<lambda>v. set (facesAt g v) \<inter> Collect P)
distinct V
?v \<in> set V \<Longrightarrow> distinct (filter P (facesAt g ?v))
distinct (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g))
{x \<in> \<F> g. \<exists>v\<in>set V. x \<in> set (facesAt g v) \<and> P x} = (\<Union>\<^bsub>v\<in>set V\<^esub> set (facesAt g v) \<inter> Collect P)
(\<Sum>v\<in>set V. ListSum (filter P (facesAt g v)) w) = (\<Sum>v\<in>set V. sum w (set (facesAt g v) \<inter> Collect P))

goal (1 subgoal):
 1. (\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w
[PROOF STEP]
by (simp add: ListSum_conv_sum sum_disj_Union)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^bsub>v\<in>V\<^esub> ListSum (filter P (facesAt g v)) w) = ListSum (filter (\<lambda>f. \<exists>v\<in>set V. f \<in> set (facesAt g v) \<inter> Collect P) (faces g)) w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_vertices_simps[simp]:
    "int_vertices [] = {}"
    "int_vertices (vv#p) = insert (fst vv) (int_vertices p)"
    "int_vertices (p1@p2) = int_vertices p1 \<union> int_vertices p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int_vertices [] = {} &&& int_vertices (vv # p) = insert (fst vv) (int_vertices p) &&& int_vertices (p1 @ p2) = int_vertices p1 \<union> int_vertices p2
[PROOF STEP]
by (auto simp add: int_vertices_def)


[STATEMENT]
lemma monom_Suc: "monom a (Suc n) = pCons 0 (monom a n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom a (Suc n) = pCons (0::'a) (monom a n)
[PROOF STEP]
by (rule poly_eqI) (simp add: coeff_pCons split: nat.split)