[STATEMENT]
lemma  OPT2_split11:
  assumes xy: "x\<noteq>y"
  shows "R\<in>{[x,y],[y,x]} \<Longrightarrow> set xs \<subseteq> {x,y} \<Longrightarrow> set ys \<subseteq> {x,y} \<Longrightarrow> OPT2 (xs@[x,x]@ys) R = OPT2 (xs@[x,x]) R @ OPT2 ys [x,y]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ([] @ [x, x] @ ys) R = OPT2 ([] @ [x, x]) R @ OPT2 ys [x, y]
 2. \<And>a xs R. \<lbrakk>\<And>R. \<lbrakk>R \<in> {[x, y], [y, x]}; set xs \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
R \<in> {[x, y], [y, x]}
set [] \<subseteq> {x, y}
set ys \<subseteq> {x, y}

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

goal (1 subgoal):
 1. OPT2 ([] @ [x, x] @ ys) R = OPT2 ([] @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R = [x, y] \<or> R = [y, x]; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (x # x # ys) R = OPT2 [x, x] R @ OPT2 ys [x, y]
[PROOF STEP]
apply(cases ys)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>R = [x, y] \<or> R = [y, x]; set ys \<subseteq> {x, y}; ys = []\<rbrakk> \<Longrightarrow> OPT2 (x # x # ys) R = OPT2 [x, x] R @ OPT2 ys [x, y]
 2. \<And>a list. \<lbrakk>R = [x, y] \<or> R = [y, x]; set ys \<subseteq> {x, y}; ys = a # list\<rbrakk> \<Longrightarrow> OPT2 (x # x # ys) R = OPT2 [x, x] R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>R = [x, y] \<or> R = [y, x]; set ys \<subseteq> {x, y}; ys = a # list\<rbrakk> \<Longrightarrow> OPT2 (x # x # ys) R = OPT2 [x, x] R @ OPT2 ys [x, y]
[PROOF STEP]
apply(cases "R=[x,y]")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a list. \<lbrakk>R = [x, y] \<or> R = [y, x]; set ys \<subseteq> {x, y}; ys = a # list; R = [x, y]\<rbrakk> \<Longrightarrow> OPT2 (x # x # ys) R = OPT2 [x, x] R @ OPT2 ys [x, y]
 2. \<And>a list. \<lbrakk>R = [x, y] \<or> R = [y, x]; set ys \<subseteq> {x, y}; ys = a # list; R \<noteq> [x, y]\<rbrakk> \<Longrightarrow> OPT2 (x # x # ys) R = OPT2 [x, x] R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>R = [x, y] \<or> R = [y, x]; set ys \<subseteq> {x, y}; ys = a # list; R \<noteq> [x, y]\<rbrakk> \<Longrightarrow> OPT2 (x # x # ys) R = OPT2 [x, x] R @ OPT2 ys [x, y]
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
OPT2 ([] @ [x, x] @ ys) R = OPT2 ([] @ [x, x]) R @ OPT2 ys [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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
case (Cons a as)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?R \<in> {[x, y], [y, x]}; set as \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (as @ [x, x] @ ys) ?R = OPT2 (as @ [x, x]) ?R @ OPT2 ys [x, y]
R \<in> {[x, y], [y, x]}
set (a # as) \<subseteq> {x, y}
set ys \<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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
note iH=this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?R \<in> {[x, y], [y, x]}; set as \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (as @ [x, x] @ ys) ?R = OPT2 (as @ [x, x]) ?R @ OPT2 ys [x, y]
R \<in> {[x, y], [y, x]}
set (a # as) \<subseteq> {x, y}
set ys \<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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?R \<in> {[x, y], [y, x]}; set as \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (as @ [x, x] @ ys) ?R = OPT2 (as @ [x, x]) ?R @ OPT2 ys [x, y]
R \<in> {[x, y], [y, x]}
set (a # as) \<subseteq> {x, y}
set ys \<subseteq> {x, y}
[PROOF STEP]
have AS: "set as \<subseteq> {x,y}" and A: "a \<in> {x,y}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?R \<in> {[x, y], [y, x]}; set as \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (as @ [x, x] @ ys) ?R = OPT2 (as @ [x, x]) ?R @ OPT2 ys [x, y]
R \<in> {[x, y], [y, x]}
set (a # as) \<subseteq> {x, y}
set ys \<subseteq> {x, y}

goal (1 subgoal):
 1. set as \<subseteq> {x, y} &&& a \<in> {x, y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set as \<subseteq> {x, y}
a \<in> {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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
note iH=Cons(1)[where R="[y,x]", simplified, OF AS Cons(4)]
[PROOF STATE]
proof (state)
this:
OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
note iH'=Cons(1)[where R="[x,y]", simplified, OF AS Cons(4)]
[PROOF STATE]
proof (state)
this:
OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [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}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (xs @ [x, x] @ ys) R = OPT2 (xs @ [x, x]) R @ OPT2 ys [x, y]; R \<in> {[x, y], [y, x]}; set (a # xs) \<subseteq> {x, y}; set ys \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 ((a # xs) @ [x, x] @ ys) R = OPT2 ((a # xs) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
proof (cases "R=[x,y]")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. R = [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
 2. R \<noteq> [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
R = [x, y]

goal (2 subgoals):
 1. R = [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
 2. R \<noteq> [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
note R=this
[PROOF STATE]
proof (state)
this:
R = [x, y]

goal (2 subgoals):
 1. R = [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
 2. R \<noteq> [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
from iH iH'
[PROOF STATE]
proof (chain)
picking this:
OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]
OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]
OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]

goal (1 subgoal):
 1. OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(cases "a=x")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a = x\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
 2. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a \<noteq> x\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp add: R OPT2x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a \<noteq> x\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
a \<in> {x, y}

goal (1 subgoal):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a \<noteq> x\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y\<rbrakk> \<Longrightarrow> OPT2 (y # as @ x # x # ys) R = OPT2 (y # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(cases as)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y; as = []\<rbrakk> \<Longrightarrow> OPT2 (y # as @ x # x # ys) R = OPT2 (y # as @ [x, x]) R @ OPT2 ys [x, y]
 2. \<And>aa list. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y; as = aa # list\<rbrakk> \<Longrightarrow> OPT2 (y # as @ x # x # ys) R = OPT2 (y # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp add: R)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa list. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y; as = aa # list\<rbrakk> \<Longrightarrow> OPT2 (y # as @ x # x # ys) R = OPT2 (y # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
using AS
[PROOF STATE]
proof (prove)
using this:
set as \<subseteq> {x, y}

goal (1 subgoal):
 1. \<And>aa list. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y; as = aa # list\<rbrakk> \<Longrightarrow> OPT2 (y # as @ x # x # ys) R = OPT2 (y # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa list. \<lbrakk>OPT2 (aa # list @ x # x # ys) [y, x] = OPT2 (aa # list @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (aa # list @ x # x # ys) [x, y] = OPT2 (aa # list @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y; as = aa # list; (aa = x \<or> aa = y) \<and> set list \<subseteq> {x, y}\<rbrakk> \<Longrightarrow> OPT2 (y # aa # list @ x # x # ys) R = OPT2 (y # aa # list @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(case_tac "aa=x")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>aa list. \<lbrakk>OPT2 (aa # list @ x # x # ys) [y, x] = OPT2 (aa # list @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (aa # list @ x # x # ys) [x, y] = OPT2 (aa # list @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y; as = aa # list; (aa = x \<or> aa = y) \<and> set list \<subseteq> {x, y}; aa = x\<rbrakk> \<Longrightarrow> OPT2 (y # aa # list @ x # x # ys) R = OPT2 (y # aa # list @ [x, x]) R @ OPT2 ys [x, y]
 2. \<And>aa list. \<lbrakk>OPT2 (aa # list @ x # x # ys) [y, x] = OPT2 (aa # list @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (aa # list @ x # x # ys) [x, y] = OPT2 (aa # list @ [x, x]) [x, y] @ OPT2 ys [x, y]; y \<noteq> x; a = y; as = aa # list; (aa = x \<or> aa = y) \<and> set list \<subseteq> {x, y}; aa \<noteq> x\<rbrakk> \<Longrightarrow> OPT2 (y # aa # list @ x # x # ys) R = OPT2 (y # aa # list @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
by(simp_all add: R)
[PROOF STATE]
proof (state)
this:
OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]

goal (1 subgoal):
 1. R \<noteq> [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. R \<noteq> [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
R \<noteq> [x, y]

goal (1 subgoal):
 1. R \<noteq> [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
with Cons(2)
[PROOF STATE]
proof (chain)
picking this:
R \<in> {[x, y], [y, x]}
R \<noteq> [x, y]
[PROOF STEP]
have R: "R=[y,x]"
[PROOF STATE]
proof (prove)
using this:
R \<in> {[x, y], [y, x]}
R \<noteq> [x, y]

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

goal (1 subgoal):
 1. R \<noteq> [x, y] \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
from iH iH'
[PROOF STATE]
proof (chain)
picking this:
OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]
OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]
OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]

goal (1 subgoal):
 1. OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(cases "a=y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a = y\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
 2. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a \<noteq> y\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp add: R OPT2x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a \<noteq> y\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
a \<in> {x, y}

goal (1 subgoal):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; a \<noteq> y\<rbrakk> \<Longrightarrow> OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; x \<noteq> y; a = x\<rbrakk> \<Longrightarrow> OPT2 (x # as @ x # x # ys) R = OPT2 (x # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(cases as)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; x \<noteq> y; a = x; as = []\<rbrakk> \<Longrightarrow> OPT2 (x # as @ x # x # ys) R = OPT2 (x # as @ [x, x]) R @ OPT2 ys [x, y]
 2. \<And>aa list. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; x \<noteq> y; a = x; as = aa # list\<rbrakk> \<Longrightarrow> OPT2 (x # as @ x # x # ys) R = OPT2 (x # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(simp add: R)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa list. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; x \<noteq> y; a = x; as = aa # list\<rbrakk> \<Longrightarrow> OPT2 (x # as @ x # x # ys) R = OPT2 (x # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
apply(case_tac "aa=y")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>aa list. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; x \<noteq> y; a = x; as = aa # list; aa = y\<rbrakk> \<Longrightarrow> OPT2 (x # as @ x # x # ys) R = OPT2 (x # as @ [x, x]) R @ OPT2 ys [x, y]
 2. \<And>aa list. \<lbrakk>OPT2 (as @ x # x # ys) [y, x] = OPT2 (as @ [x, x]) [y, x] @ OPT2 ys [x, y]; OPT2 (as @ x # x # ys) [x, y] = OPT2 (as @ [x, x]) [x, y] @ OPT2 ys [x, y]; x \<noteq> y; a = x; as = aa # list; aa \<noteq> y\<rbrakk> \<Longrightarrow> OPT2 (x # as @ x # x # ys) R = OPT2 (x # as @ [x, x]) R @ OPT2 ys [x, y]
[PROOF STEP]
by (simp_all add: R)
[PROOF STATE]
proof (state)
this:
OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
OPT2 ((a # as) @ [x, x] @ ys) R = OPT2 ((a # as) @ [x, x]) R @ OPT2 ys [x, y]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_less_eq_aux'_antisym: "\<lbrakk> A \<sqsubseteq>'' B; B \<sqsubseteq>'' A \<rbrakk> \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<sqsubseteq>'' B; B \<sqsubseteq>'' A\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
by(auto simp add: set_less_eq_aux'_def intro: set_less_eq_aux_antisym del: equalityI)


[STATEMENT]
lemma vec_to_iarray_row': "vec_to_iarray (row i A) = (matrix_to_iarray A) !! (to_nat i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (row i A) = matrix_to_iarray A !! mod_type_class.to_nat i
[PROOF STEP]
unfolding row_def vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>ia. vec_lambda (($) (A $ i)) $ mod_type_class.from_nat ia) CARD('b) = matrix_to_iarray A !! mod_type_class.to_nat i
[PROOF STEP]
by (auto, metis IArray.sub_def IArray.of_fun_def vec_matrix vec_to_iarray_def)


[STATEMENT]
lemma ltlr_to_ltln_semantics:
  "w \<Turnstile>\<^sub>n ltlr_to_ltln \<phi> \<longleftrightarrow> w \<Turnstile>\<^sub>r \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n ltlr_to_ltln \<phi> = w \<Turnstile>\<^sub>r \<phi>
[PROOF STEP]
by (induction \<phi> arbitrary: w) simp_all


[STATEMENT]
lemma infsum_Un_Int:
  fixes f :: "'a \<Rightarrow> 'b::{topological_ab_group_add, t2_space}"
  assumes [simp]: "f summable_on A - B" "f summable_on B - A" \<open>f summable_on A \<inter> B\<close>
  shows   "infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
have [simp]: \<open>f summable_on A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f summable_on A
[PROOF STEP]
apply (subst asm_rl[of \<open>A = (A-B) \<union> (A\<inter>B)\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. A = A - B \<union> A \<inter> B
 2. f summable_on A - B \<union> A \<inter> B
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f summable_on A - B \<union> A \<inter> B
[PROOF STEP]
apply (rule summable_on_Un_disjoint)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. f summable_on A - B
 2. f summable_on A \<inter> B
 3. (A - B) \<inter> (A \<inter> B) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f summable_on A

goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
have \<open>infsum f (A \<union> B) = infsum f A + infsum f (B - A)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f (B - A)
[PROOF STEP]
apply (subst infsum_Un_disjoint[symmetric])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. f summable_on A
 2. f summable_on B - A
 3. A \<inter> (B - A) = {}
 4. infsum f (A \<union> B) = infsum f (A \<union> (B - A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infsum f (A \<union> B) = infsum f A + infsum f (B - A)

goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
infsum f (A \<union> B) = infsum f A + infsum f (B - A)

goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
have \<open>infsum f (B - A \<union> A \<inter> B) = infsum f (B - A) + infsum f (A \<inter> B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f (B - A \<union> A \<inter> B) = infsum f (B - A) + infsum f (A \<inter> B)
[PROOF STEP]
by (rule infsum_Un_disjoint) auto
[PROOF STATE]
proof (state)
this:
infsum f (B - A \<union> A \<inter> B) = infsum f (B - A) + infsum f (A \<inter> B)

goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
infsum f (B - A \<union> A \<inter> B) = infsum f (B - A) + infsum f (A \<inter> B)

goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
have "B - A \<union> A \<inter> B = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B - A \<union> A \<inter> B = B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B - A \<union> A \<inter> B = B

goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
infsum f (A \<union> B) = infsum f A + infsum f (B - A)
infsum f (B - A \<union> A \<inter> B) = infsum f (B - A) + infsum f (A \<inter> B)
B - A \<union> A \<inter> B = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infsum f (A \<union> B) = infsum f A + infsum f (B - A)
infsum f (B - A \<union> A \<inter> B) = infsum f (B - A) + infsum f (A \<inter> B)
B - A \<union> A \<inter> B = B

goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infsum f (A \<union> B) = infsum f A + infsum f B - infsum f (A \<inter> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma boundedBySuc[rule_format]: "sigma \<in> subs Gamma \<Longrightarrow> boundedBy (Suc n) (tree subs Gamma) \<longrightarrow> boundedBy n (tree subs sigma)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma \<in> subs Gamma \<Longrightarrow> boundedBy (Suc n) (tree subs Gamma) \<longrightarrow> boundedBy n (tree subs sigma)
[PROOF STEP]
apply(subst treeEquation [of _ Gamma])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma \<in> subs Gamma \<Longrightarrow> boundedBy (Suc n) (insert (0, Gamma) (\<Union>delta\<in>subs Gamma. incLevel ` tree subs delta)) \<longrightarrow> boundedBy n (tree subs sigma)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sigma \<in> subs Gamma; boundedBy (Suc n) (insert (0, Gamma) (\<Union>delta\<in>subs Gamma. incLevel ` tree subs delta))\<rbrakk> \<Longrightarrow> boundedBy n (tree subs sigma)
[PROOF STEP]
apply(simp add: boundedByInsert)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sigma \<in> subs Gamma; boundedBy (Suc n) (\<Union>x\<in>subs Gamma. incLevel ` tree subs x)\<rbrakk> \<Longrightarrow> boundedBy n (tree subs sigma)
[PROOF STEP]
apply(simp add: boundedByUN)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sigma \<in> subs Gamma; \<forall>x\<in>subs Gamma. boundedBy (Suc n) (incLevel ` tree subs x)\<rbrakk> \<Longrightarrow> boundedBy n (tree subs sigma)
[PROOF STEP]
apply(drule_tac x=sigma in bspec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sigma \<in> subs Gamma \<Longrightarrow> sigma \<in> subs Gamma
 2. \<lbrakk>sigma \<in> subs Gamma; boundedBy (Suc n) (incLevel ` tree subs sigma)\<rbrakk> \<Longrightarrow> boundedBy n (tree subs sigma)
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sigma \<in> subs Gamma; boundedBy (Suc n) (incLevel ` tree subs sigma)\<rbrakk> \<Longrightarrow> boundedBy n (tree subs sigma)
[PROOF STEP]
apply(simp add: boundedByIncLevel)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma foldr_And_map_rlfm2:
  assumes lf: "\<forall> n . isrlfm (f n)"
  shows "isrlfm (foldr conj (map f xs) T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isrlfm (foldr MIR.conj (map f xs) T)
[PROOF STEP]
using lf
[PROOF STATE]
proof (prove)
using this:
\<forall>n. isrlfm (f n)

goal (1 subgoal):
 1. isrlfm (foldr MIR.conj (map f xs) T)
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma ord_equiv_inducedS:
      "\<lbrakk>Order D; Order E; ord_isom D E f; D1 \<subseteq> carrier D \<rbrakk> \<Longrightarrow>
                        ord_equiv (SIod D D1) (SIod E (f ` D1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; D1 \<subseteq> carrier D\<rbrakk> \<Longrightarrow> ord_equiv (SIod D D1) (SIod E (f ` D1))
[PROOF STEP]
apply (simp add:ord_equiv_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; D1 \<subseteq> carrier D\<rbrakk> \<Longrightarrow> \<exists>fa. ord_isom (SIod D D1) (SIod E (f ` D1)) fa
[PROOF STEP]
apply (frule ord_isom_restrictedS [of "D" "E" "f" "D1"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; D1 \<subseteq> carrier D; ord_isom (SIod D D1) (SIod E (f ` D1)) (restrict f D1)\<rbrakk> \<Longrightarrow> \<exists>fa. ord_isom (SIod D D1) (SIod E (f ` D1)) fa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma append_take_drop_id [simp]: "take n xs @ drop n xs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n xs @ drop n xs = xs
[PROOF STEP]
proof (induct n arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. take 0 xs @ drop 0 xs = xs
 2. \<And>n xs. (\<And>xs. take n xs @ drop n xs = xs) \<Longrightarrow> take (Suc n) xs @ drop (Suc n) xs = xs
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs. take 0 xs @ drop 0 xs = xs
 2. \<And>n xs. (\<And>xs. take n xs @ drop n xs = xs) \<Longrightarrow> take (Suc n) xs @ drop (Suc n) xs = xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take 0 xs @ drop 0 xs = xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
take 0 xs @ drop 0 xs = xs

goal (1 subgoal):
 1. \<And>n xs. (\<And>xs. take n xs @ drop n xs = xs) \<Longrightarrow> take (Suc n) xs @ drop (Suc n) xs = xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n xs. (\<And>xs. take n xs @ drop n xs = xs) \<Longrightarrow> take (Suc n) xs @ drop (Suc n) xs = xs
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
take n_ ?xs @ drop n_ ?xs = ?xs

goal (1 subgoal):
 1. \<And>n xs. (\<And>xs. take n xs @ drop n xs = xs) \<Longrightarrow> take (Suc n) xs @ drop (Suc n) xs = xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take n_ ?xs @ drop n_ ?xs = ?xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
take n_ ?xs @ drop n_ ?xs = ?xs

goal (1 subgoal):
 1. take (Suc n_) xs @ drop (Suc n_) xs = xs
[PROOF STEP]
by (cases xs) simp_all
[PROOF STATE]
proof (state)
this:
take (Suc n_) xs @ drop (Suc n_) xs = xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_dvd_mod: "y dvd x = (x mod y = (0::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y dvd x) = (x mod y = 0)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. y dvd x \<Longrightarrow> x mod y = 0
 2. x mod y = 0 \<Longrightarrow> y dvd x
[PROOF STEP]
apply (erule dvdE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. x = y * k \<Longrightarrow> x mod y = 0
 2. x mod y = 0 \<Longrightarrow> y dvd x
[PROOF STEP]
apply (case_tac "y=0", simp add: ordinal_mod_0, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. \<lbrakk>x = y * k; 0 < y\<rbrakk> \<Longrightarrow> y * k mod y = 0
 2. x mod y = 0 \<Longrightarrow> y dvd x
[PROOF STEP]
apply (rule ordinal_modI, simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod y = 0 \<Longrightarrow> y dvd x
[PROOF STEP]
apply (cut_tac x=x and y=y in ordinal_div_plus_mod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod y = 0; y * (x div y) + x mod y = x\<rbrakk> \<Longrightarrow> y dvd x
[PROOF STEP]
apply (rule_tac k="x div y" in dvdI, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_transform_within_openin:
  assumes "continuous (at a within T) f"
    and "openin (top_of_set T) S" "a \<in> S"
    and eq: "\<And>x. x \<in> S \<Longrightarrow> f x = g x"
  shows "continuous (at a within T) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at a within T) g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous (at a within T) f
openin (top_of_set T) S
a \<in> S
?x \<in> S \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. continuous (at a within T) g
[PROOF STEP]
by (simp add: Lim_transform_within_openin continuous_within)


[STATEMENT]
lemma Block_self:
  "\<lbrakk> a \<in> A; A \<in> P \<rbrakk> \<Longrightarrow> Block a = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; A \<in> P\<rbrakk> \<Longrightarrow> Block a = A
[PROOF STEP]
apply (simp add: Block_def block_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; A \<in> P\<rbrakk> \<Longrightarrow> (THE A. a \<in> A \<and> A \<in> P) = A
[PROOF STEP]
apply (rule the_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> A; A \<in> P\<rbrakk> \<Longrightarrow> a \<in> A \<and> A \<in> P
 2. \<And>Aa. \<lbrakk>a \<in> A; A \<in> P; a \<in> Aa \<and> Aa \<in> P\<rbrakk> \<Longrightarrow> Aa = A
[PROOF STEP]
apply (auto dest: block_unique)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mono_llist_ltakeWhile [partial_function_mono]:
  "mono_llist F \<Longrightarrow> mono_llist (\<lambda>f. ltakeWhile P (F f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone llist.le_fun (\<sqsubseteq>) F \<Longrightarrow> monotone llist.le_fun (\<sqsubseteq>) (\<lambda>f. ltakeWhile P (F f))
[PROOF STEP]
by(rule mono2mono_ltakeWhile)


[STATEMENT]
lemma map_rev_in_lists_conv [reversal_rule]: "map rev us \<in> lists \<C> \<longleftrightarrow> us \<in> lists \<C>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map rev us \<in> lists \<C>) = (us \<in> lists \<C>)
[PROOF STEP]
using palindrome
[PROOF STATE]
proof (prove)
using this:
?u \<in> \<C> \<Longrightarrow> rev ?u = ?u

goal (1 subgoal):
 1. (map rev us \<in> lists \<C>) = (us \<in> lists \<C>)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma rel_nabla_bin_unfold: "rel_nabla_bin X Q \<subseteq> relfdia X (rel_nabla_bin X Q) \<union> rdom Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_nabla_bin X Q \<subseteq> relfdia X (rel_nabla_bin X Q) \<union> rdom Q
[PROOF STEP]
by (simp add: rel_nabla_bin_def rel_ad_def rel_antidomain_kleene_algebra.fdia_def, blast)


[STATEMENT]
lemma iMOD_0_eq_conv: "([r, mod 0] = [r', mod m']) = (r = r' \<and> m' = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r, mod 0 ] = [ r', mod m' ]) = (r = r' \<and> m' = 0)
[PROOF STEP]
apply (simp add: iMOD_0 iIN_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({r} = [ r', mod m' ]) = (r = r' \<and> m' = 0)
[PROOF STEP]
apply (simp add: iMOD_singleton_eq_conv eq_sym_conv[of "{r}"] eq_sym_conv[of "r"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma freess_cons[simp]: "freess (x # xs) = frees x |\<union>| freess xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freess (x # xs) = frees x |\<union>| freess xs
[PROOF STEP]
unfolding freess_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ffUnion \<circ> fset_of_list \<circ> map frees) (x # xs) = frees x |\<union>| (ffUnion \<circ> fset_of_list \<circ> map frees) xs
[PROOF STEP]
by simp


[STATEMENT]
lemma SAMEQUTO_UN[simp]: "SAMEQUOT x (\<Union>y \<in> A. B y) = (\<Union>y \<in> A. SAMEQUOT x (B y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SAMEQUOT x (\<Union> (B ` A)) = (\<Union>y\<in>A. SAMEQUOT x (B y))
[PROOF STEP]
unfolding SAMEQUOT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {fin_cut_same x xa @ replicate m x |xa m. xa \<in> \<Union> (B ` A)} = (\<Union>y\<in>A. {fin_cut_same x xa @ replicate m x |xa m. xa \<in> B y})
[PROOF STEP]
by auto


[STATEMENT]
lemma kerT_is_subspace: "subspace K ker V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace K kerT V
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subspace K kerT V
[PROOF STEP]
have vs: "vectorspace K V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace K V
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
vectorspace K V

goal (1 subgoal):
 1. subspace K kerT V
[PROOF STEP]
from vs
[PROOF STATE]
proof (chain)
picking this:
vectorspace K V
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vectorspace K V

goal (1 subgoal):
 1. subspace K kerT V
[PROOF STEP]
apply (unfold subspace_def, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace K V \<Longrightarrow> LinearCombinations.submodule K kerT V
[PROOF STEP]
by (rule ker_is_submodule)
[PROOF STATE]
proof (state)
this:
subspace K kerT V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_of_Func_mono:
fixes A1 A2 :: "'a set" and B :: "'b set"
assumes A12: "A1 \<subseteq> A2" and B: "B \<noteq> {}"
shows "|Func A1 B| \<le>o |Func A2 B|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Func A1 B| \<le>o |Func A2 B|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |Func A1 B| \<le>o |Func A2 B|
[PROOF STEP]
obtain bb where bb: "bb \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>bb. bb \<in> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
B \<noteq> {}

goal (1 subgoal):
 1. (\<And>bb. bb \<in> B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bb \<in> B

goal (1 subgoal):
 1. |Func A1 B| \<le>o |Func A2 B|
[PROOF STEP]
define F where [abs_def]: "F f1 a =
    (if a \<in> A2 then (if a \<in> A1 then f1 a else bb) else undefined)" for f1 :: "'a \<Rightarrow> 'b" and a
[PROOF STATE]
proof (state)
this:
F \<equiv> \<lambda>f1 a. if a \<in> A2 then if a \<in> A1 then f1 a else bb else undefined

goal (1 subgoal):
 1. |Func A1 B| \<le>o |Func A2 B|
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Func A1 B| \<le>o |Func A2 B|
[PROOF STEP]
unfolding card_of_ordLeq[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. inj_on f (Func A1 B) \<and> f ` Func A1 B \<subseteq> Func A2 B
[PROOF STEP]
proof(intro exI[of _ F] conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on F (Func A1 B)
 2. F ` Func A1 B \<subseteq> Func A2 B
[PROOF STEP]
show "inj_on F (Func A1 B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on F (Func A1 B)
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>Func A1 B. \<forall>y\<in>Func A1 B. F x = F y \<longrightarrow> x = y
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> Func A1 B; y \<in> Func A1 B; F x = F y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix f g
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> Func A1 B; y \<in> Func A1 B; F x = F y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume f: "f \<in> Func A1 B" and g: "g \<in> Func A1 B" and eq: "F f = F g"
[PROOF STATE]
proof (state)
this:
f \<in> Func A1 B
g \<in> Func A1 B
F f = F g

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> Func A1 B; y \<in> Func A1 B; F x = F y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
show "f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g
[PROOF STEP]
proof(rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f x = g x
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. f x = g x
[PROOF STEP]
show "f a = g a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a = g a
[PROOF STEP]
proof(cases "a \<in> A1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<in> A1 \<Longrightarrow> f a = g a
 2. a \<notin> A1 \<Longrightarrow> f a = g a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a \<in> A1

goal (2 subgoals):
 1. a \<in> A1 \<Longrightarrow> f a = g a
 2. a \<notin> A1 \<Longrightarrow> f a = g a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> A1

goal (1 subgoal):
 1. f a = g a
[PROOF STEP]
using eq A12
[PROOF STATE]
proof (prove)
using this:
a \<in> A1
F f = F g
A1 \<subseteq> A2

goal (1 subgoal):
 1. f a = g a
[PROOF STEP]
unfolding F_def fun_eq_iff
[PROOF STATE]
proof (prove)
using this:
a \<in> A1
\<forall>x. (if x \<in> A2 then if x \<in> A1 then f x else bb else undefined) = (if x \<in> A2 then if x \<in> A1 then g x else bb else undefined)
A1 \<subseteq> A2

goal (1 subgoal):
 1. f a = g a
[PROOF STEP]
by (elim allE[of _ a]) auto
[PROOF STATE]
proof (state)
this:
f a = g a

goal (1 subgoal):
 1. a \<notin> A1 \<Longrightarrow> f a = g a
[PROOF STEP]
qed(insert f g, unfold Func_def, fastforce)
[PROOF STATE]
proof (state)
this:
f a = g a

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on F (Func A1 B)

goal (1 subgoal):
 1. F ` Func A1 B \<subseteq> Func A2 B
[PROOF STEP]
qed(insert bb, unfold Func_def F_def, force)
[PROOF STATE]
proof (state)
this:
|Func A1 B| \<le>o |Func A2 B|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolutely_integrable_spike:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "f absolutely_integrable_on T" and S: "negligible S" "\<And>x. x \<in> T - S \<Longrightarrow> g x = f x"
  shows "g absolutely_integrable_on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g absolutely_integrable_on T
[PROOF STEP]
using assms integrable_spike
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on T
negligible S
?x \<in> T - S \<Longrightarrow> g ?x = f ?x
\<lbrakk>?f integrable_on ?T; negligible ?S; \<And>x. x \<in> ?T - ?S \<Longrightarrow> ?g x = ?f x\<rbrakk> \<Longrightarrow> ?g integrable_on ?T

goal (1 subgoal):
 1. g absolutely_integrable_on T
[PROOF STEP]
unfolding absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
f integrable_on T \<and> (\<lambda>x. norm (f x)) integrable_on T
negligible S
?x \<in> T - S \<Longrightarrow> g ?x = f ?x
\<lbrakk>?f integrable_on ?T; negligible ?S; \<And>x. x \<in> ?T - ?S \<Longrightarrow> ?g x = ?f x\<rbrakk> \<Longrightarrow> ?g integrable_on ?T

goal (1 subgoal):
 1. g integrable_on T \<and> (\<lambda>x. norm (g x)) integrable_on T
[PROOF STEP]
by metis


[STATEMENT]
lemma (in conservative) induced_function_birkhoff_sum:
  fixes f::"'a \<Rightarrow> real"
  assumes "A \<in> sets M"
  shows "birkhoff_sum f (qmpt.birkhoff_sum (induced_map A) (return_time_function A) n x) x
          = qmpt.birkhoff_sum (induced_map A) (induced_function A f) n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f (qmpt.birkhoff_sum (induced_map A) (return_time_function A) n x) x = qmpt.birkhoff_sum (induced_map A) (induced_function A f) n x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. birkhoff_sum f (qmpt.birkhoff_sum (induced_map A) (return_time_function A) n x) x = qmpt.birkhoff_sum (induced_map A) (induced_function A f) n x
[PROOF STEP]
interpret A: conservative "restrict_space M A" "induced_map A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conservative (restrict_space M A) (induced_map A)
[PROOF STEP]
by (rule induced_map_conservative[OF assms])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x
[PROOF STEP]
define TA where "TA = induced_map A"
[PROOF STATE]
proof (state)
this:
TA = induced_map A

goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x
[PROOF STEP]
define phiA where "phiA = return_time_function A"
[PROOF STATE]
proof (state)
this:
phiA = return_time_function A

goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x
[PROOF STEP]
define R where "R = (\<lambda>n. A.birkhoff_sum phiA n x)"
[PROOF STATE]
proof (state)
this:
R = (\<lambda>n. A.birkhoff_sum phiA n x)

goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) 0 x) x = A.birkhoff_sum (induced_function A f) 0 x
 2. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) 0 x) x = A.birkhoff_sum (induced_function A f) 0 x
 2. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) 0 x) x = A.birkhoff_sum (induced_function A f) 0 x
[PROOF STEP]
using birkhoff_sum_1(1) A.birkhoff_sum_1(1)
[PROOF STATE]
proof (prove)
using this:
birkhoff_sum ?f 0 ?x = (0::?'b)
A.birkhoff_sum ?f 0 ?x = (0::?'b)

goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) 0 x) x = A.birkhoff_sum (induced_function A f) 0 x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (A.birkhoff_sum (return_time_function A) 0 x) x = A.birkhoff_sum (induced_function A f) 0 x

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

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
have "(T^^(R n)) x = (TA^^n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T ^^ R n) x = (TA ^^ n) x
[PROOF STEP]
unfolding TA_def R_def A.birkhoff_sum_def phiA_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T ^^ (\<Sum>i<n. return_time_function A ((induced_map A ^^ i) x))) x = (induced_map A ^^ n) x
[PROOF STEP]
by (rule induced_map_iterates[symmetric])
[PROOF STATE]
proof (state)
this:
(T ^^ R n) x = (TA ^^ n) x

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
have "R(n+1) = R n + phiA ((TA^^n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (n + 1) = R n + phiA ((TA ^^ n) x)
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A.birkhoff_sum phiA (n + 1) x = A.birkhoff_sum phiA n x + phiA ((TA ^^ n) x)
[PROOF STEP]
using A.birkhoff_sum_cocycle[where ?n = n and ?m = 1 and ?f = phiA] A.birkhoff_sum_1(2) TA_def
[PROOF STATE]
proof (prove)
using this:
A.birkhoff_sum phiA (n + 1) ?x = A.birkhoff_sum phiA n ?x + A.birkhoff_sum phiA 1 ((induced_map A ^^ n) ?x)
A.birkhoff_sum ?f 1 ?x = ?f ?x
TA = induced_map A

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

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

goal (1 subgoal):
 1. birkhoff_sum f (R (n + 1)) x = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x)
[PROOF STEP]
using birkhoff_sum_cocycle[where ?n = "R n" and ?f = f]
[PROOF STATE]
proof (prove)
using this:
R (n + 1) = R n + phiA ((TA ^^ n) x)
birkhoff_sum f (R n + ?m) ?x = birkhoff_sum f (R n) ?x + birkhoff_sum f ?m ((T ^^ R n) ?x)

goal (1 subgoal):
 1. birkhoff_sum f (R (n + 1)) x = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R (n + 1)) x = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R (n + 1)) x = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
have "... = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA^^n) x)) ((TA^^n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x) = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((TA ^^ n) x)
[PROOF STEP]
using \<open>(T^^(R n)) x = (TA^^n) x\<close>
[PROOF STATE]
proof (prove)
using this:
(T ^^ R n) x = (TA ^^ n) x

goal (1 subgoal):
 1. birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x) = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((TA ^^ n) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x) = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((TA ^^ n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((T ^^ R n) x) = birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((TA ^^ n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
have "... = birkhoff_sum f (R n) x + (induced_function A f) ((TA^^n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((TA ^^ n) x) = birkhoff_sum f (R n) x + induced_function A f ((TA ^^ n) x)
[PROOF STEP]
unfolding induced_function_def birkhoff_sum_def phiA_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<R n. f ((T ^^ i) x)) + (\<Sum>i<return_time_function A ((TA ^^ n) x). f ((T ^^ i) ((TA ^^ n) x))) = (\<Sum>i<R n. f ((T ^^ i) x)) + (\<Sum>i<return_time_function A ((TA ^^ n) x). f ((T ^^ i) ((TA ^^ n) x)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((TA ^^ n) x) = birkhoff_sum f (R n) x + induced_function A f ((TA ^^ n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R n) x + birkhoff_sum f (phiA ((TA ^^ n) x)) ((TA ^^ n) x) = birkhoff_sum f (R n) x + induced_function A f ((TA ^^ n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
have "... = A.birkhoff_sum (induced_function A f) n x + (induced_function A f) ((TA^^n) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f (R n) x + induced_function A f ((TA ^^ n) x) = A.birkhoff_sum (induced_function A f) n x + induced_function A f ((TA ^^ n) x)
[PROOF STEP]
using Suc.IH R_def phiA_def
[PROOF STATE]
proof (prove)
using this:
birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x
R = (\<lambda>n. A.birkhoff_sum phiA n x)
phiA = return_time_function A

goal (1 subgoal):
 1. birkhoff_sum f (R n) x + induced_function A f ((TA ^^ n) x) = A.birkhoff_sum (induced_function A f) n x + induced_function A f ((TA ^^ n) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R n) x + induced_function A f ((TA ^^ n) x) = A.birkhoff_sum (induced_function A f) n x + induced_function A f ((TA ^^ n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (R n) x + induced_function A f ((TA ^^ n) x) = A.birkhoff_sum (induced_function A f) n x + induced_function A f ((TA ^^ n) x)

goal (1 subgoal):
 1. \<And>n. birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x \<Longrightarrow> birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
have "... = A.birkhoff_sum (induced_function A f) (n+1) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A.birkhoff_sum (induced_function A f) n x + induced_function A f ((TA ^^ n) x) = A.birkhoff_sum (induced_function A f) (n + 1) x
[PROOF STEP]
using A.birkhoff_sum_cocycle[where ?n = n and ?m = 1 and ?f = "induced_function A f" and ?x = x, symmetric]
      A.birkhoff_sum_1(2)[where ?f = "induced_function A f" and ?x = "(TA^^n) x"]
[PROOF STATE]
proof (prove)
using this:
A.birkhoff_sum (induced_function A f) n x + A.birkhoff_sum (induced_function A f) 1 ((induced_map A ^^ n) x) = A.birkhoff_sum (induced_function A f) (n + 1) x
A.birkhoff_sum (induced_function A f) 1 ((TA ^^ n) x) = induced_function A f ((TA ^^ n) x)

goal (1 subgoal):
 1. A.birkhoff_sum (induced_function A f) n x + induced_function A f ((TA ^^ n) x) = A.birkhoff_sum (induced_function A f) (n + 1) x
[PROOF STEP]
unfolding TA_def
[PROOF STATE]
proof (prove)
using this:
A.birkhoff_sum (induced_function A f) n x + A.birkhoff_sum (induced_function A f) 1 ((induced_map A ^^ n) x) = A.birkhoff_sum (induced_function A f) (n + 1) x
A.birkhoff_sum (induced_function A f) 1 ((induced_map A ^^ n) x) = induced_function A f ((induced_map A ^^ n) x)

goal (1 subgoal):
 1. A.birkhoff_sum (induced_function A f) n x + induced_function A f ((induced_map A ^^ n) x) = A.birkhoff_sum (induced_function A f) (n + 1) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A.birkhoff_sum (induced_function A f) n x + induced_function A f ((TA ^^ n) x) = A.birkhoff_sum (induced_function A f) (n + 1) x

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

goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
unfolding R_def phiA_def
[PROOF STATE]
proof (prove)
using this:
birkhoff_sum f (A.birkhoff_sum (return_time_function A) (n + 1) x) x = A.birkhoff_sum (induced_function A f) (n + 1) x

goal (1 subgoal):
 1. birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (A.birkhoff_sum (return_time_function A) (Suc n) x) x = A.birkhoff_sum (induced_function A f) (Suc n) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
birkhoff_sum f (A.birkhoff_sum (return_time_function A) n x) x = A.birkhoff_sum (induced_function A f) n x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fmimage_of_list[code]:
  "fmimage (fmap_of_list m) A = fset_of_list (map snd (filter (\<lambda>(k, _). k |\<in>| A) (AList.clearjunk m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmimage (fmap_of_list m) A = fset_of_list (map snd (filter (\<lambda>(k, uu_). k |\<in>| A) (AList.clearjunk m)))
[PROOF STEP]
apply (subst fmimage_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmran (fmrestrict_fset A (fmap_of_list m)) = fset_of_list (map snd (filter (\<lambda>(k, uu_). k |\<in>| A) (AList.clearjunk m)))
[PROOF STEP]
apply (subst fmfilter_alt_defs)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmran (fmfilter (\<lambda>a. a |\<in>| A) (fmap_of_list m)) = fset_of_list (map snd (filter (\<lambda>(k, uu_). k |\<in>| A) (AList.clearjunk m)))
[PROOF STEP]
apply (subst fmfilter_of_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmran (fmap_of_list (filter (\<lambda>(k, uu_). k |\<in>| A) m)) = fset_of_list (map snd (filter (\<lambda>(k, uu_). k |\<in>| A) (AList.clearjunk m)))
[PROOF STEP]
apply (subst fmran_of_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd |`| fset_of_list (AList.clearjunk (filter (\<lambda>(k, uu_). k |\<in>| A) m)) = fset_of_list (map snd (filter (\<lambda>(k, uu_). k |\<in>| A) (AList.clearjunk m)))
[PROOF STEP]
apply transfer'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A m. snd ` set (AList.clearjunk (filter (\<lambda>(k, uu_). k \<in> A) m)) = set (map snd (filter (\<lambda>(k, uu_). k \<in> A) (AList.clearjunk m)))
[PROOF STEP]
apply (subst AList.restrict_eq[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A m. snd ` set (AList.clearjunk (AList.restrict A m)) = set (map snd (filter (\<lambda>(k, uu_). k \<in> A) (AList.clearjunk m)))
[PROOF STEP]
apply (subst clearjunk_restrict)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A m. snd ` set (AList.restrict A (AList.clearjunk m)) = set (map snd (filter (\<lambda>(k, uu_). k \<in> A) (AList.clearjunk m)))
[PROOF STEP]
apply (subst AList.restrict_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A m. snd ` set (filter (\<lambda>(k, v). k \<in> A) (AList.clearjunk m)) = set (map snd (filter (\<lambda>(k, uu_). k \<in> A) (AList.clearjunk m)))
[PROOF STEP]
by auto


[STATEMENT]
lemma converse_reachable_induct[consumes 1, case_names base step, induct pred: reachable]:
  assumes major: "u \<rightarrow>\<^sup>*\<^bsub>G\<^esub> v"
    and cases: "v \<in> verts G \<Longrightarrow> P v"
       "\<And>x y. \<lbrakk>x \<rightarrow>\<^bsub>G\<^esub> y; y \<rightarrow>\<^sup>*\<^bsub>G\<^esub> v; P y\<rbrakk> \<Longrightarrow> P x"
  shows "P u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<rightarrow>\<^sup>* v
v \<in> verts G \<Longrightarrow> P v
\<lbrakk>?x \<rightarrow> ?y; ?y \<rightarrow>\<^sup>* v; P ?y\<rbrakk> \<Longrightarrow> P ?x

goal (1 subgoal):
 1. P u
[PROOF STEP]
unfolding reachable_def
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> rtrancl_on (verts G) (arcs_ends G)
v \<in> verts G \<Longrightarrow> P v
\<lbrakk>?x \<rightarrow> ?y; (?y, v) \<in> rtrancl_on (verts G) (arcs_ends G); P ?y\<rbrakk> \<Longrightarrow> P ?x

goal (1 subgoal):
 1. P u
[PROOF STEP]
by (rule converse_rtrancl_on_induct) auto


[STATEMENT]
lemma phl_export2:
assumes "z \<cdot> w \<le> w \<cdot> z \<cdot> w"
and "x \<cdot> y \<le> y \<cdot> z"
shows "x \<cdot> (y \<cdot> w) \<le> y \<cdot> w \<cdot> (z \<cdot> w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> (y \<cdot> w) \<le> y \<cdot> w \<cdot> (z \<cdot> w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<cdot> (y \<cdot> w) \<le> y \<cdot> w \<cdot> (z \<cdot> w)
[PROOF STEP]
have "x \<cdot> y \<cdot> w \<le> y \<cdot> z \<cdot> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> y \<cdot> w \<le> y \<cdot> z \<cdot> w
[PROOF STEP]
using assms(2) mult_isor
[PROOF STATE]
proof (prove)
using this:
x \<cdot> y \<le> y \<cdot> z
?x \<le> ?y \<Longrightarrow> ?x \<cdot> ?z \<le> ?y \<cdot> ?z

goal (1 subgoal):
 1. x \<cdot> y \<cdot> w \<le> y \<cdot> z \<cdot> w
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<cdot> y \<cdot> w \<le> y \<cdot> z \<cdot> w

goal (1 subgoal):
 1. x \<cdot> (y \<cdot> w) \<le> y \<cdot> w \<cdot> (z \<cdot> w)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<cdot> y \<cdot> w \<le> y \<cdot> z \<cdot> w

goal (1 subgoal):
 1. x \<cdot> (y \<cdot> w) \<le> y \<cdot> w \<cdot> (z \<cdot> w)
[PROOF STEP]
by (metis assms(1) dual_order.trans order_prop subdistl mult_assoc)
[PROOF STATE]
proof (state)
this:
x \<cdot> (y \<cdot> w) \<le> y \<cdot> w \<cdot> (z \<cdot> w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_restrict_space2_iff:
  "f \<in> measurable M (restrict_space N \<Omega>) \<longleftrightarrow> (f \<in> measurable M N \<and> f \<in> space M \<rightarrow> \<Omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M restrict_space N \<Omega>) = (f \<in> M \<rightarrow>\<^sub>M N \<and> f \<in> space M \<rightarrow> \<Omega>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M restrict_space N \<Omega>) = (f \<in> M \<rightarrow>\<^sub>M N \<and> f \<in> space M \<rightarrow> \<Omega>)
[PROOF STEP]
have "\<And>A. f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f -` \<Omega> \<inter> f -` A \<inter> space M = f -` A \<inter> space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f -` \<Omega> \<inter> f -` A \<inter> space M = f -` A \<inter> space M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f -` \<Omega> \<inter> f -` ?A \<inter> space M = f -` ?A \<inter> space M

goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M restrict_space N \<Omega>) = (f \<in> M \<rightarrow>\<^sub>M N \<and> f \<in> space M \<rightarrow> \<Omega>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f -` \<Omega> \<inter> f -` ?A \<inter> space M = f -` ?A \<inter> space M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> space M \<rightarrow> \<Omega> \<Longrightarrow> f -` \<Omega> \<inter> f -` ?A \<inter> space M = f -` ?A \<inter> space M

goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M restrict_space N \<Omega>) = (f \<in> M \<rightarrow>\<^sub>M N \<and> f \<in> space M \<rightarrow> \<Omega>)
[PROOF STEP]
by (auto simp: measurable_def space_restrict_space Pi_Int[symmetric] sets_restrict_space)
[PROOF STATE]
proof (state)
this:
(f \<in> M \<rightarrow>\<^sub>M restrict_space N \<Omega>) = (f \<in> M \<rightarrow>\<^sub>M N \<and> f \<in> space M \<rightarrow> \<Omega>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_has_derivative:
  shows "((\<lambda>x::(real^'n)\<Rightarrow>\<^sub>L(real^'n). matrix (blinfun_apply x)) has_derivative (\<lambda>h. matrix (blinfun_apply h))) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. matrix (blinfun_apply x)) has_derivative (\<lambda>h. matrix (blinfun_apply h))) (at x)
[PROOF STEP]
apply (auto simp: has_derivative_at2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bounded_linear (\<lambda>h. matrix (blinfun_apply h))
 2. (\<lambda>y. (1 / norm (y - x)) *\<^sub>R (matrix (blinfun_apply y) - (matrix (blinfun_apply x) + matrix (blinfun_apply (y - x))))) \<midarrow>x\<rightarrow> 0
[PROOF STEP]
unfolding linear_linear
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. bounded_linear (\<lambda>h. matrix (blinfun_apply h))
 2. (\<lambda>y. (1 / norm (y - x)) *\<^sub>R (matrix (blinfun_apply y) - (matrix (blinfun_apply x) + matrix (blinfun_apply (y - x))))) \<midarrow>x\<rightarrow> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>h. matrix (blinfun_apply h))
[PROOF STEP]
by (rule bounded_linear_matrix_blinfun_apply)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. (1 / norm (y - x)) *\<^sub>R (matrix (blinfun_apply y) - (matrix (blinfun_apply x) + matrix (blinfun_apply (y - x))))) \<midarrow>x\<rightarrow> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. (1 / norm (y - x)) *\<^sub>R (matrix (blinfun_apply y) - (matrix (blinfun_apply x) + matrix (blinfun_apply (y - x))))) \<midarrow>x\<rightarrow> 0
[PROOF STEP]
by (auto simp: blinfun.bilinear_simps matrix_def) vector
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma coprime_diff_one_left [simp]: "coprime (a - 1) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (a - (1::'a)) a
[PROOF STEP]
using coprime_add_one_right [of "a - 1"]
[PROOF STATE]
proof (prove)
using this:
coprime (a - (1::'a)) (a - (1::'a) + (1::'a))

goal (1 subgoal):
 1. coprime (a - (1::'a)) a
[PROOF STEP]
by simp


[STATEMENT]
lemma length_subsets_smash_R:
  shows
    "length (subsets_smash_R n subs1 subs2) = length subs1 * length subs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (subsets_smash_R n subs1 subs2) = length subs1 * length subs2
[PROOF STEP]
unfolding subsets_smash_R_def length_concat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map length (map (\<lambda>l1. map (\<lambda>l2. (fst l1 @ map ((+) n) (fst l2), snd l1 @ map ((+) n) (snd l2))) subs2) subs1)) = length subs1 * length subs2
[PROOF STEP]
by (auto simp add: o_def sum_list_triv)


[STATEMENT]
lemma to_bl_double_eq:
  \<open>to_bl (2 * w) = tl (to_bl w) @ [False]\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (2 * w) = tl (to_bl w) @ [False]
[PROOF STEP]
using bl_shiftl1 [of w]
[PROOF STATE]
proof (prove)
using this:
to_bl (shiftl1 w) = tl (to_bl w) @ [False]

goal (1 subgoal):
 1. to_bl (2 * w) = tl (to_bl w) @ [False]
[PROOF STEP]
by (simp add: shiftl1_def ac_simps)

\<comment> \<open>Generalized version of \<open>bl_shiftl1\<close>. Maybe this one should replace it?\<close>


[STATEMENT]
lemma except_Un_plus_Int: "except p (U \<union> V) + except p (U \<inter> V) = except p U + except p V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. except p (U \<union> V) + except p (U \<inter> V) = except p U + except p V
[PROOF STEP]
by (rule poly_mapping_eqI) (simp add: lookup_except lookup_add)


[STATEMENT]
lemma bounded_imp_bdd_below: "bounded S \<Longrightarrow> bdd_below (S :: real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<Longrightarrow> bdd_below S
[PROOF STEP]
by (auto simp: bounded_def bdd_below_def dist_real_def)
     (metis abs_le_D1 add.commute diff_le_eq)


[STATEMENT]
lemma (in Ring) s_set_commute:"\<lbrakk>commute_bpp f (aug_pm_set z i (s_set R s A));
       x \<in> addition_set f (aug_pm_set z i (s_set R s A));
        y \<in> addition_set f (aug_pm_set z i (s_set R s A))\<rbrakk> \<Longrightarrow>
               x \<^sub>f+ y = y \<^sub>f+ x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>commute_bpp f (aug_pm_set z i (s_set R s A)); x \<in> addition_set f (aug_pm_set z i (s_set R s A)); y \<in> addition_set f (aug_pm_set z i (s_set R s A))\<rbrakk> \<Longrightarrow> x \<^sub>f+ y = y \<^sub>f+ x
[PROOF STEP]
apply (simp add:commute_bpp_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma unfold_le_opt:
  "o\<^sub>1 \<sqsubseteq>\<^bsub>le r\<^esub> o\<^sub>2 =
  (case o\<^sub>2 of None \<Rightarrow> o\<^sub>1=None |
              Some y \<Rightarrow> (case o\<^sub>1 of None \<Rightarrow> True | Some x \<Rightarrow> x \<sqsubseteq>\<^sub>r y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (o\<^sub>1 \<sqsubseteq>\<^bsub>Opt.le r\<^esub> o\<^sub>2) = (case o\<^sub>2 of None \<Rightarrow> o\<^sub>1 = None | Some y \<Rightarrow> case o\<^sub>1 of None \<Rightarrow> True | Some x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (o\<^sub>1 \<sqsubseteq>\<^bsub>Opt.le r\<^esub> o\<^sub>2) = (case o\<^sub>2 of None \<Rightarrow> o\<^sub>1 = None | Some y \<Rightarrow> case o\<^sub>1 of None \<Rightarrow> True | Some x \<Rightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y)
[PROOF STEP]
apply (unfold lesub_def le_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case o\<^sub>2 of None \<Rightarrow> o\<^sub>1 = None | Some y \<Rightarrow> case o\<^sub>1 of None \<Rightarrow> True | Some x \<Rightarrow> r x y) = (case o\<^sub>2 of None \<Rightarrow> o\<^sub>1 = None | Some y \<Rightarrow> case o\<^sub>1 of None \<Rightarrow> True | Some x \<Rightarrow> r x y)
[PROOF STEP]
apply (rule refl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_aA: "set aA = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set aA = A
[PROOF STEP]
using bij_betw_from_nat_into_finite [OF finA]
[PROOF STATE]
proof (prove)
using this:
bij_betw (from_nat_into A) {..<card A} A

goal (1 subgoal):
 1. set aA = A
[PROOF STEP]
by (simp add: aA_def atLeast0LessThan bij_betw_def)


[STATEMENT]
lemma dropWhile_mod_ring:
  "dropWhile ((=)0) (map of_int_mod_ring xs :: 'a mod_ring list) =
   map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs)

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
have "dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) =
        dropWhile ((=) 0) ((of_int_mod_ring x :: 'a mod_ring) #
        (map of_int_mod_ring xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) = dropWhile ((=) 0) (of_int_mod_ring x # map of_int_mod_ring xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) = dropWhile ((=) 0) (of_int_mod_ring x # map of_int_mod_ring xs)

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) = dropWhile ((=) 0) (of_int_mod_ring x # map of_int_mod_ring xs)

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
have "\<dots> = (if 0 = (of_int_mod_ring x :: 'a mod_ring)
    then dropWhile ((=) 0) (map of_int_mod_ring xs)
    else map of_int_mod_ring (x # xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dropWhile ((=) 0) (of_int_mod_ring x # map of_int_mod_ring xs) = (if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs))
[PROOF STEP]
unfolding dropWhile.simps(2)[of "((=) 0)"
      "of_int_mod_ring x :: 'a mod_ring" "map of_int_mod_ring xs"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else of_int_mod_ring x # map of_int_mod_ring xs) = (if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dropWhile ((=) 0) (of_int_mod_ring x # map of_int_mod_ring xs) = (if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs))

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dropWhile ((=) 0) (of_int_mod_ring x # map of_int_mod_ring xs) = (if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs))

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
have "\<dots> = (if x mod q = 0
    then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs)
    else map of_int_mod_ring (x # xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs)) = (if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs))
[PROOF STEP]
using of_int_mod_ring_eq_0
[PROOF STATE]
proof (prove)
using this:
(of_int_mod_ring ?x = 0) = (?x mod q = 0)

goal (1 subgoal):
 1. (if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs)) = (if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs))
[PROOF STEP]
unfolding Cons.hyps
[PROOF STATE]
proof (prove)
using this:
(of_int_mod_ring ?x = 0) = (?x mod q = 0)

goal (1 subgoal):
 1. (if 0 = of_int_mod_ring x then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs)) = (if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs)) = (if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs))

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if 0 = of_int_mod_ring x then dropWhile ((=) 0) (map of_int_mod_ring xs) else map of_int_mod_ring (x # xs)) = (if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs))

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
have "\<dots> = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0)
    (x # xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (x # xs))
[PROOF STEP]
unfolding dropWhile.simps(2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs)) = map of_int_mod_ring (if x mod q = 0 then dropWhile (\<lambda>x. x mod q = 0) xs else x # xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if x mod q = 0 then map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) else map of_int_mod_ring (x # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (x # xs))

goal (2 subgoals):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
 2. \<And>a xs. dropWhile ((=) 0) (map of_int_mod_ring xs) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) xs) \<Longrightarrow> dropWhile ((=) 0) (map of_int_mod_ring (a # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (a # xs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (x # xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (x # xs))

goal (1 subgoal):
 1. dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (x # xs))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dropWhile ((=) 0) (map of_int_mod_ring (x # xs)) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) (x # xs))

goal (1 subgoal):
 1. dropWhile ((=) 0) (map of_int_mod_ring []) = map of_int_mod_ring (dropWhile (\<lambda>x. x mod q = 0) [])
[PROOF STEP]
qed simp


[STATEMENT]
lemma pr_comp3_2': "\<lbrakk> pr_conv_3_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'; pr_conv_2_to_1 k \<in> PrimRec1' \<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda> x y. f (g x y) (h x y) (k x y)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'; pr_conv_2_to_1 k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y) (k x y)) \<in> PrimRec1'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'; pr_conv_2_to_1 k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y) (k x y)) \<in> PrimRec1'
[PROOF STEP]
assume "pr_conv_3_to_1 f \<in> PrimRec1'"
  and "pr_conv_2_to_1 g \<in> PrimRec1'" (is "?g1 \<in> PrimRec1'")
  and "pr_conv_2_to_1 h \<in> PrimRec1'" (is "?h1 \<in> PrimRec1'")
  and "pr_conv_2_to_1 k \<in> PrimRec1'" (is "?k1 \<in> PrimRec1'")
[PROOF STATE]
proof (state)
this:
pr_conv_3_to_1 f \<in> PrimRec1'
pr_conv_2_to_1 g \<in> PrimRec1'
pr_conv_2_to_1 h \<in> PrimRec1'
pr_conv_2_to_1 k \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'; pr_conv_2_to_1 k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y) (k x y)) \<in> PrimRec1'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pr_conv_3_to_1 f \<in> PrimRec1'
pr_conv_2_to_1 g \<in> PrimRec1'
pr_conv_2_to_1 h \<in> PrimRec1'
pr_conv_2_to_1 k \<in> PrimRec1'
[PROOF STEP]
have "(\<lambda> x. f (?g1 x) (?h1 x) (?k1 x)) \<in> PrimRec1'"
[PROOF STATE]
proof (prove)
using this:
pr_conv_3_to_1 f \<in> PrimRec1'
pr_conv_2_to_1 g \<in> PrimRec1'
pr_conv_2_to_1 h \<in> PrimRec1'
pr_conv_2_to_1 k \<in> PrimRec1'

goal (1 subgoal):
 1. (\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x) (pr_conv_2_to_1 k x)) \<in> PrimRec1'
[PROOF STEP]
by (rule pr_comp3_1')
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x) (pr_conv_2_to_1 k x)) \<in> PrimRec1'

goal (1 subgoal):
 1. \<lbrakk>pr_conv_3_to_1 f \<in> PrimRec1'; pr_conv_2_to_1 g \<in> PrimRec1'; pr_conv_2_to_1 h \<in> PrimRec1'; pr_conv_2_to_1 k \<in> PrimRec1'\<rbrakk> \<Longrightarrow> pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y) (k x y)) \<in> PrimRec1'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x) (pr_conv_2_to_1 k x)) \<in> PrimRec1'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (pr_conv_2_to_1 g x) (pr_conv_2_to_1 h x) (pr_conv_2_to_1 k x)) \<in> PrimRec1'

goal (1 subgoal):
 1. pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y) (k x y)) \<in> PrimRec1'
[PROOF STEP]
by (simp add: pr_conv_2_to_1_def)
[PROOF STATE]
proof (state)
this:
pr_conv_2_to_1 (\<lambda>x y. f (g x y) (h x y) (k x y)) \<in> PrimRec1'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Max_const[simp]: "\<lbrakk> finite A; A \<noteq> {} \<rbrakk> \<Longrightarrow> Max ((\<lambda>_. c) ` A) = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> (MAX _\<in>A. c) = c
[PROOF STEP]
using Max_in image_is_empty
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max ?A \<in> ?A
(?f ` ?A = {}) = (?A = {})

goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> (MAX _\<in>A. c) = c
[PROOF STEP]
by blast


[STATEMENT]
lemma (in group) generate_eqI:
  assumes "A \<subseteq> carrier G" "B \<subseteq> carrier G" "A \<subseteq> generate G B" "B \<subseteq> generate G A"
  shows "generate G A = generate G B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate G A = generate G B
[PROOF STEP]
using assms generate_idem
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier G
B \<subseteq> carrier G
A \<subseteq> generate G B
B \<subseteq> generate G A
?A \<subseteq> carrier G \<Longrightarrow> generate G (generate G ?A) = generate G ?A

goal (1 subgoal):
 1. generate G A = generate G B
[PROOF STEP]
by (metis generate_idem' inf_sup_aci(5) sup.absorb2)


[STATEMENT]
lemma edge_adjacent_alt_def: "e1 \<in> E \<Longrightarrow> e2 \<in> E \<Longrightarrow> \<exists> x . x \<in> V \<and> x \<in> e1 \<and> x \<in> e2 \<Longrightarrow> edge_adj e1 e2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e1 \<in> E; e2 \<in> E; \<exists>x. x \<in> V \<and> x \<in> e1 \<and> x \<in> e2\<rbrakk> \<Longrightarrow> edge_adj e1 e2
[PROOF STEP]
unfolding edge_adj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e1 \<in> E; e2 \<in> E; \<exists>x. x \<in> V \<and> x \<in> e1 \<and> x \<in> e2\<rbrakk> \<Longrightarrow> e1 \<inter> e2 \<noteq> {} \<and> e1 \<in> E \<and> e2 \<in> E
[PROOF STEP]
by auto


[STATEMENT]
lemma dist_snd_le: "dist (snd x) (snd y) \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (snd x) (snd y) \<le> dist x y
[PROOF STEP]
unfolding dist_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (snd x) (snd y) \<le> sqrt ((dist (fst x) (fst y))\<^sup>2 + (dist (snd x) (snd y))\<^sup>2)
[PROOF STEP]
by (rule real_sqrt_sum_squares_ge2)


[STATEMENT]
lemma sum_rel_id[relator_props]: "\<lbrakk>Rl=Id; Rr=Id\<rbrakk> \<Longrightarrow> \<langle>Rl,Rr\<rangle>sum_rel = Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Rl = Id; Rr = Id\<rbrakk> \<Longrightarrow> \<langle>Rl, Rr\<rangle>sum_rel = Id
[PROOF STEP]
apply (auto elim: sum_relE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<lbrakk>Rl = Id; Rr = Id\<rbrakk> \<Longrightarrow> (b, b) \<in> \<langle>Id, Id\<rangle>sum_rel
[PROOF STEP]
apply (case_tac b)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b a. \<lbrakk>Rl = Id; Rr = Id; b = Inl a\<rbrakk> \<Longrightarrow> (b, b) \<in> \<langle>Id, Id\<rangle>sum_rel
 2. \<And>b ba. \<lbrakk>Rl = Id; Rr = Id; b = Inr ba\<rbrakk> \<Longrightarrow> (b, b) \<in> \<langle>Id, Id\<rangle>sum_rel
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fsubseteq [code]:
  "(fset_of_list l) |\<subseteq>| A = List.list_all (\<lambda>x. x |\<in>| A) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fset_of_list l |\<subseteq>| A) = list_all (\<lambda>x. x |\<in>| A) l
[PROOF STEP]
by (induct l, auto)


[STATEMENT]
lemma derivation_ge_shift_plus:
  assumes "derivation_ge D u"
  assumes "derivation_ge (derivation_shift D u 0) v"
  shows "derivation_ge D (u + v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. derivation_ge D (u + v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. derivation_ge D (u + v)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
derivation_ge D u
derivation_ge (derivation_shift D u 0) v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
derivation_ge D u
derivation_ge (derivation_shift D u 0) v

goal (1 subgoal):
 1. derivation_ge D (u + v)
[PROOF STEP]
apply (auto simp add: derivation_ge_def derivation_shift_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a aa b. \<lbrakk>\<forall>d\<in>set D. u \<le> fst d; \<forall>d\<in>set D. v \<le> fst d - u; (a, aa, b) \<in> set D\<rbrakk> \<Longrightarrow> u + v \<le> a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
derivation_ge D (u + v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prog_configs_mono: "\<And>ys. set xs \<subseteq> set ys \<Longrightarrow> prog_configs xs \<subseteq> prog_configs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ys. set xs \<subseteq> set ys \<Longrightarrow> prog_configs xs \<subseteq> prog_configs ys
[PROOF STEP]
by (induct xs) (auto split: memref.splits simp add: prog_configs_append
  prog_configs_in1 prog_configs_in2)


[STATEMENT]
lemma Image_Inter[refine_hsimp]:
  "single_valued (converse R) \<Longrightarrow> R``(A\<inter>B) = R``A \<inter> R``B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued (R\<inverse>) \<Longrightarrow> R `` (A \<inter> B) = R `` A \<inter> R `` B
[PROOF STEP]
by (auto dest: single_valuedD)


[STATEMENT]
lemma (in cyclic_group) get_exp_mult_mod:
  assumes "a \<in> carrier G" "b \<in> carrier G"
  shows "get_exp gen (a \<otimes> b) mod (ord gen) = (get_exp gen a + get_exp gen b) mod (ord gen)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get_exp gen (a \<otimes> b) mod int (ord gen) = (get_exp gen a + get_exp gen b) mod int (ord gen)
[PROOF STEP]
proof (intro pow_eq_int_mod[OF gen_closed])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gen [^] get_exp gen (a \<otimes> b) = gen [^] (get_exp gen a + get_exp gen b)
[PROOF STEP]
from get_exp_fulfills[of "a \<otimes> b"]
[PROOF STATE]
proof (chain)
picking this:
a \<otimes> b \<in> carrier G \<Longrightarrow> a \<otimes> b = gen [^] get_exp gen (a \<otimes> b)
[PROOF STEP]
have "gen [^] get_exp gen (a \<otimes> b) = a \<otimes> b"
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<in> carrier G \<Longrightarrow> a \<otimes> b = gen [^] get_exp gen (a \<otimes> b)

goal (1 subgoal):
 1. gen [^] get_exp gen (a \<otimes> b) = a \<otimes> b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<in> carrier G \<Longrightarrow> a \<otimes> b = gen [^] get_exp gen (a \<otimes> b)
a \<in> carrier G
b \<in> carrier G

goal (1 subgoal):
 1. gen [^] get_exp gen (a \<otimes> b) = a \<otimes> b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gen [^] get_exp gen (a \<otimes> b) = a \<otimes> b

goal (1 subgoal):
 1. gen [^] get_exp gen (a \<otimes> b) = gen [^] (get_exp gen a + get_exp gen b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
gen [^] get_exp gen (a \<otimes> b) = a \<otimes> b

goal (1 subgoal):
 1. gen [^] get_exp gen (a \<otimes> b) = gen [^] (get_exp gen a + get_exp gen b)
[PROOF STEP]
have "gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b
[PROOF STEP]
have "gen [^] (get_exp gen a + get_exp gen b) = gen [^] (get_exp gen a) \<otimes> gen [^] (get_exp gen b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gen [^] (get_exp gen a + get_exp gen b) = gen [^] get_exp gen a \<otimes> gen [^] get_exp gen b
[PROOF STEP]
using int_pow_mult
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier G \<Longrightarrow> ?x [^] (?i + ?j) = ?x [^] ?i \<otimes> ?x [^] ?j

goal (1 subgoal):
 1. gen [^] (get_exp gen a + get_exp gen b) = gen [^] get_exp gen a \<otimes> gen [^] get_exp gen b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gen [^] (get_exp gen a + get_exp gen b) = gen [^] get_exp gen a \<otimes> gen [^] get_exp gen b

goal (1 subgoal):
 1. gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b
[PROOF STEP]
with get_exp_fulfills assms
[PROOF STATE]
proof (chain)
picking this:
?a \<in> carrier G \<Longrightarrow> ?a = gen [^] get_exp gen ?a
a \<in> carrier G
b \<in> carrier G
gen [^] (get_exp gen a + get_exp gen b) = gen [^] get_exp gen a \<otimes> gen [^] get_exp gen b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?a \<in> carrier G \<Longrightarrow> ?a = gen [^] get_exp gen ?a
a \<in> carrier G
b \<in> carrier G
gen [^] (get_exp gen a + get_exp gen b) = gen [^] get_exp gen a \<otimes> gen [^] get_exp gen b

goal (1 subgoal):
 1. gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b

goal (1 subgoal):
 1. gen [^] get_exp gen (a \<otimes> b) = gen [^] (get_exp gen a + get_exp gen b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
gen [^] get_exp gen (a \<otimes> b) = a \<otimes> b
gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b
[PROOF STEP]
show "gen [^] get_exp gen (a \<otimes> b) = gen [^] (get_exp gen a + get_exp gen b)"
[PROOF STATE]
proof (prove)
using this:
gen [^] get_exp gen (a \<otimes> b) = a \<otimes> b
gen [^] (get_exp gen a + get_exp gen b) = a \<otimes> b

goal (1 subgoal):
 1. gen [^] get_exp gen (a \<otimes> b) = gen [^] (get_exp gen a + get_exp gen b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
gen [^] get_exp gen (a \<otimes> b) = gen [^] (get_exp gen a + get_exp gen b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma member_postIDAsStr_iff[simp]: "str \<in> postIDAsStr ` (set postIDs) \<longleftrightarrow> Pid str \<in>\<in> postIDs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (str \<in> postIDAsStr ` set postIDs) = (Pid str \<in>\<in> postIDs)
[PROOF STEP]
by (metis PostID_postIDAsStr image_iff postIDAsStr.simps)


[STATEMENT]
lemma map_eq_append_conv:
  "map f xs = ys @ zs \<longleftrightarrow> (\<exists>ys' zs'. xs = ys' @ zs' \<and> ys = map f ys' \<and> zs = map f zs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map f xs = ys @ zs) = (\<exists>ys' zs'. xs = ys' @ zs' \<and> ys = map f ys' \<and> zs = map f zs')
[PROOF STEP]
by(auto 4 4 intro: exI[where x="take (length ys) xs"] exI[where x="drop (length ys) xs"] simp add: append_eq_conv_conj take_map drop_map dest: sym)


[STATEMENT]
lemma affine_trans_is_u:
  shows "\<forall>\<alpha>>0. (\<forall>\<beta>. ordinal_utility  carrier relation (\<lambda>x. u(x)*\<alpha> + \<beta>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<alpha>>0. \<forall>\<beta>. ordinal_utility carrier relation (\<lambda>x. u x * \<alpha> + \<beta>)
[PROOF STEP]
proof (rule allI, rule impI, rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. 0 < \<alpha> \<Longrightarrow> ordinal_utility carrier relation (\<lambda>x. u x * \<alpha> + \<beta>)
[PROOF STEP]
fix \<alpha>::real and \<beta>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. 0 < \<alpha> \<Longrightarrow> ordinal_utility carrier relation (\<lambda>x. u x * \<alpha> + \<beta>)
[PROOF STEP]
assume *:"\<alpha> > 0"
[PROOF STATE]
proof (state)
this:
0 < \<alpha>

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. 0 < \<alpha> \<Longrightarrow> ordinal_utility carrier relation (\<lambda>x. u x * \<alpha> + \<beta>)
[PROOF STEP]
show "ordinal_utility carrier relation (\<lambda>x. u x * \<alpha> + \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinal_utility carrier relation (\<lambda>x. u x * \<alpha> + \<beta>)
[PROOF STEP]
proof (subst ordinal_utility_def, rule conjI, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>x y. x \<in> carrier \<longrightarrow> y \<in> carrier \<longrightarrow> x \<succeq>[relation] y = (u y * \<alpha> + \<beta> \<le> u x * \<alpha> + \<beta>)
 2. (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> x \<in> carrier) \<and> (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> y \<in> carrier)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<forall>x y. x \<in> carrier \<longrightarrow> y \<in> carrier \<longrightarrow> x \<succeq>[relation] y = (u y * \<alpha> + \<beta> \<le> u x * \<alpha> + \<beta>)
 2. (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> x \<in> carrier) \<and> (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> y \<in> carrier)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<in> carrier \<longrightarrow> y \<in> carrier \<longrightarrow> x \<succeq>[relation] y = (u y * \<alpha> + \<beta> \<le> u x * \<alpha> + \<beta>)
[PROOF STEP]
by (metis * add.commute add_le_cancel_left not_le mult_less_iff1 util_def_conf)
[PROOF STATE]
proof (state)
this:
\<forall>x y. x \<in> carrier \<longrightarrow> y \<in> carrier \<longrightarrow> x \<succeq>[relation] y = (u y * \<alpha> + \<beta> \<le> u x * \<alpha> + \<beta>)

goal (1 subgoal):
 1. (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> x \<in> carrier) \<and> (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> y \<in> carrier)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> x \<in> carrier) \<and> (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> y \<in> carrier)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> x \<in> carrier) \<and> (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> y \<in> carrier)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> x \<in> carrier) \<and> (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> y \<in> carrier)
[PROOF STEP]
by (meson refl_on_domain util_imp_refl)
[PROOF STATE]
proof (state)
this:
(\<forall>x y. x \<succeq>[relation] y \<longrightarrow> x \<in> carrier) \<and> (\<forall>x y. x \<succeq>[relation] y \<longrightarrow> y \<in> carrier)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ordinal_utility carrier relation (\<lambda>x. u x * \<alpha> + \<beta>)

goal:
No subgoals!
[PROOF STEP]
qed