[STATEMENT]
lemma circlepath_inj_on:
  assumes "r>0"
  shows "inj_on (circlepath z r) {0..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (circlepath z r) {0..<1}
[PROOF STEP]
proof (rule inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume asm: "x \<in> {0..<1}" "y \<in> {0..<1}" "circlepath z r x = circlepath z r y"
[PROOF STATE]
proof (state)
this:
x \<in> {0..<1}
y \<in> {0..<1}
circlepath z r x = circlepath z r y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
define c where "c=2 * pi * \<i>"
[PROOF STATE]
proof (state)
this:
c = complex_of_real (2 * pi) * \<i>

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
have "c\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (2 * pi) * \<i> \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from asm(3)
[PROOF STATE]
proof (chain)
picking this:
circlepath z r x = circlepath z r y
[PROOF STEP]
have "exp (c * x) =exp (c * y)"
[PROOF STATE]
proof (prove)
using this:
circlepath z r x = circlepath z r y

goal (1 subgoal):
 1. exp (c * complex_of_real x) = exp (c * complex_of_real y)
[PROOF STEP]
unfolding circlepath c_def
[PROOF STATE]
proof (prove)
using this:
z + complex_of_real r * exp (2 * complex_of_real pi * \<i> * complex_of_real x) = z + complex_of_real r * exp (2 * complex_of_real pi * \<i> * complex_of_real y)

goal (1 subgoal):
 1. exp (complex_of_real (2 * pi) * \<i> * complex_of_real x) = exp (complex_of_real (2 * pi) * \<i> * complex_of_real y)
[PROOF STEP]
using \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
z + complex_of_real r * exp (2 * complex_of_real pi * \<i> * complex_of_real x) = z + complex_of_real r * exp (2 * complex_of_real pi * \<i> * complex_of_real y)
0 < r

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

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
exp (c * complex_of_real x) = exp (c * complex_of_real y)
[PROOF STEP]
obtain n where "c * x =c * (y + of_int n)"
[PROOF STATE]
proof (prove)
using this:
exp (c * complex_of_real x) = exp (c * complex_of_real y)

goal (1 subgoal):
 1. (\<And>n. c * complex_of_real x = c * complex_of_real (y + real_of_int n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add:exp_eq c_def algebra_simps)
[PROOF STATE]
proof (state)
this:
c * complex_of_real x = c * complex_of_real (y + real_of_int n)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c * complex_of_real x = c * complex_of_real (y + real_of_int n)
[PROOF STEP]
have "x=y+n"
[PROOF STATE]
proof (prove)
using this:
c * complex_of_real x = c * complex_of_real (y + real_of_int n)

goal (1 subgoal):
 1. x = y + real_of_int n
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
c * complex_of_real x = c * complex_of_real (y + real_of_int n)
c \<noteq> 0

goal (1 subgoal):
 1. x = y + real_of_int n
[PROOF STEP]
by (meson mult_cancel_left of_real_eq_iff)
[PROOF STATE]
proof (state)
this:
x = y + real_of_int n

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {0..<1}; y \<in> {0..<1}; circlepath z r x = circlepath z r y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = y + real_of_int n
[PROOF STEP]
show "x=y"
[PROOF STATE]
proof (prove)
using this:
x = y + real_of_int n

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using asm(1,2)
[PROOF STATE]
proof (prove)
using this:
x = y + real_of_int n
x \<in> {0..<1}
y \<in> {0..<1}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma T\<^sub>p_spliting: "x\<noteq>y \<Longrightarrow> set xs \<subseteq> {x,y} \<Longrightarrow> set ys \<subseteq> {x,y} \<Longrightarrow>
      R \<in> {[x,y],[y,x]} \<Longrightarrow>
      T\<^sub>p R (xs@[x,x]) (OPT2 (xs@[x,x]) R) + T\<^sub>p [x,y] ys (OPT2 ys [x,y])
      = T\<^sub>p R (xs@[x,x]@ys) (OPT2 (xs@[x,x]@ys) R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
assume nxy: "x\<noteq>y"
[PROOF STATE]
proof (state)
this:
x \<noteq> y

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
assume XSxy: "set xs \<subseteq> {x,y}"
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> {x, y}

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
assume YSxy: "set ys \<subseteq> {x,y}"
[PROOF STATE]
proof (state)
this:
set ys \<subseteq> {x, y}

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
assume R: "R \<in> {[x,y],[y,x]}"
[PROOF STATE]
proof (state)
this:
R \<in> {[x, y], [y, x]}

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
R \<in> {[x, y], [y, x]}

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
fix R
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
assume XSxy: "set xs \<subseteq> {x,y}"
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> {x, y}

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
have "R\<in>{[x,y],[y,x]} \<Longrightarrow> set xs \<subseteq> {x,y}  \<Longrightarrow> steps R (xs@[x,x]) (OPT2 (xs@[x,x]) R) = [x,y]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]
[PROOF STEP]
proof(induct xs arbitrary: R)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set [] \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]
 2. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
R \<in> {[x, y], [y, x]}
set [] \<subseteq> {x, y}

goal (2 subgoals):
 1. \<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set [] \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]
 2. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
R \<in> {[x, y], [y, x]}
set [] \<subseteq> {x, y}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
R \<in> {[x, y], [y, x]}
set [] \<subseteq> {x, y}

goal (1 subgoal):
 1. Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]
[PROOF STEP]
apply(cases "R=[x,y]")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>R \<in> {[x, y], [y, x]}; set [] \<subseteq> {x, y}; R = [x, y]\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]
 2. \<lbrakk>R \<in> {[x, y], [y, x]}; set [] \<subseteq> {x, y}; R \<noteq> [x, y]\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]
[PROOF STEP]
(* FIXME why is simp_all needed? *)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>R \<in> {[x, y], [y, x]}; set [] \<subseteq> {x, y}; R = [x, y]\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]
 2. \<lbrakk>R \<in> {[x, y], [y, x]}; set [] \<subseteq> {x, y}; R \<noteq> [x, y]\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. R = [x, y] \<Longrightarrow> step (step [x, y] x (0, [])) x (0, []) = [x, y]
 2. \<lbrakk>R = [y, x]; y \<noteq> x\<rbrakk> \<Longrightarrow> step (step [y, x] x (Suc 0, [])) x (0, []) = [x, y]
[PROOF STEP]
apply(simp add: step_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R = [y, x]; y \<noteq> x\<rbrakk> \<Longrightarrow> step (step [y, x] x (Suc 0, [])) x (0, []) = [x, y]
[PROOF STEP]
by(simp add: step_def mtf2_def swap_def)
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps R ([] @ [x, x]) (OPT2 ([] @ [x, x]) R) = [x, y]

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
case (Cons Q QS)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?R \<in> {[x, y], [y, x]}; set QS \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps ?R (QS @ [x, x]) (OPT2 (QS @ [x, x]) ?R) = [x, y]
R \<in> {[x, y], [y, x]}
set (Q # QS) \<subseteq> {x, y}

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
let ?R'="(step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
have a: "Q \<in> {x,y}"  and b: "set QS \<subseteq> {x,y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q \<in> {x, y} &&& set QS \<subseteq> {x, y}
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?R \<in> {[x, y], [y, x]}; set QS \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps ?R (QS @ [x, x]) (OPT2 (QS @ [x, x]) ?R) = [x, y]
R \<in> {[x, y], [y, x]}
set (Q # QS) \<subseteq> {x, y}

goal (1 subgoal):
 1. Q \<in> {x, y} &&& set QS \<subseteq> {x, y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Q \<in> {x, y}
set QS \<subseteq> {x, y}

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
have t: "?R' \<in> {[x,y],[y,x]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) \<in> {[x, y], [y, x]}
[PROOF STEP]
apply(rule stepxy)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Q \<in> {x, y}
 2. R \<in> {[x, y], [y, x]}
[PROOF STEP]
using nxy Cons
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
\<lbrakk>?R \<in> {[x, y], [y, x]}; set QS \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps ?R (QS @ [x, x]) (OPT2 (QS @ [x, x]) ?R) = [x, y]
R \<in> {[x, y], [y, x]}
set (Q # QS) \<subseteq> {x, y}

goal (2 subgoals):
 1. Q \<in> {x, y}
 2. R \<in> {[x, y], [y, x]}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) \<in> {[x, y], [y, x]}

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) \<in> {[x, y], [y, x]}
[PROOF STEP]
have "length (OPT2 (QS @ [x, x]) ?R') > 0"
[PROOF STATE]
proof (prove)
using this:
step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) \<in> {[x, y], [y, x]}

goal (1 subgoal):
 1. 0 < length (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
apply(cases "?R' = [x,y]")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) \<in> {[x, y], [y, x]}; step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) = [x, y]\<rbrakk> \<Longrightarrow> 0 < length (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
 2. \<lbrakk>step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) \<in> {[x, y], [y, x]}; step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)) \<noteq> [x, y]\<rbrakk> \<Longrightarrow> 0 < length (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
by(simp_all add: OPT2_length)
[PROOF STATE]
proof (state)
this:
0 < length (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < length (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
have "OPT2 (QS @ [x, x]) ?R' \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
0 < length (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))

goal (1 subgoal):
 1. OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) \<noteq> []

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) \<noteq> []
[PROOF STEP]
have hdtl: "OPT2 (QS @ [x, x]) ?R' = hd (OPT2 (QS @ [x, x]) ?R') # tl (OPT2 (QS @ [x, x]) ?R')"
[PROOF STATE]
proof (prove)
using this:
OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) \<noteq> []

goal (1 subgoal):
 1. OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) = hd (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))) # tl (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) = hd (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))) # tl (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
have maa: "(tl (OPT2 ((Q # QS) @ [x, x]) R)) = OPT2 (QS @ [x, x]) ?R' "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tl (OPT2 ((Q # QS) @ [x, x]) R) = OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))
[PROOF STEP]
using tlofOPT2[OF a b Cons(2)]
[PROOF STATE]
proof (prove)
using this:
tl (OPT2 ((Q # QS) @ [x, x]) R) = OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))

goal (1 subgoal):
 1. tl (OPT2 ((Q # QS) @ [x, x]) R) = OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tl (OPT2 ((Q # QS) @ [x, x]) R) = OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
from Cons(2)
[PROOF STATE]
proof (chain)
picking this:
R \<in> {[x, y], [y, x]}
[PROOF STEP]
have "length (OPT2 ((Q # QS) @ [x, x]) R) > 0"
[PROOF STATE]
proof (prove)
using this:
R \<in> {[x, y], [y, x]}

goal (1 subgoal):
 1. 0 < length (OPT2 ((Q # QS) @ [x, x]) R)
[PROOF STEP]
apply(cases "R = [x,y]")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>R \<in> {[x, y], [y, x]}; R = [x, y]\<rbrakk> \<Longrightarrow> 0 < length (OPT2 ((Q # QS) @ [x, x]) R)
 2. \<lbrakk>R \<in> {[x, y], [y, x]}; R \<noteq> [x, y]\<rbrakk> \<Longrightarrow> 0 < length (OPT2 ((Q # QS) @ [x, x]) R)
[PROOF STEP]
by(simp_all add: OPT2_length)
[PROOF STATE]
proof (state)
this:
0 < length (OPT2 ((Q # QS) @ [x, x]) R)

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < length (OPT2 ((Q # QS) @ [x, x]) R)
[PROOF STEP]
have nempty: "OPT2 ((Q # QS) @ [x, x]) R \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
0 < length (OPT2 ((Q # QS) @ [x, x]) R)

goal (1 subgoal):
 1. OPT2 ((Q # QS) @ [x, x]) R \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
OPT2 ((Q # QS) @ [x, x]) R \<noteq> []

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
OPT2 ((Q # QS) @ [x, x]) R \<noteq> []
[PROOF STEP]
have "steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R)
        = steps R ((Q # QS) @ [x, x]) (hd(OPT2 ((Q # QS) @ [x, x]) R) #  tl(OPT2 ((Q # QS) @ [x, x]) R))"
[PROOF STATE]
proof (prove)
using this:
OPT2 ((Q # QS) @ [x, x]) R \<noteq> []

goal (1 subgoal):
 1. Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R) = Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (hd (OPT2 ((Q # QS) @ [x, x]) R) # tl (OPT2 ((Q # QS) @ [x, x]) R))
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R) = Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (hd (OPT2 ((Q # QS) @ [x, x]) R) # tl (OPT2 ((Q # QS) @ [x, x]) R))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R) = Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (hd (OPT2 ((Q # QS) @ [x, x]) R) # tl (OPT2 ((Q # QS) @ [x, x]) R))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
have "\<dots>
        = steps ?R' (QS @ [x,x]) (tl (OPT2 ((Q # QS) @ [x, x]) R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (hd (OPT2 ((Q # QS) @ [x, x]) R) # tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R))
[PROOF STEP]
unfolding maa
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (hd (OPT2 ((Q # QS) @ [x, x]) R) # OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (hd (OPT2 ((Q # QS) @ [x, x]) R) # tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (hd (OPT2 ((Q # QS) @ [x, x]) R) # tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
have "\<dots> = steps ?R' (QS @ [x,x]) (OPT2 (QS @ [x, x]) ?R')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
using maa
[PROOF STATE]
proof (prove)
using this:
tl (OPT2 ((Q # QS) @ [x, x]) R) = OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))

goal (1 subgoal):
 1. Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
with Cons(1)[OF t b]
[PROOF STATE]
proof (chain)
picking this:
Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))) = [x, y]
Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))
[PROOF STEP]
have "\<dots> = [x,y]"
[PROOF STATE]
proof (prove)
using this:
Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))) = [x, y]
Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (tl (OPT2 ((Q # QS) @ [x, x]) R)) = Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))))

goal (1 subgoal):
 1. Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))) = [x, y]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R))) (QS @ [x, x]) (OPT2 (QS @ [x, x]) (step R Q (hd (OPT2 ((Q # QS) @ [x, x]) R)))) = [x, y]

goal (1 subgoal):
 1. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R ((a # xs) @ [x, x]) (OPT2 ((a # xs) @ [x, x]) R) = [x, y]
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R) = [x, y]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R) = [x, y]

goal (1 subgoal):
 1. Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R) = [x, y]
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps R ((Q # QS) @ [x, x]) (OPT2 ((Q # QS) @ [x, x]) R) = [x, y]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>set xs \<subseteq> {x, y}; ?Ra2 \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps ?Ra2 (xs @ [x, x]) (OPT2 (xs @ [x, x]) ?Ra2) = [x, y]

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
note aa=this
[PROOF STATE]
proof (state)
this:
\<lbrakk>set xs \<subseteq> {x, y}; ?Ra2 \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps ?Ra2 (xs @ [x, x]) (OPT2 (xs @ [x, x]) ?Ra2) = [x, y]

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
from aa XSxy R
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set xs \<subseteq> {x, y}; ?Ra2 \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps ?Ra2 (xs @ [x, x]) (OPT2 (xs @ [x, x]) ?Ra2) = [x, y]
set xs \<subseteq> {x, y}
R \<in> {[x, y], [y, x]}
[PROOF STEP]
have ll: "steps R (xs@[x,x]) (OPT2 (xs@[x,x]) R)
      = [x,y]"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set xs \<subseteq> {x, y}; ?Ra2 \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> Partial_Cost_Model.steps ?Ra2 (xs @ [x, x]) (OPT2 (xs @ [x, x]) ?Ra2) = [x, y]
set xs \<subseteq> {x, y}
R \<in> {[x, y], [y, x]}

goal (1 subgoal):
 1. Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Partial_Cost_Model.steps R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) = [x, y]

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
have uer: " length (xs @ [x, x]) = length (OPT2 (xs @ [x, x]) R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs @ [x, x]) = length (OPT2 (xs @ [x, x]) R)
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
R \<in> {[x, y], [y, x]}

goal (1 subgoal):
 1. length (xs @ [x, x]) = length (OPT2 (xs @ [x, x]) R)
[PROOF STEP]
by (auto simp: OPT2_length)
[PROOF STATE]
proof (state)
this:
length (xs @ [x, x]) = length (OPT2 (xs @ [x, x]) R)

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
have "OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(rule OPT2_split11)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. x \<noteq> y
 2. R \<in> {[x, y], [y, x]}
 3. set xs \<subseteq> {x, y}
 4. set ys \<subseteq> {x, y}
[PROOF STEP]
using nxy XSxy YSxy R
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y
set xs \<subseteq> {x, y}
set ys \<subseteq> {x, y}
R \<in> {[x, y], [y, x]}

goal (4 subgoals):
 1. x \<noteq> y
 2. R \<in> {[x, y], [y, x]}
 3. set xs \<subseteq> {x, y}
 4. set ys \<subseteq> {x, y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
have "T\<^sub>p R (xs@[x,x]@ys) (OPT2 (xs@[x,x]@ys) R)
        = T\<^sub>p R ((xs@[x,x])@ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y])"
[PROOF STATE]
proof (prove)
using this:
OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]

goal (1 subgoal):
 1. T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R) = T\<^sub>p R ((xs @ [x, x]) @ ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R) = T\<^sub>p R ((xs @ [x, x]) @ ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y])

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R) = T\<^sub>p R ((xs @ [x, x]) @ ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y])

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
have "\<dots> = T\<^sub>p R (xs@[x,x]) (OPT2 (xs @ [x, x]) R)
                + T\<^sub>p [x,y] ys (OPT2 ys [x, y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T\<^sub>p R ((xs @ [x, x]) @ ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y])
[PROOF STEP]
using T\<^sub>p_split[of "xs@[x,x]" "OPT2 (xs @ [x, x]) R" R ys "OPT2 ys [x, y]", OF uer, unfolded ll]
[PROOF STATE]
proof (prove)
using this:
T\<^sub>p R ((xs @ [x, x]) @ ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y])

goal (1 subgoal):
 1. T\<^sub>p R ((xs @ [x, x]) @ ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
T\<^sub>p R ((xs @ [x, x]) @ ys) (OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y])

goal (1 subgoal):
 1. \<lbrakk>x \<noteq> y; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}; R \<in> {[x, y], [y, x]}\<rbrakk> \<Longrightarrow> T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R) = T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R) = T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y])

goal (1 subgoal):
 1. T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
T\<^sub>p R (xs @ [x, x]) (OPT2 (xs @ [x, x]) R) + T\<^sub>p [x, y] ys (OPT2 ys [x, y]) = T\<^sub>p R (xs @ [x, x] @ ys) (OPT2 (xs @ [x, x] @ ys) R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma join_assoc:
  assumes "compatible x y"
  assumes "compatible x (y \<squnion> z)"
  assumes "compatible y z"
  shows "(x \<squnion> y) \<squnion> z = x \<squnion> (y \<squnion> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<squnion> z = x \<squnion> (y \<squnion> z)
[PROOF STEP]
apply (rule is_joinI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x \<squnion> y \<sqsubseteq> x \<squnion> (y \<squnion> z)
 2. z \<sqsubseteq> x \<squnion> (y \<squnion> z)
 3. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> x \<squnion> (y \<squnion> z) \<sqsubseteq> a
[PROOF STEP]
apply (rule join_mono[OF assms(1) assms(2) below_refl join_above1[OF assms(3)]])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. z \<sqsubseteq> x \<squnion> (y \<squnion> z)
 2. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> x \<squnion> (y \<squnion> z) \<sqsubseteq> a
[PROOF STEP]
apply (rule below_trans[OF join_above2[OF assms(3)] join_above2[OF assms(2)]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> x \<squnion> (y \<squnion> z) \<sqsubseteq> a
[PROOF STEP]
apply (rule join_below[OF assms(2)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> x \<sqsubseteq> a
 2. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> y \<squnion> z \<sqsubseteq> a
[PROOF STEP]
apply (erule rev_below_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. z \<sqsubseteq> a \<Longrightarrow> x \<sqsubseteq> x \<squnion> y
 2. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> y \<squnion> z \<sqsubseteq> a
[PROOF STEP]
apply (rule join_above1[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> y \<squnion> z \<sqsubseteq> a
[PROOF STEP]
apply (rule join_below[OF assms(3)])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> y \<sqsubseteq> a
 2. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> z \<sqsubseteq> a
[PROOF STEP]
apply (erule rev_below_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. z \<sqsubseteq> a \<Longrightarrow> y \<sqsubseteq> x \<squnion> y
 2. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> z \<sqsubseteq> a
[PROOF STEP]
apply (rule join_above2[OF assms(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>x \<squnion> y \<sqsubseteq> a; z \<sqsubseteq> a\<rbrakk> \<Longrightarrow> z \<sqsubseteq> a
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


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

goal (2 subgoals):
 1. card (row_exec 0) = 0
 2. \<And>m. card (row_exec m) = m \<Longrightarrow> card (row_exec (Suc m)) = Suc m
[PROOF STEP]
have "int (Suc m) \<notin> row_exec m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (Suc m) \<notin> row_exec m
[PROOF STEP]
using row_exec_leq
[PROOF STATE]
proof (prove)
using this:
(?j \<in> row_exec ?m) = (1 \<le> ?j \<and> ?j \<le> int ?m)

goal (1 subgoal):
 1. int (Suc m) \<notin> row_exec m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (Suc m) \<notin> row_exec m

goal (2 subgoals):
 1. card (row_exec 0) = 0
 2. \<And>m. card (row_exec m) = m \<Longrightarrow> card (row_exec (Suc m)) = Suc m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (Suc m) \<notin> row_exec m
[PROOF STEP]
have "card (insert (int (Suc m)) (row_exec m)) = 1 + card (row_exec m)"
[PROOF STATE]
proof (prove)
using this:
int (Suc m) \<notin> row_exec m

goal (1 subgoal):
 1. card (insert (int (Suc m)) (row_exec m)) = 1 + card (row_exec m)
[PROOF STEP]
using card_Suc_eq
[PROOF STATE]
proof (prove)
using this:
int (Suc m) \<notin> row_exec m
(card ?A = Suc ?k) = (\<exists>b B. ?A = insert b B \<and> b \<notin> B \<and> card B = ?k \<and> (?k = 0 \<longrightarrow> B = {}))

goal (1 subgoal):
 1. card (insert (int (Suc m)) (row_exec m)) = 1 + card (row_exec m)
[PROOF STEP]
by (metis Suc plus_1_eq_Suc row_exec.simps(1))
[PROOF STATE]
proof (state)
this:
card (insert (int (Suc m)) (row_exec m)) = 1 + card (row_exec m)

goal (2 subgoals):
 1. card (row_exec 0) = 0
 2. \<And>m. card (row_exec m) = m \<Longrightarrow> card (row_exec (Suc m)) = Suc m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (insert (int (Suc m)) (row_exec m)) = 1 + card (row_exec m)
[PROOF STEP]
have "card (row_exec (Suc m)) = 1 + card (row_exec m)"
[PROOF STATE]
proof (prove)
using this:
card (insert (int (Suc m)) (row_exec m)) = 1 + card (row_exec m)

goal (1 subgoal):
 1. card (row_exec (Suc m)) = 1 + card (row_exec m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (row_exec (Suc m)) = 1 + card (row_exec m)

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

goal (1 subgoal):
 1. card (row_exec (Suc m)) = Suc m
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
card (row_exec (Suc m)) = 1 + card (row_exec m)
card (row_exec m) = m

goal (1 subgoal):
 1. card (row_exec (Suc m)) = Suc m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (row_exec (Suc m)) = Suc m

goal (1 subgoal):
 1. card (row_exec 0) = 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma restrict_to_rtranclp:
  assumes "transp_on P A"
    and "x \<in> A" and "y \<in> A"
  shows "(restrict_to P A)\<^sup>*\<^sup>* x y \<longleftrightarrow> P\<^sup>=\<^sup>= x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y
[PROOF STEP]
assume "(restrict_to P A)\<^sup>*\<^sup>* x y"
[PROOF STATE]
proof (state)
this:
(restrict_to P A)\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. (restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(restrict_to P A)\<^sup>*\<^sup>* x y
[PROOF STEP]
have "P\<^sup>=\<^sup>= x y"
[PROOF STATE]
proof (prove)
using this:
(restrict_to P A)\<^sup>*\<^sup>* x y

goal (1 subgoal):
 1. P\<^sup>=\<^sup>= x y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(restrict_to P A)\<^sup>*\<^sup>* x y
transp_on P A
x \<in> A
y \<in> A

goal (1 subgoal):
 1. P\<^sup>=\<^sup>= x y
[PROOF STEP]
by (induct) (auto, unfold transp_on_def, blast)
[PROOF STATE]
proof (state)
this:
P\<^sup>=\<^sup>= x y

goal (1 subgoal):
 1. (restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(restrict_to P A)\<^sup>*\<^sup>* x y \<Longrightarrow> P\<^sup>=\<^sup>= x y

goal (1 subgoal):
 1. (restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
transp_on P A
x \<in> A
y \<in> A
(restrict_to P A)\<^sup>*\<^sup>* x y \<Longrightarrow> P\<^sup>=\<^sup>= x y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
transp_on P A
x \<in> A
y \<in> A
(restrict_to P A)\<^sup>*\<^sup>* x y \<Longrightarrow> P\<^sup>=\<^sup>= x y

goal (1 subgoal):
 1. (restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(restrict_to P A)\<^sup>*\<^sup>* x y = P\<^sup>=\<^sup>= x y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma onorm_id_le: "onorm (\<lambda>x. x) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (\<lambda>x. x) \<le> 1
[PROOF STEP]
by (rule onorm_bound) simp_all


[STATEMENT]
lemma scaleC_minus1_left [simp]: "scaleC (-1) x = - x"
  for x :: "'a::complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 *\<^sub>C x = - x
[PROOF STEP]
using scaleC_minus_left [of 1 x]
[PROOF STATE]
proof (prove)
using this:
- 1 *\<^sub>C x = - (1 *\<^sub>C x)

goal (1 subgoal):
 1. - 1 *\<^sub>C x = - x
[PROOF STEP]
by simp


[STATEMENT]
lemma lookup0_clearjunk0: "lookup0 xs s = lookup0 (clearjunk0 xs) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup0 xs s = lookup0 (clearjunk0 xs) s
[PROOF STEP]
unfolding clearjunk0_def fmlookup_default_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case fmlookup xs s of None \<Rightarrow> 0::'a | Some v \<Rightarrow> v) = (case fmlookup (fmfilter (\<lambda>k. fmlookup xs k \<noteq> Some (0::'a)) xs) s of None \<Rightarrow> 0::'a | Some v \<Rightarrow> v)
[PROOF STEP]
by auto


[STATEMENT]
lemma nths_drop: "nths (drop n xs) I = nths xs ((+) n ` I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths (drop n xs) I = nths xs ((+) n ` I)
[PROOF STEP]
by(force simp: drop_eq_nths nths_nths simp flip: atLeastLessThan_iff
         intro: arg_cong2[where f=nths, OF refl])


[STATEMENT]
lemma mset_eq_setD:
  assumes "mset xs = mset ys"
  shows "set xs = set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs = set ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set xs = set ys
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
mset xs = mset ys
[PROOF STEP]
have "set_mset (mset xs) = set_mset (mset ys)"
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys

goal (1 subgoal):
 1. set_mset (mset xs) = set_mset (mset ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_mset (mset xs) = set_mset (mset ys)

goal (1 subgoal):
 1. set xs = set ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_mset (mset xs) = set_mset (mset ys)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_mset (mset xs) = set_mset (mset ys)

goal (1 subgoal):
 1. set xs = set ys
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set xs = set ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma separating_hyperplane_compact_closed:
  fixes S :: "'a::euclidean_space set"
  assumes "convex S"
    and "compact S"
    and "S \<noteq> {}"
    and "convex T"
    and "closed T"
    and "S \<inter> T = {}"
  shows "\<exists>a b. (\<forall>x\<in>S. inner a x < b) \<and> (\<forall>x\<in>T. inner a x > b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
obtain a b where "(\<forall>x\<in>T. inner a x < b) \<and> (\<forall>x\<in>S. b < inner a x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. (\<forall>x\<in>T. a \<bullet> x < b) \<and> (\<forall>x\<in>S. b < a \<bullet> x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis disjoint_iff_not_equal separating_hyperplane_closed_compact assms)
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>T. a \<bullet> x < b) \<and> (\<forall>x\<in>S. b < a \<bullet> x)

goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x\<in>T. a \<bullet> x < b) \<and> (\<forall>x\<in>S. b < a \<bullet> x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>T. a \<bullet> x < b) \<and> (\<forall>x\<in>S. b < a \<bullet> x)

goal (1 subgoal):
 1. \<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)
[PROOF STEP]
by (metis inner_minus_left neg_less_iff_less)
[PROOF STATE]
proof (state)
this:
\<exists>a b. (\<forall>x\<in>S. a \<bullet> x < b) \<and> (\<forall>x\<in>T. b < a \<bullet> x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma c_fst_eq_arg: "c_fst x = x \<Longrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_fst x = x \<Longrightarrow> x = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_fst x = x \<Longrightarrow> x = 0
[PROOF STEP]
assume A1: "c_fst x = x"
[PROOF STATE]
proof (state)
this:
c_fst x = x

goal (1 subgoal):
 1. c_fst x = x \<Longrightarrow> x = 0
[PROOF STEP]
have S1: "c_fst x \<le> c_sum x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_fst x \<le> c_sum x
[PROOF STEP]
by (rule c_fst_le_c_sum)
[PROOF STATE]
proof (state)
this:
c_fst x \<le> c_sum x

goal (1 subgoal):
 1. c_fst x = x \<Longrightarrow> x = 0
[PROOF STEP]
have S2: "c_sum x \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_sum x \<le> x
[PROOF STEP]
by (rule c_sum_le_arg)
[PROOF STATE]
proof (state)
this:
c_sum x \<le> x

goal (1 subgoal):
 1. c_fst x = x \<Longrightarrow> x = 0
[PROOF STEP]
from A1 S1 S2
[PROOF STATE]
proof (chain)
picking this:
c_fst x = x
c_fst x \<le> c_sum x
c_sum x \<le> x
[PROOF STEP]
have "c_sum x = x"
[PROOF STATE]
proof (prove)
using this:
c_fst x = x
c_fst x \<le> c_sum x
c_sum x \<le> x

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

goal (1 subgoal):
 1. c_fst x = x \<Longrightarrow> x = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_sum x = x
[PROOF STEP]
have "c_fst x = 0"
[PROOF STATE]
proof (prove)
using this:
c_sum x = x

goal (1 subgoal):
 1. c_fst x = 0
[PROOF STEP]
by (rule c_sum_eq_arg_2)
[PROOF STATE]
proof (state)
this:
c_fst x = 0

goal (1 subgoal):
 1. c_fst x = x \<Longrightarrow> x = 0
[PROOF STEP]
with A1
[PROOF STATE]
proof (chain)
picking this:
c_fst x = x
c_fst x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c_fst x = x
c_fst x = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_diff_cancel_right_vec:
  "a \<in> carrier_vec n \<Longrightarrow> (b :: 'a :: cancel_ab_semigroup_add vec) \<in> carrier_vec n \<Longrightarrow>
    (a + b) - b = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier_vec n; b \<in> carrier_vec n\<rbrakk> \<Longrightarrow> a + b - b = a
[PROOF STEP]
by (intro eq_vecI, auto)


[STATEMENT]
lemma entailment_implies_validity:
  assumes "entails_formula S1 S2"
  assumes "validate_formula I S1"
  shows "validate_formula I S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<Turnstile> S2
[PROOF STEP]
using assms entails_def entails_formula_def
[PROOF STATE]
proof (prove)
using this:
entails_formula S1 S2
I \<Turnstile> S1
entails ?S ?C \<equiv> \<forall>I. I \<Turnstile> ?S \<longrightarrow> I \<Turnstile> ?C
entails_formula ?S1.0 ?S2.0 = (\<forall>C\<in>?S2.0. entails ?S1.0 C)

goal (1 subgoal):
 1. I \<Turnstile> S2
[PROOF STEP]
by auto


[STATEMENT]
lemma subset_snd_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> x \<in> A \<Longrightarrow> B \<subseteq> snd ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<times> B \<subseteq> S; x \<in> A\<rbrakk> \<Longrightarrow> B \<subseteq> snd ` S
[PROOF STEP]
unfolding image_def subset_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A \<times> B. x \<in> S; x \<in> A\<rbrakk> \<Longrightarrow> \<forall>x\<in>B. x \<in> {y. \<exists>x\<in>S. y = snd x}
[PROOF STEP]
by force


[STATEMENT]
lemma ordinal_times_monoL [rule_format]:
"\<forall>x x'. x \<le> x' \<longrightarrow> x * y \<le> x' * (y::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x x'. x \<le> x' \<longrightarrow> x * y \<le> x' * y
[PROOF STEP]
apply (rule_tac a=y in oLimit_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>x x'. x \<le> x' \<longrightarrow> x * 0 \<le> x' * 0
 2. \<And>x. \<forall>xa x'. xa \<le> x' \<longrightarrow> xa * x \<le> x' * x \<Longrightarrow> \<forall>xa x'. xa \<le> x' \<longrightarrow> xa * oSuc x \<le> x' * oSuc x
 3. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n x x'. x \<le> x' \<longrightarrow> x * f n \<le> x' * f n\<rbrakk> \<Longrightarrow> \<forall>x x'. x \<le> x' \<longrightarrow> x * oLimit f \<le> x' * oLimit f
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<forall>xa x'. xa \<le> x' \<longrightarrow> xa * x \<le> x' * x \<Longrightarrow> \<forall>xa x'. xa \<le> x' \<longrightarrow> xa * oSuc x \<le> x' * oSuc x
 2. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n x x'. x \<le> x' \<longrightarrow> x * f n \<le> x' * f n\<rbrakk> \<Longrightarrow> \<forall>x x'. x \<le> x' \<longrightarrow> x * oLimit f \<le> x' * oLimit f
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa x'. \<lbrakk>\<forall>xa x'. xa \<le> x' \<longrightarrow> xa * x \<le> x' * x; xa \<le> x'\<rbrakk> \<Longrightarrow> xa * oSuc x \<le> x' * oSuc x
 2. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n x x'. x \<le> x' \<longrightarrow> x * f n \<le> x' * f n\<rbrakk> \<Longrightarrow> \<forall>x x'. x \<le> x' \<longrightarrow> x * oLimit f \<le> x' * oLimit f
[PROOF STEP]
apply (simp add: ordinal_plus_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n x x'. x \<le> x' \<longrightarrow> x * f n \<le> x' * f n\<rbrakk> \<Longrightarrow> \<forall>x x'. x \<le> x' \<longrightarrow> x * oLimit f \<le> x' * oLimit f
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x x'. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n x x'. x \<le> x' \<longrightarrow> x * f n \<le> x' * f n; x \<le> x'\<rbrakk> \<Longrightarrow> oLimit (\<lambda>n. x * f n) \<le> oLimit (\<lambda>n. x' * f n)
[PROOF STEP]
apply (rule oLimit_leI, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x x' n. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n x x'. x \<le> x' \<longrightarrow> x * f n \<le> x' * f n; x \<le> x'\<rbrakk> \<Longrightarrow> x * f n \<le> oLimit (\<lambda>n. x' * f n)
[PROOF STEP]
apply (rule_tac n=n in le_oLimitI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x x' n. \<lbrakk>OrdinalInduct.strict_mono f; \<forall>n x x'. x \<le> x' \<longrightarrow> x * f n \<le> x' * f n; x \<le> x'\<rbrakk> \<Longrightarrow> x * f n \<le> x' * f n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma p_eq2: "int p = (2 * ((int p - 1) div 2)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int p = 2 * ((int p - 1) div 2) + 1
[PROOF STEP]
using odd_p
[PROOF STATE]
proof (prove)
using this:
odd p

goal (1 subgoal):
 1. int p = 2 * ((int p - 1) div 2) + 1
[PROOF STEP]
by simp


[STATEMENT]
lemma lfp_omega_greatest:
  assumes "\<And>u. Omega_fun f g u \<le> u \<Longrightarrow> A \<le> u"
  shows "A \<le> omega_fun f \<circ> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<le> omega_fun f \<circ> g
[PROOF STEP]
apply (unfold omega_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<le> lfp (Omega_fun f id) \<circ> g
[PROOF STEP]
apply (simp add: lfp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<le> \<Sqinter> {u. Omega_fun f id u \<le> u} \<circ> g
[PROOF STEP]
apply (unfold Inf_comp_fun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<le> (\<Sqinter>m\<in>{u. Omega_fun f id u \<le> u}. m \<circ> g)
[PROOF STEP]
apply (rule INF_greatest)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. m \<in> {u. Omega_fun f id u \<le> u} \<Longrightarrow> A \<le> m \<circ> g
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. Omega_fun f id m \<le> m \<Longrightarrow> A \<le> m \<circ> g
[PROOF STEP]
apply (rule assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. Omega_fun f id m \<le> m \<Longrightarrow> Omega_fun f g (m \<circ> g) \<le> m \<circ> g
[PROOF STEP]
apply (simp add: le_fun_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_connected_space_product_topology:
   "path_connected_space(product_topology X I) \<longleftrightarrow>
    topspace(product_topology X I) = {} \<or> (\<forall>i \<in> I. path_connected_space(X i))"
 (is "?lhs \<longleftrightarrow> ?eq \<or> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
[PROOF STEP]
proof (cases ?eq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. topspace (product_topology X I) = {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
 2. topspace (product_topology X I) \<noteq> {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
topspace (product_topology X I) \<noteq> {}

goal (2 subgoals):
 1. topspace (product_topology X I) = {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
 2. topspace (product_topology X I) \<noteq> {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
topspace (product_topology X I) \<noteq> {}

goal (2 subgoals):
 1. topspace (product_topology X I) = {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
 2. topspace (product_topology X I) \<noteq> {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
[PROOF STEP]
have "?lhs = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected_space (product_topology X I) = (\<forall>i\<in>I. path_connected_space (X i))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path_connected_space (product_topology X I) \<Longrightarrow> \<forall>i\<in>I. path_connected_space (X i)
 2. \<forall>i\<in>I. path_connected_space (X i) \<Longrightarrow> path_connected_space (product_topology X I)
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
path_connected_space (product_topology X I)

goal (2 subgoals):
 1. path_connected_space (product_topology X I) \<Longrightarrow> \<forall>i\<in>I. path_connected_space (X i)
 2. \<forall>i\<in>I. path_connected_space (X i) \<Longrightarrow> path_connected_space (product_topology X I)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. path_connected_space (X i)
[PROOF STEP]
proof (clarsimp simp flip: path_connectedin_topspace)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> path_connectedin (X i) (topspace (X i))
[PROOF STEP]
fix i :: "'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> path_connectedin (X i) (topspace (X i))
[PROOF STEP]
assume "i \<in> I"
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> path_connectedin (X i) (topspace (X i))
[PROOF STEP]
have cm: "continuous_map (product_topology X I) (X i) (\<lambda>f. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map (product_topology X I) (X i) (\<lambda>f. f i)
[PROOF STEP]
by (simp add: \<open>i \<in> I\<close> continuous_map_product_projection)
[PROOF STATE]
proof (state)
this:
continuous_map (product_topology X I) (X i) (\<lambda>f. f i)

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> path_connectedin (X i) (topspace (X i))
[PROOF STEP]
show "path_connectedin (X i) (topspace (X i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connectedin (X i) (topspace (X i))
[PROOF STEP]
using path_connectedin_continuous_map_image [OF cm L [unfolded path_connectedin_topspace [symmetric]]]
[PROOF STATE]
proof (prove)
using this:
path_connectedin (X i) ((\<lambda>f. f i) ` topspace (product_topology X I))

goal (1 subgoal):
 1. path_connectedin (X i) (topspace (X i))
[PROOF STEP]
by (metis \<open>i \<in> I\<close> False retraction_imp_surjective_map retraction_map_product_projection)
[PROOF STATE]
proof (state)
this:
path_connectedin (X i) (topspace (X i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. path_connected_space (X i)

goal (1 subgoal):
 1. \<forall>i\<in>I. path_connected_space (X i) \<Longrightarrow> path_connected_space (product_topology X I)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i\<in>I. path_connected_space (X i) \<Longrightarrow> path_connected_space (product_topology X I)
[PROOF STEP]
assume R [rule_format]: ?rhs
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> path_connected_space (X ?i)

goal (1 subgoal):
 1. \<forall>i\<in>I. path_connected_space (X i) \<Longrightarrow> path_connected_space (product_topology X I)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected_space (product_topology X I)
[PROOF STEP]
unfolding path_connected_space_def topspace_product_topology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>\<Pi>\<^sub>E i\<in>I. topspace (X i). \<forall>y\<in>\<Pi>\<^sub>E i\<in>I. topspace (X i). \<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i)); y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))\<rbrakk> \<Longrightarrow> \<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i)); y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))\<rbrakk> \<Longrightarrow> \<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
assume x: "x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))" and y: "y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))"
[PROOF STATE]
proof (state)
this:
x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))
y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i)); y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))\<rbrakk> \<Longrightarrow> \<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
have "\<forall>i. \<exists>g. i \<in> I \<longrightarrow> pathin (X i) g \<and> g 0 = x i \<and> g 1 = y i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. \<exists>g. i \<in> I \<longrightarrow> pathin (X i) g \<and> g 0 = x i \<and> g 1 = y i
[PROOF STEP]
using PiE_mem R path_connected_space_def x y
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f \<in> Pi\<^sub>E ?S ?T; ?x \<in> ?S\<rbrakk> \<Longrightarrow> ?f ?x \<in> ?T ?x
?i \<in> I \<Longrightarrow> path_connected_space (X ?i)
path_connected_space ?X \<equiv> \<forall>x\<in>topspace ?X. \<forall>y\<in>topspace ?X. \<exists>g. pathin ?X g \<and> g 0 = x \<and> g 1 = y
x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))
y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))

goal (1 subgoal):
 1. \<forall>i. \<exists>g. i \<in> I \<longrightarrow> pathin (X i) g \<and> g 0 = x i \<and> g 1 = y i
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>i. \<exists>g. i \<in> I \<longrightarrow> pathin (X i) g \<and> g 0 = x i \<and> g 1 = y i

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i)); y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))\<rbrakk> \<Longrightarrow> \<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. \<exists>g. i \<in> I \<longrightarrow> pathin (X i) g \<and> g 0 = x i \<and> g 1 = y i
[PROOF STEP]
obtain g where g: "\<And>i. i \<in> I \<Longrightarrow> pathin (X i) (g i) \<and> g i 0 = x i \<and> g i 1 = y i"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. \<exists>g. i \<in> I \<longrightarrow> pathin (X i) g \<and> g 0 = x i \<and> g 1 = y i

goal (1 subgoal):
 1. (\<And>g. (\<And>i. i \<in> I \<Longrightarrow> pathin (X i) (g i) \<and> g i 0 = x i \<and> g i 1 = y i) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> pathin (X ?i) (g ?i) \<and> g ?i 0 = x ?i \<and> g ?i 1 = y ?i

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i)); y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))\<rbrakk> \<Longrightarrow> \<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
with x y
[PROOF STATE]
proof (chain)
picking this:
x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))
y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))
?i \<in> I \<Longrightarrow> pathin (X ?i) (g ?i) \<and> g ?i 0 = x ?i \<and> g ?i 1 = y ?i
[PROOF STEP]
show "\<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))
y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i))
?i \<in> I \<Longrightarrow> pathin (X ?i) (g ?i) \<and> g ?i 0 = x ?i \<and> g ?i 1 = y ?i

goal (1 subgoal):
 1. \<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y
[PROOF STEP]
apply (rule_tac x="\<lambda>a. \<lambda>i \<in> I. g i a" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i)); y \<in> (\<Pi>\<^sub>E i\<in>I. topspace (X i)); \<And>i. i \<in> I \<Longrightarrow> pathin (X i) (g i) \<and> g i 0 = x i \<and> g i 1 = y i\<rbrakk> \<Longrightarrow> pathin (product_topology X I) (\<lambda>a. \<lambda>i\<in>I. g i a) \<and> (\<lambda>i\<in>I. g i 0) = x \<and> (\<lambda>i\<in>I. g i 1) = y
[PROOF STEP]
apply (force simp: pathin_def continuous_map_componentwise)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>g. pathin (product_topology X I) g \<and> g 0 = x \<and> g 1 = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
path_connected_space (product_topology X I)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
path_connected_space (product_topology X I) = (\<forall>i\<in>I. path_connected_space (X i))

goal (2 subgoals):
 1. topspace (product_topology X I) = {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
 2. topspace (product_topology X I) \<noteq> {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
topspace (product_topology X I) \<noteq> {}
path_connected_space (product_topology X I) = (\<forall>i\<in>I. path_connected_space (X i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
topspace (product_topology X I) \<noteq> {}
path_connected_space (product_topology X I) = (\<forall>i\<in>I. path_connected_space (X i))

goal (1 subgoal):
 1. path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))

goal (1 subgoal):
 1. topspace (product_topology X I) = {} \<Longrightarrow> path_connected_space (product_topology X I) = (topspace (product_topology X I) = {} \<or> (\<forall>i\<in>I. path_connected_space (X i)))
[PROOF STEP]
qed (simp add: path_connected_space_topspace_empty)


[STATEMENT]
lemma odd_of_distinct:
  assumes "odd_of_distinct p i \<noteq> 0"
  assumes "\<And>i. p i \<noteq> 0 \<Longrightarrow> i \<le> n"
  shows "1 \<le> i \<and> i \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> i \<and> i \<le> n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 \<le> i
 2. i \<le> n
[PROOF STEP]
from assms(1) odd
[PROOF STATE]
proof (chain)
picking this:
odd_of_distinct p i \<noteq> 0
odd_of_distinct ?p ?i \<noteq> 0 \<Longrightarrow> odd ?i
[PROOF STEP]
have "odd i"
[PROOF STATE]
proof (prove)
using this:
odd_of_distinct p i \<noteq> 0
odd_of_distinct ?p ?i \<noteq> 0 \<Longrightarrow> odd ?i

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

goal (2 subgoals):
 1. 1 \<le> i
 2. i \<le> n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
odd i
[PROOF STEP]
show "1 \<le> i"
[PROOF STATE]
proof (prove)
using this:
odd i

goal (1 subgoal):
 1. 1 \<le> i
[PROOF STEP]
by (auto elim: oddE)
[PROOF STATE]
proof (state)
this:
1 \<le> i

goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
odd_of_distinct p i \<noteq> 0
[PROOF STEP]
obtain j where "p (2 ^ j * i) > 0"
[PROOF STATE]
proof (prove)
using this:
odd_of_distinct p i \<noteq> 0

goal (1 subgoal):
 1. (\<And>j. 0 < p (2 ^ j * i) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: odd_of_distinct_def split: if_splits) fastforce
[PROOF STATE]
proof (state)
this:
0 < p (2 ^ j * i)

goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
p ?i \<noteq> 0 \<Longrightarrow> ?i \<le> n
0 < p (2 ^ j * i)
[PROOF STEP]
have "i \<le> 2 ^ j * i" "2 ^ j * i \<le> n"
[PROOF STATE]
proof (prove)
using this:
p ?i \<noteq> 0 \<Longrightarrow> ?i \<le> n
0 < p (2 ^ j * i)

goal (1 subgoal):
 1. i \<le> 2 ^ j * i &&& 2 ^ j * i \<le> n
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
i \<le> 2 ^ j * i
2 ^ j * i \<le> n

goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<le> 2 ^ j * i
2 ^ j * i \<le> n
[PROOF STEP]
show "i \<le> n"
[PROOF STATE]
proof (prove)
using this:
i \<le> 2 ^ j * i
2 ^ j * i \<le> n

goal (1 subgoal):
 1. i \<le> n
[PROOF STEP]
by (rule order_trans)
[PROOF STATE]
proof (state)
this:
i \<le> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) cyclic_group_alt:
   "cyclic_group G \<longleftrightarrow> (\<exists>x. subgroup_generated G {x} = G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cyclic_group G = (\<exists>x. subgroup_generated G {x} = G)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cyclic_group G \<Longrightarrow> \<exists>x. subgroup_generated G {x} = G
 2. \<And>x. subgroup_generated G {x} = G \<Longrightarrow> cyclic_group G
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cyclic_group G \<Longrightarrow> \<exists>x. subgroup_generated G {x} = G
 2. \<And>x. subgroup_generated G {x} = G \<Longrightarrow> cyclic_group G
[PROOF STEP]
assume *: "subgroup_generated G {x} = G"
[PROOF STATE]
proof (state)
this:
subgroup_generated G {x} = G

goal (2 subgoals):
 1. cyclic_group G \<Longrightarrow> \<exists>x. subgroup_generated G {x} = G
 2. \<And>x. subgroup_generated G {x} = G \<Longrightarrow> cyclic_group G
[PROOF STEP]
show "cyclic_group G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cyclic_group G
[PROOF STEP]
proof (cases "x \<in> carrier G")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> carrier G \<Longrightarrow> cyclic_group G
 2. x \<notin> carrier G \<Longrightarrow> cyclic_group G
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> carrier G

goal (2 subgoals):
 1. x \<in> carrier G \<Longrightarrow> cyclic_group G
 2. x \<notin> carrier G \<Longrightarrow> cyclic_group G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G

goal (1 subgoal):
 1. cyclic_group G
[PROOF STEP]
using \<open>subgroup_generated G {x} = G\<close> cyclic_group_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
subgroup_generated G {x} = G
cyclic_group ?G \<equiv> \<exists>x\<in>carrier ?G. subgroup_generated ?G {x} = ?G

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

goal (1 subgoal):
 1. x \<notin> carrier G \<Longrightarrow> cyclic_group G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> carrier G \<Longrightarrow> cyclic_group G
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> carrier G

goal (1 subgoal):
 1. x \<notin> carrier G \<Longrightarrow> cyclic_group G
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> carrier G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<notin> carrier G

goal (1 subgoal):
 1. cyclic_group G
[PROOF STEP]
by (metis "*" Int_empty_right Int_insert_right_if0 carrier_subgroup_generated generate_empty trivial_group trivial_imp_cyclic_group)
[PROOF STATE]
proof (state)
this:
cyclic_group G

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

goal (1 subgoal):
 1. cyclic_group G \<Longrightarrow> \<exists>x. subgroup_generated G {x} = G
[PROOF STEP]
qed (auto simp: cyclic_group_def)


[STATEMENT]
lemma product_language[simp]:
      assumes "alphabet\<^sub>1 A = alphabet\<^sub>2 B"
      shows "c.language (product A B) = a.language A \<union> b.language B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c.language (product A B) = a.language A \<union> b.language B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
alphabet\<^sub>1 A = alphabet\<^sub>2 B

goal (1 subgoal):
 1. c.language (product A B) = a.language A \<union> b.language B
[PROOF STEP]
by (force simp: a.run_alt_def b.run_alt_def)


[STATEMENT]
lemma sinvar_mono_imp_sinvar_mono:
  "sinvar_mono \<Longrightarrow> wf_graph \<lparr> nodes = N, edges = E \<rparr> \<Longrightarrow> E' \<subseteq> E \<Longrightarrow> sinvar \<lparr> nodes = N, edges = E \<rparr> nP \<Longrightarrow>
        sinvar \<lparr> nodes = N, edges = E' \<rparr> nP"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sinvar_mono; wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E; sinvar \<lparr>nodes = N, edges = E\<rparr> nP\<rbrakk> \<Longrightarrow> sinvar \<lparr>nodes = N, edges = E'\<rparr> nP
[PROOF STEP]
apply(simp add: sinvar_mono_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>nP N E'. (\<exists>E. wf_graph \<lparr>nodes = N, edges = E\<rparr> \<and> E' \<subseteq> E \<and> sinvar \<lparr>nodes = N, edges = E\<rparr> nP) \<longrightarrow> sinvar \<lparr>nodes = N, edges = E'\<rparr> nP; wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E; sinvar \<lparr>nodes = N, edges = E\<rparr> nP\<rbrakk> \<Longrightarrow> sinvar \<lparr>nodes = N, edges = E'\<rparr> nP
[PROOF STEP]
by blast


[STATEMENT]
lemma less_prod_Pair_conv:
  "((a1,b1) <_(Product.le rA rB) (a2,b2)) =
  (a1 <_rA a2 & b1 <=_rB b2 | a1 <=_rA a2 & b1 <_rB b2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a1, b1) \<sqsubset>\<^bsub>Product.le rA rB\<^esub> (a2, b2)) = (a1 \<sqsubset>\<^bsub>rA\<^esub> a2 \<and> b1 \<sqsubseteq>\<^bsub>rB\<^esub> b2 \<or> a1 \<sqsubseteq>\<^bsub>rA\<^esub> a2 \<and> b1 \<sqsubset>\<^bsub>rB\<^esub> b2)
[PROOF STEP]
apply (unfold lesssub_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a1, b1) <=(rA,rB) (a2, b2) \<and> (a1, b1) \<noteq> (a2, b2)) = ((a1 \<sqsubseteq>\<^bsub>rA\<^esub> a2 \<and> a1 \<noteq> a2) \<and> b1 \<sqsubseteq>\<^bsub>rB\<^esub> b2 \<or> a1 \<sqsubseteq>\<^bsub>rA\<^esub> a2 \<and> b1 \<sqsubseteq>\<^bsub>rB\<^esub> b2 \<and> b1 \<noteq> b2)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a1 \<sqsubseteq>\<^bsub>rA\<^esub> a2 \<and> b1 \<sqsubseteq>\<^bsub>rB\<^esub> b2 \<and> (a1 = a2 \<longrightarrow> b1 \<noteq> b2)) = (a1 \<sqsubseteq>\<^bsub>rA\<^esub> a2 \<and> a1 \<noteq> a2 \<and> b1 \<sqsubseteq>\<^bsub>rB\<^esub> b2 \<or> a1 \<sqsubseteq>\<^bsub>rA\<^esub> a2 \<and> b1 \<sqsubseteq>\<^bsub>rB\<^esub> b2 \<and> b1 \<noteq> b2)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma independent_vnmI2:
  assumes "\<And>p q r \<alpha>. p \<in> C \<Longrightarrow> q \<in> C \<Longrightarrow> r \<in> C \<Longrightarrow> \<alpha> \<in> {0<..1} \<Longrightarrow> p \<succeq>[P] q \<longleftrightarrow> mix_pmf \<alpha> p r \<succeq>[P] mix_pmf \<alpha> q r"
  shows "independent_vnm C P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent_vnm C P
[PROOF STEP]
by (rule independent_vnmI1, standard, standard, standard,
      standard, simp add: assms) (meson assms greaterThanAtMost_iff)


[STATEMENT]
lemma size_replicate_mset[simp]: "size (replicate_mset n M) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (replicate_mset n M) = n
[PROOF STEP]
by (induct n, simp_all)


[STATEMENT]
theorem wls_freshAbs_swapAbs_id[simp]:
assumes "wlsAbs (us,s) A"
and "freshAbs xs x1 A" and "freshAbs xs x2 A"
shows "(A $[x1 \<and> x2]_xs) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[x1 \<and> x2]_xs = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
freshAbs xs x1 A
freshAbs xs x2 A

goal (1 subgoal):
 1. A $[x1 \<and> x2]_xs = A
[PROOF STEP]
by simp


[STATEMENT]
lemma permutation_ssort: "mset (ssort l) = mset l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (ssort l) = mset l
[PROOF STEP]
unfolding ssort_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (ssort' (of_list l) []) = mset l
[PROOF STEP]
using mset_ssort'[of "of_list l" "[]"]
[PROOF STATE]
proof (prove)
using this:
inv (of_list l) \<Longrightarrow> mset (ssort' (of_list l) []) = multiset (of_list l) + mset []

goal (1 subgoal):
 1. mset (ssort' (of_list l) []) = mset l
[PROOF STEP]
using multiset_of_list of_list_inv
[PROOF STATE]
proof (prove)
using this:
inv (of_list l) \<Longrightarrow> mset (ssort' (of_list l) []) = multiset (of_list l) + mset []
multiset (of_list ?i) = mset ?i
inv (of_list ?x)

goal (1 subgoal):
 1. mset (ssort' (of_list l) []) = mset l
[PROOF STEP]
by simp


[STATEMENT]
lemma project_Stable:
     "(F\<squnion>project h (reachable (extend h F\<squnion>G)) G \<in> Stable A)  =
      (extend h F\<squnion>G \<in> Stable (extend_set h A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<squnion> project h (reachable (extend h F \<squnion> G)) G \<in> Stable A) = (extend h F \<squnion> G \<in> Stable (extend_set h A))
[PROOF STEP]
apply (unfold Stable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<squnion> project h (reachable (extend h F \<squnion> G)) G \<in> A Co A) = (extend h F \<squnion> G \<in> extend_set h A Co extend_set h A)
[PROOF STEP]
apply (rule project_Constrains)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bij_list_succ: "distinct xs \<Longrightarrow> bij (list_succ xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> bij (list_succ xs)
[PROOF STEP]
by (metis bij_def inj_list_succ distinct_rev list_succ_list_succ_rev surj_def)


[STATEMENT]
lemma MOST_const [simp]: "(MOST x::'a. P) \<longleftrightarrow> P \<or> finite (UNIV::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>\<infinity>x. P) = (P \<or> finite UNIV)
[PROOF STEP]
by (simp add: eventually_const_iff)


[STATEMENT]
lemma F1map_comp_id: "F1map g1 g2 g3 (F1map id f2 f3 x) = F1map g1 (g2 o f2) (g3 o f3) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1map g1 g2 g3 (F1map id f2 f3 x) = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F1map g1 g2 g3 (F1map id f2 f3 x) = ?s
 2. ?s = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
apply (rule F1.map_comp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1map (g1 \<circ> id) (g2 \<circ> f2) (g3 \<circ> f3) x = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
unfolding o_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x = F1map g1 (g2 \<circ> f2) (g3 \<circ> f3) x
[PROOF STEP]
apply (rule refl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma replicate_mset_lt_iff_lt[simp]: "replicate_mset m x < replicate_mset n x \<longleftrightarrow> m < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (replicate_mset m x < replicate_mset n x) = (m < n)
[PROOF STEP]
by (induct n m rule: diff_induct) (auto intro: subset_mset.gr_zeroI gr_zeroI)


[STATEMENT]
lemma fresh_star_finite_insert:
  fixes S :: "('a::fs) set"  shows "finite S \<Longrightarrow> a \<sharp>* insert x S \<longleftrightarrow> a \<sharp>* x \<and> a \<sharp>* S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> a \<sharp>* insert x S = (a \<sharp>* x \<and> a \<sharp>* S)
[PROOF STEP]
by (auto simp: fresh_star_def fresh_finite_insert)


[STATEMENT]
lemma subcocycle_lim_avg:
  assumes "subcocycle u" "subcocycle_avg_ereal u > -\<infinity>"
  shows "(\<integral>x. subcocycle_lim u x \<partial>M) = subcocycle_avg u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
have H: "(\<lambda>n. (\<integral>\<^sup>+x. norm(u n x / n - subcocycle_lim u x) \<partial>M)) \<longlonglongrightarrow> 0"
          "integrable M (subcocycle_lim u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<integral>\<^sup>+ x. ennreal (norm (u n x / real n - subcocycle_lim u x)) \<partial>M) \<longlonglongrightarrow> 0 &&& integrable M (subcocycle_lim u)
[PROOF STEP]
using kingman_theorem_nonergodic[OF assms]
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. u n x / real n) \<longlonglongrightarrow> subcocycle_lim u x
integrable M (subcocycle_lim u)
(\<lambda>n. \<integral>\<^sup>+ x. ennreal \<bar>u n x / real n - subcocycle_lim u x\<bar> \<partial>M) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. \<integral>\<^sup>+ x. ennreal (norm (u n x / real n - subcocycle_lim u x)) \<partial>M) \<longlonglongrightarrow> 0 &&& integrable M (subcocycle_lim u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<integral>\<^sup>+ x. ennreal (norm (u n x / real n - subcocycle_lim u x)) \<partial>M) \<longlonglongrightarrow> 0
integrable M (subcocycle_lim u)

goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
have "(\<lambda>n. (\<integral>x. u n x / n \<partial>M)) \<longlonglongrightarrow> (\<integral>x. subcocycle_lim u x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. LINT x|M. u n x / real n) \<longlonglongrightarrow> integral\<^sup>L M (subcocycle_lim u)
[PROOF STEP]
apply (rule tendsto_L1_int[OF _ H(2) H(1)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. integrable M (\<lambda>x. u n x / real n)
[PROOF STEP]
using subcocycle_integrable[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
integrable M (u ?n)
u ?n \<in> borel_measurable M

goal (1 subgoal):
 1. \<And>n. integrable M (\<lambda>x. u n x / real n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. LINT x|M. u n x / real n) \<longlonglongrightarrow> integral\<^sup>L M (subcocycle_lim u)

goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. LINT x|M. u n x / real n) \<longlonglongrightarrow> integral\<^sup>L M (subcocycle_lim u)
[PROOF STEP]
have "(\<lambda>n. (\<integral>x. u n x / n \<partial>M)) \<longlonglongrightarrow> ereal (\<integral>x. subcocycle_lim u x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. LINT x|M. u n x / real n) \<longlonglongrightarrow> integral\<^sup>L M (subcocycle_lim u)

goal (1 subgoal):
 1. (\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (integral\<^sup>L M (subcocycle_lim u))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (integral\<^sup>L M (subcocycle_lim u))

goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (integral\<^sup>L M (subcocycle_lim u))

goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
have "(\<lambda>n. (\<integral>x. u n x / n \<partial>M)) \<longlonglongrightarrow> ereal (subcocycle_avg u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (subcocycle_avg u)
[PROOF STEP]
using subcocycle_int_tendsto_avg[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. LINT x|M. u n x / real n) \<longlonglongrightarrow> subcocycle_avg u

goal (1 subgoal):
 1. (\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (subcocycle_avg u)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (subcocycle_avg u)

goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (integral\<^sup>L M (subcocycle_lim u))
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (subcocycle_avg u)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (integral\<^sup>L M (subcocycle_lim u))
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (subcocycle_avg u)

goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
using LIMSEQ_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (integral\<^sup>L M (subcocycle_lim u))
(\<lambda>x. ereal (LINT xa|M. u x xa / real x)) \<longlonglongrightarrow> ereal (subcocycle_avg u)
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M (subcocycle_lim u) = subcocycle_avg u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma num_params_polypow:
  shows "num_params (p ^\<^sub>p n) \<le> num_params p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_params (p ^\<^sub>p n) \<le> num_params p
[PROOF STEP]
apply (induction n rule: polypow.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. num_params (p ^\<^sub>p 0) \<le> num_params p
 2. \<And>v. (\<And>x. num_params (p ^\<^sub>p Suc v div 2) \<le> num_params p) \<Longrightarrow> num_params (p ^\<^sub>p Suc v) \<le> num_params p
[PROOF STEP]
unfolding polypow.simps
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. num_params (1::'a)\<^sub>p \<le> num_params p
 2. \<And>v. (\<And>x. num_params (p ^\<^sub>p Suc v div 2) \<le> num_params p) \<Longrightarrow> num_params (let q = p ^\<^sub>p Suc v div 2; d = q *\<^sub>p q in if even (Suc v) then d else p *\<^sub>p d) \<le> num_params p
[PROOF STEP]
by (auto intro!: order_trans[OF num_params_polymul]
      simp: Let_def simp del: polypow.simps)


[STATEMENT]
lemma in_cbox_complex_iff:
  "x \<in> cbox a b \<longleftrightarrow> Re x \<in> {Re a..Re b} \<and> Im x \<in> {Im a..Im b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> cbox a b) = (Re x \<in> {Re a..Re b} \<and> Im x \<in> {Im a..Im b})
[PROOF STEP]
by (cases x; cases a; cases b) (auto simp: cbox_Complex_eq)


[STATEMENT]
lemma parts_insert_list_set (*[simp]*):
  "parts ((L`ls) \<union> H) =  (L`ls) \<union> (\<Union>l \<in> ls. parts ((set l))) \<union> parts H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parts (L ` ls \<union> H) = L ` ls \<union> (\<Union>l\<in>ls. parts (set l)) \<union> parts H
[PROOF STEP]
apply (rule equalityI, rule subsetI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> parts (L ` ls \<union> H) \<Longrightarrow> x \<in> L ` ls \<union> (\<Union>l\<in>ls. parts (set l)) \<union> parts H
 2. L ` ls \<union> (\<Union>l\<in>ls. parts (set l)) \<union> parts H \<subseteq> parts (L ` ls \<union> H)
[PROOF STEP]
by (erule parts.induct, auto simp add: parts_list_set)


[STATEMENT]
lemma height_balance: "\<lbrakk> \<not> bal_i (size t) h \<rbrakk>
  \<Longrightarrow> height (balance_tree (t::'a::linorder tree)) < h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> bal_i (size t) h \<Longrightarrow> height (balance_tree t) < h
[PROOF STEP]
by (meson bal_i_balance leI le_refl mono_bal_i)


[STATEMENT]
lemma \<nu>_elem: "\<nu> (mk_markovian p) s = (\<Sum>i. l^i * \<P>\<^sub>X p i (r_dec\<^sub>b (p i)) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> (mk_markovian p) s = (\<Sum>i. l ^ i * apply_bfun (\<P>\<^sub>X p i (r_dec\<^sub>b (p i))) s)
[PROOF STEP]
unfolding \<nu>\<^sub>b.rep_eq \<P>\<^sub>X_def \<nu>_eq_Pn Pn'_markovian_eq_Xn'_bind measure_pmf_bind
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. l ^ i * integral\<^sup>L (measure_pmf (Xn' (mk_markovian p) s i) \<bind> (\<lambda>x. measure_pmf (K0' (p i) x))) r) = (\<Sum>i. l ^ i * apply_bfun (push_exp (\<lambda>s. Xn' (mk_markovian p) s i) (r_dec\<^sub>b (p i))) s)
[PROOF STEP]
using measure_pmf_in_subprob_algebra abs_r_le_r\<^sub>M
[PROOF STATE]
proof (prove)
using this:
measure_pmf ?x \<in> space (subprob_algebra (count_space UNIV))
\<bar>r ?sa\<bar> \<le> r\<^sub>M

goal (1 subgoal):
 1. (\<Sum>i. l ^ i * integral\<^sup>L (measure_pmf (Xn' (mk_markovian p) s i) \<bind> (\<lambda>x. measure_pmf (K0' (p i) x))) r) = (\<Sum>i. l ^ i * apply_bfun (push_exp (\<lambda>s. Xn' (mk_markovian p) s i) (r_dec\<^sub>b (p i))) s)
[PROOF STEP]
by (subst integral_bind) (auto simp: r_dec_eq_r_K0)