[STATEMENT]
lemma check_poly_strict_mono_discrete:
  fixes v :: "'v :: linorder" and p :: "('v,'a)poly"
  assumes discrete and check: "check_poly_strict_mono_discrete gt p v"
  shows "poly_strict_mono p v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_strict_mono p v
[PROOF STEP]
unfolding poly_strict_mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<alpha> \<beta>. (\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x) \<longrightarrow> pos_assign \<beta> \<longrightarrow> \<alpha> v \<succ> \<beta> v \<longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
fix f g :: "('v,'a)assign"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
assume fgw: "\<forall> w. (v \<noteq> w \<longrightarrow> f w = g w)"
  and gass: "pos_assign g"
  and v: "f v \<succ> g v"
[PROOF STATE]
proof (state)
this:
\<forall>w. v \<noteq> w \<longrightarrow> f w = g w
pos_assign g
f v \<succ> g v

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
from gass
[PROOF STATE]
proof (chain)
picking this:
pos_assign g
[PROOF STEP]
have g: "\<And> x. g x \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
pos_assign g

goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> g x
[PROOF STEP]
unfolding pos_assign_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. (0::'a) \<le> g x

goal (1 subgoal):
 1. \<And>x. (0::'a) \<le> g x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> g ?x3

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
from fgw
[PROOF STATE]
proof (chain)
picking this:
\<forall>w. v \<noteq> w \<longrightarrow> f w = g w
[PROOF STEP]
have w: "\<And> w. v \<noteq> w \<Longrightarrow> f w = g w"
[PROOF STATE]
proof (prove)
using this:
\<forall>w. v \<noteq> w \<longrightarrow> f w = g w

goal (1 subgoal):
 1. \<And>w. v \<noteq> w \<Longrightarrow> f w = g w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
from assms check_poly_gt
[PROOF STATE]
proof (chain)
picking this:
discrete
check_poly_strict_mono_discrete (\<succ>) p v
check_poly_gt (\<succ>) ?p ?q \<Longrightarrow> ?p >p ?q
[PROOF STEP]
have gt: "poly_gt (poly_subst (\<lambda> w. poly_of (if w = v then PSum [PNum 1, PVar v] else PVar w)) p) p" (is "poly_gt ?p1 p")
[PROOF STATE]
proof (prove)
using this:
discrete
check_poly_strict_mono_discrete (\<succ>) p v
check_poly_gt (\<succ>) ?p ?q \<Longrightarrow> ?p >p ?q

goal (1 subgoal):
 1. poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p >p p
[PROOF STEP]
unfolding check_poly_strict_mono_discrete_def
[PROOF STATE]
proof (prove)
using this:
discrete
check_poly_gt (\<succ>) (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) p
check_poly_gt (\<succ>) ?p ?q \<Longrightarrow> ?p >p ?q

goal (1 subgoal):
 1. poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p >p p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p >p p

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
from discrete[OF \<open>discrete\<close> gt_imp_ge[OF v]]
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. f v = ((+) (1::'a) ^^ k) (g v)
[PROOF STEP]
obtain k' where id: "f v = (((+) 1)^^k') (g v)"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. f v = ((+) (1::'a) ^^ k) (g v)

goal (1 subgoal):
 1. (\<And>k'. f v = ((+) (1::'a) ^^ k') (g v) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f v = ((+) (1::'a) ^^ k') (g v)

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
f v = ((+) (1::'a) ^^ k') (g v)

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
assume "k' = 0"
[PROOF STATE]
proof (state)
this:
k' = 0

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
from v[unfolded id this]
[PROOF STATE]
proof (chain)
picking this:
((+) (1::'a) ^^ 0) (g v) \<succ> g v
[PROOF STEP]
have "g v \<succ> g v"
[PROOF STATE]
proof (prove)
using this:
((+) (1::'a) ^^ 0) (g v) \<succ> g v

goal (1 subgoal):
 1. g v \<succ> g v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g v \<succ> g v

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
g v \<succ> g v

goal (1 subgoal):
 1. False
[PROOF STEP]
using SN g[of v]
[PROOF STATE]
proof (prove)
using this:
g v \<succ> g v
SN {(x, y). (0::'a) \<le> y \<and> x \<succ> y}
(0::'a) \<le> g v

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding SN_defs
[PROOF STATE]
proof (prove)
using this:
g v \<succ> g v
\<nexists>f. f 0 \<in> UNIV \<and> (\<forall>i. (f i, f (Suc i)) \<in> {(x, y). (0::'a) \<le> y \<and> x \<succ> y})
(0::'a) \<le> g v

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

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
k' = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
with id
[PROOF STATE]
proof (chain)
picking this:
f v = ((+) (1::'a) ^^ k') (g v)
k' = 0 \<Longrightarrow> False
[PROOF STEP]
obtain k where id: "f v = (((+) 1)^^(Suc k)) (g v)"
[PROOF STATE]
proof (prove)
using this:
f v = ((+) (1::'a) ^^ k') (g v)
k' = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. (\<And>k. f v = ((+) (1::'a) ^^ Suc k) (g v) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases k', auto)
[PROOF STATE]
proof (state)
this:
f v = ((+) (1::'a) ^^ Suc k) (g v)

goal (1 subgoal):
 1. \<And>\<alpha> \<beta>. \<lbrakk>\<forall>x. v \<noteq> x \<longrightarrow> \<alpha> x = \<beta> x; pos_assign \<beta>; \<alpha> v \<succ> \<beta> v\<rbrakk> \<Longrightarrow> eval_poly \<alpha> p \<succ> eval_poly \<beta> p
[PROOF STEP]
with w gass
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3
pos_assign g
f v = ((+) (1::'a) ^^ Suc k) (g v)
[PROOF STEP]
show "eval_poly f p \<succ> eval_poly g p"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3
pos_assign g
f v = ((+) (1::'a) ^^ Suc k) (g v)

goal (1 subgoal):
 1. eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
proof (induct k arbitrary: f g rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x f g. \<lbrakk>\<And>y f g. \<lbrakk>y < x; \<And>w. v \<noteq> w \<Longrightarrow> f w = g w; pos_assign g; f v = ((+) (1::'a) ^^ Suc y) (g v)\<rbrakk> \<Longrightarrow> eval_poly f p \<succ> eval_poly g p; \<And>w. v \<noteq> w \<Longrightarrow> f w = g w; pos_assign g; f v = ((+) (1::'a) ^^ Suc x) (g v)\<rbrakk> \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
case (less k)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y3 < k; \<And>w. v \<noteq> w \<Longrightarrow> ?f3 w = ?g3 w; pos_assign ?g3; ?f3 v = ((+) (1::'a) ^^ Suc ?y3) (?g3 v)\<rbrakk> \<Longrightarrow> eval_poly ?f3 p \<succ> eval_poly ?g3 p
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3
pos_assign g
f v = ((+) (1::'a) ^^ Suc k) (g v)

goal (1 subgoal):
 1. \<And>x f g. \<lbrakk>\<And>y f g. \<lbrakk>y < x; \<And>w. v \<noteq> w \<Longrightarrow> f w = g w; pos_assign g; f v = ((+) (1::'a) ^^ Suc y) (g v)\<rbrakk> \<Longrightarrow> eval_poly f p \<succ> eval_poly g p; \<And>w. v \<noteq> w \<Longrightarrow> f w = g w; pos_assign g; f v = ((+) (1::'a) ^^ Suc x) (g v)\<rbrakk> \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
 2. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
 2. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
with less(4)
[PROOF STATE]
proof (chain)
picking this:
f v = ((+) (1::'a) ^^ Suc k) (g v)
k = 0
[PROOF STEP]
have id0: "f v = 1 + g v"
[PROOF STATE]
proof (prove)
using this:
f v = ((+) (1::'a) ^^ Suc k) (g v)
k = 0

goal (1 subgoal):
 1. f v = (1::'a) + g v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f v = (1::'a) + g v

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
 2. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
have id1: "eval_poly f p = eval_poly g ?p1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly f p = eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p)
[PROOF STEP]
proof (rule eval_poly_subst)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
show "f w = eval_poly g (poly_of (if w = v then PSum [PNum 1, PVar v] else PVar w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
proof (cases "w = v")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w = v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
 2. w \<noteq> v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
w = v

goal (2 subgoals):
 1. w = v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
 2. w \<noteq> v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
by (simp add: True id0 zero_poly_def)
[PROOF STATE]
proof (state)
this:
f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))

goal (1 subgoal):
 1. w \<noteq> v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<noteq> v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
w \<noteq> v

goal (1 subgoal):
 1. w \<noteq> v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
with less
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y3 < k; \<And>w. v \<noteq> w \<Longrightarrow> ?f3 w = ?g3 w; pos_assign ?g3; ?f3 v = ((+) (1::'a) ^^ Suc ?y3) (?g3 v)\<rbrakk> \<Longrightarrow> eval_poly ?f3 p \<succ> eval_poly ?g3 p
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3
pos_assign g
f v = ((+) (1::'a) ^^ Suc k) (g v)
w \<noteq> v
[PROOF STEP]
have "f w = g w"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y3 < k; \<And>w. v \<noteq> w \<Longrightarrow> ?f3 w = ?g3 w; pos_assign ?g3; ?f3 v = ((+) (1::'a) ^^ Suc ?y3) (?g3 v)\<rbrakk> \<Longrightarrow> eval_poly ?f3 p \<succ> eval_poly ?g3 p
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3
pos_assign g
f v = ((+) (1::'a) ^^ Suc k) (g v)
w \<noteq> v

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

goal (1 subgoal):
 1. w \<noteq> v \<Longrightarrow> f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f w = g w

goal (1 subgoal):
 1. f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))
[PROOF STEP]
by (simp add: False)
[PROOF STATE]
proof (state)
this:
f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f w = eval_poly g (poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
eval_poly f p = eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p)

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
 2. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
have "eval_poly g ?p1 \<succ> eval_poly g p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) \<succ> eval_poly g p
[PROOF STEP]
using gt less
[PROOF STATE]
proof (prove)
using this:
poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p >p p
\<lbrakk>?y3 < k; \<And>w. v \<noteq> w \<Longrightarrow> ?f3 w = ?g3 w; pos_assign ?g3; ?f3 v = ((+) (1::'a) ^^ Suc ?y3) (?g3 v)\<rbrakk> \<Longrightarrow> eval_poly ?f3 p \<succ> eval_poly ?g3 p
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3
pos_assign g
f v = ((+) (1::'a) ^^ Suc k) (g v)

goal (1 subgoal):
 1. eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) \<succ> eval_poly g p
[PROOF STEP]
unfolding poly_gt_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<alpha>. pos_assign \<alpha> \<longrightarrow> eval_poly \<alpha> (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) \<succ> eval_poly \<alpha> p
\<lbrakk>?y3 < k; \<And>w. v \<noteq> w \<Longrightarrow> ?f3 w = ?g3 w; pos_assign ?g3; ?f3 v = ((+) (1::'a) ^^ Suc ?y3) (?g3 v)\<rbrakk> \<Longrightarrow> eval_poly ?f3 p \<succ> eval_poly ?g3 p
v \<noteq> ?w3 \<Longrightarrow> f ?w3 = g ?w3
pos_assign g
f v = ((+) (1::'a) ^^ Suc k) (g v)

goal (1 subgoal):
 1. eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) \<succ> eval_poly g p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) \<succ> eval_poly g p

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
 2. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
with id1
[PROOF STATE]
proof (chain)
picking this:
eval_poly f p = eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p)
eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) \<succ> eval_poly g p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eval_poly f p = eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p)
eval_poly g (poly_subst (\<lambda>w. poly_of (if w = v then PSum [PNum (1::'a), PVar v] else PVar w)) p) \<succ> eval_poly g p

goal (1 subgoal):
 1. eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_poly f p \<succ> eval_poly g p

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
case (Suc kk)
[PROOF STATE]
proof (state)
this:
k = Suc kk

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
obtain g' where g': "g' = (\<lambda> w. if (w = v) then 1 + g w else g w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g'. g' = (\<lambda>w. if w = v then (1::'a) + g w else g w) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g' = (\<lambda>w. if w = v then (1::'a) + g w else g w)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
have "(1 :: 'a) + g v \<ge> 1 + 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + (0::'a) \<le> (1::'a) + g v
[PROOF STEP]
by (rule plus_right_mono, simp add: less(3)[unfolded pos_assign_def])
[PROOF STATE]
proof (state)
this:
(1::'a) + (0::'a) \<le> (1::'a) + g v

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) + (0::'a) \<le> (1::'a) + g v

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
have "(1 :: 'a) + 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + (0::'a) = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) + (0::'a) = (1::'a)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) + (0::'a) = (1::'a)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
have "\<dots> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> (1::'a)
[PROOF STEP]
by (rule one_ge_zero)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> (1::'a)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> (1::'a) + g v
[PROOF STEP]
have g'pos: "pos_assign g'"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> (1::'a) + g v

goal (1 subgoal):
 1. pos_assign g'
[PROOF STEP]
using less(3)
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> (1::'a) + g v
pos_assign g

goal (1 subgoal):
 1. pos_assign g'
[PROOF STEP]
unfolding pos_assign_def
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> (1::'a) + g v
\<forall>x. (0::'a) \<le> g x

goal (1 subgoal):
 1. \<forall>x. (0::'a) \<le> g' x
[PROOF STEP]
by (simp add: g')
[PROOF STATE]
proof (state)
this:
pos_assign g'

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
pos_assign g'

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
assume "v \<noteq> w"
[PROOF STATE]
proof (state)
this:
v \<noteq> w

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
hence "f w = g' w"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> w

goal (1 subgoal):
 1. f w = g' w
[PROOF STEP]
unfolding g'
[PROOF STATE]
proof (prove)
using this:
v \<noteq> w

goal (1 subgoal):
 1. f w = (if w = v then (1::'a) + g w else g w)
[PROOF STEP]
by (simp add: less)
[PROOF STATE]
proof (state)
this:
f w = g' w

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
v \<noteq> ?w5 \<Longrightarrow> f ?w5 = g' ?w5

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
note w = this
[PROOF STATE]
proof (state)
this:
v \<noteq> ?w5 \<Longrightarrow> f ?w5 = g' ?w5

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
have eq: "f v = ((+) (1 :: 'a) ^^ Suc kk) ((g' v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f v = ((+) (1::'a) ^^ Suc kk) (g' v)
[PROOF STEP]
by (simp add: less(4) g' Suc, rule arg_cong[where f = "(+) 1"], induct kk, auto)
[PROOF STATE]
proof (state)
this:
f v = ((+) (1::'a) ^^ Suc kk) (g' v)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
k = Suc kk
[PROOF STEP]
have kk: "kk < k"
[PROOF STATE]
proof (prove)
using this:
k = Suc kk

goal (1 subgoal):
 1. kk < k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
kk < k

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
from less(1)[OF kk w g'pos] eq
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>w. v \<noteq> w \<Longrightarrow> v \<noteq> w; f v = ((+) (1::'a) ^^ Suc kk) (g' v)\<rbrakk> \<Longrightarrow> eval_poly f p \<succ> eval_poly g' p
f v = ((+) (1::'a) ^^ Suc kk) (g' v)
[PROOF STEP]
have rec1: "eval_poly f p \<succ> eval_poly g' p"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>w. v \<noteq> w \<Longrightarrow> v \<noteq> w; f v = ((+) (1::'a) ^^ Suc kk) (g' v)\<rbrakk> \<Longrightarrow> eval_poly f p \<succ> eval_poly g' p
f v = ((+) (1::'a) ^^ Suc kk) (g' v)

goal (1 subgoal):
 1. eval_poly f p \<succ> eval_poly g' p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_poly f p \<succ> eval_poly g' p

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
eval_poly f p \<succ> eval_poly g' p

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
assume "v \<noteq> w"
[PROOF STATE]
proof (state)
this:
v \<noteq> w

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
hence "g' w = g w"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> w

goal (1 subgoal):
 1. g' w = g w
[PROOF STEP]
unfolding g'
[PROOF STATE]
proof (prove)
using this:
v \<noteq> w

goal (1 subgoal):
 1. (if w = v then (1::'a) + g w else g w) = g w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g' w = g w

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
v \<noteq> ?w5 \<Longrightarrow> g' ?w5 = g ?w5

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
note w = this
[PROOF STATE]
proof (state)
this:
v \<noteq> ?w5 \<Longrightarrow> g' ?w5 = g ?w5

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
k = Suc kk
[PROOF STEP]
have z: "0 < k"
[PROOF STATE]
proof (prove)
using this:
k = Suc kk

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

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
from less(1)[OF z w less(3)] g'
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>w. v \<noteq> w \<Longrightarrow> v \<noteq> w; g' v = ((+) (1::'a) ^^ Suc 0) (g v)\<rbrakk> \<Longrightarrow> eval_poly g' p \<succ> eval_poly g p
g' = (\<lambda>w. if w = v then (1::'a) + g w else g w)
[PROOF STEP]
have rec2: "eval_poly g' p \<succ> eval_poly g p"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>w. v \<noteq> w \<Longrightarrow> v \<noteq> w; g' v = ((+) (1::'a) ^^ Suc 0) (g v)\<rbrakk> \<Longrightarrow> eval_poly g' p \<succ> eval_poly g p
g' = (\<lambda>w. if w = v then (1::'a) + g w else g w)

goal (1 subgoal):
 1. eval_poly g' p \<succ> eval_poly g p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_poly g' p \<succ> eval_poly g p

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly f p \<succ> eval_poly g p
[PROOF STEP]
by (rule gt_trans[OF rec1 rec2])
[PROOF STATE]
proof (state)
this:
eval_poly f p \<succ> eval_poly g p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
eval_poly f p \<succ> eval_poly g p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
eval_poly f p \<succ> eval_poly g p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_interior_cball:
  "rel_interior S = {x \<in> S. \<exists>e. e > 0 \<and> cball x e \<inter> affine hull S \<subseteq> S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior S = {x \<in> S. \<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S}
[PROOF STEP]
using mem_rel_interior_cball [of _ S]
[PROOF STATE]
proof (prove)
using this:
(?x \<in> rel_interior S) = (?x \<in> S \<and> (\<exists>e>0. cball ?x e \<inter> affine hull S \<subseteq> S))

goal (1 subgoal):
 1. rel_interior S = {x \<in> S. \<exists>e>0. cball x e \<inter> affine hull S \<subseteq> S}
[PROOF STEP]
by auto


[STATEMENT]
lemma adjust_orthogonal:
  assumes U: "set (us :: 'a vec list) \<subseteq> carrier_vec n"
    and orth: "corthogonal us"
    and w[simp]: "w : carrier_vec n"
    and wsU: "w \<notin> span (set us)"
  shows "corthogonal ((adjuster n w us + w) # us)"
    (is "corthogonal (?aw # _)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. corthogonal ((adjuster n w us + w) # us)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length ((adjuster n w us + w) # us); j < length ((adjuster n w us + w) # us)\<rbrakk> \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
have dist: "distinct us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct us
[PROOF STEP]
using corthogonal_distinct orth
[PROOF STATE]
proof (prove)
using this:
corthogonal ?us \<Longrightarrow> distinct ?us
corthogonal us

goal (1 subgoal):
 1. distinct us
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct us

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length ((adjuster n w us + w) # us); j < length ((adjuster n w us + w) # us)\<rbrakk> \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
have aw[simp]: "?aw : carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjuster n w us + w \<in> carrier_vec n
[PROOF STEP]
using U dist
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
distinct us

goal (1 subgoal):
 1. adjuster n w us + w \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjuster n w us + w \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length ((adjuster n w us + w) # us); j < length ((adjuster n w us + w) # us)\<rbrakk> \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
note adjust_nonzero[OF U dist w] wsU
[PROOF STATE]
proof (state)
this:
w \<notin> local.span (set us) \<Longrightarrow> adjuster n w us + w \<noteq> 0\<^sub>v n
w \<notin> local.span (set us)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length ((adjuster n w us + w) # us); j < length ((adjuster n w us + w) # us)\<rbrakk> \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence aw0: "?aw \<bullet>c ?aw \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
w \<notin> local.span (set us) \<Longrightarrow> adjuster n w us + w \<noteq> 0\<^sub>v n
w \<notin> local.span (set us)

goal (1 subgoal):
 1. (adjuster n w us + w) \<bullet>c (adjuster n w us + w) \<noteq> (0::'a)
[PROOF STEP]
using conjugate_square_eq_0_vec[OF aw]
[PROOF STATE]
proof (prove)
using this:
w \<notin> local.span (set us) \<Longrightarrow> adjuster n w us + w \<noteq> 0\<^sub>v n
w \<notin> local.span (set us)
((adjuster n w us + w) \<bullet>c (adjuster n w us + w) = (0::'a)) = (adjuster n w us + w = 0\<^sub>v n)

goal (1 subgoal):
 1. (adjuster n w us + w) \<bullet>c (adjuster n w us + w) \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(adjuster n w us + w) \<bullet>c (adjuster n w us + w) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length ((adjuster n w us + w) # us); j < length ((adjuster n w us + w) # us)\<rbrakk> \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length ((adjuster n w us + w) # us); j < length ((adjuster n w us + w) # us)\<rbrakk> \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
assume i: "i < length (?aw # us)" and j: "j < length (?aw # us)"
[PROOF STATE]
proof (state)
this:
i < length ((adjuster n w us + w) # us)
j < length ((adjuster n w us + w) # us)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < length ((adjuster n w us + w) # us); j < length ((adjuster n w us + w) # us)\<rbrakk> \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
show "((?aw # us) ! i \<bullet>c (?aw # us) ! j = 0) = (i \<noteq> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
proof (cases "i = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
note i0 = this
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
proof (cases "j = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
j = 0

goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
unfolding True i0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! 0 \<bullet>c ((adjuster n w us + w) # us) ! 0 = (0::'a)) = (0 \<noteq> 0)
[PROOF STEP]
using aw0
[PROOF STATE]
proof (prove)
using this:
(adjuster n w us + w) \<bullet>c (adjuster n w us + w) \<noteq> (0::'a)

goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! 0 \<bullet>c ((adjuster n w us + w) # us) ! 0 = (0::'a)) = (0 \<noteq> 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
j \<noteq> 0

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
define j' where "j' = j-1"
[PROOF STATE]
proof (state)
this:
j' = j - 1

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence jfold: "j = j'+1"
[PROOF STATE]
proof (prove)
using this:
j' = j - 1

goal (1 subgoal):
 1. j = j' + 1
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
j' = j - 1
j \<noteq> 0

goal (1 subgoal):
 1. j = j' + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j = j' + 1

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence j': "j' < length us"
[PROOF STATE]
proof (prove)
using this:
j = j' + 1

goal (1 subgoal):
 1. j' < length us
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j = j' + 1
j < length ((adjuster n w us + w) # us)

goal (1 subgoal):
 1. j' < length us
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j' < length us

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
unfolding i0 jfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! 0 \<bullet>c ((adjuster n w us + w) # us) ! (j' + 1) = (0::'a)) = (0 \<noteq> j' + 1)
[PROOF STEP]
using adjust_zero[OF U orth w j']
[PROOF STATE]
proof (prove)
using this:
(adjuster n w us + w) \<bullet>c us ! j' = (0::'a)

goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! 0 \<bullet>c ((adjuster n w us + w) # us) ! (j' + 1) = (0::'a)) = (0 \<noteq> j' + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> 0

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
define i' where "i' = i-1"
[PROOF STATE]
proof (state)
this:
i' = i - 1

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence ifold: "i = i'+1"
[PROOF STATE]
proof (prove)
using this:
i' = i - 1

goal (1 subgoal):
 1. i = i' + 1
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
i' = i - 1
i \<noteq> 0

goal (1 subgoal):
 1. i = i' + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = i' + 1

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence i': "i' < length us"
[PROOF STATE]
proof (prove)
using this:
i = i' + 1

goal (1 subgoal):
 1. i' < length us
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i = i' + 1
i < length ((adjuster n w us + w) # us)

goal (1 subgoal):
 1. i' < length us
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i' < length us

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
have [simp]: "us ! i' : carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. us ! i' \<in> carrier_vec n
[PROOF STEP]
using U i'
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
i' < length us

goal (1 subgoal):
 1. us ! i' \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i' \<in> carrier_vec n

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence cu': "conjugate (us ! i') : carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
us ! i' \<in> carrier_vec n

goal (1 subgoal):
 1. conjugate (us ! i') \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate (us ! i') \<in> carrier_vec n

goal (1 subgoal):
 1. i \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
proof (cases "j = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
j = 0

goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
j = 0

goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
assume "?aw \<bullet>c us ! i' = 0"
[PROOF STATE]
proof (state)
this:
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a)

goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence "conjugate (?aw \<bullet>c us ! i') = 0"
[PROOF STATE]
proof (prove)
using this:
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a)

goal (1 subgoal):
 1. conjugate ((adjuster n w us + w) \<bullet>c us ! i') = (0::'a)
[PROOF STEP]
using conjugate_zero
[PROOF STATE]
proof (prove)
using this:
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a)
conjugate (0::?'a) = (0::?'a)

goal (1 subgoal):
 1. conjugate ((adjuster n w us + w) \<bullet>c us ! i') = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate ((adjuster n w us + w) \<bullet>c us ! i') = (0::'a)

goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence "conjugate ?aw \<bullet> us ! i' = 0"
[PROOF STATE]
proof (prove)
using this:
conjugate ((adjuster n w us + w) \<bullet>c us ! i') = (0::'a)

goal (1 subgoal):
 1. conjugate (adjuster n w us + w) \<bullet> us ! i' = (0::'a)
[PROOF STEP]
using conjugate_sprod_vec[OF aw cu']
[PROOF STATE]
proof (prove)
using this:
conjugate ((adjuster n w us + w) \<bullet>c us ! i') = (0::'a)
conjugate ((adjuster n w us + w) \<bullet>c us ! i') = conjugate (adjuster n w us + w) \<bullet>c conjugate (us ! i')

goal (1 subgoal):
 1. conjugate (adjuster n w us + w) \<bullet> us ! i' = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate (adjuster n w us + w) \<bullet> us ! i' = (0::'a)

goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a) \<Longrightarrow> conjugate (adjuster n w us + w) \<bullet> us ! i' = (0::'a)

goal (2 subgoals):
 1. j = 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
 2. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a) \<Longrightarrow> conjugate (adjuster n w us + w) \<bullet> us ! i' = (0::'a)

goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
unfolding True ifold
[PROOF STATE]
proof (prove)
using this:
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a) \<Longrightarrow> conjugate (adjuster n w us + w) \<bullet> us ! i' = (0::'a)

goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! (i' + 1) \<bullet>c ((adjuster n w us + w) # us) ! 0 = (0::'a)) = (i' + 1 \<noteq> 0)
[PROOF STEP]
using adjust_zero[OF U orth w i']
[PROOF STATE]
proof (prove)
using this:
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a) \<Longrightarrow> conjugate (adjuster n w us + w) \<bullet> us ! i' = (0::'a)
(adjuster n w us + w) \<bullet>c us ! i' = (0::'a)

goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! (i' + 1) \<bullet>c ((adjuster n w us + w) # us) ! 0 = (0::'a)) = (i' + 1 \<noteq> 0)
[PROOF STEP]
by (subst comm_scalar_prod[of _ n], auto)
[PROOF STATE]
proof (state)
this:
(((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
j \<noteq> 0

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
define j' where "j' = j-1"
[PROOF STATE]
proof (state)
this:
j' = j - 1

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence jfold: "j = j'+1"
[PROOF STATE]
proof (prove)
using this:
j' = j - 1

goal (1 subgoal):
 1. j = j' + 1
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
j' = j - 1
j \<noteq> 0

goal (1 subgoal):
 1. j = j' + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j = j' + 1

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
hence j': "j' < length us"
[PROOF STATE]
proof (prove)
using this:
j = j' + 1

goal (1 subgoal):
 1. j' < length us
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j = j' + 1
j < length ((adjuster n w us + w) # us)

goal (1 subgoal):
 1. j' < length us
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j' < length us

goal (1 subgoal):
 1. j \<noteq> 0 \<Longrightarrow> (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
unfolding ifold jfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! (i' + 1) \<bullet>c ((adjuster n w us + w) # us) ! (j' + 1) = (0::'a)) = (i' + 1 \<noteq> j' + 1)
[PROOF STEP]
using orth i' j'
[PROOF STATE]
proof (prove)
using this:
corthogonal us
i' < length us
j' < length us

goal (1 subgoal):
 1. (((adjuster n w us + w) # us) ! (i' + 1) \<bullet>c ((adjuster n w us + w) # us) ! (j' + 1) = (0::'a)) = (i' + 1 \<noteq> j' + 1)
[PROOF STEP]
by (auto simp: corthogonalD)
[PROOF STATE]
proof (state)
this:
(((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(((adjuster n w us + w) # us) ! i \<bullet>c ((adjuster n w us + w) # us) ! j = (0::'a)) = (i \<noteq> j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smult_zero_mat[simp]: "(k :: 'a :: mult_zero) \<cdot>\<^sub>m 0\<^sub>m nr nc = 0\<^sub>m nr nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<cdot>\<^sub>m 0\<^sub>m nr nc = 0\<^sub>m nr nc
[PROOF STEP]
by (intro eq_matI, auto)


[STATEMENT]
lemma sums_mult2_iff:
  fixes f :: "nat \<Rightarrow> 'a::{real_normed_algebra,field}"
  assumes "c \<noteq> 0"
  shows   "(\<lambda>n. f n * c) sums (d * c) \<longleftrightarrow> f sums d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f n * c) sums (d * c) = f sums d
[PROOF STEP]
using sums_mult_iff[OF assms, of f d]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. c * f n) sums (c * d) = f sums d

goal (1 subgoal):
 1. (\<lambda>n. f n * c) sums (d * c) = f sums d
[PROOF STEP]
by (simp add: mult.commute)


[STATEMENT]
lemma lnull_lfilter [simp]: "lnull (lfilter P xs) \<longleftrightarrow> (\<forall>x\<in>lset xs. \<not> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lnull (lfilter P xs) = (\<forall>x\<in>lset xs. \<not> P x)
[PROOF STEP]
unfolding lnull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lfilter P xs = LNil) = (\<forall>x\<in>lset xs. \<not> P x)
[PROOF STEP]
by(simp add: lfilter_eq_LNil)


[STATEMENT]
lemma (in PO) transE: "[| (a, b) \<in> r; (b, c) \<in> r|] ==> (a,c) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> r; (b, c) \<in> r\<rbrakk> \<Longrightarrow> (a, c) \<in> r
[PROOF STEP]
apply (insert cl_po)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> r; (b, c) \<in> r; cl \<in> PartialOrder\<rbrakk> \<Longrightarrow> (a, c) \<in> r
[PROOF STEP]
apply (simp add: PartialOrder_def r_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a, b) \<in> order cl; (b, c) \<in> order cl; refl_on (pset cl) (order cl) \<and> antisym (order cl) \<and> trans (order cl)\<rbrakk> \<Longrightarrow> (a, c) \<in> order cl
[PROOF STEP]
apply (unfold trans_def, fast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem succsr_isNode:
  assumes xy: "(x, y) \<in> succsr\<^sup>*"
  shows "isNode x \<Longrightarrow> isNode y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isNode x \<Longrightarrow> isNode y
[PROOF STEP]
using xy
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> succsr\<^sup>*

goal (1 subgoal):
 1. isNode x \<Longrightarrow> isNode y
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. isNode x \<Longrightarrow> isNode x
 2. \<And>y z. \<lbrakk>(x, y) \<in> succsr\<^sup>*; (y, z) \<in> succsr; isNode x \<Longrightarrow> isNode y; isNode x\<rbrakk> \<Longrightarrow> isNode z
[PROOF STEP]
case (step y z)
[PROOF STATE]
proof (state)
this:
(x, y) \<in> succsr\<^sup>*
(y, z) \<in> succsr
isNode x \<Longrightarrow> isNode y
isNode x

goal (2 subgoals):
 1. isNode x \<Longrightarrow> isNode x
 2. \<And>y z. \<lbrakk>(x, y) \<in> succsr\<^sup>*; (y, z) \<in> succsr; isNode x \<Longrightarrow> isNode y; isNode x\<rbrakk> \<Longrightarrow> isNode z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> succsr\<^sup>*
(y, z) \<in> succsr
isNode x \<Longrightarrow> isNode y
isNode x
[PROOF STEP]
have "isNode y"
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> succsr\<^sup>*
(y, z) \<in> succsr
isNode x \<Longrightarrow> isNode y
isNode x

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

goal (2 subgoals):
 1. isNode x \<Longrightarrow> isNode x
 2. \<And>y z. \<lbrakk>(x, y) \<in> succsr\<^sup>*; (y, z) \<in> succsr; isNode x \<Longrightarrow> isNode y; isNode x\<rbrakk> \<Longrightarrow> isNode z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isNode y
[PROOF STEP]
have "list_all isNode (succs y)"
[PROOF STATE]
proof (prove)
using this:
isNode y

goal (1 subgoal):
 1. list_all isNode (succs y)
[PROOF STEP]
by (rule succs_isNode)
[PROOF STATE]
proof (state)
this:
list_all isNode (succs y)

goal (2 subgoals):
 1. isNode x \<Longrightarrow> isNode x
 2. \<And>y z. \<lbrakk>(x, y) \<in> succsr\<^sup>*; (y, z) \<in> succsr; isNode x \<Longrightarrow> isNode y; isNode x\<rbrakk> \<Longrightarrow> isNode z
[PROOF STEP]
with step
[PROOF STATE]
proof (chain)
picking this:
(x, y) \<in> succsr\<^sup>*
(y, z) \<in> succsr
isNode x \<Longrightarrow> isNode y
isNode x
list_all isNode (succs y)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> succsr\<^sup>*
(y, z) \<in> succsr
isNode x \<Longrightarrow> isNode y
isNode x
list_all isNode (succs y)

goal (1 subgoal):
 1. isNode z
[PROOF STEP]
by (simp add: succsr_def list_all_iff)
[PROOF STATE]
proof (state)
this:
isNode z

goal (1 subgoal):
 1. isNode x \<Longrightarrow> isNode x
[PROOF STEP]
qed


[STATEMENT]
lemma ortho_span: assumes W: "W \<subseteq> carrier_vec n"
  and X: "X \<subseteq> carrier_vec n"
  and ortho: "\<And> w x. w \<in> W \<Longrightarrow> x \<in> X \<Longrightarrow> w \<bullet> x = 0"
  and w: "w \<in> span W" and x: "x \<in> X"
shows "w \<bullet> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<bullet> x = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<bullet> x = (0::'a)
[PROOF STEP]
from w W
[PROOF STATE]
proof (chain)
picking this:
w \<in> local.span W
W \<subseteq> carrier_vec n
[PROOF STEP]
obtain c V where "finite V" and VW: "V \<subseteq> W" and w: "w = lincomb c V"
[PROOF STATE]
proof (prove)
using this:
w \<in> local.span W
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. (\<And>V c. \<lbrakk>finite V; V \<subseteq> W; w = lincomb c V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson in_spanE)
[PROOF STATE]
proof (state)
this:
finite V
V \<subseteq> W
w = lincomb c V

goal (1 subgoal):
 1. w \<bullet> x = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<bullet> x = (0::'a)
[PROOF STEP]
unfolding w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb c V \<bullet> x = (0::'a)
[PROOF STEP]
by (subst lincomb_scalar_prod_left, insert W VW X x ortho, auto intro!: sum.neutral)
[PROOF STATE]
proof (state)
this:
w \<bullet> x = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exFresh_s_p_cof:
  fixes L :: "fVariable set"
  assumes "finite L"
  shows "\<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite L
[PROOF STEP]
have "\<exists>s. s \<notin> L"
[PROOF STATE]
proof (prove)
using this:
finite L

goal (1 subgoal):
 1. \<exists>s. s \<notin> L
[PROOF STEP]
by (simp only: ex_new_if_finite[OF infinite_UNIV_listI])
[PROOF STATE]
proof (state)
this:
\<exists>s. s \<notin> L

goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>s. s \<notin> L
[PROOF STEP]
obtain s where "s \<notin> L"
[PROOF STATE]
proof (prove)
using this:
\<exists>s. s \<notin> L

goal (1 subgoal):
 1. (\<And>s. s \<notin> L \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
s \<notin> L

goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
s \<notin> L

goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
from \<open>finite L\<close>
[PROOF STATE]
proof (chain)
picking this:
finite L
[PROOF STEP]
have "finite (L \<union> {s})"
[PROOF STATE]
proof (prove)
using this:
finite L

goal (1 subgoal):
 1. finite (L \<union> {s})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (L \<union> {s})

goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
hence "\<exists>p. p \<notin> L \<union> {s}"
[PROOF STATE]
proof (prove)
using this:
finite (L \<union> {s})

goal (1 subgoal):
 1. \<exists>p. p \<notin> L \<union> {s}
[PROOF STEP]
by (simp only: ex_new_if_finite[OF infinite_UNIV_listI])
[PROOF STATE]
proof (state)
this:
\<exists>p. p \<notin> L \<union> {s}

goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>p. p \<notin> L \<union> {s}
[PROOF STEP]
obtain p where "p \<notin> L \<union> {s}"
[PROOF STATE]
proof (prove)
using this:
\<exists>p. p \<notin> L \<union> {s}

goal (1 subgoal):
 1. (\<And>p. p \<notin> L \<union> {s} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
p \<notin> L \<union> {s}

goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
s \<notin> L
p \<notin> L \<union> {s}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
s \<notin> L
p \<notin> L \<union> {s}

goal (1 subgoal):
 1. \<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>s p. s \<notin> L \<and> p \<notin> L \<and> s \<noteq> p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_of_int [simp]:
  "(conjugate (of_int x) :: 'a :: {conjugatable_ring,ring_1}) = of_int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (of_int x) = of_int x
[PROOF STEP]
proof (induct x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. conjugate (of_int (int n)) = of_int (int n)
 2. \<And>n. conjugate (of_int (- int (Suc n))) = of_int (- int (Suc n))
[PROOF STEP]
case (nonneg n)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>n. conjugate (of_int (int n)) = of_int (int n)
 2. \<And>n. conjugate (of_int (- int (Suc n))) = of_int (- int (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (of_int (int n)) = of_int (int n)
[PROOF STEP]
by (induct n, auto simp: conjugate_dist_add)
[PROOF STATE]
proof (state)
this:
conjugate (of_int (int n)) = of_int (int n)

goal (1 subgoal):
 1. \<And>n. conjugate (of_int (- int (Suc n))) = of_int (- int (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. conjugate (of_int (- int (Suc n))) = of_int (- int (Suc n))
[PROOF STEP]
case (neg n)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>n. conjugate (of_int (- int (Suc n))) = of_int (- int (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (of_int (- int (Suc n))) = of_int (- int (Suc n))
[PROOF STEP]
apply (induct n, auto simp: conjugate_minus conjugate_neg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. conjugate (of_nat n) = of_nat n \<Longrightarrow> conjugate (2::'a) = (2::'a)
[PROOF STEP]
by (metis conjugate_1 conjugate_dist_add one_add_one)
[PROOF STATE]
proof (state)
this:
conjugate (of_int (- int (Suc n))) = of_int (- int (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma at_most_one_mset_mset_diff:
  assumes "a \<notin># M - {#a#}"
  shows "set_mset (M - {#a#}) = set_mset M - {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (M - {#a#}) = set_mset M - {a}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<notin># M - {#a#}

goal (1 subgoal):
 1. set_mset (M - {#a#}) = set_mset M - {a}
[PROOF STEP]
by (auto simp add: not_in_iff in_diff_count set_eq_iff)


[STATEMENT]
lemma degree_add_le: "degree p \<le> n \<Longrightarrow> degree q \<le> n \<Longrightarrow> degree (p + q) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>degree p \<le> n; degree q \<le> n\<rbrakk> \<Longrightarrow> degree (p + q) \<le> n
[PROOF STEP]
by (auto intro: order_trans degree_add_le_max)


[STATEMENT]
lemma gtake_eSuc_gCons[simp]: "(x #\<^sub>g a) \<down>\<^sub>g (eSuc n) = x #\<^sub>g a \<down>\<^sub>g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x #\<^sub>g a) \<down>\<^sub>g eSuc n = x #\<^sub>g a \<down>\<^sub>g n
[PROOF STEP]
by (unfold gtake_def gCons_def, case_tac n, case_tac a, simp_all add: eSuc_enat)


[STATEMENT]
lemma language_equivalence_from_isomorphism :
  assumes "bij_betw f (states M1) (states M2)"
  and     "f (initial M1) = initial M2"
  and     "\<And> q x y q' . q \<in> states M1 \<Longrightarrow> q' \<in> states M1 \<Longrightarrow> (q,x,y,q') \<in> transitions M1 \<longleftrightarrow> (f q,x,y,f q') \<in> transitions M2"
  and     "q \<in> states M1"
shows "LS M1 q = LS M2 (f q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LS M1 q = LS M2 (f q)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. LS M1 q \<subseteq> LS M2 (f q)
 2. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
show "LS M1 q \<subseteq> LS M2 (f q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LS M1 q \<subseteq> LS M2 (f q)
[PROOF STEP]
using language_equivalence_from_isomorphism_helper[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q x y q'. \<lbrakk>q \<in> FSM.states M1; q' \<in> FSM.states M1\<rbrakk> \<Longrightarrow> q \<in> FSM.states M1; \<And>q x y q'. \<lbrakk>q \<in> FSM.states M1; q' \<in> FSM.states M1\<rbrakk> \<Longrightarrow> q' \<in> FSM.states M1\<rbrakk> \<Longrightarrow> LS M1 q \<subseteq> LS M2 (f q)

goal (1 subgoal):
 1. LS M1 q \<subseteq> LS M2 (f q)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
LS M1 q \<subseteq> LS M2 (f q)

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
have "f q \<in> states M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f q \<in> FSM.states M2
[PROOF STEP]
using assms(1,4)
[PROOF STATE]
proof (prove)
using this:
bij_betw f (FSM.states M1) (FSM.states M2)
q \<in> FSM.states M1

goal (1 subgoal):
 1. f q \<in> FSM.states M2
[PROOF STEP]
using bij_betwE
[PROOF STATE]
proof (prove)
using this:
bij_betw f (FSM.states M1) (FSM.states M2)
q \<in> FSM.states M1
bij_betw ?f ?A ?B \<Longrightarrow> \<forall>a\<in>?A. ?f a \<in> ?B

goal (1 subgoal):
 1. f q \<in> FSM.states M2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f q \<in> FSM.states M2

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
have "(inv_into (FSM.states M1) f (f q)) = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_into (FSM.states M1) f (f q) = q
[PROOF STEP]
by (meson assms(1) assms(4) bij_betw_imp_inj_on inv_into_f_f)
[PROOF STATE]
proof (state)
this:
inv_into (FSM.states M1) f (f q) = q

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
have "bij_betw (inv_into (states M1) f) (states M2) (states M1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)
[PROOF STEP]
using bij_betw_inv_into[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)

goal (1 subgoal):
 1. bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
have "(inv_into (states M1) f) (initial M2) = (initial M1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
bij_betw f (FSM.states M1) (FSM.states M2)
f (FSM.initial M1) = FSM.initial M2

goal (1 subgoal):
 1. inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1
[PROOF STEP]
by (metis bij_betw_inv_into_left fsm_initial)
[PROOF STATE]
proof (state)
this:
inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
have "\<And> q x y q' . q \<in> states M2 \<Longrightarrow> q' \<in> states M2 \<Longrightarrow> (q,x,y,q') \<in> transitions M2 \<longleftrightarrow> ((inv_into (states M1) f) q,x,y,(inv_into (states M1) f) q') \<in> transitions M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((q, x, y, q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2; (q, x, y, q') \<in> FSM.transitions M2\<rbrakk> \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
 2. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2; (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1\<rbrakk> \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
fix q x y q'
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2; (q, x, y, q') \<in> FSM.transitions M2\<rbrakk> \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
 2. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2; (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1\<rbrakk> \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
assume "q \<in> states M2" and "q' \<in> states M2"
[PROOF STATE]
proof (state)
this:
q \<in> FSM.states M2
q' \<in> FSM.states M2

goal (2 subgoals):
 1. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2; (q, x, y, q') \<in> FSM.transitions M2\<rbrakk> \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
 2. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2; (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1\<rbrakk> \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
show "(q,x,y,q') \<in> transitions M2 \<Longrightarrow> ((inv_into (states M1) f) q,x,y,(inv_into (states M1) f) q') \<in> transitions M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2 \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2 \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
assume a1: "(q, x, y, q') \<in> FSM.transitions M2"
[PROOF STATE]
proof (state)
this:
(q, x, y, q') \<in> FSM.transitions M2

goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2 \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
have f2: "\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. (b::'b) \<notin> B \<or> (f b::'a) \<in> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
[PROOF STEP]
using bij_betwE
[PROOF STATE]
proof (prove)
using this:
bij_betw ?f ?A ?B \<Longrightarrow> \<forall>a\<in>?A. ?f a \<in> ?B

goal (1 subgoal):
 1. \<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)

goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2 \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
[PROOF STEP]
have f3: "inv_into (states M1) f q \<in> states M1"
[PROOF STATE]
proof (prove)
using this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)

goal (1 subgoal):
 1. inv_into (FSM.states M1) f q \<in> FSM.states M1
[PROOF STEP]
using \<open>q \<in> states M2\<close> calculation(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
q \<in> FSM.states M2
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)

goal (1 subgoal):
 1. inv_into (FSM.states M1) f q \<in> FSM.states M1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv_into (FSM.states M1) f q \<in> FSM.states M1

goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2 \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
have "inv_into (states M1) f q' \<in> states M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_into (FSM.states M1) f q' \<in> FSM.states M1
[PROOF STEP]
using f2 \<open>q' \<in> states M2\<close> calculation(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
q' \<in> FSM.states M2
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)

goal (1 subgoal):
 1. inv_into (FSM.states M1) f q' \<in> FSM.states M1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv_into (FSM.states M1) f q' \<in> FSM.states M1

goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2 \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv_into (FSM.states M1) f q' \<in> FSM.states M1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv_into (FSM.states M1) f q' \<in> FSM.states M1

goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
using f3 a1 \<open>q \<in> states M2\<close> \<open>q' \<in> states M2\<close> assms(1) assms(3) bij_betw_inv_into_right
[PROOF STATE]
proof (prove)
using this:
inv_into (FSM.states M1) f q' \<in> FSM.states M1
inv_into (FSM.states M1) f q \<in> FSM.states M1
(q, x, y, q') \<in> FSM.transitions M2
q \<in> FSM.states M2
q' \<in> FSM.states M2
bij_betw f (FSM.states M1) (FSM.states M2)
\<lbrakk>?q \<in> FSM.states M1; ?q' \<in> FSM.states M1\<rbrakk> \<Longrightarrow> ((?q, ?x, ?y, ?q') \<in> FSM.transitions M1) = ((f ?q, ?x, ?y, f ?q') \<in> FSM.transitions M2)
\<lbrakk>bij_betw ?f ?A ?A'; ?a' \<in> ?A'\<rbrakk> \<Longrightarrow> ?f (inv_into ?A ?f ?a') = ?a'

goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(q, x, y, q') \<in> FSM.transitions M2 \<Longrightarrow> (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1

goal (1 subgoal):
 1. \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2; (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1\<rbrakk> \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
show "((inv_into (states M1) f) q,x,y,(inv_into (states M1) f) q') \<in> transitions M1 \<Longrightarrow> (q,x,y,q') \<in> transitions M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1 \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1 \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
assume a1: "(inv_into (states M1) f q, x, y, inv_into (states M1) f q') \<in> FSM.transitions M1"
[PROOF STATE]
proof (state)
this:
(inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1

goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1 \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
have f2: "\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. (b::'b) \<notin> B \<or> (f b::'a) \<in> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
[PROOF STEP]
by (metis (full_types) bij_betwE)
[PROOF STATE]
proof (state)
this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)

goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1 \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
[PROOF STEP]
have f3: "inv_into (states M1) f q' \<in> states M1"
[PROOF STATE]
proof (prove)
using this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)

goal (1 subgoal):
 1. inv_into (FSM.states M1) f q' \<in> FSM.states M1
[PROOF STEP]
using \<open>q' \<in> states M2\<close> calculation(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
q' \<in> FSM.states M2
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)

goal (1 subgoal):
 1. inv_into (FSM.states M1) f q' \<in> FSM.states M1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv_into (FSM.states M1) f q' \<in> FSM.states M1

goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1 \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
have "inv_into (states M1) f q \<in> states M1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_into (FSM.states M1) f q \<in> FSM.states M1
[PROOF STEP]
using f2 \<open>q \<in> states M2\<close> calculation(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>f B A. \<not> bij_betw f B A \<or> (\<forall>b. b \<notin> B \<or> f b \<in> A)
q \<in> FSM.states M2
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)

goal (1 subgoal):
 1. inv_into (FSM.states M1) f q \<in> FSM.states M1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv_into (FSM.states M1) f q \<in> FSM.states M1

goal (1 subgoal):
 1. (inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1 \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv_into (FSM.states M1) f q \<in> FSM.states M1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv_into (FSM.states M1) f q \<in> FSM.states M1

goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
using f3 a1 \<open>q \<in> states M2\<close> \<open>q' \<in> states M2\<close> assms(1) assms(3) bij_betw_inv_into_right
[PROOF STATE]
proof (prove)
using this:
inv_into (FSM.states M1) f q \<in> FSM.states M1
inv_into (FSM.states M1) f q' \<in> FSM.states M1
(inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1
q \<in> FSM.states M2
q' \<in> FSM.states M2
bij_betw f (FSM.states M1) (FSM.states M2)
\<lbrakk>?q \<in> FSM.states M1; ?q' \<in> FSM.states M1\<rbrakk> \<Longrightarrow> ((?q, ?x, ?y, ?q') \<in> FSM.transitions M1) = ((f ?q, ?x, ?y, f ?q') \<in> FSM.transitions M2)
\<lbrakk>bij_betw ?f ?A ?A'; ?a' \<in> ?A'\<rbrakk> \<Longrightarrow> ?f (inv_into ?A ?f ?a') = ?a'

goal (1 subgoal):
 1. (q, x, y, q') \<in> FSM.transitions M2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(q, x, y, q') \<in> FSM.transitions M2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1 \<Longrightarrow> (q, x, y, q') \<in> FSM.transitions M2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?q \<in> FSM.states M2; ?q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((?q, ?x, ?y, ?q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f ?q, ?x, ?y, inv_into (FSM.states M1) f ?q') \<in> FSM.transitions M1)

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)
inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1
\<lbrakk>?q \<in> FSM.states M2; ?q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((?q, ?x, ?y, ?q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f ?q, ?x, ?y, inv_into (FSM.states M1) f ?q') \<in> FSM.transitions M1)
[PROOF STEP]
show "LS M2 (f q) \<subseteq> LS M1 q"
[PROOF STATE]
proof (prove)
using this:
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)
inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1
\<lbrakk>?q \<in> FSM.states M2; ?q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((?q, ?x, ?y, ?q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f ?q, ?x, ?y, inv_into (FSM.states M1) f ?q') \<in> FSM.transitions M1)

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
using language_equivalence_from_isomorphism_helper[of "(inv_into (states M1) f)" M2 M1, OF _ _ _ \<open>f q \<in> states M2\<close>]
[PROOF STATE]
proof (prove)
using this:
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)
inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1
\<lbrakk>?q \<in> FSM.states M2; ?q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((?q, ?x, ?y, ?q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f ?q, ?x, ?y, inv_into (FSM.states M1) f ?q') \<in> FSM.transitions M1)
\<lbrakk>bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1); inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1; \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((q, x, y, q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1)\<rbrakk> \<Longrightarrow> LS M2 (f q) \<subseteq> LS M1 (inv_into (FSM.states M1) f (f q))

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
unfolding \<open>(inv_into (FSM.states M1) f (f q)) = q\<close>
[PROOF STATE]
proof (prove)
using this:
bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1)
inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1
\<lbrakk>?q \<in> FSM.states M2; ?q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((?q, ?x, ?y, ?q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f ?q, ?x, ?y, inv_into (FSM.states M1) f ?q') \<in> FSM.transitions M1)
\<lbrakk>bij_betw (inv_into (FSM.states M1) f) (FSM.states M2) (FSM.states M1); inv_into (FSM.states M1) f (FSM.initial M2) = FSM.initial M1; \<And>q x y q'. \<lbrakk>q \<in> FSM.states M2; q' \<in> FSM.states M2\<rbrakk> \<Longrightarrow> ((q, x, y, q') \<in> FSM.transitions M2) = ((inv_into (FSM.states M1) f q, x, y, inv_into (FSM.states M1) f q') \<in> FSM.transitions M1)\<rbrakk> \<Longrightarrow> LS M2 (f q) \<subseteq> LS M1 q

goal (1 subgoal):
 1. LS M2 (f q) \<subseteq> LS M1 q
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
LS M2 (f q) \<subseteq> LS M1 q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma space_as_set_image_commute:
  assumes UV: \<open>U o\<^sub>C\<^sub>L V = id_cblinfun\<close> and VU: \<open>V o\<^sub>C\<^sub>L U = id_cblinfun\<close>
    (* I think only one of them is needed, can the lemma be strengthened? *)
  shows \<open>(*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
have \<open>space_as_set (U *\<^sub>S T) = U ` V ` space_as_set (U *\<^sub>S T)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space_as_set (U *\<^sub>S T) = (*\<^sub>V) U ` (*\<^sub>V) V ` space_as_set (U *\<^sub>S T)
[PROOF STEP]
by (simp add: image_image UV flip: cblinfun_apply_cblinfun_compose)
[PROOF STATE]
proof (state)
this:
space_as_set (U *\<^sub>S T) = (*\<^sub>V) U ` (*\<^sub>V) V ` space_as_set (U *\<^sub>S T)

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
space_as_set (U *\<^sub>S T) = (*\<^sub>V) U ` (*\<^sub>V) V ` space_as_set (U *\<^sub>S T)

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
have \<open>\<dots> \<subseteq> U ` space_as_set (V *\<^sub>S U *\<^sub>S T)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>V) U ` (*\<^sub>V) V ` space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set (V *\<^sub>S U *\<^sub>S T)
[PROOF STEP]
by (metis cblinfun_image.rep_eq closure_subset image_mono)
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) U ` (*\<^sub>V) V ` space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set (V *\<^sub>S U *\<^sub>S T)

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) U ` (*\<^sub>V) V ` space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set (V *\<^sub>S U *\<^sub>S T)

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
have \<open>\<dots> = U ` space_as_set T\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set (V *\<^sub>S U *\<^sub>S T) = (*\<^sub>V) U ` space_as_set T
[PROOF STEP]
by (simp add: VU cblinfun_assoc_left(2))
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) U ` space_as_set (V *\<^sub>S U *\<^sub>S T) = (*\<^sub>V) U ` space_as_set T

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set T
[PROOF STEP]
have 1: \<open>space_as_set (U *\<^sub>S T) \<subseteq> U ` space_as_set T\<close>
[PROOF STATE]
proof (prove)
using this:
space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set T

goal (1 subgoal):
 1. space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set T
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set T

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
have 2: \<open>U ` space_as_set T \<subseteq> space_as_set (U *\<^sub>S T)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T \<subseteq> space_as_set (U *\<^sub>S T)
[PROOF STEP]
by (simp add: cblinfun_image.rep_eq closure_subset)
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) U ` space_as_set T \<subseteq> space_as_set (U *\<^sub>S T)

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
from 1 2
[PROOF STATE]
proof (chain)
picking this:
space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set T
(*\<^sub>V) U ` space_as_set T \<subseteq> space_as_set (U *\<^sub>S T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
space_as_set (U *\<^sub>S T) \<subseteq> (*\<^sub>V) U ` space_as_set T
(*\<^sub>V) U ` space_as_set T \<subseteq> space_as_set (U *\<^sub>S T)

goal (1 subgoal):
 1. (*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) U ` space_as_set T = space_as_set (U *\<^sub>S T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DSourcesEmptySources:
  assumes "DSources i C = {}"
  shows    "Sources i C = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources i C = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sources i C = {}
[PROOF STEP]
have "(Sources i C) = (DSources i C) \<union> (\<Union> S \<in> (DSources i C). (Sources i S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)
[PROOF STEP]
by (rule SourcesDef)
[PROOF STATE]
proof (state)
this:
Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)

goal (1 subgoal):
 1. Sources i C = {}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
DSources i C = {}
Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
DSources i C = {}
Sources i C = DSources i C \<union> \<Union> (Sources i ` DSources i C)

goal (1 subgoal):
 1. Sources i C = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Sources i C = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_transition_simps[simp]:
  assumes "t_source t \<in> states M" and "t_input t \<in> inputs M" and "t_output t \<in> outputs M" and "t_target t \<in> states M"
  shows
  "initial (add_transition M t) = initial M"
  "inputs (add_transition M t) = inputs M"
  "outputs (add_transition M t) = outputs M"
  "transitions (add_transition M t) = insert t (transitions M)"
  "states (add_transition M t) = states M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (FSM.initial (FSM.add_transition M t) = FSM.initial M &&& FSM.inputs (FSM.add_transition M t) = FSM.inputs M) &&& FSM.outputs (FSM.add_transition M t) = FSM.outputs M &&& FSM.transitions (FSM.add_transition M t) = insert t (FSM.transitions M) &&& FSM.states (FSM.add_transition M t) = FSM.states M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t_source t \<in> FSM.states M
t_input t \<in> FSM.inputs M
t_output t \<in> FSM.outputs M
t_target t \<in> FSM.states M

goal (1 subgoal):
 1. (FSM.initial (FSM.add_transition M t) = FSM.initial M &&& FSM.inputs (FSM.add_transition M t) = FSM.inputs M) &&& FSM.outputs (FSM.add_transition M t) = FSM.outputs M &&& FSM.transitions (FSM.add_transition M t) = insert t (FSM.transitions M) &&& FSM.states (FSM.add_transition M t) = FSM.states M
[PROOF STEP]
by (transfer; simp)+


[STATEMENT]
lemma homeomorphic_map_closedness:
  assumes hom: "homeomorphic_map X Y f" and U: "U \<subseteq> topspace X"
  shows "closedin Y (f ` U) \<longleftrightarrow> closedin X U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin Y (f ` U) = closedin X U
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin Y (f ` U) = closedin X U
[PROOF STEP]
obtain g where "homeomorphic_maps X Y f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. homeomorphic_maps X Y f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map X Y f
U \<subseteq> topspace X

goal (1 subgoal):
 1. (\<And>g. homeomorphic_maps X Y f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: homeomorphic_map_maps)
[PROOF STATE]
proof (state)
this:
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. closedin Y (f ` U) = closedin X U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_maps X Y f g
[PROOF STEP]
have g: "homeomorphic_map Y X g" and gf: "\<And>x. x \<in> topspace X \<Longrightarrow> g(f x) = x"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y f g

goal (1 subgoal):
 1. homeomorphic_map Y X g &&& (\<And>x. x \<in> topspace X \<Longrightarrow> g (f x) = x)
[PROOF STEP]
by (auto simp: homeomorphic_maps_map)
[PROOF STATE]
proof (state)
this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. closedin Y (f ` U) = closedin X U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x
[PROOF STEP]
have "closedin X U \<Longrightarrow> closedin Y (f ` U)"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
using hom homeomorphic_imp_closed_map closed_map_def
[PROOF STATE]
proof (prove)
using this:
homeomorphic_map Y X g
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x
homeomorphic_map X Y f
homeomorphic_map ?X ?Y ?f \<Longrightarrow> closed_map ?X ?Y ?f
closed_map ?X1.0 ?X2.0 ?f \<equiv> \<forall>U. closedin ?X1.0 U \<longrightarrow> closedin ?X2.0 (?f ` U)

goal (1 subgoal):
 1. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closedin X U \<Longrightarrow> closedin Y (f ` U)

goal (1 subgoal):
 1. closedin Y (f ` U) = closedin X U
[PROOF STEP]
show "closedin Y (f ` U) = closedin X U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin Y (f ` U) = closedin X U
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. closedin Y (f ` U) \<Longrightarrow> closedin X U
 2. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
assume L: "closedin Y (f ` U)"
[PROOF STATE]
proof (state)
this:
closedin Y (f ` U)

goal (2 subgoals):
 1. closedin Y (f ` U) \<Longrightarrow> closedin X U
 2. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
have "U = g ` (f ` U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U = g ` f ` U
[PROOF STEP]
using U gf
[PROOF STATE]
proof (prove)
using this:
U \<subseteq> topspace X
?x \<in> topspace X \<Longrightarrow> g (f ?x) = ?x

goal (1 subgoal):
 1. U = g ` f ` U
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
U = g ` f ` U

goal (2 subgoals):
 1. closedin Y (f ` U) \<Longrightarrow> closedin X U
 2. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
U = g ` f ` U
[PROOF STEP]
show "closedin X U"
[PROOF STATE]
proof (prove)
using this:
U = g ` f ` U

goal (1 subgoal):
 1. closedin X U
[PROOF STEP]
by (metis L homeomorphic_imp_closed_map closed_map_def g)
[PROOF STATE]
proof (state)
this:
closedin X U

goal (1 subgoal):
 1. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
assume "closedin X U"
[PROOF STATE]
proof (state)
this:
closedin X U

goal (1 subgoal):
 1. closedin X U \<Longrightarrow> closedin Y (f ` U)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closedin X U
[PROOF STEP]
show "closedin Y (f ` U)"
[PROOF STATE]
proof (prove)
using this:
closedin X U

goal (1 subgoal):
 1. closedin Y (f ` U)
[PROOF STEP]
using hom homeomorphic_imp_closed_map closed_map_def
[PROOF STATE]
proof (prove)
using this:
closedin X U
homeomorphic_map X Y f
homeomorphic_map ?X ?Y ?f \<Longrightarrow> closed_map ?X ?Y ?f
closed_map ?X1.0 ?X2.0 ?f \<equiv> \<forall>U. closedin ?X1.0 U \<longrightarrow> closedin ?X2.0 (?f ` U)

goal (1 subgoal):
 1. closedin Y (f ` U)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
closedin Y (f ` U)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closedin Y (f ` U) = closedin X U

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lin_indpt_lin_comb_list:
  assumes "distinct ss"
  assumes "lin_indpt (set ss)"
  assumes "set ss \<subseteq> carrier_vec n"
  assumes "lincomb_list f ss = 0\<^sub>v n"
  assumes "i < length ss"
  shows "f i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
from lincomb_list_as_lincomb[OF assms(3)]
[PROOF STATE]
proof (chain)
picking this:
lincomb_list ?c ss = lincomb (mk_coeff ss ?c) (set ss)
[PROOF STEP]
have "lincomb_list f ss = lincomb (mk_coeff ss f) (set ss)"
[PROOF STATE]
proof (prove)
using this:
lincomb_list ?c ss = lincomb (mk_coeff ss ?c) (set ss)

goal (1 subgoal):
 1. lincomb_list f ss = lincomb (mk_coeff ss f) (set ss)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lincomb_list f ss = lincomb (mk_coeff ss f) (set ss)

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list f ss = lincomb (mk_coeff ss f) (set ss)

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
have "... = lincomb  (\<lambda>v. sum f (set (find_indices v ss))) (set ss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (mk_coeff ss f) (set ss) = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)
[PROOF STEP]
unfolding mk_coeff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>v. R.sumlist (map f (find_indices v ss))) (set ss) = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)
[PROOF STEP]
apply (subst R.sumlist_map_as_finsum)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>v. True
 2. \<And>v. distinct (find_indices v ss)
 3. lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss) = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)
[PROOF STEP]
by (auto simp add: distinct_find_indices)
[PROOF STATE]
proof (state)
this:
lincomb (mk_coeff ss f) (set ss) = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
lincomb_list f ss = lincomb (mk_coeff ss f) (set ss)
lincomb (mk_coeff ss f) (set ss) = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)
[PROOF STEP]
have "lincomb_list f ss = lincomb  (\<lambda>v. sum f (set (find_indices v ss))) (set ss)"
[PROOF STATE]
proof (prove)
using this:
lincomb_list f ss = lincomb (mk_coeff ss f) (set ss)
lincomb (mk_coeff ss f) (set ss) = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)

goal (1 subgoal):
 1. lincomb_list f ss = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list f ss = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lincomb_list f ss = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)
[PROOF STEP]
have *:"lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss) = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
lincomb_list f ss = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)

goal (1 subgoal):
 1. lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss) = 0\<^sub>v n
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
lincomb_list f ss = lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss)
lincomb_list f ss = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss) = 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>v. sum f (set (find_indices v ss))) (set ss) = 0\<^sub>v n

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
have "finite (set ss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set ss)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (set ss)

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
from not_lindepD[OF assms(2) this _ _ *]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set ss \<subseteq> set ss; (\<lambda>v. sum f (set (find_indices v ss))) \<in> set ss \<rightarrow> UNIV\<rbrakk> \<Longrightarrow> (\<lambda>v. sum f (set (find_indices v ss))) \<in> set ss \<rightarrow> {0::'a}
[PROOF STEP]
have "(\<lambda>v. sum f (set (find_indices v ss))) \<in> set ss \<rightarrow> {0}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set ss \<subseteq> set ss; (\<lambda>v. sum f (set (find_indices v ss))) \<in> set ss \<rightarrow> UNIV\<rbrakk> \<Longrightarrow> (\<lambda>v. sum f (set (find_indices v ss))) \<in> set ss \<rightarrow> {0::'a}

goal (1 subgoal):
 1. (\<lambda>v. sum f (set (find_indices v ss))) \<in> set ss \<rightarrow> {0::'a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>v. sum f (set (find_indices v ss))) \<in> set ss \<rightarrow> {0::'a}

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
from funcset_mem[OF this]
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set ss \<Longrightarrow> sum f (set (find_indices ?x ss)) \<in> {0::'a}
[PROOF STEP]
have "sum f (set (find_indices (nth ss i) ss)) \<in> {0}"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set ss \<Longrightarrow> sum f (set (find_indices ?x ss)) \<in> {0::'a}

goal (1 subgoal):
 1. sum f (set (find_indices (ss ! i) ss)) \<in> {0::'a}
[PROOF STEP]
using assms(5)
[PROOF STATE]
proof (prove)
using this:
?x \<in> set ss \<Longrightarrow> sum f (set (find_indices ?x ss)) \<in> {0::'a}
i < length ss

goal (1 subgoal):
 1. sum f (set (find_indices (ss ! i) ss)) \<in> {0::'a}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f (set (find_indices (ss ! i) ss)) \<in> {0::'a}

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f (set (find_indices (ss ! i) ss)) \<in> {0::'a}

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
unfolding find_indices_distinct[OF assms(1) assms(5)]
[PROOF STATE]
proof (prove)
using this:
sum f (set [i]) \<in> {0::'a}

goal (1 subgoal):
 1. f i = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f i = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed