[STATEMENT]
lemma multiply_by_add_tc: "VARS m s a b
  [a=A \<and> b=B]
  m := 0; s := 0;
  WHILE m\<noteq>a
  INV {s=m*b \<and> a=A \<and> b=B \<and> m\<le>a}
  VAR {a-m}
  DO s := s+b; m := m+(1::nat) OD
  [s = A*B]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [a = A \<and> b = B]
m := 0; s := 0; WHILE m \<noteq> a INV {s = m * b \<and> a = A \<and> b = B \<and> m \<le> a}  VAR {a - m}
DO s := s + b; m := m + 1 OD
[s = A * B]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. m \<le> A \<and> m \<noteq> A \<Longrightarrow> A - Suc m < A - m
[PROOF STEP]
by auto


[STATEMENT]
lemma single_addition_neg:"\<lbrakk>commute_bpp f (aug_pm_set z i {(a::'a)});
      assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f;
      ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a});
      zeroA z i f {a} z; (n::int) < 0; (m::int) < 0 \<rbrakk> \<Longrightarrow>
           (n\<Odot>a\<^bsub>f,i,z\<^esub>) \<^sub>f+ (m\<Odot>a\<^bsub>f,i,z\<^esub>) = (n + m)\<Odot>a\<^bsub>f,i,z\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>commute_bpp f (aug_pm_set z i {a}); assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z; n < 0; m < 0\<rbrakk> \<Longrightarrow> n\<Odot>a\<^bsub>f,i,z\<^esub> \<^sub>f+ m\<Odot>a\<^bsub>f,i,z\<^esub> = (n + m)\<Odot>a\<^bsub>f,i,z\<^esub>
[PROOF STEP]
apply (simp add:fg_elem_single_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i {a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {a}); zeroA z i f {a} z; n < 0; m < 0\<rbrakk> \<Longrightarrow> (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - m - 1)))
[PROOF STEP]
apply (simp del:add_set_Suc add:aug_pm_aug_pm_minus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0\<rbrakk> \<Longrightarrow> (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - m - 1)))
[PROOF STEP]
apply (frule ipp_cond1_minus[of "a" "i"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0; ipp_cond1 {\<^sub>i- a} i\<rbrakk> \<Longrightarrow> (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - m - 1)))
[PROOF STEP]
apply (frule ipp_cond2_minus[of "a" "i" "z" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0; ipp_cond1 {\<^sub>i- a} i; ipp_cond2 z {\<^sub>i- a} i f\<rbrakk> \<Longrightarrow> (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - m - 1)))
[PROOF STEP]
apply (frule inv_ipp_minus[of "a" "i" "z" "f"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0; ipp_cond1 {\<^sub>i- a} i; ipp_cond2 z {\<^sub>i- a} i f; inv_ipp z i f {\<^sub>i- a}\<rbrakk> \<Longrightarrow> (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - m - 1)))
[PROOF STEP]
apply (frule zeroA_minus[of "a" "i" "z" "f" "z"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0; ipp_cond1 {\<^sub>i- a} i; ipp_cond2 z {\<^sub>i- a} i f; inv_ipp z i f {\<^sub>i- a}; zeroA z i f {\<^sub>i- a} z\<rbrakk> \<Longrightarrow> (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - m - 1)))
[PROOF STEP]
apply (frule single_addition_posTr [of f z i "\<^sub>i- a" "- n" "- m"], assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0; ipp_cond1 {\<^sub>i- a} i; ipp_cond2 z {\<^sub>i- a} i f; inv_ipp z i f {\<^sub>i- a}; zeroA z i f {\<^sub>i- a} z\<rbrakk> \<Longrightarrow> 0 < - n
 2. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0; ipp_cond1 {\<^sub>i- a} i; ipp_cond2 z {\<^sub>i- a} i f; inv_ipp z i f {\<^sub>i- a}; zeroA z i f {\<^sub>i- a} z\<rbrakk> \<Longrightarrow> 0 < - m
 3. \<lbrakk>assoc_bpp (aug_pm_set z i {\<^sub>i- a}) f; ipp_cond1 {a} i; ipp_cond2 z {a} i f; ipp_cond3 z i; inv_ipp z i f {a}; commute_bpp f (aug_pm_set z i {\<^sub>i- a}); zeroA z i f {a} z; n < 0; m < 0; ipp_cond1 {\<^sub>i- a} i; ipp_cond2 z {\<^sub>i- a} i f; inv_ipp z i f {\<^sub>i- a}; zeroA z i f {\<^sub>i- a} z; (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n + - m - 1)))\<rbrakk> \<Longrightarrow> (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - 1))) \<^sub>f+ (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- m - 1))) = (THE x. x \<in> add_set f {\<^sub>i- a} (nat (- n - m - 1)))
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(x::real) > 1 \<and> y > 1 \<longrightarrow> x * y > x + y - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < x \<and> 1 < y \<longrightarrow> x + y - 1 < x * y
[PROOF STEP]
by (sos "((((A<0 * A<1) * R<1) + ((A<=0 * R<1) * (R<1 * [1]^2))))")


[STATEMENT]
lemma (in cring)
  assumes "x \<in> carrier R" "y \<in> carrier R"
  shows "(x \<ominus> y) [^] (2::nat) = x [^] (2::nat) \<oplus> y [^] (2::nat) \<ominus> \<guillemotleft>2\<guillemotright> \<otimes> x \<otimes> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<ominus> y) [^] 2 = x [^] 2 \<oplus> y [^] 2 \<ominus> \<guillemotleft>2\<guillemotright> \<otimes> x \<otimes> y
[PROOF STEP]
by ring


[STATEMENT]
lemma DeMoivre: "(cos z + \<i> * sin z) ^ n = cos(n * z) + \<i> * sin(n * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cos z + \<i> * sin z) ^ n = cos (of_nat n * z) + \<i> * sin (of_nat n * z)
[PROOF STEP]
by (metis exp_Euler [symmetric] exp_of_nat_mult mult.left_commute)


[STATEMENT]
lemma p_gt_1: "p > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
using p_ge_18
[PROOF STATE]
proof (prove)
using this:
18 \<le> p

goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
by simp


[STATEMENT]
lemma setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t_suffix_subset:
  "setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t B \<subseteq> setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t (A@B)"
  "setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t (proj n B) \<subseteq> setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t (proj n (A@B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t B \<subseteq> setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t (A @ B) &&& setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t (proj n B) \<subseteq> setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t (proj n (A @ B))
[PROOF STEP]
unfolding proj_def setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t\<^sub>p ` set B) \<subseteq> \<Union> (setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t\<^sub>p ` set (A @ B)) &&& \<Union> (setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t\<^sub>p ` set (filter (\<lambda>s. has_LabelN n s \<or> has_LabelS s) B)) \<subseteq> \<Union> (setops\<^sub>l\<^sub>s\<^sub>s\<^sub>t\<^sub>p ` set (filter (\<lambda>s. has_LabelN n s \<or> has_LabelS s) (A @ B)))
[PROOF STEP]
by auto


[STATEMENT]
lemma count_space_PiM_finite:
  fixes B :: "'a \<Rightarrow> 'b set"
  assumes "finite A" "\<And>i. countable (B i)"
  shows   "PiM A (\<lambda>i. count_space (B i)) = count_space (PiE A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>M A (\<lambda>i. count_space (B i)) = count_space (Pi\<^sub>E A B)
[PROOF STEP]
proof (rule measure_eqI_countable')
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. space (Pi\<^sub>M A (\<lambda>i. count_space (B i))) = ?A
 2. space (count_space (Pi\<^sub>E A B)) = ?A
 3. \<And>x. x \<in> ?A \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 4. \<And>x. x \<in> ?A \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 5. countable ?A
 6. \<And>a. a \<in> ?A \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
show "space (PiM A (\<lambda>i. count_space (B i))) = PiE A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (Pi\<^sub>M A (\<lambda>i. count_space (B i))) = Pi\<^sub>E A B
[PROOF STEP]
by (simp add: space_PiM)
[PROOF STATE]
proof (state)
this:
space (Pi\<^sub>M A (\<lambda>i. count_space (B i))) = Pi\<^sub>E A B

goal (5 subgoals):
 1. space (count_space (Pi\<^sub>E A B)) = Pi\<^sub>E A B
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 3. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 4. countable (Pi\<^sub>E A B)
 5. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
show "space (count_space (PiE A B)) = PiE A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (count_space (Pi\<^sub>E A B)) = Pi\<^sub>E A B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
space (count_space (Pi\<^sub>E A B)) = Pi\<^sub>E A B

goal (4 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 3. countable (Pi\<^sub>E A B)
 4. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 3. countable (Pi\<^sub>E A B)
 4. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 3. countable (Pi\<^sub>E A B)
 4. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
assume f: "f \<in> PiE A B"
[PROOF STATE]
proof (state)
this:
f \<in> Pi\<^sub>E A B

goal (4 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 3. countable (Pi\<^sub>E A B)
 4. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
hence "PiE A (\<lambda>x. {f x}) \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))"
[PROOF STATE]
proof (prove)
using this:
f \<in> Pi\<^sub>E A B

goal (1 subgoal):
 1. (\<Pi>\<^sub>E x\<in>A. {f x}) \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
[PROOF STEP]
by (intro sets_PiM_I_finite assms) auto
[PROOF STATE]
proof (state)
this:
(\<Pi>\<^sub>E x\<in>A. {f x}) \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))

goal (4 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 3. countable (Pi\<^sub>E A B)
 4. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Pi>\<^sub>E x\<in>A. {f x}) \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))

goal (4 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 3. countable (Pi\<^sub>E A B)
 4. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
f \<in> Pi\<^sub>E A B
[PROOF STEP]
have "PiE A (\<lambda>x. {f x}) = {f}"
[PROOF STATE]
proof (prove)
using this:
f \<in> Pi\<^sub>E A B

goal (1 subgoal):
 1. (\<Pi>\<^sub>E x\<in>A. {f x}) = {f}
[PROOF STEP]
by (intro PiE_singleton) (auto simp: PiE_def)
[PROOF STATE]
proof (state)
this:
(\<Pi>\<^sub>E x\<in>A. {f x}) = {f}

goal (4 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
 2. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 3. countable (Pi\<^sub>E A B)
 4. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
{f} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
[PROOF STEP]
show "{f} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))"
[PROOF STATE]
proof (prove)
using this:
{f} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))

goal (1 subgoal):
 1. {f} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
{f} \<in> sets (Pi\<^sub>M A (\<lambda>i. count_space (B i)))

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
interpret product_sigma_finite "(\<lambda>i. count_space (B i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (\<lambda>i. count_space (B i))
[PROOF STEP]
by (intro product_sigma_finite.intro sigma_finite_measure_count_space_countable assms)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
thm sigma_finite_measure_count_space
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
assume f: "f \<in> PiE A B"
[PROOF STATE]
proof (state)
this:
f \<in> Pi\<^sub>E A B

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
hence "{f} = PiE A (\<lambda>x. {f x})"
[PROOF STATE]
proof (prove)
using this:
f \<in> Pi\<^sub>E A B

goal (1 subgoal):
 1. {f} = (\<Pi>\<^sub>E x\<in>A. {f x})
[PROOF STEP]
by (intro PiE_singleton [symmetric]) (auto simp: PiE_def)
[PROOF STATE]
proof (state)
this:
{f} = (\<Pi>\<^sub>E x\<in>A. {f x})

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{f} = (\<Pi>\<^sub>E x\<in>A. {f x})

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
have "emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) \<dots> =
               (\<Prod>i\<in>A. emeasure (count_space (B i)) {f i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) (\<Pi>\<^sub>E x\<in>A. {f x}) = (\<Prod>i\<in>A. emeasure (count_space (B i)) {f i})
[PROOF STEP]
using f assms
[PROOF STATE]
proof (prove)
using this:
f \<in> Pi\<^sub>E A B
finite A
countable (B ?i)

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) (\<Pi>\<^sub>E x\<in>A. {f x}) = (\<Prod>i\<in>A. emeasure (count_space (B i)) {f i})
[PROOF STEP]
by (subst emeasure_PiM) auto
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) (\<Pi>\<^sub>E x\<in>A. {f x}) = (\<Prod>i\<in>A. emeasure (count_space (B i)) {f i})

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) (\<Pi>\<^sub>E x\<in>A. {f x}) = (\<Prod>i\<in>A. emeasure (count_space (B i)) {f i})

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
have "\<dots> = (\<Prod>i\<in>A. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>A. emeasure (count_space (B i)) {f i}) = (\<Prod>i\<in>A. 1)
[PROOF STEP]
by (intro prod.cong refl, subst emeasure_count_space_finite) (use f in auto)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>A. emeasure (count_space (B i)) {f i}) = (\<Prod>i\<in>A. 1)

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>A. emeasure (count_space (B i)) {f i}) = (\<Prod>i\<in>A. 1)

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
have "\<dots> = emeasure (count_space (PiE A B)) {f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>A. 1) = emeasure (count_space (Pi\<^sub>E A B)) {f}
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
f \<in> Pi\<^sub>E A B

goal (1 subgoal):
 1. (\<Prod>i\<in>A. 1) = emeasure (count_space (Pi\<^sub>E A B)) {f}
[PROOF STEP]
by (subst emeasure_count_space_finite) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>A. 1) = emeasure (count_space (Pi\<^sub>E A B)) {f}

goal (3 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
 3. \<And>a. a \<in> Pi\<^sub>E A B \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {a} = emeasure (count_space (Pi\<^sub>E A B)) {a}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {f} = emeasure (count_space (Pi\<^sub>E A B)) {f}
[PROOF STEP]
show "emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {f} =
                  emeasure (count_space (Pi\<^sub>E A B)) {f}"
[PROOF STATE]
proof (prove)
using this:
emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {f} = emeasure (count_space (Pi\<^sub>E A B)) {f}

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {f} = emeasure (count_space (Pi\<^sub>E A B)) {f}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M A (\<lambda>i. count_space (B i))) {f} = emeasure (count_space (Pi\<^sub>E A B)) {f}

goal (2 subgoals):
 1. \<And>x. x \<in> Pi\<^sub>E A B \<Longrightarrow> {x} \<in> sets (count_space (Pi\<^sub>E A B))
 2. countable (Pi\<^sub>E A B)
[PROOF STEP]
qed (simp_all add: countable_PiE assms)


[STATEMENT]
lemma n0: "n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
using d0 dn
[PROOF STATE]
proof (prove)
using this:
0 < d
d \<le> n

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by auto


[STATEMENT]
lemma boffa_aux2:
  "conway_assm1 x \<Longrightarrow>
  \<Sum>{x\<^bsub>i\<^esub>\<cdot>x\<^bsub>j \<^esub>| i j. i \<in> UNIV \<and> j \<in> UNIV} \<le> \<Sum>{x\<^bsub>i\<cdot>j\<^esub> | i j. i \<in> UNIV \<and> j \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conway_assm1 x \<Longrightarrow> \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} \<le> \<Sum> {x\<^bsub>i \<cdot> j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}
[PROOF STEP]
unfolding conway_assm1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> \<le> x\<^bsub>i \<cdot> j\<^esub> \<Longrightarrow> \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} \<le> \<Sum> {x\<^bsub>i \<cdot> j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}
[PROOF STEP]
using [[simproc add: finite_Collect]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> \<le> x\<^bsub>i \<cdot> j\<^esub> \<Longrightarrow> \<Sum> {x\<^bsub>i\<^esub> \<cdot> x\<^bsub>j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV} \<le> \<Sum> {x\<^bsub>i \<cdot> j\<^esub> |i j. i \<in> UNIV \<and> j \<in> UNIV}
[PROOF STEP]
by force


[STATEMENT]
lemma gen_boolean_algebra_generators:
  assumes "\<And>b. b \<in> B \<Longrightarrow> b \<subseteq> S"
  assumes "b \<in> B"
  shows "b \<in> gen_boolean_algebra S B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> gen_boolean_algebra S B
[PROOF STEP]
unfolding gen_boolean_algebra.simps[of b]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = S \<or> (\<exists>A. b = A \<inter> S \<and> A \<in> B) \<or> (\<exists>A C. b = A \<union> C \<and> A \<in> gen_boolean_algebra S B \<and> C \<in> gen_boolean_algebra S B) \<or> (\<exists>A. b = S - A \<and> A \<in> gen_boolean_algebra S B)
[PROOF STEP]
using assms(1)[of b] assms(2)
[PROOF STATE]
proof (prove)
using this:
b \<in> B \<Longrightarrow> b \<subseteq> S
b \<in> B

goal (1 subgoal):
 1. b = S \<or> (\<exists>A. b = A \<inter> S \<and> A \<in> B) \<or> (\<exists>A C. b = A \<union> C \<and> A \<in> gen_boolean_algebra S B \<and> C \<in> gen_boolean_algebra S B) \<or> (\<exists>A. b = S - A \<and> A \<in> gen_boolean_algebra S B)
[PROOF STEP]
by blast


[STATEMENT]
lemma partially_ordered_set_cong:
  assumes r: "\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> r a b \<longleftrightarrow> r' a b"
  shows "partially_ordered_set A r \<longleftrightarrow> partially_ordered_set A r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partially_ordered_set A r = partially_ordered_set A r'
[PROOF STEP]
by (simp add: partially_ordered_set_def r cong: reflexive_cong antisymmetric_cong transitive_cong)


[STATEMENT]
lemma mono_mult2_s:
  assumes "ns \<subseteq> ns'" "s \<subseteq> s'" shows "mult2_s ns s \<subseteq> mult2_s ns' s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult2_s ns s \<subseteq> mult2_s ns' s'
[PROOF STEP]
using mono_multpw[OF assms(1)] mono_mult[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
multpw ns \<subseteq> multpw ns'
mult s \<subseteq> mult s'

goal (1 subgoal):
 1. mult2_s ns s \<subseteq> mult2_s ns' s'
[PROOF STEP]
unfolding mult2_s_def
[PROOF STATE]
proof (prove)
using this:
multpw ns \<subseteq> multpw ns'
mult s \<subseteq> mult s'

goal (1 subgoal):
 1. multpw ns O mult s \<subseteq> multpw ns' O mult s'
[PROOF STEP]
by auto


[STATEMENT]
lemma list_all2_in_setE: "list_all2 P xs ys \<Longrightarrow> x \<in> set xs \<Longrightarrow> (\<And>y. y \<in> set ys \<Longrightarrow> P x y \<Longrightarrow> Q) \<Longrightarrow> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>list_all2 P xs ys; x \<in> set xs; \<And>y. \<lbrakk>y \<in> set ys; P x y\<rbrakk> \<Longrightarrow> Q\<rbrakk> \<Longrightarrow> Q
[PROOF STEP]
by (fastforce simp: list_all2_iff set_zip in_set_conv_nth)


[STATEMENT]
lemma poly_pseudo_mod:
  assumes "poly q x=0" "q\<noteq>0"
  shows "poly (pseudo_mod p q) x = (lead_coeff q ^ (Suc (degree p) - degree q)) * poly p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
define a where "a=coeff q (degree q) ^ (Suc (degree p) - degree q)"
[PROOF STATE]
proof (state)
this:
a = lead_coeff q ^ (Suc (degree p) - degree q)

goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
obtain f r where fr:"pseudo_divmod p q = (f, r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f r. pseudo_divmod p q = (f, r) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
pseudo_divmod p q = (f, r)

goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pseudo_divmod p q = (f, r)
[PROOF STEP]
have "smult a p = q * f + r" "r = 0 \<or> degree r < degree q"
[PROOF STATE]
proof (prove)
using this:
pseudo_divmod p q = (f, r)

goal (1 subgoal):
 1. smult a p = q * f + r &&& r = 0 \<or> degree r < degree q
[PROOF STEP]
using pseudo_divmod[OF \<open>q\<noteq>0\<close>]
[PROOF STATE]
proof (prove)
using this:
pseudo_divmod p q = (f, r)
pseudo_divmod ?f q = (?q, ?r) \<Longrightarrow> smult (lead_coeff q ^ (Suc (degree ?f) - degree q)) ?f = q * ?q + ?r
pseudo_divmod ?f q = (?q, ?r) \<Longrightarrow> ?r = 0 \<or> degree ?r < degree q

goal (1 subgoal):
 1. smult a p = q * f + r &&& r = 0 \<or> degree r < degree q
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
using this:
pseudo_divmod p q = (f, r)
pseudo_divmod ?f q = (?q, ?r) \<Longrightarrow> smult (lead_coeff q ^ (Suc (degree ?f) - degree q)) ?f = q * ?q + ?r
pseudo_divmod ?f q = (?q, ?r) \<Longrightarrow> ?r = 0 \<or> degree ?r < degree q

goal (1 subgoal):
 1. smult (lead_coeff q ^ (Suc (degree p) - degree q)) p = q * f + r &&& r = 0 \<or> degree r < degree q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
smult a p = q * f + r
r = 0 \<or> degree r < degree q

goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
smult a p = q * f + r
r = 0 \<or> degree r < degree q
[PROOF STEP]
have "poly (q*f+r) x = poly (smult a p) x"
[PROOF STATE]
proof (prove)
using this:
smult a p = q * f + r
r = 0 \<or> degree r < degree q

goal (1 subgoal):
 1. poly (q * f + r) x = poly (smult a p) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (q * f + r) x = poly (smult a p) x

goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly (q * f + r) x = poly (smult a p) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly (q * f + r) x = poly (smult a p) x

goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
using assms(1) fr
[PROOF STATE]
proof (prove)
using this:
poly (q * f + r) x = poly (smult a p) x
poly q x = (0::'a)
pseudo_divmod p q = (f, r)

goal (1 subgoal):
 1. poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
unfolding pseudo_mod_def a_def
[PROOF STATE]
proof (prove)
using this:
poly (q * f + r) x = poly (smult (lead_coeff q ^ (Suc (degree p) - degree q)) p) x
poly q x = (0::'a)
pseudo_divmod p q = (f, r)

goal (1 subgoal):
 1. poly (snd (pseudo_divmod p q)) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (pseudo_mod p q) x = lead_coeff q ^ (Suc (degree p) - degree q) * poly p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Worder) ord_isom_Pre2:"\<lbrakk>Worder E; a \<in> carrier D; ExPre D a;
       ord_isom D E f\<rbrakk> \<Longrightarrow> f (Pre D a) = Pre E (f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder E; a \<in> carrier D; ExPre D a; ord_isom D E f\<rbrakk> \<Longrightarrow> f (Pre D a) = Pre E (f a)
[PROOF STEP]
apply (frule_tac E = E and a = a and f = f in ord_isom_Pre1, assumption+,
       frule_tac a = a in Pre_element, assumption+, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder E; a \<in> carrier D; ExPre D a; ord_isom D E f; ExPre E (f a); Pre D a \<in> carrier D; Pre D a \<prec> a; \<not> (\<exists>y\<in>carrier D. Pre D a \<prec> y \<and> y \<prec> a)\<rbrakk> \<Longrightarrow> f (Pre D a) = Pre E (f a)
[PROOF STEP]
apply (frule Worder.Order[of "E"],
        frule  ord_isom_mem[of "E" "f" "a"], assumption+,
        frule  ord_isom_mem[of "E" "f" "Pre D a"], assumption+,
        simp add:ord_isom_less[of "E" "f" "Pre D a" "a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder E; a \<in> carrier D; ExPre D a; ord_isom D E f; ExPre E (f a); Pre D a \<in> carrier D; f (Pre D a) \<prec>\<^bsub>E\<^esub> f a; \<forall>y\<in>carrier D. Pre D a \<prec> y \<longrightarrow> \<not> y \<prec> a; Order E; f a \<in> carrier E; f (Pre D a) \<in> carrier E\<rbrakk> \<Longrightarrow> f (Pre D a) = Pre E (f a)
[PROOF STEP]
apply (simp add:ord_isom_convert[of E f "Pre D a" a])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Worder E; a \<in> carrier D; ExPre D a; ord_isom D E f; ExPre E (f a); Pre D a \<in> carrier D; f (Pre D a) \<prec>\<^bsub>E\<^esub> f a; \<forall>z\<in>carrier E. f (Pre D a) \<prec>\<^bsub>E\<^esub> z \<longrightarrow> \<not> z \<prec>\<^bsub>E\<^esub> f a; Order E; f a \<in> carrier E; f (Pre D a) \<in> carrier E\<rbrakk> \<Longrightarrow> f (Pre D a) = Pre E (f a)
[PROOF STEP]
apply (rule Worder.UniquePre[THEN sym, of "E" "f a" "f (Pre D a)"],
        assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma balance_left_inv2_app:
  assumes "inv2 lt" "inv2 rt" "bheight lt + 1 = bheight rt" "color_of rt = B"
  shows "inv2 (balance_left lt k v rt)"
        "bheight (balance_left lt k v rt) = bheight rt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv2 (balance_left lt k v rt) &&& bheight (balance_left lt k v rt) = bheight rt
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inv2 lt
inv2 rt
bheight lt + 1 = bheight rt
color_of rt = B

goal (1 subgoal):
 1. inv2 (balance_left lt k v rt) &&& bheight (balance_left lt k v rt) = bheight rt
[PROOF STEP]
by (induct lt k v rt rule: balance_left.induct) (auto simp add: balance_inv2 balance_bheight)+


[STATEMENT]
lemma norm_\<P>\<^sub>L_le_one: "norm (\<P>\<^sub>L d) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<P>\<^sub>L d) \<le> 1
[PROOF STEP]
using norm_\<P>\<^sub>L_le norm_\<P>\<^sub>1
[PROOF STATE]
proof (prove)
using this:
norm (\<P>\<^sub>L ?d) \<le> norm (\<P>\<^sub>1 (mk_dec_det ?d))
norm (\<P>\<^sub>1 ?d) = 1

goal (1 subgoal):
 1. norm (\<P>\<^sub>L d) \<le> 1
[PROOF STEP]
by auto


[STATEMENT]
lemma nth_delete_index:
  "i < length xs \<Longrightarrow> n < length xs \<Longrightarrow>
     delete_index n xs ! i = (if i < n then xs ! i else xs ! Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; n < length xs\<rbrakk> \<Longrightarrow> delete_index n xs ! i = (if i < n then xs ! i else xs ! Suc i)
[PROOF STEP]
by (auto simp: delete_index_altdef nth_append min_def)


[STATEMENT]
lemma nth_append_take:
  assumes "i \<le> length xs" shows "(take i xs @ y#ys)!i = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take i xs @ y # ys) ! i = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (take i xs @ y # ys) ! i = y
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
i \<le> length xs
[PROOF STEP]
have a: "length(take i xs) = i"
[PROOF STATE]
proof (prove)
using this:
i \<le> length xs

goal (1 subgoal):
 1. length (take i xs) = i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (take i xs) = i

goal (1 subgoal):
 1. (take i xs @ y # ys) ! i = y
[PROOF STEP]
have "(take i xs @ y#ys)!(length(take i xs)) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take i xs @ y # ys) ! length (take i xs) = y
[PROOF STEP]
by (rule nth_append_length)
[PROOF STATE]
proof (state)
this:
(take i xs @ y # ys) ! length (take i xs) = y

goal (1 subgoal):
 1. (take i xs @ y # ys) ! i = y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(take i xs @ y # ys) ! length (take i xs) = y

goal (1 subgoal):
 1. (take i xs @ y # ys) ! i = y
[PROOF STEP]
unfolding a
[PROOF STATE]
proof (prove)
using this:
(take i xs @ y # ys) ! i = y

goal (1 subgoal):
 1. (take i xs @ y # ys) ! i = y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(take i xs @ y # ys) ! i = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma banach':
  fixes C :: "'b :: complete_space \<Rightarrow> 'b"
  assumes "is_contraction C"
  shows "\<exists>!v. C v = v" "\<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!v. C v = v &&& (\<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
obtain v where C: "C v = v" "\<forall>v'. C v' = v' \<longrightarrow> v' = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. \<lbrakk>C v = v; \<forall>v'. C v' = v' \<longrightarrow> v' = v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms is_contraction_def banach_fix_type)
[PROOF STATE]
proof (state)
this:
C v = v
\<forall>v'. C v' = v' \<longrightarrow> v' = v

goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
obtain l where cont: "dist (C v) (C u) \<le> l * dist v u" "0 \<le> l" "l < 1" for v u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>l. \<lbrakk>\<And>v u. dist (C v) (C u) \<le> l * dist v u; 0 \<le> l; l < 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms is_contraction_def
[PROOF STATE]
proof (prove)
using this:
is_contraction C
is_contraction ?C \<equiv> \<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (?C v) (?C u) \<le> l * dist v u)

goal (1 subgoal):
 1. (\<And>l. \<lbrakk>\<And>v u. dist (C v) (C u) \<le> l * dist v u; 0 \<le> l; l < 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dist (C ?v) (C ?u) \<le> l * dist ?v ?u
0 \<le> l
l < 1

goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
have *: "\<And>n v0. dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n v0. dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n v0. dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v
[PROOF STEP]
fix n v0
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n v0. dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v
[PROOF STEP]
show "dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dist ((C ^^ 0) v0) v \<le> l ^ 0 * dist v0 v
 2. \<And>n. dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v \<Longrightarrow> dist ((C ^^ Suc n) v0) v \<le> l ^ Suc n * dist v0 v
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v

goal (2 subgoals):
 1. dist ((C ^^ 0) v0) v \<le> l ^ 0 * dist v0 v
 2. \<And>n. dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v \<Longrightarrow> dist ((C ^^ Suc n) v0) v \<le> l ^ Suc n * dist v0 v
[PROOF STEP]
thus "dist ((C ^^ Suc n) v0) v \<le> l ^ Suc n * dist v0 v"
[PROOF STATE]
proof (prove)
using this:
dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v

goal (1 subgoal):
 1. dist ((C ^^ Suc n) v0) v \<le> l ^ Suc n * dist v0 v
[PROOF STEP]
using \<open>0 \<le> l\<close>
[PROOF STATE]
proof (prove)
using this:
dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v
0 \<le> l

goal (1 subgoal):
 1. dist ((C ^^ Suc n) v0) v \<le> l ^ Suc n * dist v0 v
[PROOF STEP]
by (subst C(1)[symmetric])
          (auto simp: algebra_simps intro!: order_trans[OF cont(1)] mult_left_mono)
[PROOF STATE]
proof (state)
this:
dist ((C ^^ Suc n) v0) v \<le> l ^ Suc n * dist v0 v

goal (1 subgoal):
 1. dist ((C ^^ 0) v0) v \<le> l ^ 0 * dist v0 v
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
dist ((C ^^ n) v0) v \<le> l ^ n * dist v0 v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dist ((C ^^ ?n) ?v0.0) v \<le> l ^ ?n * dist ?v0.0 v

goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
have "(\<lambda>n. l ^ n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (^) l \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: LIMSEQ_realpow_zero \<open>0 \<le> l\<close> \<open>l < 1\<close>)
[PROOF STATE]
proof (state)
this:
(^) l \<longlonglongrightarrow> 0

goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
hence "\<And>v0. (\<lambda>n. l ^ n * dist v0 v) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(^) l \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<And>v0. (\<lambda>n. l ^ n * dist v0 v) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: tendsto_mult_left_zero)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. l ^ n * dist ?v0.0 v) \<longlonglongrightarrow> 0

goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
hence "(\<lambda>n. dist ((C ^^ n) v0) v) \<longlonglongrightarrow> 0" for v0
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. l ^ n * dist ?v0.0 v) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. dist ((C ^^ n) v0) v) \<longlonglongrightarrow> 0
[PROOF STEP]
using * order_trans abs_ge_self
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. l ^ n * dist ?v0.0 v) \<longlonglongrightarrow> 0
dist ((C ^^ ?n) ?v0.0) v \<le> l ^ ?n * dist ?v0.0 v
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z
?a \<le> \<bar>?a\<bar>

goal (1 subgoal):
 1. (\<lambda>n. dist ((C ^^ n) v0) v) \<longlonglongrightarrow> 0
[PROOF STEP]
by (subst Limits.tendsto_0_le[of "(\<lambda>n. l ^ n * dist v0 v)" _ _ 1])
        (fastforce intro!: eventuallyI)+
[PROOF STATE]
proof (state)
this:
(\<lambda>n. dist ((C ^^ n) ?v0.0) v) \<longlonglongrightarrow> 0

goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
hence "\<And>v0. (\<lambda>n. (C ^^ n) v0) \<longlonglongrightarrow> v"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. dist ((C ^^ n) ?v0.0) v) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<And>v0. (\<lambda>n. (C ^^ n) v0) \<longlonglongrightarrow> v
[PROOF STEP]
using tendsto_dist_iff
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. dist ((C ^^ n) ?v0.0) v) \<longlonglongrightarrow> 0
(?f \<longlongrightarrow> ?l) ?F = ((\<lambda>x. dist (?f x) ?l) \<longlongrightarrow> 0) ?F

goal (1 subgoal):
 1. \<And>v0. (\<lambda>n. (C ^^ n) v0) \<longlonglongrightarrow> v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (C ^^ n) ?v0.0) \<longlonglongrightarrow> v

goal (2 subgoals):
 1. \<exists>!v. C v = v
 2. \<And>v. (\<lambda>n. (C ^^ n) v) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
thus "\<And>v0. (\<lambda>n. (C ^^ n) v0) \<longlonglongrightarrow> (THE v. C v = v)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (C ^^ n) ?v0.0) \<longlonglongrightarrow> v

goal (1 subgoal):
 1. \<And>v0. (\<lambda>n. (C ^^ n) v0) \<longlonglongrightarrow> (THE v. C v = v)
[PROOF STEP]
by (metis (mono_tags, lifting) C theI')
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (C ^^ n) ?v0.0) \<longlonglongrightarrow> (THE v. C v = v)

goal (1 subgoal):
 1. \<exists>!v. C v = v
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!v. C v = v
[PROOF STEP]
show "\<exists>!v. C v = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!v. C v = v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_contraction C

goal (1 subgoal):
 1. \<exists>!v. C v = v
[PROOF STEP]
unfolding is_contraction_def
[PROOF STATE]
proof (prove)
using this:
\<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (C v) (C u) \<le> l * dist v u)

goal (1 subgoal):
 1. \<exists>!v. C v = v
[PROOF STEP]
using banach_fix_type
[PROOF STATE]
proof (prove)
using this:
\<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (C v) (C u) \<le> l * dist v u)
\<lbrakk>0 \<le> ?c; ?c < 1; \<forall>x y. dist (?f x) (?f y) \<le> ?c * dist x y\<rbrakk> \<Longrightarrow> \<exists>!x. ?f x = x

goal (1 subgoal):
 1. \<exists>!v. C v = v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>!v. C v = v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prv_cnj_mono:
assumes "\<phi>1 \<in> fmla" and "\<phi>2 \<in> fmla" and "\<chi>1 \<in> fmla" and "\<chi>2 \<in> fmla"
assumes "prv (imp \<phi>1 \<chi>1)" and "prv (imp \<phi>2 \<chi>2)"
shows "prv (imp (cnj \<phi>1 \<phi>2) (cnj \<chi>1 \<chi>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (cnj \<phi>1 \<phi>2) (cnj \<chi>1 \<chi>2))
[PROOF STEP]
using assms prv_cnj_imp_mono prv_imp_mp
[PROOF STATE]
proof (prove)
using this:
\<phi>1 \<in> fmla
\<phi>2 \<in> fmla
\<chi>1 \<in> fmla
\<chi>2 \<in> fmla
prv (imp \<phi>1 \<chi>1)
prv (imp \<phi>2 \<chi>2)
\<lbrakk>?\<phi>1.0 \<in> fmla; ?\<phi>2.0 \<in> fmla; ?\<chi>1.0 \<in> fmla; ?\<chi>2.0 \<in> fmla\<rbrakk> \<Longrightarrow> prv (imp (imp ?\<phi>1.0 ?\<chi>1.0) (imp (imp ?\<phi>2.0 ?\<chi>2.0) (imp (cnj ?\<phi>1.0 ?\<phi>2.0) (cnj ?\<chi>1.0 ?\<chi>2.0))))
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; prv (imp ?\<phi> ?\<chi>); prv ?\<phi>\<rbrakk> \<Longrightarrow> prv ?\<chi>

goal (1 subgoal):
 1. prv (imp (cnj \<phi>1 \<phi>2) (cnj \<chi>1 \<chi>2))
[PROOF STEP]
by (metis (mono_tags) cnj prv_prv_imp_trans prv_imp_cnj prv_imp_cnjL prv_imp_cnjR)


[STATEMENT]
lemma sum_negf:
  "sum (%x. - (f x)::'a) A = - sum f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> (\<Sum>x\<in>A. - f x) = - sum f A
 2. infinite A \<Longrightarrow> (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> (\<Sum>x\<in>A. - f x) = - sum f A
 2. infinite A \<Longrightarrow> (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
by (induct set: finite) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. - f x) = - sum f A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite A

goal (1 subgoal):
 1. (\<Sum>x\<in>A. - f x) = - sum f A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. - f x) = - sum f A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma notTerminalNforms: "\<not> terminal subs (f n) \<Longrightarrow> nforms (f n) \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> terminal subs (f n) \<Longrightarrow> nforms (f n) \<noteq> []
[PROOF STEP]
apply(erule contrapos_nn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nforms (f n) = [] \<Longrightarrow> terminal subs (f n)
[PROOF STEP]
apply(erule nformsTerminal)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma remove_vertex_E: "E\<^bsub>remove_vertex x\<^esub> = Restr E (V - {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E\<^bsub>remove_vertex x\<^esub> = Restr E (V - {x})
[PROOF STEP]
unfolding remove_vertex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E\<^bsub>G\<lparr>verts := V - {x}, arcs := Restr E (V - {x})\<rparr>\<^esub> = Restr E (V - {x})
[PROOF STEP]
by simp


[STATEMENT]
lemma while_mult_top:
  "(x * top) \<star> z = z \<squnion> x * top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
have 1: "z \<squnion> x * top \<le> (x * top) \<star> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<squnion> x * top \<le> x * top \<star> z
[PROOF STEP]
by (metis le_supI sup_ge1 while_def while_increasing tarski_top_omega)
[PROOF STATE]
proof (state)
this:
z \<squnion> x * top \<le> x * top \<star> z

goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
have "(x * top) \<star> z = z \<squnion> x * top * ((x * top) \<star> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top * (x * top \<star> z)
[PROOF STEP]
using while_left_unfold
[PROOF STATE]
proof (prove)
using this:
?x \<star> ?y = ?y \<squnion> ?x * (?x \<star> ?y)

goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top * (x * top \<star> z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x * top \<star> z = z \<squnion> x * top * (x * top \<star> z)

goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * top \<star> z = z \<squnion> x * top * (x * top \<star> z)

goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
have "... \<le> z \<squnion> x * top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<squnion> x * top * (x * top \<star> z) \<le> z \<squnion> x * top
[PROOF STEP]
using mult_right_isotone sup_right_isotone top_greatest mult_assoc
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?z * ?x \<le> ?z * ?y
?x \<le> ?y \<Longrightarrow> ?z \<squnion> ?x \<le> ?z \<squnion> ?y
?x \<le> top
?a * ?b * ?c = ?a * (?b * ?c)

goal (1 subgoal):
 1. z \<squnion> x * top * (x * top \<star> z) \<le> z \<squnion> x * top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<squnion> x * top * (x * top \<star> z) \<le> z \<squnion> x * top

goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * top \<star> z \<le> z \<squnion> x * top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x * top \<star> z \<le> z \<squnion> x * top

goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
using 1 order.antisym
[PROOF STATE]
proof (prove)
using this:
x * top \<star> z \<le> z \<squnion> x * top
z \<squnion> x * top \<le> x * top \<star> z
\<lbrakk>?a \<le> ?b; ?b \<le> ?a\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. x * top \<star> z = z \<squnion> x * top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x * top \<star> z = z \<squnion> x * top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upset_set_downset_set_dual: "(`) \<partial> \<circ> \<Up> = \<Down> \<circ> (`) \<partial>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) \<partial> \<circ> \<Up> = \<Down> \<circ> (`) \<partial>
[PROOF STEP]
using downset_set_upset_set_dual
[PROOF STATE]
proof (prove)
using this:
(`) \<partial> \<circ> \<Down> = \<Up> \<circ> (`) \<partial>

goal (1 subgoal):
 1. (`) \<partial> \<circ> \<Up> = \<Down> \<circ> (`) \<partial>
[PROOF STEP]
by (metis (no_types, opaque_lifting) comp_id id_comp image_dual o_assoc)


[STATEMENT]
lemma sqrt_piecewise_C1_differentiable [simp, derivative_intros]:
  assumes f: "f piecewise_C1_differentiable_on S" and fim: "f ` S \<subseteq> {0<..}"
  shows "(\<lambda>x. sqrt (f x)) piecewise_C1_differentiable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sqrt (f x)) piecewise_C1_differentiable_on S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f piecewise_C1_differentiable_on S
f ` S \<subseteq> {0<..}

goal (1 subgoal):
 1. (\<lambda>x. sqrt (f x)) piecewise_C1_differentiable_on S
[PROOF STEP]
unfolding piecewise_C1_differentiable_on_def
[PROOF STATE]
proof (prove)
using this:
continuous_on S f \<and> (\<exists>Sa. finite Sa \<and> f C1_differentiable_on S - Sa)
f ` S \<subseteq> {0<..}

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. sqrt (f x)) \<and> (\<exists>Sa. finite Sa \<and> (\<lambda>x. sqrt (f x)) C1_differentiable_on S - Sa)
[PROOF STEP]
by (fastforce intro!: continuous_intros derivative_intros)


[STATEMENT]
lemma inverse_Real:
  "cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))
[PROOF STEP]
using inverse_real.transfer zero_real.transfer
[PROOF STATE]
proof (prove)
using this:
rel_fun pcr_real pcr_real (\<lambda>X. if vanishes X then \<lambda>n. 0 else (\<lambda>n. inverse (X n))) inverse
pcr_real (\<lambda>n. 0) 0

goal (1 subgoal):
 1. cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))
[PROOF STEP]
unfolding cr_real_eq rel_fun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. cauchy x \<and> Real x = y \<longrightarrow> cauchy (if vanishes x then \<lambda>n. 0 else (\<lambda>n. inverse (x n))) \<and> Real (if vanishes x then \<lambda>n. 0 else (\<lambda>n. inverse (x n))) = inverse y
cauchy (\<lambda>n. 0) \<and> Real (\<lambda>n. 0) = 0

goal (1 subgoal):
 1. cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))
[PROOF STEP]
by (simp split: if_split_asm, metis)


[STATEMENT]
lemma bet2_le2__le2356:
  assumes "Bet A B C" and
    "Bet A' B' C'" and
    "A B Le A' B'" and
    "A' C' Le A C"
  shows "B' C' Le B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B' C' Le B C
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> B' C' Le B C
 2. \<not> ?P \<Longrightarrow> B' C' Le B C
[PROOF STEP]
assume "A = B"
[PROOF STATE]
proof (state)
this:
A = B

goal (2 subgoals):
 1. ?P \<Longrightarrow> B' C' Le B C
 2. \<not> ?P \<Longrightarrow> B' C' Le B C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A = B

goal (1 subgoal):
 1. B' C' Le B C
[PROOF STEP]
using assms(1) assms(2) assms(3) assms(4) bet2_le2__le2356_R1
[PROOF STATE]
proof (prove)
using this:
A = B
Bet A B C
Bet A' B' C'
A B Le A' B'
A' C' Le A C
\<lbrakk>Bet ?A ?A ?C; Bet ?A' ?B' ?C'; ?A ?A Le ?A' ?B'; ?A' ?C' Le ?A ?C\<rbrakk> \<Longrightarrow> ?B' ?C' Le ?A ?C

goal (1 subgoal):
 1. B' C' Le B C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B' C' Le B C

goal (1 subgoal):
 1. A \<noteq> B \<Longrightarrow> B' C' Le B C
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<noteq> B \<Longrightarrow> B' C' Le B C
[PROOF STEP]
assume "\<not> A = B"
[PROOF STATE]
proof (state)
this:
A \<noteq> B

goal (1 subgoal):
 1. A \<noteq> B \<Longrightarrow> B' C' Le B C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B

goal (1 subgoal):
 1. B' C' Le B C
[PROOF STEP]
using assms(1) assms(2) assms(3) assms(4) bet2_le2__le2356_R2
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B
Bet A B C
Bet A' B' C'
A B Le A' B'
A' C' Le A C
\<lbrakk>?A \<noteq> ?B; Bet ?A ?B ?C; Bet ?A' ?B' ?C'; ?A ?B Le ?A' ?B'; ?A' ?C' Le ?A ?C\<rbrakk> \<Longrightarrow> ?B' ?C' Le ?B ?C

goal (1 subgoal):
 1. B' C' Le B C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B' C' Le B C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_rtc_2: "1 + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
assume "1 + y \<cdot> y + x \<le> y"
[PROOF STATE]
proof (state)
this:
(1::'a) + y \<cdot> y + x \<le> y

goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "1 \<le> y" and "x \<le> y" and "y \<cdot> y \<le> y"
[PROOF STATE]
proof (prove)
using this:
(1::'a) + y \<cdot> y + x \<le> y

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

goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "y \<le> y \<rightarrow> y" and "x \<le> y \<rightarrow> y"
[PROOF STATE]
proof (prove)
using this:
(1::'a) \<le> y
x \<le> y
y \<cdot> y \<le> y

goal (1 subgoal):
 1. y \<le> y \<rightarrow> y &&& x \<le> y \<rightarrow> y
[PROOF STEP]
using local.order_trans
[PROOF STATE]
proof (prove)
using this:
(1::'a) \<le> y
x \<le> y
y \<cdot> y \<le> y
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. y \<le> y \<rightarrow> y &&& x \<le> y \<rightarrow> y
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
y \<le> y \<rightarrow> y
x \<le> y \<rightarrow> y

goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
y \<le> y \<rightarrow> y
x \<le> y \<rightarrow> y

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>
[PROOF STEP]
by (metis local.join.sup.absorb2 local.star_subdist)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>

goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "x\<^sup>\<star> \<le> y \<rightarrow> y"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> y \<rightarrow> y
[PROOF STEP]
by (metis order_trans right_pure_induction)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> y \<rightarrow> y

goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "y \<cdot> x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>\<star> \<le> y \<rightarrow> y

goal (1 subgoal):
 1. y \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
by (simp add: local.resr_galois)
[PROOF STATE]
proof (state)
this:
y \<cdot> x\<^sup>\<star> \<le> y

goal (1 subgoal):
 1. (1::'a) + y \<cdot> y + x \<le> y \<Longrightarrow> x\<^sup>\<star> \<le> y
[PROOF STEP]
thus "x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
using this:
y \<cdot> x\<^sup>\<star> \<le> y

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> y
[PROOF STEP]
by (metis \<open>1 \<le> y\<close> local.dual_order.trans local.mult_onel local.resl_galois)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma expands_to_squeeze:
  assumes "eventually (\<lambda>x. l x \<le> f x) at_top" "eventually (\<lambda>x. f x \<le> g x) at_top"
          "(l expands_to L) bs" "(g expands_to L) bs"
  shows   "(f expands_to L) bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f expands_to L) bs
[PROOF STEP]
proof (rule expands_to_cong[OF assms(3)])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. l x = f x
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. l x \<le> f x
\<forall>\<^sub>F x in at_top. f x \<le> g x
(l expands_to L) bs
(g expands_to L) bs
[PROOF STEP]
have "eventually (\<lambda>x. eval L x = l x) at_top" "eventually (\<lambda>x. eval L x = g x) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. l x \<le> f x
\<forall>\<^sub>F x in at_top. f x \<le> g x
(l expands_to L) bs
(g expands_to L) bs

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. eval L x = l x &&& \<forall>\<^sub>F x in at_top. eval L x = g x
[PROOF STEP]
by (simp_all add: expands_to.simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. eval L x = l x
\<forall>\<^sub>F x in at_top. eval L x = g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. l x = f x
[PROOF STEP]
with assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. l x \<le> f x
\<forall>\<^sub>F x in at_top. f x \<le> g x
\<forall>\<^sub>F x in at_top. eval L x = l x
\<forall>\<^sub>F x in at_top. eval L x = g x
[PROOF STEP]
show "eventually (\<lambda>x. l x = f x) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. l x \<le> f x
\<forall>\<^sub>F x in at_top. f x \<le> g x
\<forall>\<^sub>F x in at_top. eval L x = l x
\<forall>\<^sub>F x in at_top. eval L x = g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. l x = f x
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. l x = f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigo_imp_conv_radius_ge:
  fixes f g :: "nat \<Rightarrow> 'a :: {banach, real_normed_field}"
  assumes "f \<in> O(g)"
  shows   "conv_radius f \<ge> conv_radius g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
have "conv_radius g = Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius g = Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))}
[PROOF STEP]
by (simp add: conv_radius_conv_Sup')
[PROOF STATE]
proof (state)
this:
conv_radius g = Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))}

goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conv_radius g = Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))}

goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
have "\<dots> \<le> Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))} \<le> Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)}
[PROOF STEP]
proof (rule Sup_subset_mono, safe)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x z. \<lbrakk>\<forall>z. ereal (norm z) < x \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n)); ereal (norm z) < x\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
fix r :: ereal and z :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x z. \<lbrakk>\<forall>z. ereal (norm z) < x \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n)); ereal (norm z) < x\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
assume g: "\<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))"
[PROOF STATE]
proof (state)
this:
\<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>\<forall>z. ereal (norm z) < x \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n)); ereal (norm z) < x\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
assume z: "ereal (norm z) < r"
[PROOF STATE]
proof (state)
this:
ereal (norm z) < r

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>\<forall>z. ereal (norm z) < x \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n)); ereal (norm z) < x\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
from g z
[PROOF STATE]
proof (chain)
picking this:
\<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))
ereal (norm z) < r
[PROOF STEP]
have "summable (\<lambda>n. norm (g n * z ^ n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))
ereal (norm z) < r

goal (1 subgoal):
 1. summable (\<lambda>n. norm (g n * z ^ n))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (g n * z ^ n))

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>\<forall>z. ereal (norm z) < x \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n)); ereal (norm z) < x\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (g n * z ^ n))

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>\<forall>z. ereal (norm z) < x \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n)); ereal (norm z) < x\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
have "(\<lambda>n. norm (f n * z ^ n)) \<in> O(\<lambda>n. norm (g n * z ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. norm (f n * z ^ n)) \<in> O(\<lambda>n. norm (g n * z ^ n))
[PROOF STEP]
unfolding landau_o.big.norm_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f n * z ^ n) \<in> O(\<lambda>n. g n * z ^ n)
[PROOF STEP]
by (intro landau_o.big.mult assms) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. norm (f n * z ^ n)) \<in> O(\<lambda>n. norm (g n * z ^ n))

goal (1 subgoal):
 1. \<And>x z. \<lbrakk>\<forall>z. ereal (norm z) < x \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n)); ereal (norm z) < x\<rbrakk> \<Longrightarrow> summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. norm (g n * z ^ n))
(\<lambda>n. norm (f n * z ^ n)) \<in> O(\<lambda>n. norm (g n * z ^ n))
[PROOF STEP]
show "summable (\<lambda>n. f n * z ^ n)"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (g n * z ^ n))
(\<lambda>n. norm (f n * z ^ n)) \<in> O(\<lambda>n. norm (g n * z ^ n))

goal (1 subgoal):
 1. summable (\<lambda>n. f n * z ^ n)
[PROOF STEP]
by (rule summable_comparison_test_bigo')
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. f n * z ^ n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))} \<le> Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)}

goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. norm (g n * z ^ n))} \<le> Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)}

goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
have "\<dots> = conv_radius f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)} = conv_radius f
[PROOF STEP]
by (simp add: conv_radius_conv_Sup)
[PROOF STATE]
proof (state)
this:
Sup {r. \<forall>z. ereal (norm z) < r \<longrightarrow> summable (\<lambda>n. f n * z ^ n)} = conv_radius f

goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
conv_radius g \<le> conv_radius f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
conv_radius g \<le> conv_radius f

goal (1 subgoal):
 1. conv_radius g \<le> conv_radius f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
conv_radius g \<le> conv_radius f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_mkarr [simp]:
    assumes "Arr t" and "Arr u"
    shows "mkarr t \<otimes> mkarr u = mkarr (t \<^bold>\<otimes> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mkarr t \<otimes> mkarr u = mkarr (t \<^bold>\<otimes> u)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Arr t
Arr u

goal (1 subgoal):
 1. mkarr t \<otimes> mkarr u = mkarr (t \<^bold>\<otimes> u)
[PROOF STEP]
by (meson Tensor_in_tensor arr_char Arr_in_mkarr arr_mkarr arr_tensor)


[STATEMENT]
lemma in_set_suffixes [simp]: "xs \<in> set (suffixes ys) \<longleftrightarrow> suffix xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> set (suffixes ys)) = suffix xs ys
[PROOF STEP]
by (induction ys) (auto simp: suffix_def Cons_eq_append_conv)


[STATEMENT]
lemma plus_MP_oalist [code]: "MP_oalist xs + MP_oalist ys = MP_oalist (OAlist_map2_val_neutr_ntm (\<lambda>_. (+)) xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MP_oalist xs + MP_oalist ys = MP_oalist (OAlist_map2_val_neutr_ntm (\<lambda>_. (+)) xs ys)
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_plus_fun, rule oa_ntm.lookup_map2_val_neutr[symmetric], simp_all)


[STATEMENT]
lemma size_mset_SucE: "size A = Suc n \<Longrightarrow> (\<And>a B. A = {#a#} + B \<Longrightarrow> size B = n \<Longrightarrow> P) \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>size A = Suc n; \<And>a B. \<lbrakk>A = {#a#} + B; size B = n\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (cases A) (auto simp add: ac_simps)


[STATEMENT]
lemma compare_lists_induct [consumes 1, case_names Nil Eq Neq]:
  fixes as bs :: "real list"
  assumes "length as = length bs"
  assumes "P [] []"
  assumes "\<And>a as bs. P as bs \<Longrightarrow> P (a # as) (a # bs)"
  assumes "\<And>a as b bs. a \<noteq> b \<Longrightarrow> P (a # as) (b # bs)"
  shows   "P as bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P as bs
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
length as = length bs

goal (1 subgoal):
 1. P as bs
[PROOF STEP]
proof (induction as bs rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P [] []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; P xs ys\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)
[PROOF STEP]
case (Cons a as b bs)
[PROOF STATE]
proof (state)
this:
length as = length bs
P as bs

goal (2 subgoals):
 1. P [] []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; P xs ys\<rbrakk> \<Longrightarrow> P (x # xs) (y # ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length as = length bs
P as bs

goal (1 subgoal):
 1. P (a # as) (b # bs)
[PROOF STEP]
by (cases "a < b") (auto intro: assms)
[PROOF STATE]
proof (state)
this:
P (a # as) (b # bs)

goal (1 subgoal):
 1. P [] []
[PROOF STEP]
qed (simp_all add: assms)


[STATEMENT]
lemma asymp_equiv_powr_real [asymp_equiv_intros]:
  fixes f g :: "'a \<Rightarrow> real"
  assumes "f \<sim>[F] g" "eventually (\<lambda>x. f x \<ge> 0) F" "eventually (\<lambda>x. g x \<ge> 0) F"
  shows   "(\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
let ?T = "\<lambda>f g x. if f x = 0 \<and> g x = 0 then 1 else f x / g x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
have "((\<lambda>x. ?T f g x powr y) \<longlongrightarrow> 1 powr y) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1 powr y) F
[PROOF STEP]
by (intro tendsto_intros asymp_equivD[OF assms(1)]) simp_all
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1 powr y) F

goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
hence "((\<lambda>x. ?T f g x powr y) \<longlongrightarrow> 1) F"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1 powr y) F

goal (1 subgoal):
 1. ((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1) F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1) F

goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1) F

goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
have "eventually (\<lambda>x. ?T f g x powr y = ?T (\<lambda>x. f x powr y) (\<lambda>x. g x powr y) x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y = (if f x powr y = 0 \<and> g x powr y = 0 then 1 else f x powr y / g x powr y)
[PROOF STEP]
using asymp_equiv_eventually_zeros[OF assms(1)] assms(2,3)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. (f x = 0) = (g x = 0)
\<forall>\<^sub>F x in F. 0 \<le> f x
\<forall>\<^sub>F x in F. 0 \<le> g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y = (if f x powr y = 0 \<and> g x powr y = 0 then 1 else f x powr y / g x powr y)
[PROOF STEP]
by eventually_elim (auto simp: powr_divide)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y = (if f x powr y = 0 \<and> g x powr y = 0 then 1 else f x powr y / g x powr y)

goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1) F
\<forall>\<^sub>F x in F. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y = (if f x powr y = 0 \<and> g x powr y = 0 then 1 else f x powr y / g x powr y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1) F
\<forall>\<^sub>F x in F. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y = (if f x powr y = 0 \<and> g x powr y = 0 then 1 else f x powr y / g x powr y)

goal (1 subgoal):
 1. (\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)
[PROOF STEP]
unfolding asymp_equiv_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y) \<longlongrightarrow> 1) F
\<forall>\<^sub>F x in F. (if f x = 0 \<and> g x = 0 then 1 else f x / g x) powr y = (if f x powr y = 0 \<and> g x powr y = 0 then 1 else f x powr y / g x powr y)

goal (1 subgoal):
 1. ((\<lambda>x. if f x powr y = 0 \<and> g x powr y = 0 then 1 else f x powr y / g x powr y) \<longlongrightarrow> 1) F
[PROOF STEP]
by (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x powr y) \<sim>[F] (\<lambda>x. g x powr y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma shuffle_subset_lists:
  assumes "A \<subseteq> lists S" "B \<subseteq> lists S"
  shows "A \<parallel> B \<subseteq> lists S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<parallel> B \<subseteq> lists S
[PROOF STEP]
unfolding Shuffle_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {shuffles xs ys |xs ys. xs \<in> A \<and> ys \<in> B} \<subseteq> lists S
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x X xa xs ys. \<lbrakk>x \<in> shuffles xs ys; xa \<in> set x; xs \<in> A; ys \<in> B\<rbrakk> \<Longrightarrow> xa \<in> S
[PROOF STEP]
fix x and zs xs ys :: "'a list"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x X xa xs ys. \<lbrakk>x \<in> shuffles xs ys; xa \<in> set x; xs \<in> A; ys \<in> B\<rbrakk> \<Longrightarrow> xa \<in> S
[PROOF STEP]
assume zs: "zs \<in> shuffles xs ys" "x \<in> set zs" and "xs \<in> A" "ys \<in> B"
[PROOF STATE]
proof (state)
this:
zs \<in> shuffles xs ys
x \<in> set zs
xs \<in> A
ys \<in> B

goal (1 subgoal):
 1. \<And>x X xa xs ys. \<lbrakk>x \<in> shuffles xs ys; xa \<in> set x; xs \<in> A; ys \<in> B\<rbrakk> \<Longrightarrow> xa \<in> S
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> lists S
B \<subseteq> lists S
zs \<in> shuffles xs ys
x \<in> set zs
xs \<in> A
ys \<in> B
[PROOF STEP]
have "xs \<in> lists S" "ys \<in> lists S"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> lists S
B \<subseteq> lists S
zs \<in> shuffles xs ys
x \<in> set zs
xs \<in> A
ys \<in> B

goal (1 subgoal):
 1. xs \<in> lists S &&& ys \<in> lists S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<in> lists S
ys \<in> lists S

goal (1 subgoal):
 1. \<And>x X xa xs ys. \<lbrakk>x \<in> shuffles xs ys; xa \<in> set x; xs \<in> A; ys \<in> B\<rbrakk> \<Longrightarrow> xa \<in> S
[PROOF STEP]
with zs
[PROOF STATE]
proof (chain)
picking this:
zs \<in> shuffles xs ys
x \<in> set zs
xs \<in> lists S
ys \<in> lists S
[PROOF STEP]
show "x \<in> S"
[PROOF STATE]
proof (prove)
using this:
zs \<in> shuffles xs ys
x \<in> set zs
xs \<in> lists S
ys \<in> lists S

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
by (induct xs ys arbitrary: zs rule: shuffles.induct) auto
[PROOF STATE]
proof (state)
this:
x \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma univalent_d_in_forest_modulo_equivalence:
  assumes "forest_modulo_equivalence x d"
  shows "univalent d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coreflexive (d[[d]])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coreflexive (d[[d]])
[PROOF STEP]
have "d\<^sup>T * d \<le> d\<^sup>T * x\<^sup>T * x * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d[[d]] \<le> (d[[x\<^sup>T]]) * x * d
[PROOF STEP]
using assms(1) forest_modulo_equivalence_def comp_isotone comp_right_one mult_sub_right_one
[PROOF STATE]
proof (prove)
using this:
forest_modulo_equivalence x d
forest_modulo_equivalence ?x ?d \<equiv> equivalence ?x \<and> coreflexive (?x * ?d[[?x * ?d]]) \<and> coreflexive (?x \<sqinter> ?d * ?d\<^sup>T) \<and> (?x * ?d)\<^sup>+ \<sqinter> ?x \<le> bot
\<lbrakk>?x \<le> ?y; ?w \<le> ?z\<rbrakk> \<Longrightarrow> ?x * ?w \<le> ?y * ?z
?x * (1::'a) = ?x
?x \<le> ?x * (1::'a)

goal (1 subgoal):
 1. d[[d]] \<le> (d[[x\<^sup>T]]) * x * d
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
d[[d]] \<le> (d[[x\<^sup>T]]) * x * d

goal (1 subgoal):
 1. coreflexive (d[[d]])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d[[d]] \<le> (d[[x\<^sup>T]]) * x * d

goal (1 subgoal):
 1. coreflexive (d[[d]])
[PROOF STEP]
have "... \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coreflexive ((d[[x\<^sup>T]]) * x * d)
[PROOF STEP]
using assms(1) forest_modulo_equivalence_def comp_associative conv_dist_comp
[PROOF STATE]
proof (prove)
using this:
forest_modulo_equivalence x d
forest_modulo_equivalence ?x ?d \<equiv> equivalence ?x \<and> coreflexive (?x * ?d[[?x * ?d]]) \<and> coreflexive (?x \<sqinter> ?d * ?d\<^sup>T) \<and> (?x * ?d)\<^sup>+ \<sqinter> ?x \<le> bot
?x * ?y * ?z = ?x * (?y * ?z)
(?x * ?y)\<^sup>T = ?y[[?x\<^sup>T]]

goal (1 subgoal):
 1. coreflexive ((d[[x\<^sup>T]]) * x * d)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coreflexive ((d[[x\<^sup>T]]) * x * d)

goal (1 subgoal):
 1. coreflexive (d[[d]])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
coreflexive (d[[d]])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coreflexive (d[[d]])

goal (1 subgoal):
 1. coreflexive (d[[d]])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
coreflexive (d[[d]])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matching_rels_if_no_cross: "\<lbrakk>\<forall>r. t \<noteq> Relation r; no_cross_products t\<rbrakk> \<Longrightarrow> matching_rels t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>r. t \<noteq> Relation r; no_cross_products t\<rbrakk> \<Longrightarrow> matching_rels t
[PROOF STEP]
unfolding matching_rels_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>r. t \<noteq> Relation r; no_cross_products t\<rbrakk> \<Longrightarrow> relations t \<subseteq> verts G
[PROOF STEP]
by(induction t) fastforce+


[STATEMENT]
lemma measurable_on_compose_continuous_0:
   assumes f: "f measurable_on S" and g: "continuous_on UNIV g" and "g 0 = 0"
   shows "(g \<circ> f) measurable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<circ> f measurable_on S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<circ> f measurable_on S
[PROOF STEP]
have f': "(\<lambda>x. if x \<in> S then f x else 0) measurable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<in> S then f x else (0::'b)) measurable_on UNIV
[PROOF STEP]
using f measurable_on_UNIV
[PROOF STATE]
proof (prove)
using this:
f measurable_on S
((\<lambda>x. if x \<in> ?S then ?f x else (0::?'b)) measurable_on UNIV) = (?f measurable_on ?S)

goal (1 subgoal):
 1. (\<lambda>x. if x \<in> S then f x else (0::'b)) measurable_on UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> S then f x else (0::'b)) measurable_on UNIV

goal (1 subgoal):
 1. g \<circ> f measurable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<circ> f measurable_on S
[PROOF STEP]
using measurable_on_compose_continuous [OF f' g]
[PROOF STATE]
proof (prove)
using this:
g \<circ> (\<lambda>x. if x \<in> S then f x else (0::'b)) measurable_on UNIV

goal (1 subgoal):
 1. g \<circ> f measurable_on S
[PROOF STEP]
by (simp add: measurable_on_UNIV o_def if_distrib \<open>g 0 = 0\<close> cong: if_cong)
[PROOF STATE]
proof (state)
this:
g \<circ> f measurable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem bound_main_lemma_reachability_s:
  fixes PROB :: "'a problem" and s
  assumes "finite PROB" "s \<in> valid_states PROB"
  shows "(problem_plan_bound_s PROB s < card (reachable_s PROB s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
proof -
  \<comment> \<open>NOTE derive premise for MP of 'bound\_child\_parent\_lemma\_s\_2'.\<close>
  \<comment> \<open>NOTE type of `s` had to be fixed (warning in assumption declaration).\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
fix PROB :: "'a problem" and s :: "'a state" and as
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
assume P1: "finite PROB" "s \<in> valid_states PROB" "as \<in> valid_plans PROB"
[PROOF STATE]
proof (state)
this:
finite PROB
s \<in> valid_states PROB
as \<in> valid_plans PROB

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite PROB
s \<in> valid_states PROB
as \<in> valid_plans PROB
[PROOF STEP]
obtain as' where a: "exec_plan s as = exec_plan s as'" "subseq as' as"
      "length as' \<le> card (reachable_s PROB s) - 1"
[PROOF STATE]
proof (prove)
using this:
finite PROB
s \<in> valid_states PROB
as \<in> valid_plans PROB

goal (1 subgoal):
 1. (\<And>as'. \<lbrakk>exec_plan s as = exec_plan s as'; subseq as' as; length as' \<le> card (reachable_s PROB s) - 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using P1 main_lemma_reachability_s
[PROOF STATE]
proof (prove)
using this:
finite PROB
s \<in> valid_states PROB
as \<in> valid_plans PROB
finite PROB
s \<in> valid_states PROB
as \<in> valid_plans PROB
\<lbrakk>finite ?PROB; ?s \<in> valid_states ?PROB; ?as \<in> valid_plans ?PROB\<rbrakk> \<Longrightarrow> \<exists>as'. exec_plan ?s ?as = exec_plan ?s as' \<and> subseq as' ?as \<and> length as' \<le> card (reachable_s ?PROB ?s) - 1

goal (1 subgoal):
 1. (\<And>as'. \<lbrakk>exec_plan s as = exec_plan s as'; subseq as' as; length as' \<le> card (reachable_s PROB s) - 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
exec_plan s as = exec_plan s as'
subseq as' as
length as' \<le> card (reachable_s PROB s) - 1

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
exec_plan s as = exec_plan s as'
subseq as' as
length as' \<le> card (reachable_s PROB s) - 1
[PROOF STEP]
have "length as' < card (reachable_s PROB s)"
[PROOF STATE]
proof (prove)
using this:
exec_plan s as = exec_plan s as'
subseq as' as
length as' \<le> card (reachable_s PROB s) - 1

goal (1 subgoal):
 1. length as' < card (reachable_s PROB s)
[PROOF STEP]
using P1(1, 2) card_reachable_s_non_zero
[PROOF STATE]
proof (prove)
using this:
exec_plan s as = exec_plan s as'
subseq as' as
length as' \<le> card (reachable_s PROB s) - 1
finite PROB
s \<in> valid_states PROB
\<lbrakk>finite ?PROB; ?s \<in> valid_states ?PROB\<rbrakk> \<Longrightarrow> 0 < card (reachable_s ?PROB ?s)

goal (1 subgoal):
 1. length as' < card (reachable_s PROB s)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
length as' < card (reachable_s PROB s)

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length as' < card (reachable_s PROB s)
[PROOF STEP]
have "(\<exists>as'.
      exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' < card (reachable_s PROB s))
    "
[PROOF STATE]
proof (prove)
using this:
length as' < card (reachable_s PROB s)

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' < card (reachable_s PROB s)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
length as' < card (reachable_s PROB s)
exec_plan s as = exec_plan s as'
subseq as' as
length as' \<le> card (reachable_s PROB s) - 1

goal (1 subgoal):
 1. \<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' < card (reachable_s PROB s)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' < card (reachable_s PROB s)

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite ?PROBa2; ?sa2 \<in> valid_states ?PROBa2; ?as2 \<in> valid_plans ?PROBa2\<rbrakk> \<Longrightarrow> \<exists>as'. exec_plan ?sa2 ?as2 = exec_plan ?sa2 as' \<and> subseq as' ?as2 \<and> length as' < card (reachable_s ?PROBa2 ?sa2)

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite ?PROBa2; ?sa2 \<in> valid_states ?PROBa2; ?as2 \<in> valid_plans ?PROBa2\<rbrakk> \<Longrightarrow> \<exists>as'. exec_plan ?sa2 ?as2 = exec_plan ?sa2 as' \<and> subseq as' ?as2 \<and> length as' < card (reachable_s ?PROBa2 ?sa2)
[PROOF STEP]
have "
    finite PROB \<and> True \<and> s \<in> valid_states PROB
    \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)
  "
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?PROBa2; ?sa2 \<in> valid_states ?PROBa2; ?as2 \<in> valid_plans ?PROBa2\<rbrakk> \<Longrightarrow> \<exists>as'. exec_plan ?sa2 ?as2 = exec_plan ?sa2 as' \<and> subseq as' ?as2 \<and> length as' < card (reachable_s ?PROBa2 ?sa2)

goal (1 subgoal):
 1. finite PROB \<and> True \<and> s \<in> valid_states PROB \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
using bound_child_parent_lemma_s_2[where PROB = PROB and P = "\<lambda>_. True" and s = s
        and f = "\<lambda>PROB s. card (reachable_s PROB s)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?PROBa2; ?sa2 \<in> valid_states ?PROBa2; ?as2 \<in> valid_plans ?PROBa2\<rbrakk> \<Longrightarrow> \<exists>as'. exec_plan ?sa2 ?as2 = exec_plan ?sa2 as' \<and> subseq as' ?as2 \<and> length as' < card (reachable_s ?PROBa2 ?sa2)
\<forall>PROB as s. finite PROB \<and> True \<and> s \<in> valid_states PROB \<and> as \<in> valid_plans PROB \<longrightarrow> (\<exists>as'. exec_plan s as = exec_plan s as' \<and> subseq as' as \<and> length as' < card (reachable_s PROB s)) \<Longrightarrow> finite PROB \<and> True \<and> s \<in> valid_states PROB \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)

goal (1 subgoal):
 1. finite PROB \<and> True \<and> s \<in> valid_states PROB \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite PROB \<and> True \<and> s \<in> valid_states PROB \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite PROB \<and> True \<and> s \<in> valid_states PROB \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite PROB \<and> True \<and> s \<in> valid_states PROB \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
using assms(1, 2)
[PROOF STATE]
proof (prove)
using this:
finite PROB \<and> True \<and> s \<in> valid_states PROB \<longrightarrow> problem_plan_bound_s PROB s < card (reachable_s PROB s)
finite PROB
s \<in> valid_states PROB

goal (1 subgoal):
 1. problem_plan_bound_s PROB s < card (reachable_s PROB s)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
problem_plan_bound_s PROB s < card (reachable_s PROB s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible_multD:
  assumes l: "irreducible (a*b)"
  shows "a dvd 1 \<and> irreducible b \<or> b dvd 1 \<and> irreducible a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
from l
[PROOF STATE]
proof (chain)
picking this:
irreducible (a * b)
[PROOF STEP]
have "a dvd 1 \<or> b dvd 1"
[PROOF STATE]
proof (prove)
using this:
irreducible (a * b)

goal (1 subgoal):
 1. a dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
using irreducibleD
[PROOF STATE]
proof (prove)
using this:
irreducible (a * b)
\<lbrakk>irreducible ?p; ?p = ?a * ?b\<rbrakk> \<Longrightarrow> ?a dvd (1::'a) \<or> ?b dvd (1::'a)

goal (1 subgoal):
 1. a dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<or> b dvd (1::'a)

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a dvd (1::'a) \<or> b dvd (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a dvd (1::'a) \<or> b dvd (1::'a)

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
proof(elim disjE)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
 2. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
assume a: "a dvd 1"
[PROOF STATE]
proof (state)
this:
a dvd (1::'a)

goal (2 subgoals):
 1. a dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
 2. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with l
[PROOF STATE]
proof (chain)
picking this:
irreducible (a * b)
a dvd (1::'a)
[PROOF STEP]
have "irreducible b"
[PROOF STATE]
proof (prove)
using this:
irreducible (a * b)
a dvd (1::'a)

goal (1 subgoal):
 1. irreducible b
[PROOF STEP]
unfolding irreducible_def
[PROOF STATE]
proof (prove)
using this:
a * b \<noteq> (0::'a) \<and> \<not> a * b dvd (1::'a) \<and> (\<forall>aa ba. a * b = aa * ba \<longrightarrow> aa dvd (1::'a) \<or> ba dvd (1::'a))
a dvd (1::'a)

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<and> \<not> b dvd (1::'a) \<and> (\<forall>a ba. b = a * ba \<longrightarrow> a dvd (1::'a) \<or> ba dvd (1::'a))
[PROOF STEP]
by (metis is_unit_mult_iff mult.left_commute mult_not_zero)
[PROOF STATE]
proof (state)
this:
irreducible b

goal (2 subgoals):
 1. a dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
 2. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
a dvd (1::'a)
irreducible b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a dvd (1::'a)
irreducible b

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a

goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
assume a: "b dvd 1"
[PROOF STATE]
proof (state)
this:
b dvd (1::'a)

goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with l
[PROOF STATE]
proof (chain)
picking this:
irreducible (a * b)
b dvd (1::'a)
[PROOF STEP]
have "irreducible a"
[PROOF STATE]
proof (prove)
using this:
irreducible (a * b)
b dvd (1::'a)

goal (1 subgoal):
 1. irreducible a
[PROOF STEP]
unfolding irreducible_def
[PROOF STATE]
proof (prove)
using this:
a * b \<noteq> (0::'a) \<and> \<not> a * b dvd (1::'a) \<and> (\<forall>aa ba. a * b = aa * ba \<longrightarrow> aa dvd (1::'a) \<or> ba dvd (1::'a))
b dvd (1::'a)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<and> \<not> a dvd (1::'a) \<and> (\<forall>aa b. a = aa * b \<longrightarrow> aa dvd (1::'a) \<or> b dvd (1::'a))
[PROOF STEP]
by (meson is_unit_mult_iff mult_not_zero semiring_normalization_rules(16))
[PROOF STATE]
proof (state)
this:
irreducible a

goal (1 subgoal):
 1. b dvd (1::'a) \<Longrightarrow> a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
b dvd (1::'a)
irreducible a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b dvd (1::'a)
irreducible a

goal (1 subgoal):
 1. a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a dvd (1::'a) \<and> irreducible b \<or> b dvd (1::'a) \<and> irreducible a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_Real:
  "cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))
[PROOF STEP]
using inverse_real.transfer zero_real.transfer
[PROOF STATE]
proof (prove)
using this:
rel_fun pcr_real pcr_real (\<lambda>X. if vanishes X then \<lambda>n. 0 else (\<lambda>n. inverse (X n))) inverse
pcr_real (\<lambda>n. 0) 0

goal (1 subgoal):
 1. cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))
[PROOF STEP]
unfolding cr_real_eq rel_fun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. cauchy x \<and> Real x = y \<longrightarrow> cauchy (if vanishes x then \<lambda>n. 0 else (\<lambda>n. inverse (x n))) \<and> Real (if vanishes x then \<lambda>n. 0 else (\<lambda>n. inverse (x n))) = inverse y
cauchy (\<lambda>n. 0) \<and> Real (\<lambda>n. 0) = 0

goal (1 subgoal):
 1. cauchy X \<Longrightarrow> inverse (Real X) = (if vanishes X then 0 else Real (\<lambda>n. inverse (X n)))
[PROOF STEP]
by (simp split: if_split_asm, metis)