[STATEMENT]
theorem rqs'_cost_expectation_le:
  assumes "linorder_on A R" "set xs \<subseteq> A"
  shows   "measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
linorder_on A R
set xs \<subseteq> A

goal (1 subgoal):
 1. measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
proof (induction R xs rule: rqs'_cost.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>R xs. \<lbrakk>\<And>x xa. \<lbrakk>xs \<noteq> []; x \<in> set_pmf (pmf_of_set {..<length xs}); xa = xs ! x; linorder_on A R; set (lesss R xa xs) \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R (lesss R xa xs)) real \<le> rqs_cost_exp (length (lesss R xa xs)); \<And>x xa. \<lbrakk>xs \<noteq> []; x \<in> set_pmf (pmf_of_set {..<length xs}); xa = xs ! x; linorder_on A R; set (greaters R xa xs) \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R (greaters R xa xs)) real \<le> rqs_cost_exp (length (greaters R xa xs)); linorder_on A R; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
case (1 R xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>xs \<noteq> []; ?x \<in> set_pmf (pmf_of_set {..<length xs}); ?xa = xs ! ?x; linorder_on A R; set (lesss R ?xa xs) \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R (lesss R ?xa xs)) real \<le> rqs_cost_exp (length (lesss R ?xa xs))
\<lbrakk>xs \<noteq> []; ?x \<in> set_pmf (pmf_of_set {..<length xs}); ?xa = xs ! ?x; linorder_on A R; set (greaters R ?xa xs) \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R (greaters R ?xa xs)) real \<le> rqs_cost_exp (length (greaters R ?xa xs))
linorder_on A R
set xs \<subseteq> A

goal (1 subgoal):
 1. \<And>R xs. \<lbrakk>\<And>x xa. \<lbrakk>xs \<noteq> []; x \<in> set_pmf (pmf_of_set {..<length xs}); xa = xs ! x; linorder_on A R; set (lesss R xa xs) \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R (lesss R xa xs)) real \<le> rqs_cost_exp (length (lesss R xa xs)); \<And>x xa. \<lbrakk>xs \<noteq> []; x \<in> set_pmf (pmf_of_set {..<length xs}); xa = xs ! x; linorder_on A R; set (greaters R xa xs) \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R (greaters R xa xs)) real \<le> rqs_cost_exp (length (greaters R xa xs)); linorder_on A R; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
proof (cases "xs = []")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
xs \<noteq> []

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
define n where "n = length xs - 1"
[PROOF STATE]
proof (state)
this:
n = length xs - 1

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have length_eq: "length xs = Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = Suc n
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. length xs = Suc n
[PROOF STEP]
by (simp add: n_def)
[PROOF STATE]
proof (state)
this:
length xs = Suc n

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
define E where "E = (\<lambda>xs. measure_pmf.expectation (rqs'_cost R xs) real)"
[PROOF STATE]
proof (state)
this:
E = (\<lambda>xs. measure_pmf.expectation (rqs'_cost R xs) real)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
define f where "f = (\<lambda>x. rqs_cost_exp (length (lesss R x xs)) +
                                rqs_cost_exp (length (greaters R x xs)))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>x. rqs_cost_exp (length (lesss R x xs)) + rqs_cost_exp (length (greaters R x xs)))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "rqs'_cost R xs =
            do {
              i \<leftarrow> pmf_of_set {..<length xs};
              map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y)
                (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs))
                          (rqs'_cost R (greaters R (xs ! i) xs)))
            }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rqs'_cost R xs = pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. rqs'_cost R xs = pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))
[PROOF STEP]
by (subst rqs'_cost.simps) (simp_all add: Let_def)
[PROOF STATE]
proof (state)
this:
rqs'_cost R xs = pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rqs'_cost R xs = pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "measure_pmf.expectation \<dots> real = real n +
           (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))) real = real n + (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. measure_pmf.expectation (pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))) real = real n + (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs)
[PROOF STEP]
by (subst pmf_expectation_bind_pmf_of_set)
         (auto intro!: finite_imageI finite_cartesian_product simp: case_prod_unfold
            integrable_measure_pmf_finite sum_divide_distrib [symmetric] field_simps
            length_eq sum.distrib E_def)
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation (pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))) real = real n + (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation (pmf_of_set {..<length xs} \<bind> (\<lambda>i. map_pmf (\<lambda>(n1, y). length xs - Suc 0 + n1 + y) (pair_pmf (rqs'_cost R (lesss R (xs ! i) xs)) (rqs'_cost R (greaters R (xs ! i) xs))))) real = real n + (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "\<dots> \<le> real n + (\<Sum>k<length xs. f (xs ! k)) / real (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n + (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs) \<le> real n + (\<Sum>k<length xs. f (xs ! k)) / real (length xs)
[PROOF STEP]
unfolding E_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n + (\<Sum>k<length xs. measure_pmf.expectation (rqs'_cost R (lesss R (xs ! k) xs)) real + measure_pmf.expectation (rqs'_cost R (greaters R (xs ! k) xs)) real) / real (length xs) \<le> real n + (\<Sum>k<length xs. rqs_cost_exp (length (lesss R (xs ! k) xs)) + rqs_cost_exp (length (greaters R (xs ! k) xs))) / real (length xs)
[PROOF STEP]
using False "1.prems"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
linorder_on A R
set xs \<subseteq> A

goal (1 subgoal):
 1. real n + (\<Sum>k<length xs. measure_pmf.expectation (rqs'_cost R (lesss R (xs ! k) xs)) real + measure_pmf.expectation (rqs'_cost R (greaters R (xs ! k) xs)) real) / real (length xs) \<le> real n + (\<Sum>k<length xs. rqs_cost_exp (length (lesss R (xs ! k) xs)) + rqs_cost_exp (length (greaters R (xs ! k) xs))) / real (length xs)
[PROOF STEP]
by (intro add_mono order.refl divide_right_mono sum_mono "1.IH"[OF _ _ refl] False)
         (auto simp: lesss_def greaters_def)
[PROOF STATE]
proof (state)
this:
real n + (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs) \<le> real n + (\<Sum>k<length xs. f (xs ! k)) / real (length xs)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n + (\<Sum>k<length xs. E (lesss R (xs ! k) xs) + E (greaters R (xs ! k) xs)) / real (length xs) \<le> real n + (\<Sum>k<length xs. f (xs ! k)) / real (length xs)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "(\<Sum>k<length xs. f (xs ! k)) = (\<Sum>x\<in>#mset xs. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<length xs. f (xs ! k)) = \<Sum>\<^sub># (image_mset f (mset xs))
[PROOF STEP]
by (simp only: mset_map [symmetric] sum_mset_sum_list sum_list_sum_nth)
         (simp_all add: atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
(\<Sum>k<length xs. f (xs ! k)) = \<Sum>\<^sub># (image_mset f (mset xs))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<length xs. f (xs ! k)) = \<Sum>\<^sub># (image_mset f (mset xs))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "mset xs = mset (insort_wrt R xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset xs = mset (insort_wrt R xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mset xs = mset (insort_wrt R xs)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mset xs = mset (insort_wrt R xs)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "(\<Sum>x\<in>#\<dots>. f x) = (\<Sum>i<length xs. f (insort_wrt R xs ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (image_mset f (mset (insort_wrt R xs))) = (\<Sum>i<length xs. f (insort_wrt R xs ! i))
[PROOF STEP]
by (simp only: mset_map [symmetric] sum_mset_sum_list sum_list_sum_nth)
         (simp_all add: atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f (mset (insort_wrt R xs))) = (\<Sum>i<length xs. f (insort_wrt R xs ! i))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum>\<^sub># (image_mset f (mset (insort_wrt R xs))) = (\<Sum>i<length xs. f (insort_wrt R xs ! i))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length xs. f (insort_wrt R xs ! i)) \<le> (\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1))
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length xs. rqs_cost_exp (length (lesss R (insort_wrt R xs ! i) xs)) + rqs_cost_exp (length (greaters R (insort_wrt R xs ! i) xs))) \<le> (\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1))
[PROOF STEP]
proof (intro sum_mono add_mono rqs_cost_exp_leI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> {..<length xs} \<Longrightarrow> length (lesss R (insort_wrt R xs ! i) xs) \<le> i
 2. \<And>i. i \<in> {..<length xs} \<Longrightarrow> length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> {..<length xs} \<Longrightarrow> length (lesss R (insort_wrt R xs ! i) xs) \<le> i
 2. \<And>i. i \<in> {..<length xs} \<Longrightarrow> length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1
[PROOF STEP]
assume i: "i \<in> {..<length xs}"
[PROOF STATE]
proof (state)
this:
i \<in> {..<length xs}

goal (2 subgoals):
 1. \<And>i. i \<in> {..<length xs} \<Longrightarrow> length (lesss R (insort_wrt R xs ! i) xs) \<le> i
 2. \<And>i. i \<in> {..<length xs} \<Longrightarrow> length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1
[PROOF STEP]
show "length (lesss R (insort_wrt R xs ! i) xs) \<le> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (lesss R (insort_wrt R xs ! i) xs) \<le> i
[PROOF STEP]
using i "1.prems"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..<length xs}
linorder_on A R
set xs \<subseteq> A

goal (1 subgoal):
 1. length (lesss R (insort_wrt R xs ! i) xs) \<le> i
[PROOF STEP]
by (intro length_lesss_le'[where A = A]) auto
[PROOF STATE]
proof (state)
this:
length (lesss R (insort_wrt R xs ! i) xs) \<le> i

goal (1 subgoal):
 1. \<And>i. i \<in> {..<length xs} \<Longrightarrow> length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1
[PROOF STEP]
show "length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1
[PROOF STEP]
using i "1.prems"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..<length xs}
linorder_on A R
set xs \<subseteq> A

goal (1 subgoal):
 1. length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1
[PROOF STEP]
by (intro length_greaters_le'[where A = A]) auto
[PROOF STATE]
proof (state)
this:
length (greaters R (insort_wrt R xs ! i) xs) \<le> length xs - i - 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length xs. f (insort_wrt R xs ! i)) \<le> (\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length xs. f (insort_wrt R xs ! i)) \<le> (\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. rqs_cost_exp i + rqs_cost_exp (n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1)) = (\<Sum>i\<le>n. rqs_cost_exp i + rqs_cost_exp (n - i))
[PROOF STEP]
by (intro sum.cong) (auto simp: length_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1)) = (\<Sum>i\<le>n. rqs_cost_exp i + rqs_cost_exp (n - i))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<length xs. rqs_cost_exp i + rqs_cost_exp (length xs - i - 1)) = (\<Sum>i\<le>n. rqs_cost_exp i + rqs_cost_exp (n - i))

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
have "real n + \<dots> / real (length xs) = rqs_cost_exp (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n + (\<Sum>i\<le>n. rqs_cost_exp i + rqs_cost_exp (n - i)) / real (length xs) = rqs_cost_exp (length xs)
[PROOF STEP]
by (simp add: length_eq rqs_cost_exp.simps(2))
[PROOF STATE]
proof (state)
this:
real n + (\<Sum>i\<le>n. rqs_cost_exp i + rqs_cost_exp (n - i)) / real (length xs) = rqs_cost_exp (length xs)

goal (2 subgoals):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
 2. xs \<noteq> [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> real n + x / real (length xs) \<le> real n + y / real (length xs)) \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> real n + x / real (length xs) \<le> real n + y / real (length xs)) \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)

goal (1 subgoal):
 1. measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
by (simp add: divide_right_mono)
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)

goal (1 subgoal):
 1. xs = [] \<Longrightarrow> measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)
[PROOF STEP]
qed (auto simp: rqs'_cost.simps)
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation (rqs'_cost R xs) real \<le> rqs_cost_exp (length xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compute_double_of_Float[code]:
  "double_of_Float f = double_of_man_exp (integer_of_int (mantissa f)) (integer_of_int (Float.exponent f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. double_of_Float f = double_of_man_exp (integer_of_int (mantissa f)) (integer_of_int (Float.exponent f))
[PROOF STEP]
unfolding double_of_man_exp_def Let_def Float_mantissa_exponent int_of_integer_integer_of_int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. double_of_Float f = (if is_finite_Float TYPE((11, 52) IEEE.float) f then Some (Double.of_finite_Float f) else None)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. is_finite_Float TYPE((11, 52) IEEE.float) f \<Longrightarrow> double_of_Float f = Some (Double.of_finite_Float f)
 2. \<not> is_finite_Float TYPE((11, 52) IEEE.float) f \<Longrightarrow> double_of_Float f = None
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_finite_Float TYPE((11, 52) IEEE.float) f \<Longrightarrow> double_of_Float f = Some (Double.of_finite_Float f)
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_finite_Float TYPE((11, 52) IEEE.float) f \<Longrightarrow> double_of_Float f = None
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_finite_Float TYPE((11, 52) IEEE.float) f \<Longrightarrow> double_of_Float f = None
[PROOF STEP]
by transfer auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eval_wlp_SetDC:
  "wlp (SetDC p S) R s = Inf ((\<lambda>a. wlp (p a) R s) ` S s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wlp (SetDC p S) R s = (INF a\<in>S s. wlp (p a) R s)
[PROOF STEP]
unfolding wlp_def SetDC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF a\<in>S s. p a False R s) = (INF a\<in>S s. p a False R s)
[PROOF STEP]
by(simp)


[STATEMENT]
lemma im_jointfun1:"(jointfun n f m g) `({j. j \<le> (Suc (n + m))}) =
                                      f `{j. j \<le> n} \<union> g ` {j. j \<le> m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jointfun n f m g ` {j. j \<le> Suc (n + m)} = f ` {j. j \<le> n} \<union> g ` {j. j \<le> m}
[PROOF STEP]
apply (cut_tac Nset_nset[of "n" "m"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<le> Suc (n + m)} = {i. i \<le> n} \<union> nset (Suc n) (Suc (n + m)) \<Longrightarrow> jointfun n f m g ` {j. j \<le> Suc (n + m)} = f ` {j. j \<le> n} \<union> g ` {j. j \<le> m}
[PROOF STEP]
apply (subst  im_set_un2[of "{j. j \<le> (Suc (n + m))}" "{j. j \<le> n}"
              "nset (Suc n) (Suc (n + m))" "jointfun n f m g"], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<le> Suc (n + m)} = {i. i \<le> n} \<union> nset (Suc n) (Suc (n + m)) \<Longrightarrow> jointfun n f m g ` {j. j \<le> n} \<union> jointfun n f m g ` nset (Suc n) (Suc (n + m)) = f ` {j. j \<le> n} \<union> g ` {j. j \<le> m}
[PROOF STEP]
apply (simp add:im_jointfunTr1 im_jointfunTr2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem If_BisT[simp]:
assumes "compatTst tst" and "c1 \<approx>T d1" and "c2 \<approx>T d2"
shows "If tst c1 c2 \<approx>T If tst d1 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. if tst then c1 else c2 \<approx>T if tst then d1 else d2
[PROOF STEP]
using assms thetaIfTT_BisT
[PROOF STATE]
proof (prove)
using this:
compatTst tst
c1 \<approx>T d1
c2 \<approx>T d2
thetaIfTT \<subseteq> BisT

goal (1 subgoal):
 1. if tst then c1 else c2 \<approx>T if tst then d1 else d2
[PROOF STEP]
unfolding thetaIfTT_def
[PROOF STATE]
proof (prove)
using this:
compatTst tst
c1 \<approx>T d1
c2 \<approx>T d2
{(if tst then c1 else c2, if tst then d1 else d2) |tst c1 c2 d1 d2. compatTst tst \<and> c1 \<approx>T d1 \<and> c2 \<approx>T d2} \<subseteq> BisT

goal (1 subgoal):
 1. if tst then c1 else c2 \<approx>T if tst then d1 else d2
[PROOF STEP]
by blast


[STATEMENT]
lemma sound_and_compltete_mat_leqb_eqc [iff]:
  assumes "dim_row A\<^sup>T = dim_vec c"
  assumes "dim_col A\<^sup>T = dim_vec b"
  shows "(\<exists>x. [A *\<^sub>v x]\<le>b) \<and> (\<exists>y. [y \<^sub>v* A]=c) \<longleftrightarrow> (\<exists>X. simplex (mat_leqb_eqc A b c) = Sat X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<exists>x. [A*\<^sub>vx]\<le>b) \<and> (\<exists>y. [y\<^sub>v*A]=c)) = (\<exists>X. simplex (mat_leqb_eqc A b c) = Inr X)
[PROOF STEP]
by (metis assms(1) assms(2) completeness_mat_leqb_eqc index_transpose_mat(3)
      soundness_mat_leqb_eqc1 soundness_mat_leqb_eqc2)


[STATEMENT]
lemma exists_set_with_max_card:
  assumes "finite S" "S \<noteq> {}"
  shows "\<exists>s \<in> S. card s = Max (card ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s\<in>S. card s = Max (card ` S)
[PROOF STEP]
by (metis (mono_tags, lifting) Max_in assms finite_imageI imageE image_is_empty)


[STATEMENT]
lemma max_Var_floatariths_Max:
  "max_Var_floatariths xs = (if set xs = {} then 0 else linorder_class.Max (max_Var_floatarith ` set xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_Var_floatariths xs = (if set xs = {} then 0 else Max (max_Var_floatarith ` set xs))
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma pos_sub_infty:
  assumes "E \<in> sets M"
    and "\<bar>\<mu> E\<bar> < \<infinity>"
  shows "\<bar>\<mu> (pos_sub E)\<bar> < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>\<mu> (pos_sub E)\<bar> < \<infinity>
[PROOF STEP]
using signed_measure_finite_subset assms
    pos_sub_sets pos_sub_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?E \<in> sets M; \<bar>\<mu> ?E\<bar> < \<infinity>; ?A \<in> sets M; ?A \<subseteq> ?E\<rbrakk> \<Longrightarrow> \<bar>\<mu> ?A\<bar> < \<infinity>
E \<in> sets M
\<bar>\<mu> E\<bar> < \<infinity>
?E \<in> sets M \<Longrightarrow> pos_sub ?E \<in> sets M
pos_sub ?E \<subseteq> ?E

goal (1 subgoal):
 1. \<bar>\<mu> (pos_sub E)\<bar> < \<infinity>
[PROOF STEP]
by simp


[STATEMENT]
theorem UP_cring:
  "cring P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring P
[PROOF STEP]
using UP_ring
[PROOF STATE]
proof (prove)
using this:
ring P

goal (1 subgoal):
 1. cring P
[PROOF STEP]
unfolding cring_def
[PROOF STATE]
proof (prove)
using this:
ring P

goal (1 subgoal):
 1. ring P \<and> Group.comm_monoid P
[PROOF STEP]
by (auto intro!: comm_monoidI UP_m_assoc UP_m_comm)


[STATEMENT]
lemma "(3::real) * x + 7 * a < 4 \<and> 3 < 2 * x \<longrightarrow> a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * x + 7 * a < 4 \<and> 3 < 2 * x \<longrightarrow> a < 0
[PROOF STEP]
by sos


[STATEMENT]
lemma (in topological_space) nhds_generated_topology:
  "open = generate_topology T \<Longrightarrow> nhds x = (INF S\<in>{S\<in>T. x \<in> S}. principal S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open = generate_topology T \<Longrightarrow> nhds x = Inf (principal ` {S \<in> T. x \<in> S})
[PROOF STEP]
unfolding nhds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open = generate_topology T \<Longrightarrow> Inf (principal ` {S. open S \<and> x \<in> S}) = Inf (principal ` {S \<in> T. x \<in> S})
[PROOF STEP]
proof (safe intro!: antisym INF_greatest)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>open = generate_topology T; S \<in> T; x \<in> S\<rbrakk> \<Longrightarrow> Inf (principal ` {S. generate_topology T S \<and> x \<in> S}) \<le> principal S
 2. \<And>i. \<lbrakk>open = generate_topology T; generate_topology T i; x \<in> i\<rbrakk> \<Longrightarrow> Inf (principal ` {S \<in> T. x \<in> S}) \<le> principal i
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S. \<lbrakk>open = generate_topology T; S \<in> T; x \<in> S\<rbrakk> \<Longrightarrow> Inf (principal ` {S. generate_topology T S \<and> x \<in> S}) \<le> principal S
 2. \<And>i. \<lbrakk>open = generate_topology T; generate_topology T i; x \<in> i\<rbrakk> \<Longrightarrow> Inf (principal ` {S \<in> T. x \<in> S}) \<le> principal i
[PROOF STEP]
assume "generate_topology T S" "x \<in> S"
[PROOF STATE]
proof (state)
this:
generate_topology T S
x \<in> S

goal (2 subgoals):
 1. \<And>S. \<lbrakk>open = generate_topology T; S \<in> T; x \<in> S\<rbrakk> \<Longrightarrow> Inf (principal ` {S. generate_topology T S \<and> x \<in> S}) \<le> principal S
 2. \<And>i. \<lbrakk>open = generate_topology T; generate_topology T i; x \<in> i\<rbrakk> \<Longrightarrow> Inf (principal ` {S \<in> T. x \<in> S}) \<le> principal i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
generate_topology T S
x \<in> S
[PROOF STEP]
show "(INF S\<in>{S \<in> T. x \<in> S}. principal S) \<le> principal S"
[PROOF STATE]
proof (prove)
using this:
generate_topology T S
x \<in> S

goal (1 subgoal):
 1. Inf (principal ` {S \<in> T. x \<in> S}) \<le> principal S
[PROOF STEP]
by induct
      (auto intro: INF_lower order_trans simp: inf_principal[symmetric] simp del: inf_principal)
[PROOF STATE]
proof (state)
this:
Inf (principal ` {S \<in> T. x \<in> S}) \<le> principal S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open = generate_topology T; S \<in> T; x \<in> S\<rbrakk> \<Longrightarrow> Inf (principal ` {S. generate_topology T S \<and> x \<in> S}) \<le> principal S
[PROOF STEP]
qed (auto intro!: INF_lower intro: generate_topology.intros)


[STATEMENT]
lemma mono_mult2_alt:
  assumes "ns \<subseteq> ns'" "s \<subseteq> s'" shows "mult2_alt b ns s \<subseteq> mult2_alt b ns' s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult2_alt b ns s \<subseteq> mult2_alt b ns' s'
[PROOF STEP]
unfolding mult2_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(X, Y). \<exists>X1 X2 Y1 Y2. X = X1 + X2 \<and> Y = Y1 + Y2 \<and> (X1, Y1) \<in> multpw ns \<and> (b \<or> Y2 \<noteq> {#}) \<and> (\<forall>x. x \<in># X2 \<longrightarrow> (\<exists>y. y \<in># Y2 \<and> (x, y) \<in> s))} \<subseteq> {(X, Y). \<exists>X1 X2 Y1 Y2. X = X1 + X2 \<and> Y = Y1 + Y2 \<and> (X1, Y1) \<in> multpw ns' \<and> (b \<or> Y2 \<noteq> {#}) \<and> (\<forall>x. x \<in># X2 \<longrightarrow> (\<exists>y. y \<in># Y2 \<and> (x, y) \<in> s'))}
[PROOF STEP]
using mono_multpw[OF assms(1)] assms
[PROOF STATE]
proof (prove)
using this:
multpw ns \<subseteq> multpw ns'
ns \<subseteq> ns'
s \<subseteq> s'

goal (1 subgoal):
 1. {(X, Y). \<exists>X1 X2 Y1 Y2. X = X1 + X2 \<and> Y = Y1 + Y2 \<and> (X1, Y1) \<in> multpw ns \<and> (b \<or> Y2 \<noteq> {#}) \<and> (\<forall>x. x \<in># X2 \<longrightarrow> (\<exists>y. y \<in># Y2 \<and> (x, y) \<in> s))} \<subseteq> {(X, Y). \<exists>X1 X2 Y1 Y2. X = X1 + X2 \<and> Y = Y1 + Y2 \<and> (X1, Y1) \<in> multpw ns' \<and> (b \<or> Y2 \<noteq> {#}) \<and> (\<forall>x. x \<in># X2 \<longrightarrow> (\<exists>y. y \<in># Y2 \<and> (x, y) \<in> s'))}
[PROOF STEP]
by (blast 19)


[STATEMENT]
lemma pair_completeD:
  assumes "pair_complete A r"
  shows "x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> \<exists>s. extreme_bound A r {x,y} s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> Ex (extreme_bound A r {x, y})
[PROOF STEP]
by (intro completeD[OF assms[unfolded pair_complete_def]], auto)


[STATEMENT]
lemma UP_smult_assoc1:
      "[| a \<in> carrier R; b \<in> carrier R; p \<in> carrier P |] ==>
      (a \<otimes> b) \<odot>\<^bsub>P\<^esub> p = a \<odot>\<^bsub>P\<^esub> (b \<odot>\<^bsub>P\<^esub> p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; p \<in> carrier P\<rbrakk> \<Longrightarrow> a \<otimes> b \<odot>\<^bsub>P\<^esub> p = a \<odot>\<^bsub>P\<^esub> (b \<odot>\<^bsub>P\<^esub> p)
[PROOF STEP]
by (rule up_eqI) (simp_all add: R.m_assoc)


[STATEMENT]
lemma geqmaxNone:
  assumes "invar_vebt (Node (Some (mi, ma)) deg treeList summary) n ""x \<ge> ma "
  shows "vebt_succ  (Node (Some (mi, ma)) deg treeList summary) x = None "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vebt_succ (Node (Some (mi, ma)) deg treeList summary) x = None
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None \<Longrightarrow> False
[PROOF STEP]
assume "vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None"
[PROOF STATE]
proof (state)
this:
vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None

goal (1 subgoal):
 1. vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None
[PROOF STEP]
obtain y where "vebt_succ (Node (Some (mi, ma)) deg treeList summary) x =  Some y"
[PROOF STATE]
proof (prove)
using this:
vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None

goal (1 subgoal):
 1. (\<And>y. vebt_succ (Node (Some (mi, ma)) deg treeList summary) x = Some y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vebt_succ (Node (Some (mi, ma)) deg treeList summary) x = Some y

goal (1 subgoal):
 1. vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None \<Longrightarrow> False
[PROOF STEP]
hence  "y > ma \<and> y \<in> set_vebt' ((Node (Some (mi, ma)) deg treeList summary))"
[PROOF STATE]
proof (prove)
using this:
vebt_succ (Node (Some (mi, ma)) deg treeList summary) x = Some y

goal (1 subgoal):
 1. ma < y \<and> y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
by (smt (verit, ccfv_SIG) assms(1) assms(2) dual_order.strict_trans2 member_inv min_in_set_def vebt_mint.simps(3) mint_corr not_less_iff_gr_or_eq succ_corr succ_member)
[PROOF STATE]
proof (state)
this:
ma < y \<and> y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)

goal (1 subgoal):
 1. vebt_succ (Node (Some (mi, ma)) deg treeList summary) x \<noteq> None \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ma < y \<and> y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
ma < y \<and> y \<in> set_vebt' (Node (Some (mi, ma)) deg treeList summary)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis assms(1) leD vebt_maxt.simps(3) maxt_corr_help mem_Collect_eq set_vebt'_def)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma some_gcd_ff_list_divides: "x \<in> set xs \<Longrightarrow> divides_ff (some_gcd_ff_list xs) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs \<Longrightarrow> divides_ff (some_gcd_ff_list xs) x
[PROOF STEP]
using some_gcd_ff_list[of xs]
[PROOF STATE]
proof (prove)
using this:
gcd_ff_list xs (some_gcd_ff_list xs)

goal (1 subgoal):
 1. x \<in> set xs \<Longrightarrow> divides_ff (some_gcd_ff_list xs) x
[PROOF STEP]
unfolding gcd_ff_list_def
[PROOF STATE]
proof (prove)
using this:
Ball (set xs) (divides_ff (some_gcd_ff_list xs)) \<and> (\<forall>d. Ball (set xs) (divides_ff d) \<longrightarrow> divides_ff d (some_gcd_ff_list xs))

goal (1 subgoal):
 1. x \<in> set xs \<Longrightarrow> divides_ff (some_gcd_ff_list xs) x
[PROOF STEP]
by auto


[STATEMENT]
lemma inf_qbs_Mx[simp]: "qbs_Mx (inf_quasi_borel X X') = qbs_Mx X \<inter> qbs_Mx X'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_Mx (inf_quasi_borel X X') = qbs_Mx X \<inter> qbs_Mx X'
[PROOF STEP]
by(simp add: qbs_Mx_def inf_quasi_borel_correct)


[STATEMENT]
lemma lm043:
  "omega pair = {(fst pair, {y})| y. y \<in>  snd pair}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. omega pair = {(fst pair, {y}) |y. y \<in> snd pair}
[PROOF STEP]
using lm042 setOfPairs
[PROOF STATE]
proof (prove)
using this:
omega ?pair = {fst ?pair} \<times> {{y} |y. y \<in> snd ?pair}
{(fst ?pair, {y}) |y. y \<in> snd ?pair} = {fst ?pair} \<times> {{y} |y. y \<in> snd ?pair}

goal (1 subgoal):
 1. omega pair = {(fst pair, {y}) |y. y \<in> snd pair}
[PROOF STEP]
by metis


[STATEMENT]
lemma inc_matrix_point_not_in_block_iff:  "i < length Vs \<Longrightarrow> j < length Bs \<Longrightarrow>
    (inc_mat_of Vs Bs) $$ (i, j) = 0 \<longleftrightarrow> Vs ! i \<notin> Bs ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length Vs; j < length Bs\<rbrakk> \<Longrightarrow> (inc_mat_of Vs Bs $$ (i, j) = (0::'b)) = (Vs ! i \<notin> Bs ! j)
[PROOF STEP]
using inc_matrix_point_not_in_block inc_matrix_point_not_in_block_zero
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < length ?Vs; ?j < length ?Bs; inc_mat_of ?Vs ?Bs $$ (?i, ?j) = (0::?'b)\<rbrakk> \<Longrightarrow> ?Vs ! ?i \<notin> ?Bs ! ?j
\<lbrakk>?i < length ?Vs; ?j < length ?Bs; ?Vs ! ?i \<notin> ?Bs ! ?j\<rbrakk> \<Longrightarrow> inc_mat_of ?Vs ?Bs $$ (?i, ?j) = (0::?'b)

goal (1 subgoal):
 1. \<lbrakk>i < length Vs; j < length Bs\<rbrakk> \<Longrightarrow> (inc_mat_of Vs Bs $$ (i, j) = (0::'b)) = (Vs ! i \<notin> Bs ! j)
[PROOF STEP]
by blast


[STATEMENT]
lemma pair_measure_closed: "{a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B} \<subseteq> Pow (space A \<times> space B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B} \<subseteq> Pow (space A \<times> space B)
[PROOF STEP]
using sets.space_closed[of A] sets.space_closed[of B]
[PROOF STATE]
proof (prove)
using this:
sets A \<subseteq> Pow (space A)
sets B \<subseteq> Pow (space B)

goal (1 subgoal):
 1. {a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B} \<subseteq> Pow (space A \<times> space B)
[PROOF STEP]
by auto


[STATEMENT]
lemma antisym_finer_than: "S = T" if "S finer_than T" "T finer_than S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = T
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
S finer_than T
T finer_than S

goal (1 subgoal):
 1. S = T
[PROOF STEP]
apply (auto simp: finer_than_def topology_eq_iff continuous_map_alt)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>U. openin T U \<longrightarrow> openin S (U \<inter> topspace T); topspace S = topspace T; \<forall>U. openin S U \<longrightarrow> openin T (U \<inter> topspace T); x \<subseteq> topspace T; openin S x\<rbrakk> \<Longrightarrow> openin T x
 2. \<And>x. \<lbrakk>\<forall>U. openin T U \<longrightarrow> openin S (U \<inter> topspace T); topspace S = topspace T; \<forall>U. openin S U \<longrightarrow> openin T (U \<inter> topspace T); x \<subseteq> topspace T; openin T x\<rbrakk> \<Longrightarrow> openin S x
[PROOF STEP]
apply (metis inf.orderE)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma exp_one_2pi_iff:
  fixes x::real shows "exp (2 * of_real pi * \<i> * x) = 1 \<longleftrightarrow> x \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
have c: "cis (2 * x * pi) = 1 \<longleftrightarrow> x \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cis (2 * x * pi) = 1) = (x \<in> \<int>)
[PROOF STEP]
by (auto simp: complex_eq_iff sin_times_pi_eq_0 cos_one_2pi_int, meson Ints_cases)
[PROOF STATE]
proof (state)
this:
(cis (2 * x * pi) = 1) = (x \<in> \<int>)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
have "exp (2 * of_real pi * \<i> * x) = exp (\<i> * complex_of_real (2 * x * pi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (2 * complex_of_real pi * \<i> * complex_of_real x) = exp (\<i> * complex_of_real (2 * x * pi))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (2 * complex_of_real pi * \<i> * complex_of_real x) = exp (\<i> * complex_of_real (2 * x * pi))
[PROOF STEP]
have "2 * of_real pi * \<i> * x = \<i> * complex_of_real (2 * x * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * complex_of_real pi * \<i> * complex_of_real x = \<i> * complex_of_real (2 * x * pi)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * complex_of_real pi * \<i> * complex_of_real x = \<i> * complex_of_real (2 * x * pi)

goal (1 subgoal):
 1. exp (2 * complex_of_real pi * \<i> * complex_of_real x) = exp (\<i> * complex_of_real (2 * x * pi))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * complex_of_real pi * \<i> * complex_of_real x = \<i> * complex_of_real (2 * x * pi)

goal (1 subgoal):
 1. exp (2 * complex_of_real pi * \<i> * complex_of_real x) = exp (\<i> * complex_of_real (2 * x * pi))
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
exp (2 * complex_of_real pi * \<i> * complex_of_real x) = exp (\<i> * complex_of_real (2 * x * pi))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
exp (2 * complex_of_real pi * \<i> * complex_of_real x) = exp (\<i> * complex_of_real (2 * x * pi))

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (2 * complex_of_real pi * \<i> * complex_of_real x) = exp (\<i> * complex_of_real (2 * x * pi))

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
from cis_conv_exp
[PROOF STATE]
proof (chain)
picking this:
cis ?b = exp (\<i> * complex_of_real ?b)
[PROOF STEP]
have "\<dots> = cis (2 * x * pi)"
[PROOF STATE]
proof (prove)
using this:
cis ?b = exp (\<i> * complex_of_real ?b)

goal (1 subgoal):
 1. exp (\<i> * complex_of_real (2 * x * pi)) = cis (2 * x * pi)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (\<i> * complex_of_real (2 * x * pi)) = cis (2 * x * pi)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (2 * complex_of_real pi * \<i> * complex_of_real x) = cis (2 * x * pi)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
exp (2 * complex_of_real pi * \<i> * complex_of_real x) = cis (2 * x * pi)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
exp (2 * complex_of_real pi * \<i> * complex_of_real x) = cis (2 * x * pi)
(cis (2 * x * pi) = 1) = (x \<in> \<int>)

goal (1 subgoal):
 1. (exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(exp (2 * complex_of_real pi * \<i> * complex_of_real x) = 1) = (x \<in> \<int>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniformly_convergent_eq_cauchy:
  fixes s::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space"
  shows
    "(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e) \<longleftrightarrow>
      (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x  \<longrightarrow> dist (s m x) (s n x) < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)
[PROOF STEP]
have *: "(\<forall>n\<ge>N. \<forall>x. Q x \<longrightarrow> R n x) \<longleftrightarrow> (\<forall>n x. N \<le> n \<and> Q x \<longrightarrow> R n x)"
    "(\<forall>x. Q x \<longrightarrow> (\<forall>m\<ge>N. \<forall>n\<ge>N. S n m x)) \<longleftrightarrow> (\<forall>m n x. N \<le> m \<and> N \<le> n \<and> Q x \<longrightarrow> S n m x)"
    for N::nat and Q::"'b \<Rightarrow> bool" and R S
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>n\<ge>N. \<forall>x. Q x \<longrightarrow> R n x) = (\<forall>n x. N \<le> n \<and> Q x \<longrightarrow> R n x) &&& (\<forall>x. Q x \<longrightarrow> (\<forall>m\<ge>N. \<forall>n\<ge>N. S n m x)) = (\<forall>m n x. N \<le> m \<and> N \<le> n \<and> Q x \<longrightarrow> S n m x)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
(\<forall>n\<ge>?N. \<forall>x. ?Q x \<longrightarrow> ?R n x) = (\<forall>n x. ?N \<le> n \<and> ?Q x \<longrightarrow> ?R n x)
(\<forall>x. ?Q x \<longrightarrow> (\<forall>m\<ge>?N. \<forall>n\<ge>?N. ?S n m x)) = (\<forall>m n x. ?N \<le> m \<and> ?N \<le> n \<and> ?Q x \<longrightarrow> ?S n m x)

goal (1 subgoal):
 1. (\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)
[PROOF STEP]
using uniformly_convergent_eq_Cauchy[of "Collect P" s]
[PROOF STATE]
proof (prove)
using this:
uniformly_convergent_on (Collect P) s = uniformly_Cauchy_on (Collect P) s

goal (1 subgoal):
 1. (\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)
[PROOF STEP]
unfolding uniformly_convergent_on_def uniformly_Cauchy_on_def uniform_limit_sequentially_iff
[PROOF STATE]
proof (prove)
using this:
(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<forall>x\<in>Collect P. dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>M. \<forall>x\<in>Collect P. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (s m x) (s n x) < e)

goal (1 subgoal):
 1. (\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)
[PROOF STEP]
by (simp add: *)
[PROOF STATE]
proof (state)
this:
(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l x) < e) = (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x \<longrightarrow> dist (s m x) (s n x) < e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_cutoff_zero_iff: "fps_cutoff n f = 0 \<longleftrightarrow> (f = 0 \<or> n \<le> subdegree f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fps_cutoff n f = 0) = (f = 0 \<or> n \<le> subdegree f)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fps_cutoff n f = 0 \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
 2. f = 0 \<or> n \<le> subdegree f \<Longrightarrow> fps_cutoff n f = 0
[PROOF STEP]
assume A: "fps_cutoff n f = 0"
[PROOF STATE]
proof (state)
this:
fps_cutoff n f = 0

goal (2 subgoals):
 1. fps_cutoff n f = 0 \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
 2. f = 0 \<or> n \<le> subdegree f \<Longrightarrow> fps_cutoff n f = 0
[PROOF STEP]
thus "f = 0 \<or> n \<le> subdegree f"
[PROOF STATE]
proof (prove)
using this:
fps_cutoff n f = 0

goal (1 subgoal):
 1. f = 0 \<or> n \<le> subdegree f
[PROOF STEP]
proof (cases "f = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>fps_cutoff n f = 0; f = 0\<rbrakk> \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
 2. \<lbrakk>fps_cutoff n f = 0; f \<noteq> 0\<rbrakk> \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
[PROOF STEP]
assume "f \<noteq> 0"
[PROOF STATE]
proof (state)
this:
f \<noteq> 0

goal (2 subgoals):
 1. \<lbrakk>fps_cutoff n f = 0; f = 0\<rbrakk> \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
 2. \<lbrakk>fps_cutoff n f = 0; f \<noteq> 0\<rbrakk> \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
[PROOF STEP]
with A
[PROOF STATE]
proof (chain)
picking this:
fps_cutoff n f = 0
f \<noteq> 0
[PROOF STEP]
have "n \<le> subdegree f"
[PROOF STATE]
proof (prove)
using this:
fps_cutoff n f = 0
f \<noteq> 0

goal (1 subgoal):
 1. n \<le> subdegree f
[PROOF STEP]
by (intro subdegree_geI) (simp_all add: fps_eq_iff split: if_split_asm)
[PROOF STATE]
proof (state)
this:
n \<le> subdegree f

goal (2 subgoals):
 1. \<lbrakk>fps_cutoff n f = 0; f = 0\<rbrakk> \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
 2. \<lbrakk>fps_cutoff n f = 0; f \<noteq> 0\<rbrakk> \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> subdegree f

goal (1 subgoal):
 1. f = 0 \<or> n \<le> subdegree f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f = 0 \<or> n \<le> subdegree f

goal (1 subgoal):
 1. \<lbrakk>fps_cutoff n f = 0; f = 0\<rbrakk> \<Longrightarrow> f = 0 \<or> n \<le> subdegree f
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
f = 0 \<or> n \<le> subdegree f

goal (1 subgoal):
 1. f = 0 \<or> n \<le> subdegree f \<Longrightarrow> fps_cutoff n f = 0
[PROOF STEP]
qed (auto simp: fps_eq_iff intro: nth_less_subdegree_zero)


[STATEMENT]
lemma segment_to_point_exists:
  fixes S :: "'a :: euclidean_space set"
    assumes "closed S" "S \<noteq> {}"
    obtains b where "b \<in> S" "open_segment a b \<inter> S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> S; open_segment a b \<inter> S = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms segment_to_closest_point closest_point_exists that)


[STATEMENT]
lemma set_less_trans_set_less_eq [trans]:
  "\<lbrakk> A \<sqsubset>' B; B \<sqsubseteq>' C \<rbrakk> \<Longrightarrow> A \<sqsubset>' C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<sqsubset>' B; B \<sqsubseteq>' C\<rbrakk> \<Longrightarrow> A \<sqsubset>' C
[PROOF STEP]
by(auto simp add: set_less_eq_aux_def dest: set_less_aux_trans)


[STATEMENT]
lemma filterlim_at_top_to_right:
  "filterlim f F at_top \<longleftrightarrow> (LIM x (at_right (0::real)). f (inverse x) :> F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f F at_top = (LIM x at_right 0. f (inverse x) :> F)
[PROOF STEP]
unfolding filterlim_def at_top_to_right filtermap_filtermap
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (filtermap (\<lambda>x. f (inverse x)) (at_right 0) \<le> F) = (filtermap (\<lambda>x. f (inverse x)) (at_right 0) \<le> F)
[PROOF STEP]
..


[STATEMENT]
lemma urel32_inverse: assumes x: "urel32 x x'"
  shows "urel32 (inverse_p32 pp x) (inverse_p p x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel32 (inverse_p32 pp x) (inverse_p p x')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. urel32 (inverse_p32 pp x) (inverse_p p x')
[PROOF STEP]
have p: "urel32 (pp - 2) (int (nat (p - 2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel32 (pp - 2) (int (nat (p - 2)))
[PROOF STEP]
using p2 small
[PROOF STATE]
proof (prove)
using this:
2 \<le> p
p \<le> 65535

goal (1 subgoal):
 1. urel32 (pp - 2) (int (nat (p - 2)))
[PROOF STEP]
unfolding urel32_def
[PROOF STATE]
proof (prove)
using this:
2 \<le> p
p \<le> 65535

goal (1 subgoal):
 1. int (nat (p - 2)) = int_of_uint32 (pp - 2) \<and> int (nat (p - 2)) < p
[PROOF STEP]
unfolding ppp
[PROOF STATE]
proof (prove)
using this:
2 \<le> int_of_uint32 pp
int_of_uint32 pp \<le> 65535

goal (1 subgoal):
 1. int (nat (int_of_uint32 pp - 2)) = int_of_uint32 (pp - 2) \<and> int (nat (int_of_uint32 pp - 2)) < int_of_uint32 pp
[PROOF STEP]
by (simp add: int_of_uint32.rep_eq minus_uint32.rep_eq uint_sub_if')
[PROOF STATE]
proof (state)
this:
urel32 (pp - 2) (int (nat (p - 2)))

goal (1 subgoal):
 1. urel32 (inverse_p32 pp x) (inverse_p p x')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel32 (inverse_p32 pp x) (inverse_p p x')
[PROOF STEP]
unfolding inverse_p32_def inverse_p_def urel32_eq[OF x urel32_0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel32 (if x' = 0 then 0 else power_p32 pp x (pp - 2)) (if x' = 0 then 0 else power_p p x' (nat (p - 2)))
[PROOF STEP]
using urel32_0 urel32_power[OF x p]
[PROOF STATE]
proof (prove)
using this:
urel32 0 0
urel32 (power_p32 pp x (pp - 2)) (power_p p x' (nat (p - 2)))

goal (1 subgoal):
 1. urel32 (if x' = 0 then 0 else power_p32 pp x (pp - 2)) (if x' = 0 then 0 else power_p p x' (nat (p - 2)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
urel32 (inverse_p32 pp x) (inverse_p p x')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Stable_Constrains_Int:
    "[| F \<in> Stable C; F \<in> (C \<inter> A) Co A' |]
     ==> F \<in> (C \<inter> A) Co (C \<inter> A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> Stable C; F \<in> C \<inter> A Co A'\<rbrakk> \<Longrightarrow> F \<in> C \<inter> A Co C \<inter> A'
[PROOF STEP]
apply (unfold Stable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> C Co C; F \<in> C \<inter> A Co A'\<rbrakk> \<Longrightarrow> F \<in> C \<inter> A Co C \<inter> A'
[PROOF STEP]
apply (blast intro: Constrains_Int [THEN Constrains_weaken])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mtx_vec_mult_0r[simp]: "A *\<^sub>V 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>V 0 = 0
[PROOF STEP]
by (transfer, simp)


[STATEMENT]
lemma real_divr_nonneg_neg_upper_bound: "0 \<le> x \<Longrightarrow> y \<le> 0 \<Longrightarrow> real_divr prec x y \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; y \<le> 0\<rbrakk> \<Longrightarrow> real_divr prec x y \<le> 0
[PROOF STEP]
by (simp add: real_divr_def truncate_up_nonpos divide_le_0_iff)


[STATEMENT]
lemma degree_pdevs_of_list_eq':
  \<open>degree (pdevs_of_list xs) = Min {n. n \<le> length xs \<and> (\<forall>m. n \<le> m \<longrightarrow> m < length xs \<longrightarrow> xs ! m = 0)}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (pdevs_of_list xs) = Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))}
[PROOF STEP]
apply (simp add: degree_def pdevs_apply_pdevs_of_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST i. \<forall>j<length xs. i \<le> j \<longrightarrow> xs ! j = (0::'a)) = Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))}
[PROOF STEP]
apply (rule Least_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>j<length xs. Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<le> j \<longrightarrow> xs ! j = (0::'a)
 2. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<le> y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. \<lbrakk>j < length xs; Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<le> j\<rbrakk> \<Longrightarrow> xs ! j = (0::'a)
 2. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<le> y
[PROOF STEP]
apply (subst (asm) Min_le_iff)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>j. j < length xs \<Longrightarrow> finite {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))}
 2. \<And>j. j < length xs \<Longrightarrow> {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<noteq> {}
 3. \<And>j. \<lbrakk>j < length xs; \<exists>a\<in>{n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))}. a \<le> j\<rbrakk> \<Longrightarrow> xs ! j = (0::'a)
 4. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<le> y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> Min {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<le> y
[PROOF STEP]
apply (subst Min_le_iff)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> finite {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))}
 2. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> {n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))} \<noteq> {}
 3. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> \<exists>a\<in>{n. n \<le> length xs \<and> (\<forall>m\<ge>n. m < length xs \<longrightarrow> xs ! m = (0::'a))}. a \<le> y
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<forall>j<length xs. y \<le> j \<longrightarrow> xs ! j = (0::'a) \<Longrightarrow> \<exists>a\<le>length xs. (\<forall>m\<ge>a. m < length xs \<longrightarrow> xs ! m = (0::'a)) \<and> a \<le> y
[PROOF STEP]
apply (metis le_cases not_less)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma contour_integrable_continuous_circlepath:
    "continuous_on (path_image (circlepath z r)) f
     \<Longrightarrow> f contour_integrable_on (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image (circlepath z r)) f \<Longrightarrow> f contour_integrable_on circlepath z r
[PROOF STEP]
by (simp add: circlepath_def contour_integrable_continuous_part_circlepath)


[STATEMENT]
lemma FAddSA_dom_dom_States [simp]:
  "\<lbrakk> S \<in> (dom F); S \<notin> States SA \<rbrakk> \<Longrightarrow>
    (dom ((F::('a \<rightharpoonup> (('a,'b,'d)seqauto) set)) [f+] (S, SA))) =
    ((dom F) \<union> (States (SA::('a,'b,'d)seqauto)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<in> dom F; S \<notin> States SA\<rbrakk> \<Longrightarrow> dom (F [f+] (S, SA)) = dom F \<union> States SA
[PROOF STEP]
by (unfold FAddSA_def Let_def, auto)


[STATEMENT]
lemma cong_left_commutativity:
  assumes "Cong A B C D"
  shows "Cong B A C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cong B A C D
[PROOF STEP]
using assms cong_inner_transitivity cong_pseudo_reflexivity
[PROOF STATE]
proof (prove)
using this:
Cong A B C D
\<forall>a b p q r s. Cong a b p q \<and> Cong a b r s \<longrightarrow> Cong p q r s
\<forall>a b. Cong a b b a

goal (1 subgoal):
 1. Cong B A C D
[PROOF STEP]
by blast


[STATEMENT]
lemma pi_float_interval: "pi \<in> set_of (real_interval (pi_float_interval prec))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi \<in>\<^sub>r pi_float_interval prec
[PROOF STEP]
using pi_boundaries
[PROOF STATE]
proof (prove)
using this:
pi \<in> {real_of_float (lb_pi ?n)..real_of_float (ub_pi ?n)}

goal (1 subgoal):
 1. pi \<in>\<^sub>r pi_float_interval prec
[PROOF STEP]
by (auto simp: set_of_eq lower_pi_float_interval upper_pi_float_interval)


[STATEMENT]
lemma min_coin_defI: assumes "r \<noteq> \<epsilon>" and "s \<noteq> \<epsilon>" and  "g r = h s" and
      "(\<And> r' s'. r' \<le>np r \<Longrightarrow> s' \<le>np s \<Longrightarrow> g r' = h s' \<Longrightarrow> r' = r \<and> s' = s)"
   shows "g r =\<^sub>m h s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g r =\<^sub>m h s
[PROOF STEP]
unfolding min_coin_def[rule_format]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<noteq> \<epsilon> \<and> s \<noteq> \<epsilon> \<and> g r = h s \<and> (\<forall>r' s'. r' \<le>np r \<and> s' \<le>np s \<and> g r' = h s' \<longrightarrow> r' = r \<and> s' = s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<noteq> \<epsilon>
s \<noteq> \<epsilon>
g r = h s
\<lbrakk>?r' \<le>np r; ?s' \<le>np s; g ?r' = h ?s'\<rbrakk> \<Longrightarrow> ?r' = r \<and> ?s' = s

goal (1 subgoal):
 1. r \<noteq> \<epsilon> \<and> s \<noteq> \<epsilon> \<and> g r = h s \<and> (\<forall>r' s'. r' \<le>np r \<and> s' \<le>np s \<and> g r' = h s' \<longrightarrow> r' = r \<and> s' = s)
[PROOF STEP]
by blast


[STATEMENT]
lemma eval_ternary_DeMorgan:
  "eval_ternary_Not (eval_ternary_And a b) = eval_ternary_Or (eval_ternary_Not a) (eval_ternary_Not b)"
  "eval_ternary_Not (eval_ternary_Or a b) = eval_ternary_And (eval_ternary_Not a) (eval_ternary_Not b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_ternary_Not (eval_ternary_And a b) = eval_ternary_Or (eval_ternary_Not a) (eval_ternary_Not b) &&& eval_ternary_Not (eval_ternary_Or a b) = eval_ternary_And (eval_ternary_Not a) (eval_ternary_Not b)
[PROOF STEP]
by (cases a b rule: ternaryvalue.exhaust[case_product ternaryvalue.exhaust],auto)+


[STATEMENT]
lemma dvd_imp_dvdm:
  assumes "a dvd b" shows "a dvdm b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvdm b
[PROOF STEP]
by (metis assms dvd_def dvdm_def)


[STATEMENT]
lemma "\<not>(\<exists>(a::int) b m. (b - a) mod m = 0 \<and> a mod m \<noteq> b mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>a b m. (b - a) mod m = 0 \<and> a mod m \<noteq> b mod m
[PROOF STEP]
by (simp add: zmod_eq_diff_mod_0_conv)


[STATEMENT]
lemma completely_multiplicative_iff_inverse_moebius_mu:
  fixes f :: "nat \<Rightarrow> 'a :: {comm_ring_1, ring_no_zero_divisors}"
  assumes "multiplicative_function f"
  defines "g \<equiv> dirichlet_inverse f 1"
  shows   "completely_multiplicative_function f \<longleftrightarrow>
             (\<forall>n. g n = moebius_mu n * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
interpret multiplicative_function f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
assume "completely_multiplicative_function f"
[PROOF STATE]
proof (state)
this:
completely_multiplicative_function f

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
completely_multiplicative_function f
[PROOF STEP]
interpret completely_multiplicative_function f
[PROOF STATE]
proof (prove)
using this:
completely_multiplicative_function f

goal (1 subgoal):
 1. completely_multiplicative_function f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
have [simp]: "fds f \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds f \<noteq> 0
[PROOF STEP]
by (auto simp: fds_eq_iff)
[PROOF STATE]
proof (state)
this:
fds f \<noteq> 0

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
have "fds (\<lambda>n. moebius_mu n * f n) * fds f = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds (\<lambda>n. moebius_mu n * f n) * fds f = 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n =
              (\<Sum>(r, d) | r * d = n. moebius_mu r * f (r * d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d))
[PROOF STEP]
by (simp add: fds_eq_iff fds_nth_mult fds_nth_fds dirichlet_prod_altdef2 mult mult.assoc)
[PROOF STATE]
proof (state)
this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "\<dots> = (\<Sum>(r, d) | r * d = n. moebius_mu r * f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d)) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n)
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d)) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f (r * d)) = (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n)

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "\<dots> = dirichlet_prod moebius_mu (\<lambda>_. 1) n * f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n) = dirichlet_prod moebius_mu (\<lambda>_. 1::'a) n * f n
[PROOF STEP]
by (simp add: dirichlet_prod_altdef2 sum_distrib_right case_prod_unfold mult)
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n) = dirichlet_prod moebius_mu (\<lambda>_. 1::'a) n * f n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(r, d)\<in>{(r, d). r * d = n}. moebius_mu r * f n) = dirichlet_prod moebius_mu (\<lambda>_. 1::'a) n * f n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "dirichlet_prod moebius_mu (\<lambda>_. 1) n = fds_nth (fds moebius_mu * fds_zeta) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod moebius_mu (\<lambda>_. 1::'b) n = fds_nth (fds moebius_mu * fds_zeta) n
[PROOF STEP]
by (simp add: fds_nth_mult)
[PROOF STATE]
proof (state)
this:
dirichlet_prod moebius_mu (\<lambda>_. 1::?'b1) n = fds_nth (fds moebius_mu * fds_zeta) n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod moebius_mu (\<lambda>_. 1::?'b1) n = fds_nth (fds moebius_mu * fds_zeta) n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "fds moebius_mu * fds_zeta = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds moebius_mu * fds_zeta = 1
[PROOF STEP]
by (simp add: mult_ac fds_zeta_times_moebius_mu)
[PROOF STATE]
proof (state)
this:
fds moebius_mu * fds_zeta = 1

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds moebius_mu * fds_zeta = 1

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
have "fds_nth 1 n * f n = fds_nth 1 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth 1 n * f n = fds_nth 1 n
[PROOF STEP]
by (auto simp: fds_eq_iff fds_nth_one)
[PROOF STATE]
proof (state)
this:
fds_nth 1 n * f n = fds_nth 1 n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
show "fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n"
[PROOF STATE]
proof (prove)
using this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n

goal (1 subgoal):
 1. fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_nth (fds (\<lambda>n. moebius_mu n * f n) * fds f) n = fds_nth 1 n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = 1

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = 1

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
have "1 = fds g * fds f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = fds g * fds f
[PROOF STEP]
by (auto simp: fds_eq_iff g_def fds_nth_mult dirichlet_prod_inverse')
[PROOF STATE]
proof (state)
this:
1 = fds g * fds f

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = fds g * fds f
[PROOF STEP]
have "fds g = fds (\<lambda>n. moebius_mu n * f n)"
[PROOF STATE]
proof (prove)
using this:
fds (\<lambda>n. moebius_mu n * f n) * fds f = fds g * fds f

goal (1 subgoal):
 1. fds g = fds (\<lambda>n. moebius_mu n * f n)
[PROOF STEP]
by (subst (asm) mult_cancel_right) auto
[PROOF STATE]
proof (state)
this:
fds g = fds (\<lambda>n. moebius_mu n * f n)

goal (2 subgoals):
 1. \<And>n. completely_multiplicative_function f \<Longrightarrow> g n = moebius_mu n * f n
 2. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
thus "g n = moebius_mu n * f n" for n
[PROOF STATE]
proof (prove)
using this:
fds g = fds (\<lambda>n. moebius_mu n * f n)

goal (1 subgoal):
 1. g n = moebius_mu n * f n
[PROOF STEP]
by (cases "n = 0") (auto simp: fds_eq_iff g_def)
[PROOF STATE]
proof (state)
this:
g ?n = moebius_mu ?n * f ?n

goal (1 subgoal):
 1. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
assume g: "\<forall>n. g n = moebius_mu n * f n"
[PROOF STATE]
proof (state)
this:
\<forall>n. g n = moebius_mu n * f n

goal (1 subgoal):
 1. \<forall>n. g n = moebius_mu n * f n \<Longrightarrow> completely_multiplicative_function f
[PROOF STEP]
show "completely_multiplicative_function f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_multiplicative_function f
[PROOF STEP]
proof (rule completely_multiplicativeI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p k. \<lbrakk>prime p; 0 < k\<rbrakk> \<Longrightarrow> f (p ^ k) = f p ^ k
[PROOF STEP]
fix p k :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p k. \<lbrakk>prime p; 0 < k\<rbrakk> \<Longrightarrow> f (p ^ k) = f p ^ k
[PROOF STEP]
assume pk: "prime p" "k > 0"
[PROOF STATE]
proof (state)
this:
prime p
0 < k

goal (1 subgoal):
 1. \<And>p k. \<lbrakk>prime p; 0 < k\<rbrakk> \<Longrightarrow> f (p ^ k) = f p ^ k
[PROOF STEP]
show "f (p ^ k) = f p ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (p ^ k) = f p ^ k
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
f (p ^ k) = f p ^ k

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have eq: "dirichlet_prod g f n = 0" if "n \<noteq> 1" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod g f n = (0::'a)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (dirichlet_inverse f (1::'a)) f n = (0::'a)
[PROOF STEP]
using dirichlet_prod_inverse'[of f 1] that
[PROOF STATE]
proof (prove)
using this:
f 1 * (1::'a) = (1::'a) \<Longrightarrow> dirichlet_prod (dirichlet_inverse f (1::'a)) f = (\<lambda>n. if n = 1 then 1::'a else (0::'a))
n \<noteq> 1

goal (1 subgoal):
 1. dirichlet_prod (dirichlet_inverse f (1::'a)) f n = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?n \<noteq> 1 \<Longrightarrow> dirichlet_prod g f ?n = (0::'a)

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "dirichlet_prod g f (p ^ Suc k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod g f (p ^ Suc k) = (0::'a)
[PROOF STEP]
using pk
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k__

goal (1 subgoal):
 1. dirichlet_prod g f (p ^ Suc k) = (0::'a)
[PROOF STEP]
by (intro eq) auto
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (0::'a)

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (0::'a)

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
by (intro dirichlet_prod_prime_power) fact+
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod g f (p ^ Suc k) = (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
by (intro sum.cong refl, subst g) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. g (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
using pk
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k__

goal (1 subgoal):
 1. (\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto simp: moebius_mu_power')
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>Suc k. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i)))

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
have "\<dots> = f (p ^ Suc k) - f p ^ Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = f (p ^ Suc k) - f p ^ Suc k
[PROOF STEP]
using pk Suc.IH
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k__
f (p ^ k) = f p ^ k

goal (1 subgoal):
 1. (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = f (p ^ Suc k) - f p ^ Suc k
[PROOF STEP]
by (auto simp: moebius_mu.prime)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i) * f (p ^ (Suc k - i))) = f (p ^ Suc k) - f p ^ Suc k

goal (2 subgoals):
 1. f (p ^ 0) = f p ^ 0
 2. \<And>k. f (p ^ k) = f p ^ k \<Longrightarrow> f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (p ^ Suc k) - f p ^ Suc k = (0::'a)
[PROOF STEP]
show "f (p ^ Suc k) = f p ^ Suc k"
[PROOF STATE]
proof (prove)
using this:
f (p ^ Suc k) - f p ^ Suc k = (0::'a)

goal (1 subgoal):
 1. f (p ^ Suc k) = f p ^ Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (p ^ Suc k) = f p ^ Suc k

goal (1 subgoal):
 1. f (p ^ 0) = f p ^ 0
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
f (p ^ k) = f p ^ k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
completely_multiplicative_function f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
completely_multiplicative_function f = (\<forall>n. g n = moebius_mu n * f n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_UNIV_vec:
  assumes "infinite (UNIV :: 'a set)"
  shows   "infinite (UNIV :: ('a^'b) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
proof (subst bij_betw_finite)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bij_betw ?f UNIV ?B
 2. infinite ?B
[PROOF STEP]
show "bij_betw vec_nth UNIV (Pi (UNIV :: 'b set) (\<lambda>_. UNIV :: 'a set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw ($) UNIV (UNIV \<rightarrow> UNIV)
[PROOF STEP]
by (intro bij_betwI[of _ _ _ vec_lambda]) (auto simp: vec_eq_iff)
[PROOF STATE]
proof (state)
this:
bij_betw ($) UNIV (UNIV \<rightarrow> UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
have "infinite (PiE (UNIV :: 'b set) (\<lambda>_. UNIV :: 'a set))" (is "infinite ?A")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (UNIV \<rightarrow>\<^sub>E UNIV)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
assume "finite ?A"
[PROOF STATE]
proof (state)
this:
finite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
hence "finite ((\<lambda>f. f undefined) ` ?A)"
[PROOF STATE]
proof (prove)
using this:
finite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. finite ((\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV))
[PROOF STEP]
by (rule finite_imageI)
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV))

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV))

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
have "(\<lambda>f. f undefined) ` ?A = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV) = UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>f. f undefined) ` (UNIV \<rightarrow>\<^sub>E UNIV) = UNIV

goal (1 subgoal):
 1. finite (UNIV \<rightarrow>\<^sub>E UNIV) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finite UNIV
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
finite UNIV

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>infinite (UNIV :: 'a set)\<close>
[PROOF STATE]
proof (prove)
using this:
finite UNIV
infinite UNIV

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
infinite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infinite (UNIV \<rightarrow>\<^sub>E UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
have "?A = Pi UNIV (\<lambda>_. UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<rightarrow>\<^sub>E UNIV = UNIV \<rightarrow> UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV \<rightarrow>\<^sub>E UNIV = UNIV \<rightarrow> UNIV

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
show "infinite (Pi (UNIV :: 'b set) (\<lambda>_. UNIV :: 'a set))"
[PROOF STATE]
proof (prove)
using this:
infinite (UNIV \<rightarrow> UNIV)

goal (1 subgoal):
 1. infinite (UNIV \<rightarrow> UNIV)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
infinite (UNIV \<rightarrow> UNIV)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Field_symcl[simp]: "Field (symcl r) = Field r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Field (symcl r) = Field r
[PROOF STEP]
unfolding symcl_def Field_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domain {(x, y). (x, y) \<in> r \<or> (y, x) \<in> r} \<union> Range {(x, y). (x, y) \<in> r \<or> (y, x) \<in> r} = Domain r \<union> Range r
[PROOF STEP]
by auto


[STATEMENT]
lemma monom_of_set_eq_iff [simp]: "finite X \<Longrightarrow> finite Y \<Longrightarrow> monom_of_set X = monom_of_set Y \<longleftrightarrow> X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; finite Y\<rbrakk> \<Longrightarrow> (monom_of_set X = monom_of_set Y) = (X = Y)
[PROOF STEP]
by transfer (auto simp: fun_eq_iff)


[STATEMENT]
lemma bigtheta_inverse [simp]:
  shows "(\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x)) \<longleftrightarrow> f \<in> \<Theta>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
have "(\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))"
    if A: "f \<in> \<Theta>[F](g)"
    for f g :: "'a \<Rightarrow> 'b" and F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
f \<in> \<Theta>[F](g)
[PROOF STEP]
obtain c1 c2 :: real where *: "c1 > 0" "c2 > 0"
      and **: "\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)"
              "\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)"
[PROOF STATE]
proof (prove)
using this:
f \<in> \<Theta>[F](g)

goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>0 < c1; 0 < c2; \<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x); \<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bigtheta_def
[PROOF STATE]
proof (prove)
using this:
f \<in> O[F](g) \<inter> \<Omega>[F](g)

goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>0 < c1; 0 < c2; \<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x); \<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim landau_o.bigE landau_omega.bigE IntE)
[PROOF STATE]
proof (state)
this:
0 < c1
0 < c2
\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)
\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
from \<open>c2 > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < c2
[PROOF STEP]
have c2: "inverse c2 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c2

goal (1 subgoal):
 1. 0 < inverse c2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < inverse c2

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
from **
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)
\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)
[PROOF STEP]
have "eventually (\<lambda>x. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> c1 * norm (g x)
\<forall>\<^sub>F x in F. c2 * norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
assume A: "norm (f x) \<le> c1 * norm (g x)" "c2 * norm (g x) \<le> norm (f x)"
[PROOF STATE]
proof (state)
this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
from A *
[PROOF STATE]
proof (chain)
picking this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2
[PROOF STEP]
have "f x = 0 \<longleftrightarrow> g x = 0"
[PROOF STATE]
proof (prove)
using this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2

goal (1 subgoal):
 1. (f x = (0::'b)) = (g x = (0::'b))
[PROOF STEP]
by (auto simp: field_simps mult_le_0_iff)
[PROOF STATE]
proof (state)
this:
(f x = (0::'b)) = (g x = (0::'b))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (f x) \<le> c1 * norm (g x); c2 * norm (g x) \<le> norm (f x)\<rbrakk> \<Longrightarrow> norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
with A *
[PROOF STATE]
proof (chain)
picking this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2
(f x = (0::'b)) = (g x = (0::'b))
[PROOF STEP]
show "norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))"
[PROOF STATE]
proof (prove)
using this:
norm (f x) \<le> c1 * norm (g x)
c2 * norm (g x) \<le> norm (f x)
0 < c1
0 < c2
(f x = (0::'b)) = (g x = (0::'b))

goal (1 subgoal):
 1. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
by (force simp: field_simps norm_inverse norm_divide)
[PROOF STATE]
proof (state)
this:
norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
with c2
[PROOF STATE]
proof (chain)
picking this:
0 < inverse c2
\<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < inverse c2
\<forall>\<^sub>F x in F. norm (inverse (f x)) \<le> inverse c2 * norm (inverse (g x))

goal (1 subgoal):
 1. (\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))
[PROOF STEP]
by (rule landau_o.bigI)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?f \<in> \<Theta>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?f \<in> \<Theta>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?f \<in> \<Theta>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))
[PROOF STEP]
unfolding bigtheta_def
[PROOF STATE]
proof (prove)
using this:
?f \<in> O[?F](?g) \<inter> \<Omega>[?F](?g) \<Longrightarrow> (\<lambda>x. inverse (?f x)) \<in> O[?F](\<lambda>x. inverse (?g x))

goal (1 subgoal):
 1. ((\<lambda>x. inverse (f x)) \<in> O[F](\<lambda>x. inverse (g x)) \<inter> \<Omega>[F](\<lambda>x. inverse (g x))) = (f \<in> O[F](g) \<inter> \<Omega>[F](g))
[PROOF STEP]
by (force simp: bigomega_iff_bigo bigtheta_sym)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. inverse (f x)) \<in> \<Theta>[F](\<lambda>x. inverse (g x))) = (f \<in> \<Theta>[F](g))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reflexivity: "refl_on carrier relation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on carrier relation
[PROOF STEP]
using preorder_on_def trans_refl
[PROOF STATE]
proof (prove)
using this:
preorder_on ?A ?r \<equiv> refl_on ?A ?r \<and> trans ?r
preorder_on carrier relation

goal (1 subgoal):
 1. refl_on carrier relation
[PROOF STEP]
by blast


[STATEMENT]
lemma add_left_zero: "0 + a = (a::'a::comm_monoid_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) + a = a
[PROOF STEP]
by simp


[STATEMENT]
theorem max_flow_min_cut_bounded:
  "\<exists>f S. flow \<Delta> f \<and> cut \<Delta> S \<and> orthogonal \<Delta> f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
interpret \<Delta>': bounded_countable_network \<Delta>'''
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_countable_network \<Delta>'''
[PROOF STEP]
by(rule \<Delta>'''_bounded_countable_network)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
have "\<exists>f S. flow \<Delta>''' f \<and> cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S
[PROOF STEP]
by(rule \<Delta>'.max_flow_min_cut'''_bounded) auto
[PROOF STATE]
proof (state)
this:
\<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S

goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S
[PROOF STEP]
obtain f S where f: "flow \<Delta>''' f" and cut: "cut \<Delta>''' S" and ortho: "orthogonal \<Delta>''' f S"
[PROOF STATE]
proof (prove)
using this:
\<exists>f S. flow \<Delta>''' f \<and> MFMC_Network.cut \<Delta>''' S \<and> orthogonal \<Delta>''' f S

goal (1 subgoal):
 1. (\<And>f S. \<lbrakk>flow \<Delta>''' f; MFMC_Network.cut \<Delta>''' S; orthogonal \<Delta>''' f S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
flow \<Delta>''' f
MFMC_Network.cut \<Delta>''' S
orthogonal \<Delta>''' f S

goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
from flow_\<Delta>'''[OF this]
[PROOF STATE]
proof (chain)
picking this:
flow \<Delta> f
MFMC_Network.cut \<Delta> S
orthogonal \<Delta> f S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
flow \<Delta> f
MFMC_Network.cut \<Delta> S
orthogonal \<Delta> f S

goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_igba_impl_rel_sv[relator_props]:
  "\<lbrakk>single_valued Rl; single_valued Rm\<rbrakk>
  \<Longrightarrow> single_valued (\<langle>Rm,Rl\<rangle>gen_igba_impl_rel_eext)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rl; single_valued Rm\<rbrakk> \<Longrightarrow> single_valued (\<langle>Rm, Rl\<rangle>gen_igba_impl_rel_eext)
[PROOF STEP]
unfolding gen_igba_impl_rel_eext_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>single_valued Rl; single_valued Rm\<rbrakk> \<Longrightarrow> single_valued {(\<lparr>igbai_L = Li, \<dots> = mi\<rparr>, \<lparr>igba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}
[PROOF STEP]
apply (rule single_valuedI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>single_valued Rl; single_valued Rm; (x, y) \<in> {(\<lparr>igbai_L = Li, \<dots> = mi\<rparr>, \<lparr>igba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}; (x, z) \<in> {(\<lparr>igbai_L = Li, \<dots> = mi\<rparr>, \<lparr>igba_L = L, \<dots> = m\<rparr>) |Li mi L m. (Li, L) \<in> Rl \<and> (mi, m) \<in> Rm}\<rbrakk> \<Longrightarrow> y = z
[PROOF STEP]
apply (clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> L = La \<and> m = ma
[PROOF STEP]
apply (intro conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> L = La
 2. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> m = ma
[PROOF STEP]
apply (rule single_valuedD[rotated], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>Lia mia L m La ma. \<lbrakk>single_valued Rl; single_valued Rm; (Lia, L) \<in> Rl; (mia, m) \<in> Rm; (Lia, La) \<in> Rl; (mia, ma) \<in> Rm\<rbrakk> \<Longrightarrow> m = ma
[PROOF STEP]
apply (rule single_valuedD[rotated], assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done