[STATEMENT]
lemma local_time_birkhoff:
  "local_time A n x = birkhoff_sum (indicator A) n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_time A n x = birkhoff_sum (indicator A) n x
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. local_time A 0 x = birkhoff_sum (indicator A) 0 x
 2. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. local_time A 0 x = birkhoff_sum (indicator A) 0 x
 2. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_time A 0 x = birkhoff_sum (indicator A) 0 x
[PROOF STEP]
unfolding local_time_def birkhoff_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i \<in> {..<0}. (T ^^ i) x \<in> A} = (\<Sum>i<0. indicator A ((T ^^ i) x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local_time A 0 x = birkhoff_sum (indicator A) 0 x

goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
local_time A n x = birkhoff_sum (indicator A) n x

goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
have "local_time A (n+1) x = local_time A n x + indicator A ((T^^n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
 2. \<not> ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
assume *: "(T^^n) x \<in> A"
[PROOF STATE]
proof (state)
this:
(T ^^ n) x \<in> A

goal (2 subgoals):
 1. ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
 2. \<not> ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(T ^^ n) x \<in> A
[PROOF STEP]
have "{i\<in>{..<Suc n}. (T^^i) x \<in> A} = {i\<in>{..<n}. (T^^i) x \<in> A} \<union> {n}"
[PROOF STATE]
proof (prove)
using this:
(T ^^ n) x \<in> A

goal (1 subgoal):
 1. {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A} \<union> {n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A} \<union> {n}

goal (2 subgoals):
 1. ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
 2. \<not> ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A} \<union> {n}
[PROOF STEP]
have "card {i\<in>{..<Suc n}. (T^^i) x \<in> A} = card {i\<in>{..<n}. (T^^i) x \<in> A} + card {n}"
[PROOF STATE]
proof (prove)
using this:
{i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A} \<union> {n}

goal (1 subgoal):
 1. card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A} + card {n}
[PROOF STEP]
using card_Un_disjoint
[PROOF STATE]
proof (prove)
using this:
{i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A} \<union> {n}
\<lbrakk>finite ?A; finite ?B; ?A \<inter> ?B = {}\<rbrakk> \<Longrightarrow> card (?A \<union> ?B) = card ?A + card ?B

goal (1 subgoal):
 1. card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A} + card {n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A} + card {n}

goal (2 subgoals):
 1. ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
 2. \<not> ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A} + card {n}
[PROOF STEP]
have "local_time A (n+1) x = local_time A n x + 1"
[PROOF STATE]
proof (prove)
using this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A} + card {n}

goal (1 subgoal):
 1. local_time A (n + 1) x = local_time A n x + 1
[PROOF STEP]
using local_time_def
[PROOF STATE]
proof (prove)
using this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A} + card {n}
local_time ?A ?n ?x = card {i \<in> {..<?n}. (T ^^ i) ?x \<in> ?A}

goal (1 subgoal):
 1. local_time A (n + 1) x = local_time A n x + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = local_time A n x + 1

goal (2 subgoals):
 1. ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
 2. \<not> ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = local_time A n x + 1

goal (2 subgoals):
 1. ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
 2. \<not> ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
have "indicator A ((T^^n)x) = (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator A ((T ^^ n) x) = 1
[PROOF STEP]
using * indicator_def
[PROOF STATE]
proof (prove)
using this:
(T ^^ n) x \<in> A
indicator ?S ?x = of_bool (?x \<in> ?S)

goal (1 subgoal):
 1. indicator A ((T ^^ n) x) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
indicator A ((T ^^ n) x) = 1

goal (2 subgoals):
 1. ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
 2. \<not> ?P \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local_time A (n + 1) x = local_time A n x + 1
indicator A ((T ^^ n) x) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local_time A (n + 1) x = local_time A n x + 1
indicator A ((T ^^ n) x) = 1

goal (1 subgoal):
 1. local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)

goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
assume *: "\<not>((T^^n) x \<in> A)"
[PROOF STATE]
proof (state)
this:
(T ^^ n) x \<notin> A

goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(T ^^ n) x \<notin> A
[PROOF STEP]
have "{i\<in>{..<Suc n}. (T^^i) x \<in> A} = {i\<in>{..<n}. (T^^i) x \<in> A}"
[PROOF STATE]
proof (prove)
using this:
(T ^^ n) x \<notin> A

goal (1 subgoal):
 1. {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A}
[PROOF STEP]
using less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
(T ^^ n) x \<notin> A
(?m < Suc ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A}

goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A}
[PROOF STEP]
have "card {i\<in>{..<Suc n}. (T^^i) x \<in> A} = card {i\<in>{..<n}. (T^^i) x \<in> A}"
[PROOF STATE]
proof (prove)
using this:
{i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = {i \<in> {..<n}. (T ^^ i) x \<in> A}

goal (1 subgoal):
 1. card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A}

goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A}
[PROOF STEP]
have "local_time A (n+1) x = local_time A n x"
[PROOF STATE]
proof (prove)
using this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A}

goal (1 subgoal):
 1. local_time A (n + 1) x = local_time A n x
[PROOF STEP]
using local_time_def
[PROOF STATE]
proof (prove)
using this:
card {i \<in> {..<Suc n}. (T ^^ i) x \<in> A} = card {i \<in> {..<n}. (T ^^ i) x \<in> A}
local_time ?A ?n ?x = card {i \<in> {..<?n}. (T ^^ i) ?x \<in> ?A}

goal (1 subgoal):
 1. local_time A (n + 1) x = local_time A n x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = local_time A n x

goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = local_time A n x

goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
have "indicator A ((T^^n)x) = (0::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator A ((T ^^ n) x) = 0
[PROOF STEP]
using * indicator_def
[PROOF STATE]
proof (prove)
using this:
(T ^^ n) x \<notin> A
indicator ?S ?x = of_bool (?x \<in> ?S)

goal (1 subgoal):
 1. indicator A ((T ^^ n) x) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
indicator A ((T ^^ n) x) = 0

goal (1 subgoal):
 1. (T ^^ n) x \<notin> A \<Longrightarrow> local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local_time A (n + 1) x = local_time A n x
indicator A ((T ^^ n) x) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local_time A (n + 1) x = local_time A n x
indicator A ((T ^^ n) x) = 0

goal (1 subgoal):
 1. local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)

goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
[PROOF STEP]
have "local_time A (n+1) x = birkhoff_sum (indicator A) n x + indicator A ((T^^n) x)"
[PROOF STATE]
proof (prove)
using this:
local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)

goal (1 subgoal):
 1. local_time A (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
local_time A (n + 1) x = local_time A n x + indicator A ((T ^^ n) x)
local_time A n x = birkhoff_sum (indicator A) n x

goal (1 subgoal):
 1. local_time A (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)

goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)

goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
have "birkhoff_sum (indicator A) (n+1) x = birkhoff_sum (indicator A) n x + indicator A ((T^^n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum (indicator A) (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)
[PROOF STEP]
by (metis birkhoff_sum_cocycle[where ?n = "n" and ?m = "1"] birkhoff_sum_1(2))
[PROOF STATE]
proof (state)
this:
birkhoff_sum (indicator A) (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)

goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local_time A (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)
birkhoff_sum (indicator A) (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)
[PROOF STEP]
have "local_time A (n+1) x = birkhoff_sum (indicator A) (n+1) x"
[PROOF STATE]
proof (prove)
using this:
local_time A (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)
birkhoff_sum (indicator A) (n + 1) x = birkhoff_sum (indicator A) n x + indicator A ((T ^^ n) x)

goal (1 subgoal):
 1. local_time A (n + 1) x = birkhoff_sum (indicator A) (n + 1) x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
local_time A (n + 1) x = birkhoff_sum (indicator A) (n + 1) x

goal (1 subgoal):
 1. \<And>n. local_time A n x = birkhoff_sum (indicator A) n x \<Longrightarrow> local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local_time A (n + 1) x = birkhoff_sum (indicator A) (n + 1) x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local_time A (n + 1) x = birkhoff_sum (indicator A) (n + 1) x

goal (1 subgoal):
 1. local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x
[PROOF STEP]
by (metis Suc_eq_plus1)
[PROOF STATE]
proof (state)
this:
local_time A (Suc n) x = birkhoff_sum (indicator A) (Suc n) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_image_eq_pointwiseI:
  assumes "length l = length l'"
  assumes "\<And>i. i<length l \<Longrightarrow> f (l!i) = f (l'!i)"
  shows "f`set l = f`set l'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` set l = f ` set l'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length l = length l'
?i < length l \<Longrightarrow> f (l ! ?i) = f (l' ! ?i)

goal (1 subgoal):
 1. f ` set l = f ` set l'
[PROOF STEP]
by (fastforce simp: in_set_conv_nth in_set_image_conv_nth)


[STATEMENT]
lemma cop2_os__osp:
  assumes "\<not> Coplanar A B C X" and
    "Coplanar A B C D" and
    "Coplanar A B C E" and
    "D E OS X Y"
  shows "A B C OSP X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B C OSP X Y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A B C OSP X Y
[PROOF STEP]
obtain Z where P1: "D E TS X Z \<and> D E TS Y Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Z. D E TS X Z \<and> D E TS Y Z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using OS_def assms(4)
[PROOF STATE]
proof (prove)
using this:
?A ?B OS ?P ?Q \<equiv> \<exists>R. ?A ?B TS ?P R \<and> ?A ?B TS ?Q R
D E OS X Y

goal (1 subgoal):
 1. (\<And>Z. D E TS X Z \<and> D E TS Y Z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
D E TS X Z \<and> D E TS Y Z

goal (1 subgoal):
 1. A B C OSP X Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
D E TS X Z \<and> D E TS Y Z
[PROOF STEP]
have P2: "A B C TSP X Z"
[PROOF STATE]
proof (prove)
using this:
D E TS X Z \<and> D E TS Y Z

goal (1 subgoal):
 1. A B CTSP X Z
[PROOF STEP]
using assms(1) assms(2) assms(3) cop2_ts__tsp
[PROOF STATE]
proof (prove)
using this:
D E TS X Z \<and> D E TS Y Z
\<not> Coplanar A B C X
Coplanar A B C D
Coplanar A B C E
\<lbrakk>\<not> Coplanar ?A ?B ?C ?X; Coplanar ?A ?B ?C ?D; Coplanar ?A ?B ?C ?E; ?D ?E TS ?X ?Y\<rbrakk> \<Longrightarrow> ?A ?B ?CTSP ?X ?Y

goal (1 subgoal):
 1. A B CTSP X Z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A B CTSP X Z

goal (1 subgoal):
 1. A B C OSP X Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A B CTSP X Z
[PROOF STEP]
have P3: "A B C TSP Y Z"
[PROOF STATE]
proof (prove)
using this:
A B CTSP X Z

goal (1 subgoal):
 1. A B CTSP Y Z
[PROOF STEP]
by (meson P1 assms(2) assms(3) cop2_ts__tsp l9_2 tsp__ncop2)
[PROOF STATE]
proof (state)
this:
A B CTSP Y Z

goal (1 subgoal):
 1. A B C OSP X Y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A B CTSP Y Z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A B CTSP Y Z

goal (1 subgoal):
 1. A B C OSP X Y
[PROOF STEP]
using P2 l9_41_1
[PROOF STATE]
proof (prove)
using this:
A B CTSP Y Z
A B CTSP X Z
\<lbrakk>?A ?B ?CTSP ?P ?R; ?A ?B ?CTSP ?Q ?R\<rbrakk> \<Longrightarrow> ?A ?B ?C OSP ?P ?Q

goal (1 subgoal):
 1. A B C OSP X Y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A B C OSP X Y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_step_down_word_2:
  fixes x :: "'a::len word"
  shows "\<lbrakk>x \<le>  y; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<le> y - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; x \<noteq> y\<rbrakk> \<Longrightarrow> x \<le> y - 1
[PROOF STEP]
by (subst (asm) word_le_less_eq,
      clarsimp,
      simp add: word_le_minus_one_leq)


[STATEMENT]
lemma parts_UN_subset2: "parts(\<Union>x\<in>A. H x) \<subseteq> (\<Union>x\<in>A. parts(H x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parts (\<Union> (H ` A)) \<subseteq> (\<Union>x\<in>A. parts (H x))
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> parts (\<Union> (H ` A)) \<Longrightarrow> x \<in> (\<Union>x\<in>A. parts (H x))
[PROOF STEP]
apply (erule parts.induct, blast+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma factorization_m_smult: assumes "factorization_m f (c,fs)"
  shows "factorization_m (smult d f) (c * d,fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
note * = assms[unfolded factorization_m_def split]
[PROOF STATE]
proof (state)
this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))

goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
[PROOF STEP]
have f: "Mp f = Mp (smult c (prod_mset fs))"
[PROOF STATE]
proof (prove)
using this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))

goal (1 subgoal):
 1. f =m smult c (\<Prod>\<^sub># fs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f =m smult c (\<Prod>\<^sub># fs)

goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
have "Mp (smult d f) = Mp (smult d (Mp f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult d f =m smult d (Mp f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
smult d f =m smult d (Mp f)

goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
smult d f =m smult d (Mp f)

goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
have "\<dots> = Mp (smult (c * d) (prod_mset fs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult d (Mp f) =m smult (c * d) (\<Prod>\<^sub># fs)
[PROOF STEP]
unfolding f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult d (Mp (smult c (\<Prod>\<^sub># fs))) =m smult (c * d) (\<Prod>\<^sub># fs)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
smult d (Mp f) =m smult (c * d) (\<Prod>\<^sub># fs)

goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
smult d f =m smult (c * d) (\<Prod>\<^sub># fs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
smult d f =m smult (c * d) (\<Prod>\<^sub># fs)

goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
smult d f =m smult (c * d) (\<Prod>\<^sub># fs)
factorization_m f (c, fs)

goal (1 subgoal):
 1. factorization_m (smult d f) (c * d, fs)
[PROOF STEP]
unfolding factorization_m_def split
[PROOF STATE]
proof (prove)
using this:
smult d f =m smult (c * d) (\<Prod>\<^sub># fs)
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))

goal (1 subgoal):
 1. smult d f =m smult (c * d) (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
factorization_m (smult d f) (c * d, fs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l2_eq: "length a = length b \<Longrightarrow> l2 a b = (\<Prod>d<length a. l2_\<phi> (a!d) (b!d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length a = length b \<Longrightarrow> l2 a b = (\<Prod>d<length a. l2_\<phi> (a ! d) (b ! d))
[PROOF STEP]
unfolding l2_def l2_\<phi>_def \<Phi>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length a = length b \<Longrightarrow> LINT x|Pi\<^sub>M {..<length a} (\<lambda>d. lborel). (\<Prod>d<length a. \<phi> (a ! d) (x d)) * (\<Prod>d<length b. \<phi> (b ! d) (x d)) = (\<Prod>d<length a. LBINT x. \<phi> (a ! d) x * \<phi> (b ! d) x)
[PROOF STEP]
apply (simp add: prod.distrib[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length a = length b \<Longrightarrow> LINT x|Pi\<^sub>M {..<length b} (\<lambda>d. lborel). (\<Prod>xa<length b. \<phi> (a ! xa) (x xa) * \<phi> (b ! xa) (x xa)) = (\<Prod>d<length b. LBINT x. \<phi> (a ! d) x * \<phi> (b ! d) x)
[PROOF STEP]
proof (rule product_sigma_finite.product_integral_prod)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. length a = length b \<Longrightarrow> product_sigma_finite (\<lambda>d. lborel)
 2. length a = length b \<Longrightarrow> finite {..<length b}
 3. \<And>x. \<lbrakk>length a = length b; x \<in> {..<length b}\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>xa. \<phi> (a ! x) xa * \<phi> (b ! x) xa)
[PROOF STEP]
show "product_sigma_finite (\<lambda>d. lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (\<lambda>d. lborel)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
product_sigma_finite (\<lambda>d. lborel)

goal (2 subgoals):
 1. length a = length b \<Longrightarrow> finite {..<length b}
 2. \<And>x. \<lbrakk>length a = length b; x \<in> {..<length b}\<rbrakk> \<Longrightarrow> integrable lborel (\<lambda>xa. \<phi> (a ! x) xa * \<phi> (b ! x) xa)
[PROOF STEP]
qed (auto intro: integrable_\<phi>2)


[STATEMENT]
lemma tendsto_eval_fds_truncate:
  assumes "fds_converges f s"
  shows   "(\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
have "(\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s \<longleftrightarrow>
          (\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s = (\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
unfolding eval_fds_truncate
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>N. \<Sum>k = 1..N. fds_nth f k / nat_power k s) \<longlonglongrightarrow> eval_fds f s = (\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
by (intro filterlim_cong always_eventually allI sum.mono_neutral_left) (auto simp: not_le)
[PROOF STATE]
proof (state)
this:
(\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s = (\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s

goal (1 subgoal):
 1. (\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s = (\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s

goal (1 subgoal):
 1. (\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
have \<dots>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fds_converges f s

goal (1 subgoal):
 1. (\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
by (simp add: fds_converges_iff sums_def' atLeast0AtMost)
[PROOF STATE]
proof (state)
this:
(\<lambda>N. \<Sum>i\<le>N. fds_nth f i / nat_power i s) \<longlonglongrightarrow> eval_fds f s

goal (1 subgoal):
 1. (\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s

goal (1 subgoal):
 1. (\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>N. eval_fds (fds_truncate N f) s) \<longlonglongrightarrow> eval_fds f s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Tarski) intY1_func: "(\<lambda>x \<in> intY1. f x) \<in> intY1 \<rightarrow> intY1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict f intY1 \<in> intY1 \<rightarrow> intY1
[PROOF STEP]
apply (rule restrictI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> intY1 \<Longrightarrow> f x \<in> intY1
[PROOF STEP]
apply (metis intY1_f_closed)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma differenceset_stabilizer_eq:
  shows "differenceset (stabilizer A) (stabilizer A) = stabilizer A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. differenceset (stabilizer A) (stabilizer A) = stabilizer A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A
 2. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
show "differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
assume "x \<in> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (state)
this:
x \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
obtain a b where "a \<in> stabilizer A" and "b \<in> stabilizer A" and "x = a \<ominus> b"
[PROOF STATE]
proof (prove)
using this:
x \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>a \<in> stabilizer A; b \<in> stabilizer A; x = a \<ominus> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis minusset.cases sumset.cases)
[PROOF STATE]
proof (state)
this:
a \<in> stabilizer A
b \<in> stabilizer A
x = a \<ominus> b

goal (1 subgoal):
 1. \<And>x. x \<in> differenceset (stabilizer A) (stabilizer A) \<Longrightarrow> x \<in> stabilizer A
[PROOF STEP]
thus "x \<in> stabilizer A"
[PROOF STATE]
proof (prove)
using this:
a \<in> stabilizer A
b \<in> stabilizer A
x = a \<ominus> b

goal (1 subgoal):
 1. x \<in> stabilizer A
[PROOF STEP]
using stabilizer_is_subgroup subgroup.axioms(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> stabilizer A
b \<in> stabilizer A
x = a \<ominus> b
subgroup (stabilizer ?S) G (\<oplus>) \<zero>
subgroup ?G ?M ?composition ?unit \<Longrightarrow> submonoid ?G ?M ?composition ?unit

goal (1 subgoal):
 1. x \<in> stabilizer A
[PROOF STEP]
by (smt (verit, ccfv_threshold) in_mono invertible stabilizer_subset_group
        subgroup_inverse_iff sub_composition_closed)
[PROOF STATE]
proof (state)
this:
x \<in> stabilizer A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
differenceset (stabilizer A) (stabilizer A) \<subseteq> stabilizer A

goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
show "stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
assume hx: "x \<in> stabilizer A"
[PROOF STATE]
proof (state)
this:
x \<in> stabilizer A

goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> stabilizer A
[PROOF STEP]
have "x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (prove)
using this:
x \<in> stabilizer A

goal (1 subgoal):
 1. x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. \<And>x. x \<in> stabilizer A \<Longrightarrow> x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
show "x \<in> differenceset (stabilizer A) (stabilizer A)"
[PROOF STATE]
proof (prove)
using this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)

goal (1 subgoal):
 1. x \<in> differenceset (stabilizer A) (stabilizer A)
[PROOF STEP]
using hx
[PROOF STATE]
proof (prove)
using this:
x \<ominus> \<zero> \<in> differenceset (stabilizer A) (stabilizer A)
x \<in> stabilizer A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
stabilizer A \<subseteq> differenceset (stabilizer A) (stabilizer A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_less_set_unique:
  assumes "sorted xs"
      and "sorted ys"
      and "set xs = set ys"
    shows "xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted xs
Sorted_Less.sorted ys
set xs = set ys

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
Sorted_Less.sorted xs
[PROOF STEP]
have "distinct xs" and "List.sorted xs"
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted xs

goal (1 subgoal):
 1. distinct xs &&& linorder_class.sorted xs
[PROOF STEP]
by (induct xs) auto
[PROOF STATE]
proof (state)
this:
distinct xs
linorder_class.sorted xs

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
distinct xs
linorder_class.sorted xs

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
Sorted_Less.sorted ys
[PROOF STEP]
have "distinct ys" and "List.sorted ys"
[PROOF STATE]
proof (prove)
using this:
Sorted_Less.sorted ys

goal (1 subgoal):
 1. distinct ys &&& linorder_class.sorted ys
[PROOF STEP]
by (induct ys) auto
[PROOF STATE]
proof (state)
this:
distinct ys
linorder_class.sorted ys

goal (1 subgoal):
 1. \<lbrakk>Sorted_Less.sorted xs; Sorted_Less.sorted ys; set xs = set ys\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
distinct xs
linorder_class.sorted xs
distinct ys
linorder_class.sorted ys
[PROOF STEP]
show "xs = ys"
[PROOF STATE]
proof (prove)
using this:
distinct xs
linorder_class.sorted xs
distinct ys
linorder_class.sorted ys

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
distinct xs
linorder_class.sorted xs
distinct ys
linorder_class.sorted ys
set xs = set ys

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
by (auto intro: sorted_distinct_set_unique)
[PROOF STATE]
proof (state)
this:
xs = ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj_lift_poly_fun_homogenous:
  assumes "f 0 = 0"
  shows "proj_poly k (lift_poly_fun f p) = f (proj_poly k p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k (lift_poly_fun f p) = f (proj_poly k p)
[PROOF STEP]
by (rule poly_mapping_eqI,
      simp add: lookup_proj_poly lookup_lift_poly_fun_homogenous[of f, OF assms] term_simps)


[STATEMENT]
lemma plus_absorb1:
  assumes "f \<in> o[F](g)"
  shows   "L F (\<lambda>x. f x + g x) = L F (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) = L F g
[PROOF STEP]
proof (intro equalityI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
 2. L F g \<subseteq> L F (\<lambda>x. f x + g x)
[PROOF STEP]
from plus_subset1 and assms
[PROOF STATE]
proof (chain)
picking this:
?f \<in> o[?F](?g) \<Longrightarrow> L ?F ?g \<subseteq> L ?F (\<lambda>x. ?f x + ?g x)
f \<in> o[F](g)
[PROOF STEP]
show "L F g \<subseteq> L F (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
using this:
?f \<in> o[?F](?g) \<Longrightarrow> L ?F ?g \<subseteq> L ?F (\<lambda>x. ?f x + ?g x)
f \<in> o[F](g)

goal (1 subgoal):
 1. L F g \<subseteq> L F (\<lambda>x. f x + g x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
L F g \<subseteq> L F (\<lambda>x. f x + g x)

goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
[PROOF STEP]
from landau_o.small.plus_subset1[OF assms] and assms
[PROOF STATE]
proof (chain)
picking this:
o[F](g) \<subseteq> o[F](\<lambda>x. f x + g x)
f \<in> o[F](g)
[PROOF STEP]
have "(\<lambda>x. -f x) \<in> o[F](\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
using this:
o[F](g) \<subseteq> o[F](\<lambda>x. f x + g x)
f \<in> o[F](g)

goal (1 subgoal):
 1. (\<lambda>x. - f x) \<in> o[F](\<lambda>x. f x + g x)
[PROOF STEP]
by (auto simp: landau_o.small.uminus_in_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. - f x) \<in> o[F](\<lambda>x. f x + g x)

goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
[PROOF STEP]
from plus_subset1[OF this]
[PROOF STATE]
proof (chain)
picking this:
L F (\<lambda>x. f x + g x) \<subseteq> L F (\<lambda>x. - f x + (f x + g x))
[PROOF STEP]
show "L F (\<lambda>x. f x + g x) \<subseteq> L F (g)"
[PROOF STATE]
proof (prove)
using this:
L F (\<lambda>x. f x + g x) \<subseteq> L F (\<lambda>x. - f x + (f x + g x))

goal (1 subgoal):
 1. L F (\<lambda>x. f x + g x) \<subseteq> L F g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
L F (\<lambda>x. f x + g x) \<subseteq> L F g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_deg_uminus [simp]: "poly_deg (-p) = poly_deg p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_deg (- p) = poly_deg p
[PROOF STEP]
by (simp add: poly_deg_def keys_uminus)


[STATEMENT]
lemma filterlim_at_top_div_const_nat:
  assumes "c > 0"
  shows   "filterlim (\<lambda>x::nat. x div c) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x sequentially. x div c :> sequentially
[PROOF STEP]
unfolding filterlim_at_top
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
fix C :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
have *: "n div c \<ge> C" if "n \<ge> C * c" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C \<le> n div c
[PROOF STEP]
using assms that
[PROOF STATE]
proof (prove)
using this:
0 < c
C * c \<le> n

goal (1 subgoal):
 1. C \<le> n div c
[PROOF STEP]
by (metis div_le_mono div_mult_self_is_m)
[PROOF STATE]
proof (state)
this:
C * c \<le> ?n \<Longrightarrow> C \<le> ?n div c

goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
have "eventually (\<lambda>n. n \<ge> C * c) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((\<le>) (C * c)) sequentially
[PROOF STEP]
by (rule eventually_ge_at_top)
[PROOF STATE]
proof (state)
this:
eventually ((\<le>) (C * c)) sequentially

goal (1 subgoal):
 1. \<And>Z. \<forall>\<^sub>F x in sequentially. Z \<le> x div c
[PROOF STEP]
thus "eventually (\<lambda>n. n div c \<ge> C) at_top"
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) (C * c)) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. C \<le> n div c
[PROOF STEP]
by eventually_elim (use * in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. C \<le> n div c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wqo_on_lists:
  assumes "wqo_on P A" shows "wqo_on (list_emb P) (lists A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (list_emb P) (lists A)
[PROOF STEP]
using assms and almost_full_on_lists
    and transp_on_list_emb
[PROOF STATE]
proof (prove)
using this:
wqo_on P A
almost_full_on ?P ?A \<Longrightarrow> almost_full_on (list_emb ?P) (lists ?A)
transp_on ?P ?A \<Longrightarrow> transp_on (list_emb ?P) (lists ?A)

goal (1 subgoal):
 1. wqo_on (list_emb P) (lists A)
[PROOF STEP]
by (auto simp: wqo_on_def)


[STATEMENT]
lemma one_le_exp_iff [simp]: "1 \<le> exp x \<longleftrightarrow> 0 \<le> x"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> exp x) = (0 \<le> x)
[PROOF STEP]
using exp_le_cancel_iff [where x = 0 and y = x]
[PROOF STATE]
proof (prove)
using this:
(exp 0 \<le> exp x) = (0 \<le> x)

goal (1 subgoal):
 1. (1 \<le> exp x) = (0 \<le> x)
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_unit_factor_mult_unit_factor:
  fixes f g :: "'a::{comm_monoid_add,mult_zero} fps"
  shows "unit_factor (f * unit_factor g) = unit_factor (f * g)"
  and   "unit_factor (unit_factor f * g) = unit_factor (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g) &&& unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
 2. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
show "unit_factor (f * unit_factor g) = unit_factor (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
proof (cases "f*g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
 2. f * g \<noteq> 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f * g \<noteq> 0

goal (2 subgoals):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
 2. f * g \<noteq> 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f * g \<noteq> 0

goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
using fps_mult_subdegree_ge[of f g] fps_unit_factor_shift[of "subdegree g" "f*g"]
[PROOF STATE]
proof (prove)
using this:
f * g \<noteq> 0
f * g \<noteq> 0 \<Longrightarrow> subdegree f + subdegree g \<le> subdegree (f * g)
subdegree g \<le> subdegree (f * g) \<Longrightarrow> unit_factor (fps_shift (subdegree g) (f * g)) = unit_factor (f * g)

goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
by    (simp add: fps_shift_mult)
[PROOF STATE]
proof (state)
this:
unit_factor (f * unit_factor g) = unit_factor (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
have "f * unit_factor g = fps_shift (subdegree g) (f*g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * unit_factor g = fps_shift (subdegree g) (f * g)
[PROOF STEP]
by (simp add: fps_shift_mult)
[PROOF STATE]
proof (state)
this:
f * unit_factor g = fps_shift (subdegree g) (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f * g = 0
f * unit_factor g = fps_shift (subdegree g) (f * g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f * g = 0
f * unit_factor g = fps_shift (subdegree g) (f * g)

goal (1 subgoal):
 1. unit_factor (f * unit_factor g) = unit_factor (f * g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unit_factor (f * unit_factor g) = unit_factor (f * g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unit_factor (f * unit_factor g) = unit_factor (f * g)

goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
show "unit_factor (unit_factor f * g) = unit_factor (f * g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
proof (cases "f*g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
 2. f * g \<noteq> 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f * g \<noteq> 0

goal (2 subgoals):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
 2. f * g \<noteq> 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f * g \<noteq> 0

goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
using fps_mult_subdegree_ge[of f g] fps_unit_factor_shift[of "subdegree f" "f*g"]
[PROOF STATE]
proof (prove)
using this:
f * g \<noteq> 0
f * g \<noteq> 0 \<Longrightarrow> subdegree f + subdegree g \<le> subdegree (f * g)
subdegree f \<le> subdegree (f * g) \<Longrightarrow> unit_factor (fps_shift (subdegree f) (f * g)) = unit_factor (f * g)

goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
by    (simp add: fps_shift_mult_right_noncomm)
[PROOF STATE]
proof (state)
this:
unit_factor (unit_factor f * g) = unit_factor (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f * g = 0

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
have "unit_factor f * g = fps_shift (subdegree f) (f*g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor f * g = fps_shift (subdegree f) (f * g)
[PROOF STEP]
by (simp add: fps_shift_mult_right_noncomm)
[PROOF STATE]
proof (state)
this:
unit_factor f * g = fps_shift (subdegree f) (f * g)

goal (1 subgoal):
 1. f * g = 0 \<Longrightarrow> unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f * g = 0
unit_factor f * g = fps_shift (subdegree f) (f * g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f * g = 0
unit_factor f * g = fps_shift (subdegree f) (f * g)

goal (1 subgoal):
 1. unit_factor (unit_factor f * g) = unit_factor (f * g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unit_factor (unit_factor f * g) = unit_factor (f * g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unit_factor (unit_factor f * g) = unit_factor (f * g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma div_Ints_mod_0: assumes "rat_of_int a / rat_of_int b \<in> \<int>" "b \<noteq> 0"
  shows "a mod b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
define c where "c = int_of_rat (rat_of_int a / rat_of_int b)"
[PROOF STATE]
proof (state)
this:
c = int_of_rat (rat_of_int a / rat_of_int b)

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
have "rat_of_int a / rat_of_int b = rat_of_int c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int a / rat_of_int b = rat_of_int c
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int a / rat_of_int b = rat_of_int (int_of_rat (rat_of_int a / rat_of_int b))
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
rat_of_int a / rat_of_int b \<in> \<int>

goal (1 subgoal):
 1. rat_of_int a / rat_of_int b = rat_of_int (int_of_rat (rat_of_int a / rat_of_int b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rat_of_int a / rat_of_int b = rat_of_int c

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
hence "rat_of_int a = rat_of_int b * rat_of_int c"
[PROOF STATE]
proof (prove)
using this:
rat_of_int a / rat_of_int b = rat_of_int c

goal (1 subgoal):
 1. rat_of_int a = rat_of_int b * rat_of_int c
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
rat_of_int a / rat_of_int b = rat_of_int c
b \<noteq> 0

goal (1 subgoal):
 1. rat_of_int a = rat_of_int b * rat_of_int c
[PROOF STEP]
by (metis divide_cancel_right nonzero_mult_div_cancel_left of_int_eq_0_iff)
[PROOF STATE]
proof (state)
this:
rat_of_int a = rat_of_int b * rat_of_int c

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
hence a: "a = b * c"
[PROOF STATE]
proof (prove)
using this:
rat_of_int a = rat_of_int b * rat_of_int c

goal (1 subgoal):
 1. a = b * c
[PROOF STEP]
by (simp add: of_int_hom.injectivity)
[PROOF STATE]
proof (state)
this:
a = b * c

goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
show "a mod b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod b = 0
[PROOF STEP]
unfolding a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * c mod b = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a mod b = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma C_continuum_ge: "C_continuum \<ge> \<aleph>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega>1 \<le> C_continuum
[PROOF STEP]
by (metis C_continuum_def Ord_\<omega>1 Ord_cardinal Ord_linear2 countable_iff_vcard_less1
            uncountable_Real_set)


[STATEMENT]
lemma bin_rest_numeral_simps [simp]:
  "(\<lambda>k::int. k div 2) 0 = 0"
  "(\<lambda>k::int. k div 2) 1 = 0"
  "(\<lambda>k::int. k div 2) (- 1) = - 1"
  "(\<lambda>k::int. k div 2) Numeral1 = 0"
  "(\<lambda>k::int. k div 2) (numeral (Num.Bit0 w)) = numeral w"
  "(\<lambda>k::int. k div 2) (numeral (Num.Bit1 w)) = numeral w"
  "(\<lambda>k::int. k div 2) (- numeral (Num.Bit0 w)) = - numeral w"
  "(\<lambda>k::int. k div 2) (- numeral (Num.Bit1 w)) = - numeral (w + Num.One)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0 div 2 = 0 &&& 1 div 2 = 0) &&& - 1 div 2 = - 1 &&& Numeral1 div 2 = 0) &&& (numeral (num.Bit0 w) div 2 = numeral w &&& numeral (num.Bit1 w) div 2 = numeral w) &&& - numeral (num.Bit0 w) div 2 = - numeral w &&& - numeral (num.Bit1 w) div 2 = - numeral (w + num.One)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma residue_bernoulli:
  assumes "n \<noteq> 0"
  shows   "residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (2 * pi * real_of_int n * \<i>) =
             1 / (2 * pi * real_of_int n * \<i>) ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
have "residue (\<lambda>z. (1 / z ^ m) / (exp z - 1)) (2 * pi * real_of_int n * \<i>) =
          1 / (2 * pi * real_of_int n * \<i>) ^ m / 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1
[PROOF STEP]
using exp_integer_2pi[of "real_of_int n"] and assms
[PROOF STATE]
proof (prove)
using this:
real_of_int n \<in> \<int> \<Longrightarrow> exp (complex_of_real (2 * real_of_int n * pi) * \<i>) = 1
n \<noteq> 0

goal (1 subgoal):
 1. residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1
[PROOF STEP]
by (rule_tac residue_simple_pole_deriv[where s="-{0}"])
       (auto intro!: holomorphic_intros derivative_eq_intros connected_open_delete_finite
             simp add: mult_ac connected_punctured_universe)
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1

goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
residue (\<lambda>z. 1 / z ^ m / (exp z - 1)) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m / 1

goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. 1 / (z ^ m * (exp z - 1))) (complex_of_real (2 * pi * real_of_int n) * \<i>) = 1 / (complex_of_real (2 * pi * real_of_int n) * \<i>) ^ m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma decseq_powrat_inverse_of_nat_ge_one:
      "a \<ge> 1 \<Longrightarrow> decseq (\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat (Suc n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> a \<Longrightarrow> decseq (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat (Suc n)))
[PROOF STEP]
unfolding decseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> a \<Longrightarrow> \<forall>m n. m \<le> n \<longrightarrow> a pow\<^sub>\<rat> inverse (rat_of_nat (Suc n)) \<le> a pow\<^sub>\<rat> inverse (rat_of_nat (Suc m))
[PROOF STEP]
by (auto intro: powrat_le_mono)


[STATEMENT]
lemma scount_eq:
  "scount P \<omega> = (if alw (ev P) \<omega> then \<infinity> else enat (card {i. P (sdrop i \<omega>)}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scount P \<omega> = (if alw (ev P) \<omega> then \<infinity> else enat (card {i. P (sdrop i \<omega>)}))
[PROOF STEP]
by (auto simp: scount_infinite_iff scount_eq_card not_alw_iff not_ev_iff)


[STATEMENT]
lemma converse_ordermap_mono_iff:
  assumes "wf r" "total_on A r" "x \<in> A" "y \<in> A" "small A"
  shows "ordermap A r y \<in> elts (ordermap A r x) \<longleftrightarrow> (y, x) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ordermap A r y \<in> elts (ordermap A r x)) = ((y, x) \<in> r)
[PROOF STEP]
by (metis assms converse_ordermap_mono ordermap_mono)


[STATEMENT]
lemma subseqs_map[simp]: "subseqs (map f xs) = map (map f) (subseqs xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subseqs (map f xs) = map (map f) (subseqs xs)
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma all_imp_eq_triv: "(\<forall>x. x = k \<longrightarrow> Q) = Q"
                       "(\<forall>x. k = x \<longrightarrow> Q) = Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x = k \<longrightarrow> Q) = Q &&& (\<forall>x. k = x \<longrightarrow> Q) = Q
[PROOF STEP]
by auto


[STATEMENT]
lemma all3_lemma [simp]:
  "rec_eval (rec_all3 f) [x, y1, y2, y3] = (if (\<forall>z \<le> x. 0 < rec_eval f [z, y1, y2, y3]) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_all3 f) [x, y1, y2, y3] = (if \<forall>z\<le>x. 0 < rec_eval f [z, y1, y2, y3] then 1 else 0)
[PROOF STEP]
by (simp add: rec_all3_def)


[STATEMENT]
lemma subset_singleton_conv: "(A \<subseteq> {a}) = (A = {} \<or> A = {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<subseteq> {a}) = (A = {} \<or> A = {a})
[PROOF STEP]
by blast


[STATEMENT]
lemma sums_imp_has_prod_exp:
  assumes "f sums s"
  shows "raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)
[PROOF STEP]
using assms continuous_on_exp [of UNIV "\<lambda>x::'a. x"]
[PROOF STATE]
proof (prove)
using this:
f sums s
continuous_on UNIV (\<lambda>x. x) \<Longrightarrow> continuous_on UNIV exp

goal (1 subgoal):
 1. raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)
[PROOF STEP]
using continuous_on_tendsto_compose [of UNIV exp "(\<lambda>n. sum f {..n})" s]
[PROOF STATE]
proof (prove)
using this:
f sums s
continuous_on UNIV (\<lambda>x. x) \<Longrightarrow> continuous_on UNIV exp
\<lbrakk>continuous_on UNIV exp; ((\<lambda>n. sum f {..n}) \<longlongrightarrow> s) ?F; s \<in> UNIV; \<forall>\<^sub>F x in ?F. sum f {..x} \<in> UNIV\<rbrakk> \<Longrightarrow> ((\<lambda>x. exp (sum f {..x})) \<longlongrightarrow> exp s) ?F

goal (1 subgoal):
 1. raw_has_prod (\<lambda>i. exp (f i)) 0 (exp s)
[PROOF STEP]
by (simp add: prod_defs sums_def_le exp_sum)


[STATEMENT]
lemma measure_pmf_single: "measure (measure_pmf M) {x} = pmf M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob M {x} = pmf M x
[PROOF STEP]
using emeasure_pmf_single[of M x]
[PROOF STATE]
proof (prove)
using this:
emeasure (measure_pmf M) {x} = ennreal (pmf M x)

goal (1 subgoal):
 1. measure_pmf.prob M {x} = pmf M x
[PROOF STEP]
by(simp add: measure_pmf.emeasure_eq_measure pmf_nonneg measure_nonneg)


[STATEMENT]
lemma "\<not>(\<exists>x. P(x) \<and> (Q(x) \<or> R(x))) \<and>
        (\<exists>x. L(x) \<and> P(x)) \<and>
        (\<forall>x. \<not> R(x) \<longrightarrow> M(x))
    \<longrightarrow> (\<exists>x. L(x) \<and> M(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>x. P x \<and> (Q x \<or> R x)) \<and> (\<exists>x. L x \<and> P x) \<and> (\<forall>x. \<not> R x \<longrightarrow> M x) \<longrightarrow> (\<exists>x. L x \<and> M x)
[PROOF STEP]
by iprover


[STATEMENT]
lemma markedElementIsMarkedTrue:
  shows "(m \<in> set (markedElements M)) = ((m, True) \<in> set M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<in> set (markedElements M)) = ((m, True) \<in> set M)
[PROOF STEP]
by (induct M) (auto split: if_split_asm)


[STATEMENT]
lemma prob_T:
  assumes P: "Measurable.pred S P"
  shows "\<P>(\<omega> in T s. P \<omega>) = (\<integral>t. \<P>(\<omega> in T t. P (t ## \<omega>)) \<partial>K s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T.prob s {\<omega> \<in> space (T s). P \<omega>} = measure_pmf.expectation (K s) (\<lambda>t. T.prob t {\<omega> \<in> space (T t). P (t ## \<omega>)})
[PROOF STEP]
using emeasure_Collect_T[OF P, of s]
[PROOF STATE]
proof (prove)
using this:
emeasure (T s) {x \<in> space (T s). P x} = \<integral>\<^sup>+ t. emeasure (T t) {x \<in> space (T t). P (t ## x)} \<partial>measure_pmf (K s)

goal (1 subgoal):
 1. T.prob s {\<omega> \<in> space (T s). P \<omega>} = measure_pmf.expectation (K s) (\<lambda>t. T.prob t {\<omega> \<in> space (T t). P (t ## \<omega>)})
[PROOF STEP]
unfolding T.emeasure_eq_measure
[PROOF STATE]
proof (prove)
using this:
ennreal (T.prob s {x \<in> space (T s). P x}) = \<integral>\<^sup>+ t. ennreal (T.prob t {x \<in> space (T t). P (t ## x)}) \<partial>measure_pmf (K s)

goal (1 subgoal):
 1. T.prob s {\<omega> \<in> space (T s). P \<omega>} = measure_pmf.expectation (K s) (\<lambda>t. T.prob t {\<omega> \<in> space (T t). P (t ## \<omega>)})
[PROOF STEP]
by (subst (asm) nn_integral_eq_integral)
     (auto intro!: measure_pmf.integrable_const_bound[where B=1])


[STATEMENT]
lemma measurable_If_restrict_space_iff:
  "{x\<in>space M. P x} \<in> sets M \<Longrightarrow>
    (\<lambda>x. if P x then f x else g x) \<in> measurable M N \<longleftrightarrow>
    (f \<in> measurable (restrict_space M {x. P x}) N \<and> g \<in> measurable (restrict_space M {x. \<not> P x}) N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. P x} \<in> sets M \<Longrightarrow> ((\<lambda>x. if P x then f x else g x) \<in> M \<rightarrow>\<^sub>M N) = (f \<in> restrict_space M {x. P x} \<rightarrow>\<^sub>M N \<and> g \<in> restrict_space M {x. \<not> P x} \<rightarrow>\<^sub>M N)
[PROOF STEP]
by (subst measurable_piecewise_restrict_iff[where C="{{x. P x}, {x. \<not> P x}}"])
     (auto simp: Int_def sets.sets_Collect_neg space_restrict_space conj_commute[of _ "x \<in> space M" for x]
           cong: measurable_cong')


[STATEMENT]
lemma ordinal_times_oSuc [simp]: "x * oSuc y = (x * y) + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * oSuc y = x * y + x
[PROOF STEP]
by (simp add: times_ordinal_def)


[STATEMENT]
lemma (in sigma_finite_measure) density_unique_iff:
  assumes f: "f \<in> borel_measurable M" and f': "f' \<in> borel_measurable M"
  shows "density M f = density M f' \<longleftrightarrow> (AE x in M. f x = f' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (density M f = density M f') = (AE x in M. f x = f' x)
[PROOF STEP]
using density_unique[OF assms] density_cong[OF f f']
[PROOF STATE]
proof (prove)
using this:
density M f = density M f' \<Longrightarrow> AE x in M. f x = f' x
AE x in M. f x = f' x \<Longrightarrow> density M f = density M f'

goal (1 subgoal):
 1. (density M f = density M f') = (AE x in M. f x = f' x)
[PROOF STEP]
by auto


[STATEMENT]
lemma path_connected_complement_absolute_retract:
  fixes S :: "'a::euclidean_space set"
  assumes "compact S" "AR S" "2 \<le> DIM('a)"
    shows "path_connected(- S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected (- S)
[PROOF STEP]
using connected_complement_absolute_retract [OF assms]
[PROOF STATE]
proof (prove)
using this:
connected (- S)

goal (1 subgoal):
 1. path_connected (- S)
[PROOF STEP]
using \<open>compact S\<close> compact_eq_bounded_closed connected_open_path_connected
[PROOF STATE]
proof (prove)
using this:
connected (- S)
compact S
compact ?S = (bounded ?S \<and> closed ?S)
\<lbrakk>open ?S; connected ?S\<rbrakk> \<Longrightarrow> path_connected ?S

goal (1 subgoal):
 1. path_connected (- S)
[PROOF STEP]
by blast


[STATEMENT]
lemma diag_def_poly_closed:
  assumes "i < n"
  shows "diag_def_poly n i \<in> carrier (coord_ring R (n + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_def_poly n i \<in> carrier (R [\<X>\<^bsub>n + n\<^esub>])
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. diag_def_poly n i \<in> carrier (R [\<X>\<^bsub>n + n\<^esub>])
[PROOF STEP]
unfolding diag_def_poly_def  coord_ring_def
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. pvar R i \<ominus>\<^bsub>Pring R {..<n + n}\<^esub> pvar R (i + n) \<in> carrier (Pring R {..<n + n})
[PROOF STEP]
by (metis (no_types, lifting) MP.minus_closed add.assoc add_leD1 coord_ring_def less_add_eq_less local.pvar_closed nat_less_le not_add_less1)


[STATEMENT]
lemma unat_2tp_if:
  "unat (2 ^ n :: ('a :: len) word) = (if n < LENGTH ('a) then 2 ^ n else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (2 ^ n) = (if n < LENGTH('a) then 2 ^ n else 0)
[PROOF STEP]
by (split if_split, simp_all add: power_overflow)


[STATEMENT]
theorem time_vebt_insert: "invar_vebt t n \<Longrightarrow> u =  2^n \<Longrightarrow>   T\<^sub>i\<^sub>n\<^sub>s\<^sub>e\<^sub>r\<^sub>t t x \<le> 46 + 23 * lb (lb u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar_vebt t n; u = 2 ^ n\<rbrakk> \<Longrightarrow> real (T\<^sub>i\<^sub>n\<^sub>s\<^sub>e\<^sub>r\<^sub>t t x) \<le> 46 + 23 * log 2 (log 2 u)
[PROOF STEP]
by (meson insert_bound_size_univ)


[STATEMENT]
lemma not_is_TNil_conv: "\<not> is_TNil xs \<longleftrightarrow> (\<exists>x xs'. xs = TCons x xs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> is_TNil xs) = (\<exists>x xs'. xs = TCons x xs')
[PROOF STEP]
by(cases xs) simp_all


[STATEMENT]
theorem hta_mem_correct: "hta_mem t H \<longleftrightarrow> t\<in>ta_lang (hta_\<alpha> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hta_mem t H = (t \<in> ta_lang (hta_\<alpha> H))
[PROOF STEP]
using hashedTa.hta_mem'_correct[OF hta_ensure_idx_f_correct, simplified]
[PROOF STATE]
proof (prove)
using this:
hta_mem' ?t (hta_ensure_idx_f H) = (?t \<in> ta_lang (hta_\<alpha> H))

goal (1 subgoal):
 1. hta_mem t H = (t \<in> ta_lang (hta_\<alpha> H))
[PROOF STEP]
apply (unfold hta_mem_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. hta_mem' t (hta_ensure_idx_f H) = (t \<in> ta_lang (hta_\<alpha> H))) \<Longrightarrow> hta_mem' t (hta_ensure_idx_f H) = (t \<in> ta_lang (hta_\<alpha> H))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma focus_monomial: "focus X (monomial c t) = monomial (monomial c (except t X)) (except t (- X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. focus X (monomial c t) = monomial (monomial c (except t X)) (except t (- X))
[PROOF STEP]
by (simp add: focus_def)


[STATEMENT]
lemma compact_imp_fip:
  assumes "compact S"
    and "\<And>T. T \<in> F \<Longrightarrow> closed T"
    and "\<And>F'. finite F' \<Longrightarrow> F' \<subseteq> F \<Longrightarrow> S \<inter> (\<Inter>F') \<noteq> {}"
  shows "S \<inter> (\<Inter>F) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> \<Inter> F \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compact S
?T \<in> F \<Longrightarrow> closed ?T
\<lbrakk>finite ?F'; ?F' \<subseteq> F\<rbrakk> \<Longrightarrow> S \<inter> \<Inter> ?F' \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> F \<noteq> {}
[PROOF STEP]
unfolding compact_fip
[PROOF STATE]
proof (prove)
using this:
\<forall>A. Ball A closed \<longrightarrow> (\<forall>B\<subseteq>A. finite B \<longrightarrow> S \<inter> \<Inter> B \<noteq> {}) \<longrightarrow> S \<inter> \<Inter> A \<noteq> {}
?T \<in> F \<Longrightarrow> closed ?T
\<lbrakk>finite ?F'; ?F' \<subseteq> F\<rbrakk> \<Longrightarrow> S \<inter> \<Inter> ?F' \<noteq> {}

goal (1 subgoal):
 1. S \<inter> \<Inter> F \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
lemma prefixes_neq_nil: "length (prefixes i x) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length (prefixes i x)
[PROOF STEP]
by (induction x) auto


[STATEMENT]
theorem row_col_match:
 fixes A1 A2 B1 B2 i j
 assumes wf1:"mat (row_length A1) (length A1) A1"
    and wf2:"mat (row_length A2) (length A2) A2"
    and wf3:"mat (row_length B1) (length B1) B1"
    and wf4:"mat (row_length B2) (length B2) B2"
    and matchAA:"length A1 = row_length A2"
    and matchBB:"length B1 = row_length B2"
    and non_Nil:"(A1 \<noteq> [])\<and>(A2 \<noteq> [])\<and>(B1 \<noteq> [])\<and>(B2 \<noteq> [])"
    and i:"i<(row_length A1)*(row_length B1)" and j:"j< (length A2)*(length B2)"
 shows "length (row A1 (i div (row_length B1)))
                 = length (col A2  (j div (length B2)))"
 and "length (row B1 (i mod (row_length B1)))
                 = length (col B2 (j mod (length B2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2)) &&& length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "i div (row_length B1) < row_length  A1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i div row_length B1 < row_length A1
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < row_length A1 * row_length B1

goal (1 subgoal):
 1. i div row_length B1 < row_length A1
[PROOF STEP]
by (metis div_left_ineq)
[PROOF STATE]
proof (state)
this:
i div row_length B1 < row_length A1

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i div row_length B1 < row_length A1
[PROOF STEP]
have 1:"length (row A1 (i div (row_length B1))) = length A1"
[PROOF STATE]
proof (prove)
using this:
i div row_length B1 < row_length A1

goal (1 subgoal):
 1. length (row A1 (i div row_length B1)) = length A1
[PROOF STEP]
unfolding row_def
[PROOF STATE]
proof (prove)
using this:
i div row_length B1 < row_length A1

goal (1 subgoal):
 1. length (map (\<lambda>w. w ! (i div row_length B1)) A1) = length A1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row A1 (i div row_length B1)) = length A1

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "j div (length B2)< length A2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j div length B2 < length A2
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j < length A2 * length B2

goal (1 subgoal):
 1. j div length B2 < length A2
[PROOF STEP]
by (metis div_left_ineq)
[PROOF STATE]
proof (state)
this:
j div length B2 < length A2

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j div length B2 < length A2
[PROOF STEP]
have 2:"length (col A2  (j div (length B2))) = row_length A2"
[PROOF STATE]
proof (prove)
using this:
j div length B2 < length A2

goal (1 subgoal):
 1. length (col A2 (j div length B2)) = row_length A2
[PROOF STEP]
using row_length_constant wf2
[PROOF STATE]
proof (prove)
using this:
j div length B2 < length A2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length A2) (length A2) A2

goal (1 subgoal):
 1. length (col A2 (j div length B2)) = row_length A2
[PROOF STEP]
unfolding col_def
[PROOF STATE]
proof (prove)
using this:
j div length B2 < length A2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length A2) (length A2) A2

goal (1 subgoal):
 1. length (A2 ! (j div length B2)) = row_length A2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (col A2 (j div length B2)) = row_length A2

goal (2 subgoals):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
 2. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
with 1 matchAA
[PROOF STATE]
proof (chain)
picking this:
length (row A1 (i div row_length B1)) = length A1
length A1 = row_length A2
length (col A2 (j div length B2)) = row_length A2
[PROOF STEP]
show "length (row A1 (i div (row_length B1)))=length (col A2  (j div (length B2)))"
[PROOF STATE]
proof (prove)
using this:
length (row A1 (i div row_length B1)) = length A1
length A1 = row_length A2
length (col A2 (j div length B2)) = row_length A2

goal (1 subgoal):
 1. length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row A1 (i div row_length B1)) = length (col A2 (j div length B2))

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "i mod (row_length B1) < row_length B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i mod row_length B1 < row_length B1
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < row_length A1 * row_length B1

goal (1 subgoal):
 1. i mod row_length B1 < row_length B1
[PROOF STEP]
by (metis less_nat_zero_code mod_less_divisor mult_is_0 neq0_conv)
[PROOF STATE]
proof (state)
this:
i mod row_length B1 < row_length B1

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i mod row_length B1 < row_length B1
[PROOF STEP]
have 2:"length (row B1 (i mod (row_length B1))) = length B1"
[PROOF STATE]
proof (prove)
using this:
i mod row_length B1 < row_length B1

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length B1
[PROOF STEP]
unfolding row_def
[PROOF STATE]
proof (prove)
using this:
i mod row_length B1 < row_length B1

goal (1 subgoal):
 1. length (map (\<lambda>w. w ! (i mod row_length B1)) B1) = length B1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row B1 (i mod row_length B1)) = length B1

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
have "j mod (length B2) < length B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j mod length B2 < length B2
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j < length A2 * length B2

goal (1 subgoal):
 1. j mod length B2 < length B2
[PROOF STEP]
by (metis less_nat_zero_code mod_less_divisor mult_is_0 neq0_conv)
[PROOF STATE]
proof (state)
this:
j mod length B2 < length B2

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j mod length B2 < length B2
[PROOF STEP]
have "length (col B2 (j mod (length B2))) = row_length B2"
[PROOF STATE]
proof (prove)
using this:
j mod length B2 < length B2

goal (1 subgoal):
 1. length (col B2 (j mod length B2)) = row_length B2
[PROOF STEP]
using row_length_constant wf4
[PROOF STATE]
proof (prove)
using this:
j mod length B2 < length B2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length B2) (length B2) B2

goal (1 subgoal):
 1. length (col B2 (j mod length B2)) = row_length B2
[PROOF STEP]
unfolding col_def
[PROOF STATE]
proof (prove)
using this:
j mod length B2 < length B2
\<lbrakk>mat ?nr ?nc ?A; ?j < length ?A\<rbrakk> \<Longrightarrow> length (?A ! ?j) = row_length ?A
mat (row_length B2) (length B2) B2

goal (1 subgoal):
 1. length (B2 ! (j mod length B2)) = row_length B2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (col B2 (j mod length B2)) = row_length B2

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
with 2 matchBB
[PROOF STATE]
proof (chain)
picking this:
length (row B1 (i mod row_length B1)) = length B1
length B1 = row_length B2
length (col B2 (j mod length B2)) = row_length B2
[PROOF STEP]
show "length (row B1 (i mod (row_length B1))) = length (col B2 (j mod (length B2)))"
[PROOF STATE]
proof (prove)
using this:
length (row B1 (i mod row_length B1)) = length B1
length B1 = row_length B2
length (col B2 (j mod length B2)) = row_length B2

goal (1 subgoal):
 1. length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (row B1 (i mod row_length B1)) = length (col B2 (j mod length B2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lincomb_list_smult:
  "set Vs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda> i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Vs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs
[PROOF STEP]
proof (induction Vs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
case (snoc x Vs)
[PROOF STATE]
proof (state)
this:
set Vs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs
set (Vs @ [x]) \<subseteq> carrier_vec n

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have x: "x \<in> carrier_vec n" and Vs: "set Vs \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier_vec n &&& set Vs \<subseteq> carrier_vec n
[PROOF STEP]
using snoc.prems
[PROOF STATE]
proof (prove)
using this:
set (Vs @ [x]) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. x \<in> carrier_vec n &&& set Vs \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec n
set Vs \<subseteq> carrier_vec n

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "lincomb_list (\<lambda> i. a * c i) (Vs @ [x]) =
        lincomb_list (\<lambda> i. a * c i) Vs + (a * c (length Vs)) \<cdot>\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x
[PROOF STEP]
using x Vs
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n
set Vs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = lincomb_list (\<lambda>i. a * c i) Vs + a * c (length Vs) \<cdot>\<^sub>v x

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "lincomb_list (\<lambda> i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs
[PROOF STEP]
by(rule snoc.IH[OF Vs])
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) Vs = a \<cdot>\<^sub>v lincomb_list c Vs

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "(a * c (length Vs)) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
using smult_smult_assoc x
[PROOF STATE]
proof (prove)
using this:
?a \<cdot>\<^sub>v (?b \<cdot>\<^sub>v ?v) = ?a * ?b \<cdot>\<^sub>v ?v
x \<in> carrier_vec n

goal (1 subgoal):
 1. a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * c (length Vs) \<cdot>\<^sub>v x = a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "a \<cdot>\<^sub>v lincomb_list c Vs + \<dots> = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
using smult_add_distrib_vec[of _ n _ a] lincomb_list_carrier[OF Vs] x
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec n; ?w \<in> carrier_vec n\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>v (?v + ?w) = a \<cdot>\<^sub>v ?v + a \<cdot>\<^sub>v ?w
lincomb_list ?c Vs \<in> carrier_vec n
x \<in> carrier_vec n

goal (1 subgoal):
 1. a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a \<cdot>\<^sub>v lincomb_list c Vs + a \<cdot>\<^sub>v (c (length Vs) \<cdot>\<^sub>v x) = a \<cdot>\<^sub>v (lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
have "lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])
[PROOF STEP]
using Vs x
[PROOF STATE]
proof (prove)
using this:
set Vs \<subseteq> carrier_vec n
x \<in> carrier_vec n

goal (1 subgoal):
 1. lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list c Vs + c (length Vs) \<cdot>\<^sub>v x = lincomb_list c (Vs @ [x])

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) xs = a \<cdot>\<^sub>v lincomb_list c xs; set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) (xs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (xs @ [x])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])

goal (1 subgoal):
 1. lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. a * c i) (Vs @ [x]) = a \<cdot>\<^sub>v lincomb_list c (Vs @ [x])

goal (1 subgoal):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list (\<lambda>i. a * c i) [] = a \<cdot>\<^sub>v lincomb_list c []
[PROOF STEP]
qed simp


[STATEMENT]
lemma bl_shiftl: "to_bl (w << n) = drop n (to_bl w) @ replicate (min (size w) n) False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (w << n) = drop n (to_bl w) @ replicate (min (size w) n) False
[PROOF STEP]
by (simp add: shiftl_bl word_rep_drop word_size)


[STATEMENT]
lemma compact_rel_boundary:
  fixes S :: "'n::euclidean_space set"
  shows "compact S \<Longrightarrow> compact(S - rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact S \<Longrightarrow> compact (S - rel_interior S)
[PROOF STEP]
by (metis bounded_diff closed_rel_boundary closure_eq compact_closure compact_imp_closed)


[STATEMENT]
lemma SA_zero_set_is_semialgebraic:
  assumes "f \<in> carrier (SA n)"
  shows "is_semialgebraic n (SA_zero_set n f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic n (SA_zero_set n f)
[PROOF STEP]
using assms semialg_level_set_is_semialg[of f n \<zero>]
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
\<lbrakk>f \<in> carrier (SA n); \<zero> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}

goal (1 subgoal):
 1. is_semialgebraic n (SA_zero_set n f)
[PROOF STEP]
unfolding SA_zero_set_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
\<lbrakk>f \<in> carrier (SA n); \<zero> \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}

goal (1 subgoal):
 1. is_semialgebraic n {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x = \<zero>}
[PROOF STEP]
by blast


[STATEMENT]
lemma filter_mset_disjunction:
  assumes "\<And>x. x \<in># X \<Longrightarrow> P x \<Longrightarrow> Q x \<Longrightarrow> False"
  shows   "filter_mset (\<lambda>x. P x \<or> Q x) X = filter_mset P X + filter_mset Q X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#x \<in># X. P x \<or> Q x#} = filter_mset P X + filter_mset Q X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in># X; P ?x; Q ?x\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. {#x \<in># X. P x \<or> Q x#} = filter_mset P X + filter_mset Q X
[PROOF STEP]
by (induction X) auto


[STATEMENT]
lemma of_rat_floor [simp]:
  "\<lfloor>of_rat r\<rfloor> = \<lfloor>r\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>of_rat r\<rfloor> = \<lfloor>r\<rfloor>
[PROOF STEP]
by (cases r) (simp add: Fract_of_int_quotient of_rat_divide floor_divide_of_int_eq)


[STATEMENT]
lemma finite_set_in_idem:
  assumes "finite A"
  shows "max a (Max (Set.insert a A)) = Max (Set.insert a A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max a (Max (insert a A)) = Max (insert a A)
[PROOF STEP]
using Max_insert assms max.commute max.left_commute
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert ?x ?A) = max ?x (Max ?A)
finite A
max ?a ?b = max ?b ?a
max ?b (max ?a ?c) = max ?a (max ?b ?c)

goal (1 subgoal):
 1. max a (Max (insert a A)) = Max (insert a A)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma length_append [simp]: "length (xs @ ys) = length xs + length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs @ ys) = length xs + length ys
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma preImage_insert: "preImage f (insert a A) = pre f a Un preImage f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. preImage f (insert a A) = pre f a \<union> preImage f A
[PROOF STEP]
by(auto simp add: preImage_def pre_def)


[STATEMENT]
lemma measure_pmf_zero_iff: "measure (measure_pmf p) s = 0 \<longleftrightarrow> set_pmf p \<inter> s = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (measure_pmf.prob p s = 0) = (set_pmf p \<inter> s = {})
[PROOF STEP]
by (subst measure_pmf.prob_eq_0) (auto simp: AE_measure_pmf_iff)


[STATEMENT]
lemma degree_poly_uminus_abs[simp]: "degree (poly_uminus_abs p) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (poly_uminus_abs p) = degree p
[PROOF STEP]
unfolding poly_uminus_abs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (abs_int_poly (poly_uminus p)) = degree p
[PROOF STEP]
by auto


[STATEMENT]
lemma count_vec_empty: "dim_vec v = 0 \<Longrightarrow> count_vec v a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec v = 0 \<Longrightarrow> count_vec v a = 0
[PROOF STEP]
by (simp add: mset_vec_same_size)


[STATEMENT]
lemma wqo_on_UNIV_nat:
  "wqo_on (\<le>) (UNIV :: nat set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wqo_on (\<le>) UNIV
[PROOF STEP]
unfolding wqo_on_def transp_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. \<forall>z\<in>UNIV. x \<le> y \<and> y \<le> z \<longrightarrow> x \<le> z) \<and> almost_full_on (\<le>) UNIV
[PROOF STEP]
using almost_full_on_UNIV_nat
[PROOF STATE]
proof (prove)
using this:
almost_full_on (\<le>) UNIV

goal (1 subgoal):
 1. (\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. \<forall>z\<in>UNIV. x \<le> y \<and> y \<le> z \<longrightarrow> x \<le> z) \<and> almost_full_on (\<le>) UNIV
[PROOF STEP]
by simp


[STATEMENT]
lemma butlast_rest_bin: "butlast (bin_to_bl n w) = bin_to_bl (n - 1) (w div 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast (bin_to_bl n w) = bin_to_bl (n - 1) (w div 2)
[PROOF STEP]
apply (unfold bin_to_bl_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast (bin_to_bl_aux n w []) = bin_to_bl_aux (n - 1) (w div 2) []
[PROOF STEP]
apply (cases n, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> butlast (bin_to_bl_aux n w []) = bin_to_bl_aux (n - 1) (w div 2) []
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> butlast (bin_to_bl_aux nat (w div 2) [odd w]) = bin_to_bl_aux nat (w div 2) []
[PROOF STEP]
apply (auto simp add: bin_to_bl_aux_alt)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem valid_tree_deg_neq_0: "(\<not> invar_vebt t 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> invar_vebt t 0
[PROOF STEP]
using valid_0_not
[PROOF STATE]
proof (prove)
using this:
invar_vebt ?t 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> invar_vebt t 0
[PROOF STEP]
by blast


[STATEMENT]
theorem abs_convergent_prod_conv_summable:
  fixes f :: "nat \<Rightarrow> 'a :: real_normed_div_algebra"
  shows "abs_convergent_prod f \<longleftrightarrow> summable (\<lambda>i. norm (f i - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_convergent_prod f = summable (\<lambda>i. norm (f i - (1::'a)))
[PROOF STEP]
by (blast intro: abs_convergent_prod_imp_summable summable_imp_abs_convergent_prod)


[STATEMENT]
lemma sum_flatten1:
  fixes f :: "'a \<Rightarrow> 'a \<Rightarrow> 'b::join_semilattice_zero"
  assumes "finite (A :: 'a set)"
  and "finite (B :: 'a set)"
  shows "\<Sum>{\<Sum>{f x y |y. y \<in> B} |x. x \<in> A} = \<Sum>{f x y |x y. x \<in> A \<and> y \<in> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {\<Sum> {f x y |y. y \<in> B} |x. x \<in> A} = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply (simp add: fset_to_im assms flatten1_im)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f (fst x) (snd x)) ` (A \<times> B)) = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply (subst fset_to_im[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {f (fst x) (snd x) |x. x \<in> A \<times> B} = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma length_Cons: "length (x # xs) = Suc (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (x # xs) = Suc (length xs)
[PROOF STEP]
by simp


[STATEMENT]
lemma expands_to_imp_eventually_lt:
  assumes "basis_wf basis" "((\<lambda>x. f x - g x) expands_to F) basis" "trimmed_neg F"
  shows   "eventually (\<lambda>x. f x < g x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x < g x
[PROOF STEP]
using expands_to_imp_eventually_neg[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. f x - g x < 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. f x < g x
[PROOF STEP]
by simp


[STATEMENT]
lemma conjuncts: "(\<forall> q\<in> set (conjuncts p). Ifm bs q) = Ifm bs p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>q\<in>set (conjuncts p). Ifm bs q) = Ifm bs p
[PROOF STEP]
by (induct p rule: conjuncts.induct) auto


[STATEMENT]
lemma real_derivative_chain:
  fixes x :: real
  shows "f differentiable at x \<Longrightarrow> g differentiable at (f x)
    \<Longrightarrow> deriv (g o f) x = deriv g (f x) * deriv f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f differentiable at x; g differentiable at (f x)\<rbrakk> \<Longrightarrow> deriv (g \<circ> f) x = deriv g (f x) * deriv f x
[PROOF STEP]
by (metis DERIV_deriv_iff_real_differentiable DERIV_chain DERIV_imp_deriv)


[STATEMENT]
lemma compact_projset:
  shows "compact ((\<lambda>k. (k)\<^sub>F i) ` K n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact ((\<lambda>k. (k)\<^sub>F i) ` K n)
[PROOF STEP]
using continuous_proj compact
[PROOF STATE]
proof (prove)
using this:
continuous_on ?s (\<lambda>x. (x)\<^sub>F ?i)
compact (K ?n)

goal (1 subgoal):
 1. compact ((\<lambda>k. (k)\<^sub>F i) ` K n)
[PROOF STEP]
by (rule compact_continuous_image)


[STATEMENT]
lemma word_cat_inj: "(word_cat a b::'c::len word) = word_cat c d \<longleftrightarrow> a = c \<and> b = d"
  if "LENGTH('a) + LENGTH('b) \<le> LENGTH('c)"
  for a::"'a::len word" and b::"'b::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (word_cat a b = word_cat c d) = (a = c \<and> b = d)
[PROOF STEP]
using word_of_int_bin_cat_eq_iff [OF that, of b a d c]
[PROOF STATE]
proof (prove)
using this:
(word_of_int (concat_bit LENGTH('b) (uint b) (uint a)) = word_of_int (concat_bit LENGTH('b) (uint d) (uint c))) = (b = d \<and> a = c)

goal (1 subgoal):
 1. (word_cat a b = word_cat c d) = (a = c \<and> b = d)
[PROOF STEP]
by (simp add: word_cat_eq' ac_simps)


[STATEMENT]
lemma abs_summable_on_nat_iff':
  "f abs_summable_on (UNIV :: nat set) \<longleftrightarrow> summable (\<lambda>n. norm (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f abs_summable_on UNIV) = summable (\<lambda>n. norm (f n))
[PROOF STEP]
by (subst abs_summable_on_nat_iff) auto


[STATEMENT]
lemma subFNot: "!!theta. subF theta (FNot A) = FNot (subF theta A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>theta. subF theta (FNot A) = FNot (subF theta A)
[PROOF STEP]
by(induct A) auto


[STATEMENT]
lemma inorder_eq_rev_revorder: "inorder t = rev (revorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder t = rev (revorder t)
[PROOF STEP]
by(induction t) (auto)


[STATEMENT]
lemma circ_sup_4:
  "(x \<squnion> y)\<^sup>\<circ> = (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<squnion> y)\<^sup>\<circ> = (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ>
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (x \<squnion> y)\<^sup>\<circ> \<le> (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ>
 2. (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ> \<le> (x \<squnion> y)\<^sup>\<circ>
[PROOF STEP]
apply (metis circ_sup circ_sub_decompose circ_transitive_equal mult_assoc mult_left_isotone)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sup>\<star> * y)\<^sup>\<circ> * x\<^sup>\<circ> \<le> (x \<squnion> y)\<^sup>\<circ>
[PROOF STEP]
by (metis circ_sup circ_isotone mult_left_isotone star_below_circ)