[STATEMENT]
lemma triangular_toD [dest]:
  "triangular_to k A \<Longrightarrow> j < k \<Longrightarrow> j < i \<Longrightarrow> i < dim_row A \<Longrightarrow> A $$ (i,j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.triangular_to k A; j < k; j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
[PROOF STEP]
unfolding triangular_to_def triangular_column_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j<k. \<forall>i>j. i < dim_row A \<longrightarrow> A $$ (i, j) = (0::'a); j < k; j < i; i < dim_row A\<rbrakk> \<Longrightarrow> A $$ (i, j) = (0::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma of_rat_le_1_iff [simp]: "(of_rat r :: 'a::linordered_field) \<le> 1 \<longleftrightarrow> r \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r \<le> (1::'a)) = (r \<le> 1)
[PROOF STEP]
using of_rat_less_eq [of r 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat r \<le> of_rat 1) = (r \<le> 1)

goal (1 subgoal):
 1. (of_rat r \<le> (1::'a)) = (r \<le> 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma af_leq:
  "af UNIV ((\<le>) :: nat \<Rightarrow> nat \<Rightarrow> bool)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. af UNIV (\<le>)
[PROOF STEP]
using wf_less [folded wfP_def wfp_on_UNIV, THEN wfp_on_imp_af]
[PROOF STATE]
proof (prove)
using this:
af UNIV (\<lambda>x y. \<not> y < x)

goal (1 subgoal):
 1. af UNIV (\<le>)
[PROOF STEP]
by (simp add: not_less)


[STATEMENT]
lemma fps_zero_to_fls [simp]: "fps_to_fls 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_to_fls 0 = 0
[PROOF STEP]
by (intro fls_zero_eqI) simp


[STATEMENT]
lemma paths_up_to_length'_set :
  assumes "q \<in> states M"
  and     "path M q prev"
shows "paths_up_to_length' prev (target q prev) (h M) (inputs M) k
        = {(prev@p) | p . path M (target q prev) p \<and> length p \<le> k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
path M q prev

goal (1 subgoal):
 1. paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}
[PROOF STEP]
proof (induction k arbitrary: prev)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) 0 = {prev @ p |p. path M (target q prev) p \<and> length p \<le> 0}
 2. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
path M q prev

goal (2 subgoals):
 1. \<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) 0 = {prev @ p |p. path M (target q prev) p \<and> length p \<le> 0}
 2. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) 0 = {prev @ p |p. path M (target q prev) p \<and> length p \<le> 0}
[PROOF STEP]
unfolding paths_up_to_length'.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {prev} = {prev @ p |p. path M (target q prev) p \<and> length p \<le> 0}
[PROOF STEP]
using path_target_is_state[OF "0.prems"(1)]
[PROOF STATE]
proof (prove)
using this:
target q prev \<in> FSM.states M

goal (1 subgoal):
 1. {prev} = {prev @ p |p. path M (target q prev) p \<and> length p \<le> 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) 0 = {prev @ p |p. path M (target q prev) p \<and> length p \<le> 0}

goal (1 subgoal):
 1. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
path M q ?prev \<Longrightarrow> paths_up_to_length' ?prev (target q ?prev) (FSM.h M) (FSM.inputs M) k = {?prev @ p |p. path M (target q ?prev) p \<and> length p \<le> k}
path M q prev

goal (1 subgoal):
 1. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
have "\<And> p . p \<in> paths_up_to_length' prev (target q prev) (h M) (inputs M) (Suc k)
          \<Longrightarrow> p \<in> {(prev@p) | p . path M (target q prev) p \<and> length p \<le> Suc k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
assume "p \<in> paths_up_to_length' prev (target q prev) (h M) (inputs M) (Suc k)"
[PROOF STATE]
proof (state)
this:
p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. \<And>p. p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
show "p \<in> {(prev@p) | p . path M (target q prev) p \<and> length p \<le> Suc k}"
[PROOF STATE]
proof (prove)
using this:
p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
proof (cases "p = prev")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p = prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
 2. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = prev

goal (2 subgoals):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p = prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
 2. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
using path_target_is_state[OF Suc.prems(1)]
[PROOF STATE]
proof (prove)
using this:
target q prev \<in> FSM.states M

goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
using this:
target q prev \<in> FSM.states M

goal (1 subgoal):
 1. prev \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
by (simp add: nil)
[PROOF STATE]
proof (state)
this:
p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> prev

goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> prev
[PROOF STEP]
have "p \<in> (\<Union> (image (\<lambda>t. paths_up_to_length' (prev@[t]) (t_target t) (h M) (inputs M) k)
                                (transitions_from' (h M) (inputs M) (target q prev))))"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> prev

goal (1 subgoal):
 1. p \<in> (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)
[PROOF STEP]
using \<open>p \<in> paths_up_to_length' prev (target q prev) (h M) (inputs M) (Suc k)\<close>
[PROOF STATE]
proof (prove)
using this:
p \<noteq> prev
p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. p \<in> (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)
[PROOF STEP]
unfolding paths_up_to_length'.simps Let_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> prev
p \<in> insert prev (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)

goal (1 subgoal):
 1. p \<in> (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p \<in> (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)

goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)
[PROOF STEP]
obtain t where "t \<in> \<Union>(image (\<lambda>x . image (\<lambda>(y,q') . ((target q prev),x,y,q'))
                                                    (h M ((target q prev),x))) (inputs M))"
                    and   "p \<in> paths_up_to_length' (prev@[t]) (t_target t) (h M) (inputs M) k"
[PROOF STATE]
proof (prove)
using this:
p \<in> (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> (\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (target q prev, x, y, q')) ` FSM.h M (target q prev, x)); p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding transitions_from'.simps
[PROOF STATE]
proof (prove)
using this:
p \<in> (\<Union>t\<in>\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (target q prev, x, y, q')) ` FSM.h M (target q prev, x). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> (\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (target q prev, x, y, q')) ` FSM.h M (target q prev, x)); p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t \<in> (\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (target q prev, x, y, q')) ` FSM.h M (target q prev, x))
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
have "t \<in> transitions M" and "t_source t = (target q prev)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> FSM.transitions M &&& t_source t = target q prev
[PROOF STEP]
using \<open>t \<in> \<Union>(image (\<lambda>x . image (\<lambda>(y,q') . ((target q prev),x,y,q'))
                                        (h M ((target q prev),x))) (inputs M))\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (target q prev, x, y, q')) ` FSM.h M (target q prev, x))

goal (1 subgoal):
 1. t \<in> FSM.transitions M &&& t_source t = target q prev
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<in> FSM.transitions M
t_source t = target q prev

goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> FSM.transitions M
t_source t = target q prev
[PROOF STEP]
have "path M q (prev@[t])"
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
t_source t = target q prev

goal (1 subgoal):
 1. path M q (prev @ [t])
[PROOF STEP]
using Suc.prems(1)
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
t_source t = target q prev
path M q prev

goal (1 subgoal):
 1. path M q (prev @ [t])
[PROOF STEP]
using path_append_transition
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
t_source t = target q prev
path M q prev
\<lbrakk>path ?M ?q ?p; ?t \<in> FSM.transitions ?M; t_source ?t = target ?q ?p\<rbrakk> \<Longrightarrow> path ?M ?q (?p @ [?t])

goal (1 subgoal):
 1. path M q (prev @ [t])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
path M q (prev @ [t])

goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
have "(target q (prev @ [t])) = t_target t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. target q (prev @ [t]) = t_target t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
target q (prev @ [t]) = t_target t

goal (1 subgoal):
 1. \<lbrakk>p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k); p \<noteq> prev\<rbrakk> \<Longrightarrow> p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
using \<open>p \<in> paths_up_to_length' (prev@[t]) (t_target t) (h M) (inputs M) k\<close>
[PROOF STATE]
proof (prove)
using this:
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
using Suc.IH[OF \<open>path M q (prev@[t])\<close>]
[PROOF STATE]
proof (prove)
using this:
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
paths_up_to_length' (prev @ [t]) (target q (prev @ [t])) (FSM.h M) (FSM.inputs M) k = {(prev @ [t]) @ p |p. path M (target q (prev @ [t])) p \<and> length p \<le> k}

goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
unfolding \<open>(target q (prev @ [t])) = t_target t\<close>
[PROOF STATE]
proof (prove)
using this:
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k = {(prev @ [t]) @ p |p. path M (t_target t) p \<and> length p \<le> k}

goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
using \<open>path M q (prev @ [t])\<close>
[PROOF STATE]
proof (prove)
using this:
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k = {(prev @ [t]) @ p |p. path M (t_target t) p \<and> length p \<le> k}
path M q (prev @ [t])

goal (1 subgoal):
 1. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> ?p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal (1 subgoal):
 1. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> ?p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal (1 subgoal):
 1. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
have "\<And> p . p \<in> {(prev@p) | p . path M (target q prev) p \<and> length p \<le> Suc k}
                  \<Longrightarrow> p \<in> paths_up_to_length' prev (target q prev) (h M) (inputs M) (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
assume "p \<in> {(prev@p) | p . path M (target q prev) p \<and> length p \<le> Suc k}"
[PROOF STATE]
proof (state)
this:
p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal (1 subgoal):
 1. \<And>p. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
obtain p' where "p = prev@p'"
                   and   "path M (target q prev) p'"
                   and   "length p' \<le> Suc k"
[PROOF STATE]
proof (prove)
using this:
p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal (1 subgoal):
 1. (\<And>p'. \<lbrakk>p = prev @ p'; path M (target q prev) p'; length p' \<le> Suc k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p = prev @ p'
path M (target q prev) p'
length p' \<le> Suc k

goal (1 subgoal):
 1. \<And>p. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
have "prev@p' \<in> paths_up_to_length' prev (target q prev) (h M) (inputs M) (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
proof (cases p')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p' = [] \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
 2. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
p' = []

goal (2 subgoals):
 1. p' = [] \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
 2. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p' = []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p' = []

goal (1 subgoal):
 1. prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
case (Cons t p'')
[PROOF STATE]
proof (state)
this:
p' = t # p''

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p' = t # p''
[PROOF STEP]
have "t \<in> transitions M" and "t_source t = (target q prev)"
[PROOF STATE]
proof (prove)
using this:
p' = t # p''

goal (1 subgoal):
 1. t \<in> FSM.transitions M &&& t_source t = target q prev
[PROOF STEP]
using \<open>path M (target q prev) p'\<close>
[PROOF STATE]
proof (prove)
using this:
p' = t # p''
path M (target q prev) p'

goal (1 subgoal):
 1. t \<in> FSM.transitions M &&& t_source t = target q prev
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<in> FSM.transitions M
t_source t = target q prev

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> FSM.transitions M
t_source t = target q prev
[PROOF STEP]
have "path M q (prev@[t])"
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
t_source t = target q prev

goal (1 subgoal):
 1. path M q (prev @ [t])
[PROOF STEP]
using Suc.prems(1)
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
t_source t = target q prev
path M q prev

goal (1 subgoal):
 1. path M q (prev @ [t])
[PROOF STEP]
using path_append_transition
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
t_source t = target q prev
path M q prev
\<lbrakk>path ?M ?q ?p; ?t \<in> FSM.transitions ?M; t_source ?t = target ?q ?p\<rbrakk> \<Longrightarrow> path ?M ?q (?p @ [?t])

goal (1 subgoal):
 1. path M q (prev @ [t])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
path M q (prev @ [t])

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
have "(target q (prev @ [t])) = t_target t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. target q (prev @ [t]) = t_target t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
target q (prev @ [t]) = t_target t

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
have "length p'' \<le> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length p'' \<le> k
[PROOF STEP]
using \<open>length p' \<le> Suc k\<close> Cons
[PROOF STATE]
proof (prove)
using this:
length p' \<le> Suc k
p' = t # p''

goal (1 subgoal):
 1. length p'' \<le> k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length p'' \<le> k

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length p'' \<le> k

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
have "path M (target q (prev@[t])) p''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M (target q (prev @ [t])) p''
[PROOF STEP]
using \<open>path M (target q prev) p'\<close>
[PROOF STATE]
proof (prove)
using this:
path M (target q prev) p'

goal (1 subgoal):
 1. path M (target q (prev @ [t])) p''
[PROOF STEP]
unfolding Cons
[PROOF STATE]
proof (prove)
using this:
path M (target q prev) (t # p'')

goal (1 subgoal):
 1. path M (target q (prev @ [t])) p''
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
path M (target q (prev @ [t])) p''

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
length p'' \<le> k
path M (target q (prev @ [t])) p''
[PROOF STEP]
have "p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (h M) (FSM.inputs M) k"
[PROOF STATE]
proof (prove)
using this:
length p'' \<le> k
path M (target q (prev @ [t])) p''

goal (1 subgoal):
 1. p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
[PROOF STEP]
using Suc.IH[OF \<open>path M q (prev@[t])\<close>]
[PROOF STATE]
proof (prove)
using this:
length p'' \<le> k
path M (target q (prev @ [t])) p''
paths_up_to_length' (prev @ [t]) (target q (prev @ [t])) (FSM.h M) (FSM.inputs M) k = {(prev @ [t]) @ p |p. path M (target q (prev @ [t])) p \<and> length p \<le> k}

goal (1 subgoal):
 1. p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
[PROOF STEP]
unfolding \<open>(target q (prev @ [t])) = t_target t\<close> \<open>p = prev@p'\<close> Cons
[PROOF STATE]
proof (prove)
using this:
length p'' \<le> k
path M (t_target t) p''
paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k = {(prev @ [t]) @ p |p. path M (t_target t) p \<and> length p \<le> k}

goal (1 subgoal):
 1. prev @ t # p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
[PROOF STEP]
have "prev@t#p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (h M) (FSM.inputs M) k"
[PROOF STATE]
proof (prove)
using this:
p \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. prev @ t # p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
[PROOF STEP]
unfolding \<open>p = prev@p'\<close> Cons
[PROOF STATE]
proof (prove)
using this:
prev @ t # p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. prev @ t # p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prev @ t # p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
have "t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) `
                              {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}
[PROOF STEP]
using \<open>t \<in> transitions M\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M

goal (1 subgoal):
 1. t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}
[PROOF STEP]
by (metis (no_types, lifting) case_prodI mem_Collect_eq pair_imageI surjective_pairing)
[PROOF STATE]
proof (state)
this:
t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}
[PROOF STEP]
have "t \<in> transitions_from' (h M) (inputs M) (target q prev)"
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}

goal (1 subgoal):
 1. t \<in> transitions_from' (FSM.h M) (FSM.inputs M) (target q prev)
[PROOF STEP]
unfolding transitions_from'.simps
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}

goal (1 subgoal):
 1. t \<in> (\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (target q prev, x, y, q')) ` FSM.h M (target q prev, x))
[PROOF STEP]
using fsm_transition_input[OF \<open>t \<in> transitions M\<close>]
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}
t_input t \<in> FSM.inputs M

goal (1 subgoal):
 1. t \<in> (\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (target q prev, x, y, q')) ` FSM.h M (target q prev, x))
[PROOF STEP]
unfolding \<open>t_source t = (target q prev)\<close>[symmetric] h_simps
[PROOF STATE]
proof (prove)
using this:
t \<in> (\<lambda>(y, q'). (t_source t, t_input t, y, q')) ` {(y, q'). (t_source t, t_input t, y, q') \<in> FSM.transitions M}
t_input t \<in> FSM.inputs M

goal (1 subgoal):
 1. t \<in> (\<Union>x\<in>FSM.inputs M. (\<lambda>(y, q'). (t_source t, x, y, q')) ` {(y, q'). (t_source t, x, y, q') \<in> FSM.transitions M})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t \<in> transitions_from' (FSM.h M) (FSM.inputs M) (target q prev)

goal (1 subgoal):
 1. \<And>a list. p' = a # list \<Longrightarrow> prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> transitions_from' (FSM.h M) (FSM.inputs M) (target q prev)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t \<in> transitions_from' (FSM.h M) (FSM.inputs M) (target q prev)

goal (1 subgoal):
 1. prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
using \<open>prev @ t # p'' \<in> paths_up_to_length' (prev@[t]) (t_target t) (h M) (FSM.inputs M) k\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> transitions_from' (FSM.h M) (FSM.inputs M) (target q prev)
prev @ t # p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
unfolding \<open>p = prev@p'\<close> Cons paths_up_to_length'.simps Let_def
[PROOF STATE]
proof (prove)
using this:
t \<in> transitions_from' (FSM.h M) (FSM.inputs M) (target q prev)
prev @ t # p'' \<in> paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k

goal (1 subgoal):
 1. prev @ t # p'' \<in> insert prev (\<Union>t\<in>transitions_from' (FSM.h M) (FSM.inputs M) (target q prev). paths_up_to_length' (prev @ [t]) (t_target t) (FSM.h M) (FSM.inputs M) k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. \<And>p. p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
show "p \<in> paths_up_to_length' prev (target q prev) (h M) (inputs M) (Suc k)"
[PROOF STATE]
proof (prove)
using this:
prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
unfolding \<open>p = prev@p'\<close>
[PROOF STATE]
proof (prove)
using this:
prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. prev @ p' \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
by assumption
[PROOF STATE]
proof (state)
this:
p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> ?p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. \<And>k prev. \<lbrakk>\<And>prev. path M q prev \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) k = {prev @ p |p. path M (target q prev) p \<and> length p \<le> k}; path M q prev\<rbrakk> \<Longrightarrow> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> ?p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
?p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> ?p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) \<Longrightarrow> ?p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
?p \<in> {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k} \<Longrightarrow> ?p \<in> paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k)

goal (1 subgoal):
 1. paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
paths_up_to_length' prev (target q prev) (FSM.h M) (FSM.inputs M) (Suc k) = {prev @ p |p. path M (target q prev) p \<and> length p \<le> Suc k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lincomb_list_index:
  assumes i: "i < n"
  shows "set Xs \<subseteq> carrier_vec n \<Longrightarrow>
         lincomb_list c Xs $ i = sum (\<lambda> j. c j * (Xs ! j) $ i) {0..<length Xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c Xs $ i = (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i)
[PROOF STEP]
proof (induction Xs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
case (snoc x Xs)
[PROOF STATE]
proof (state)
this:
set Xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c Xs $ i = (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i)
set (Xs @ [x]) \<subseteq> carrier_vec n

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
hence x: "x \<in> carrier_vec n" and Xs: "set Xs \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set Xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c Xs $ i = (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i)
set (Xs @ [x]) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. x \<in> carrier_vec n &&& set Xs \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec n
set Xs \<subseteq> carrier_vec n

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
hence "lincomb_list c (Xs @ [x]) = lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n
set Xs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lincomb_list c (Xs @ [x]) = lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list c (Xs @ [x]) = lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list c (Xs @ [x]) = lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
have "\<dots> $ i = lincomb_list c Xs $ i + (c (length Xs) \<cdot>\<^sub>v x) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x) $ i = lincomb_list c Xs $ i + (c (length Xs) \<cdot>\<^sub>v x) $ i
[PROOF STEP]
using i index_add_vec(1) x
[PROOF STATE]
proof (prove)
using this:
i < n
?i < dim_vec ?v\<^sub>2 \<Longrightarrow> (?v\<^sub>1 + ?v\<^sub>2) $ ?i = ?v\<^sub>1 $ ?i + ?v\<^sub>2 $ ?i
x \<in> carrier_vec n

goal (1 subgoal):
 1. (lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x) $ i = lincomb_list c Xs $ i + (c (length Xs) \<cdot>\<^sub>v x) $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x) $ i = lincomb_list c Xs $ i + (c (length Xs) \<cdot>\<^sub>v x) $ i

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(lincomb_list c Xs + c (length Xs) \<cdot>\<^sub>v x) $ i = lincomb_list c Xs $ i + (c (length Xs) \<cdot>\<^sub>v x) $ i

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
have "(c (length Xs) \<cdot>\<^sub>v x) $ i = c (length Xs) * x $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c (length Xs) \<cdot>\<^sub>v x) $ i = c (length Xs) * x $ i
[PROOF STEP]
using i x
[PROOF STATE]
proof (prove)
using this:
i < n
x \<in> carrier_vec n

goal (1 subgoal):
 1. (c (length Xs) \<cdot>\<^sub>v x) $ i = c (length Xs) * x $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(c (length Xs) \<cdot>\<^sub>v x) $ i = c (length Xs) * x $ i

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(c (length Xs) \<cdot>\<^sub>v x) $ i = c (length Xs) * x $ i

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
have "x $ i= (Xs @ [x]) ! (length Xs) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x $ i = (Xs @ [x]) ! length Xs $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x $ i = (Xs @ [x]) ! length Xs $ i

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x $ i = (Xs @ [x]) ! length Xs $ i

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
have "lincomb_list c Xs $ i = (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list c Xs $ i = (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i)
[PROOF STEP]
by (rule snoc.IH[OF Xs])
[PROOF STATE]
proof (state)
this:
lincomb_list c Xs $ i = (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list c Xs $ i = (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
have "\<dots> =  (\<Sum>j = 0..<length Xs. c j * (Xs @ [x]) ! j $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<length Xs. c j * Xs ! j $ i) = (\<Sum>j = 0..<length Xs. c j * (Xs @ [x]) ! j $ i)
[PROOF STEP]
by (rule R.finsum_restrict, force, rule restrict_ext, auto simp: append_Cons_nth_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<length Xs. c j * Xs ! j $ i) = (\<Sum>j = 0..<length Xs. c j * (Xs @ [x]) ! j $ i)

goal (2 subgoals):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c xs $ i = (\<Sum>j = 0..<length xs. c j * xs ! j $ i); set (xs @ [x]) \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list c (xs @ [x]) $ i = (\<Sum>j = 0..<length (xs @ [x]). c j * (xs @ [x]) ! j $ i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb_list c (Xs @ [x]) $ i = (\<Sum>j = 0..<length Xs. c j * (Xs @ [x]) ! j $ i) + c (length Xs) * (Xs @ [x]) ! length Xs $ i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
lincomb_list c (Xs @ [x]) $ i = (\<Sum>j = 0..<length Xs. c j * (Xs @ [x]) ! j $ i) + c (length Xs) * (Xs @ [x]) ! length Xs $ i

goal (1 subgoal):
 1. lincomb_list c (Xs @ [x]) $ i = (\<Sum>j = 0..<length (Xs @ [x]). c j * (Xs @ [x]) ! j $ i)
[PROOF STEP]
using sum.atLeast0_lessThan_Suc[of "\<lambda> j. c j * (Xs @ [x]) ! j $ i" "length Xs"]
[PROOF STATE]
proof (prove)
using this:
lincomb_list c (Xs @ [x]) $ i = (\<Sum>j = 0..<length Xs. c j * (Xs @ [x]) ! j $ i) + c (length Xs) * (Xs @ [x]) ! length Xs $ i
(\<Sum>j = 0..<Suc (length Xs). c j * (Xs @ [x]) ! j $ i) = (\<Sum>j = 0..<length Xs. c j * (Xs @ [x]) ! j $ i) + c (length Xs) * (Xs @ [x]) ! length Xs $ i

goal (1 subgoal):
 1. lincomb_list c (Xs @ [x]) $ i = (\<Sum>j = 0..<length (Xs @ [x]). c j * (Xs @ [x]) ! j $ i)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
lincomb_list c (Xs @ [x]) $ i = (\<Sum>j = 0..<length (Xs @ [x]). c j * (Xs @ [x]) ! j $ i)

goal (1 subgoal):
 1. set [] \<subseteq> carrier_vec n \<Longrightarrow> lincomb_list c [] $ i = (\<Sum>j = 0..<length []. c j * [] ! j $ i)
[PROOF STEP]
qed (simp add: i)


[STATEMENT]
lemma real_LIM_sandwich_zero:
  fixes f g :: "'a::topological_space \<Rightarrow> real"
  assumes f: "f \<midarrow>a\<rightarrow> 0"
    and 1: "\<And>x. x \<noteq> a \<Longrightarrow> 0 \<le> g x"
    and 2: "\<And>x. x \<noteq> a \<Longrightarrow> g x \<le> f x"
  shows "g \<midarrow>a\<rightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<midarrow>a\<rightarrow> 0
[PROOF STEP]
proof (rule LIM_imp_LIM [OF f])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
assume x: "x \<noteq> a"
[PROOF STATE]
proof (state)
this:
x \<noteq> a

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
?x \<noteq> a \<Longrightarrow> 0 \<le> g ?x
x \<noteq> a
[PROOF STEP]
have "norm (g x - 0) = g x"
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> a \<Longrightarrow> 0 \<le> g ?x
x \<noteq> a

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

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (g x - 0) = g x

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
have "g x \<le> f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g x \<le> f x
[PROOF STEP]
by (rule 2 [OF x])
[PROOF STATE]
proof (state)
this:
g x \<le> f x

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g x \<le> f x

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
have "f x \<le> \<bar>f x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<le> \<bar>f x\<bar>
[PROOF STEP]
by (rule abs_ge_self)
[PROOF STATE]
proof (state)
this:
f x \<le> \<bar>f x\<bar>

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f x \<le> \<bar>f x\<bar>

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
have "\<bar>f x\<bar> = norm (f x - 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>f x\<bar> = norm (f x - 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>f x\<bar> = norm (f x - 0)

goal (1 subgoal):
 1. \<And>x. x \<noteq> a \<Longrightarrow> norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (g x - 0) \<le> norm (f x - 0)
[PROOF STEP]
show "norm (g x - 0) \<le> norm (f x - 0)"
[PROOF STATE]
proof (prove)
using this:
norm (g x - 0) \<le> norm (f x - 0)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma circle_top_bot_edges_neq' [simp]:
  shows "circle_top_edge \<noteq> circle_bot_edge"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circle_top_edge \<noteq> circle_bot_edge
[PROOF STEP]
by (simp add: circle_top_edge_def circle_bot_edge_def)


[STATEMENT]
lemma smallo':
  fixes c :: real assumes "c > exp 1"
  shows "g \<in> o(\<lambda>x. c powr x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
have "c > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c
[PROOF STEP]
by (rule le_less_trans[OF _ assms]) auto
[PROOF STATE]
proof (state)
this:
0 < c

goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
from \<open>c > 0\<close> assms
[PROOF STATE]
proof (chain)
picking this:
0 < c
exp 1 < c
[PROOF STEP]
have "exp 1 < exp (ln c)"
[PROOF STATE]
proof (prove)
using this:
0 < c
exp 1 < c

goal (1 subgoal):
 1. exp 1 < exp (ln c)
[PROOF STEP]
by (subst exp_ln) auto
[PROOF STATE]
proof (state)
this:
exp 1 < exp (ln c)

goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
hence "ln c > 1"
[PROOF STATE]
proof (prove)
using this:
exp 1 < exp (ln c)

goal (1 subgoal):
 1. 1 < ln c
[PROOF STEP]
by (subst (asm) exp_less_cancel_iff)
[PROOF STATE]
proof (state)
this:
1 < ln c

goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
hence "g \<in> o(\<lambda>x. exp ((1 + (ln c - 1)) * x))"
[PROOF STATE]
proof (prove)
using this:
1 < ln c

goal (1 subgoal):
 1. g \<in> o(\<lambda>x. exp ((1 + (ln c - 1)) * x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < ln c
exp 1 < c

goal (1 subgoal):
 1. g \<in> o(\<lambda>x. exp ((1 + (ln c - 1)) * x))
[PROOF STEP]
by (intro smallo) auto
[PROOF STATE]
proof (state)
this:
g \<in> o(\<lambda>x. exp ((1 + (ln c - 1)) * x))

goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g \<in> o(\<lambda>x. exp ((1 + (ln c - 1)) * x))

goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
have "(\<lambda>x. exp ((1 + (ln c - 1)) * x)) = (\<lambda>x. c powr x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp ((1 + (ln c - 1)) * x)) = (powr) c
[PROOF STEP]
using \<open>c > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. (\<lambda>x. exp ((1 + (ln c - 1)) * x)) = (powr) c
[PROOF STEP]
by (simp add: powr_def mult_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. exp ((1 + (ln c - 1)) * x)) = (powr) c

goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
g \<in> o((powr) c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g \<in> o((powr) c)

goal (1 subgoal):
 1. g \<in> o((powr) c)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g \<in> o((powr) c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_point_bound_ell2: "norm (Rep_ell2 x i) \<le> norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (Rep_ell2 x i) \<le> norm x
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x i. has_ell2_norm x \<Longrightarrow> cmod (x i) \<le> ell2_norm x
[PROOF STEP]
by (simp add: ell2_norm_point_bound)


[STATEMENT]
lemma sorted_wrt_list_of_set_eqI:
  assumes "linorder_on B R" "A \<subseteq> B" "set xs = A" "distinct xs" "sorted_wrt R xs"
  shows   "sorted_wrt_list_of_set R A = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt_list_of_set R A = xs
[PROOF STEP]
proof (rule sorted_wrt_linorder_unique)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. linorder_on ?A ?R
 2. mset (sorted_wrt_list_of_set R A) = mset xs
 3. Linorder_Relations.sorted_wrt ?R (sorted_wrt_list_of_set R A)
 4. Linorder_Relations.sorted_wrt ?R xs
[PROOF STEP]
show "linorder_on B R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linorder_on B R
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
linorder_on B R

goal (3 subgoals):
 1. mset (sorted_wrt_list_of_set R A) = mset xs
 2. Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
 3. Linorder_Relations.sorted_wrt R xs
[PROOF STEP]
let ?ys = "sorted_wrt_list_of_set R A"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mset (sorted_wrt_list_of_set R A) = mset xs
 2. Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
 3. Linorder_Relations.sorted_wrt R xs
[PROOF STEP]
have fin [simp]: "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
by (simp_all add: assms(3) [symmetric])
[PROOF STATE]
proof (state)
this:
finite A

goal (3 subgoals):
 1. mset (sorted_wrt_list_of_set R A) = mset xs
 2. Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
 3. Linorder_Relations.sorted_wrt R xs
[PROOF STEP]
have *: "distinct ?ys" "set ?ys = A" "sorted_wrt R ?ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (sorted_wrt_list_of_set R A) &&& set (sorted_wrt_list_of_set R A) = A &&& Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
[PROOF STEP]
by (rule linorder_sorted_wrt_list_of_set[OF assms(1)] fin assms)+
[PROOF STATE]
proof (state)
this:
distinct (sorted_wrt_list_of_set R A)
set (sorted_wrt_list_of_set R A) = A
Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)

goal (3 subgoals):
 1. mset (sorted_wrt_list_of_set R A) = mset xs
 2. Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
 3. Linorder_Relations.sorted_wrt R xs
[PROOF STEP]
from assms *
[PROOF STATE]
proof (chain)
picking this:
linorder_on B R
A \<subseteq> B
set xs = A
distinct xs
Linorder_Relations.sorted_wrt R xs
distinct (sorted_wrt_list_of_set R A)
set (sorted_wrt_list_of_set R A) = A
Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
[PROOF STEP]
show "mset ?ys = mset xs"
[PROOF STATE]
proof (prove)
using this:
linorder_on B R
A \<subseteq> B
set xs = A
distinct xs
Linorder_Relations.sorted_wrt R xs
distinct (sorted_wrt_list_of_set R A)
set (sorted_wrt_list_of_set R A) = A
Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)

goal (1 subgoal):
 1. mset (sorted_wrt_list_of_set R A) = mset xs
[PROOF STEP]
by (subst set_eq_iff_mset_eq_distinct [symmetric]) simp_all
[PROOF STATE]
proof (state)
this:
mset (sorted_wrt_list_of_set R A) = mset xs

goal (2 subgoals):
 1. Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
 2. Linorder_Relations.sorted_wrt R xs
[PROOF STEP]
show "sorted_wrt R ?ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
Linorder_Relations.sorted_wrt R (sorted_wrt_list_of_set R A)

goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R xs
[PROOF STEP]
qed fact+


[STATEMENT]
lemma continuous_on_compose_Pair:
  assumes f: "continuous_on (Sigma A B) (\<lambda>(a, b). f a b)"
  assumes g: "continuous_on C g"
  assumes h: "continuous_on C h"
  assumes subset: "\<And>c. c \<in> C \<Longrightarrow> g c \<in> A" "\<And>c. c \<in> C \<Longrightarrow> h c \<in> B (g c)"
  shows "continuous_on C (\<lambda>c. f (g c) (h c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
using continuous_on_compose2[OF f continuous_on_Pair[OF g h]] subset
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g x, h x)) ` C \<subseteq> Sigma A B \<Longrightarrow> continuous_on C (\<lambda>x. case (g x, h x) of (a, b) \<Rightarrow> f a b)
?c \<in> C \<Longrightarrow> g ?c \<in> A
?c \<in> C \<Longrightarrow> h ?c \<in> B (g ?c)

goal (1 subgoal):
 1. continuous_on C (\<lambda>c. f (g c) (h c))
[PROOF STEP]
by auto


[STATEMENT]
lemma least_Suc_diff[simp]: "Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
proof (cases "A = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
 2. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A = {}

goal (2 subgoals):
 1. A = {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
 2. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc ` {} - {least (Suc ` {})} = Suc ` ({} - {least {}})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
have "Suc ` A - {least (Suc ` A)} = Suc ` A - {Suc (least A)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc ` A - {least (Suc ` A)} = Suc ` A - {Suc (least A)}
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}

goal (1 subgoal):
 1. Suc ` A - {least (Suc ` A)} = Suc ` A - {Suc (least A)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc ` A - {least (Suc ` A)} = Suc ` A - {Suc (least A)}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc ` A - {least (Suc ` A)} = Suc ` A - {Suc (least A)}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
have "\<dots> = Suc ` A - Suc ` {least A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc ` A - {Suc (least A)} = Suc ` A - Suc ` {least A}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc ` A - {Suc (least A)} = Suc ` A - Suc ` {least A}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc ` A - {Suc (least A)} = Suc ` A - Suc ` {least A}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
have "\<dots> = Suc ` (A - {least A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc ` A - Suc ` {least A} = Suc ` (A - {least A})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Suc ` A - Suc ` {least A} = Suc ` (A - {least A})

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})

goal (1 subgoal):
 1. Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
Suc ` A - {least (Suc ` A)} = Suc ` (A - {least A})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_compose_divide:
  assumes [simp]: "g dvd f" "h $ 0 = 0"
  shows   "fps_compose f h = fps_compose (f / g :: 'a :: field fps) h * fps_compose g h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
have "f = (f / g) * g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = f / g * g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f = f / g * g

goal (1 subgoal):
 1. f oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f = f / g * g

goal (1 subgoal):
 1. f oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
have "fps_compose \<dots> h = fps_compose (f / g) h * fps_compose g h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f / g * g oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
by (subst fps_compose_mult_distrib) simp_all
[PROOF STATE]
proof (state)
this:
f / g * g oo h = (f / g oo h) * (g oo h)

goal (1 subgoal):
 1. f oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f oo h = (f / g oo h) * (g oo h)

goal (1 subgoal):
 1. f oo h = (f / g oo h) * (g oo h)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f oo h = (f / g oo h) * (g oo h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma padr_image:
  assumes "U \<subseteq> carrier_vec n" shows "padr m ` U \<subseteq> carrier_vec (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U \<subseteq> carrier_vec (n + m)
[PROOF STEP]
proof(rule subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
assume "v : padr m ` U"
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U
[PROOF STEP]
obtain u where "u : U" and vmu: "v = padr m u"
[PROOF STATE]
proof (prove)
using this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>u \<in> U; v = u @\<^sub>v 0\<^sub>v m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<in> U
v = u @\<^sub>v 0\<^sub>v m

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
hence "u : carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
u \<in> U
v = u @\<^sub>v 0\<^sub>v m

goal (1 subgoal):
 1. u \<in> carrier_vec n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> U
v = u @\<^sub>v 0\<^sub>v m
U \<subseteq> carrier_vec n

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

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` U \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
thus "v : carrier_vec (n + m)"
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier_vec n

goal (1 subgoal):
 1. v \<in> carrier_vec (n + m)
[PROOF STEP]
unfolding vmu
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier_vec n

goal (1 subgoal):
 1. u @\<^sub>v 0\<^sub>v m \<in> carrier_vec (n + m)
[PROOF STEP]
using zero_carrier_vec[of m] append_carrier_vec
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier_vec n
0\<^sub>v m \<in> carrier_vec m
\<lbrakk>?v \<in> carrier_vec ?n1.0; ?w \<in> carrier_vec ?n2.0\<rbrakk> \<Longrightarrow> ?v @\<^sub>v ?w \<in> carrier_vec (?n1.0 + ?n2.0)

goal (1 subgoal):
 1. u @\<^sub>v 0\<^sub>v m \<in> carrier_vec (n + m)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec (n + m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RD_bounds_sublistD_i:
  fixes Pi :: "'a problem" and x
  assumes "finite Pi" "(\<forall>y. y \<in> MPLS Pi \<longrightarrow> y \<le> x)" "x \<in> MPLS Pi"
  shows "x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
let ?P="MPLS Pi"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
let ?Q="{length p - 1 |p. valid_path Pi p \<and> distinct p}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
x \<in> MPLS Pi
[PROOF STEP]
obtain s as where 1:
      "s \<in> valid_states Pi" "as \<in> valid_plans Pi" "x = Inf (PLS s as)"
[PROOF STATE]
proof (prove)
using this:
x \<in> MPLS Pi

goal (1 subgoal):
 1. (\<And>s as. \<lbrakk>s \<in> valid_states Pi; as \<in> valid_plans Pi; x = Inf (PLS s as)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding MPLS_def
[PROOF STATE]
proof (prove)
using this:
x \<in> (\<lambda>(s, as). Inf (PLS s as)) ` {(s, as). s \<in> valid_states Pi \<and> as \<in> valid_plans Pi}

goal (1 subgoal):
 1. (\<And>s as. \<lbrakk>s \<in> valid_states Pi; as \<in> valid_plans Pi; x = Inf (PLS s as)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
s \<in> valid_states Pi
as \<in> valid_plans Pi
x = Inf (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
have "x \<le> Max ?Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
text \<open> Show that `x` is not only the infimum but also the minimum of `PLS s as`.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
have "finite (PLS s as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (PLS s as)
[PROOF STEP]
using finite_PLS
[PROOF STATE]
proof (prove)
using this:
finite (PLS ?s ?as)

goal (1 subgoal):
 1. finite (PLS s as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
have "PLS s as \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PLS s as \<noteq> {}
[PROOF STEP]
using PLS_NEMPTY
[PROOF STATE]
proof (prove)
using this:
PLS ?s ?as \<noteq> {}

goal (1 subgoal):
 1. PLS s as \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
PLS s as \<noteq> {}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (PLS s as)
PLS s as \<noteq> {}
[PROOF STEP]
have a: "Inf (PLS s as) = Min (PLS s as)"
[PROOF STATE]
proof (prove)
using this:
finite (PLS s as)
PLS s as \<noteq> {}

goal (1 subgoal):
 1. Inf (PLS s as) = Min (PLS s as)
[PROOF STEP]
using cInf_eq_Min[of "PLS s as"]
[PROOF STATE]
proof (prove)
using this:
finite (PLS s as)
PLS s as \<noteq> {}
\<lbrakk>finite (PLS s as); PLS s as \<noteq> {}\<rbrakk> \<Longrightarrow> Inf (PLS s as) = Min (PLS s as)

goal (1 subgoal):
 1. Inf (PLS s as) = Min (PLS s as)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Inf (PLS s as) = Min (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
from 1(3) a
[PROOF STATE]
proof (chain)
picking this:
x = Inf (PLS s as)
Inf (PLS s as) = Min (PLS s as)
[PROOF STEP]
have "x = Min (PLS s as)"
[PROOF STATE]
proof (prove)
using this:
x = Inf (PLS s as)
Inf (PLS s as) = Min (PLS s as)

goal (1 subgoal):
 1. x = Min (PLS s as)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = Min (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
x = Min (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
note a = this
[PROOF STATE]
proof (state)
this:
x = Min (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
x = Min (PLS s as)

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
let ?limit="Min (PLS s as)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
finite Pi
[PROOF STEP]
have a: "finite ?Q"
[PROOF STATE]
proof (prove)
using this:
finite Pi

goal (1 subgoal):
 1. finite {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
using RD_bounds_sublistD_i_a
[PROOF STATE]
proof (prove)
using this:
finite Pi
finite ?Pi \<Longrightarrow> finite {length p - 1 |p. valid_path ?Pi p \<and> distinct p}

goal (1 subgoal):
 1. finite {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
have b: "?Q \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {length p - 1 |p. valid_path Pi p \<and> distinct p} \<noteq> {}
[PROOF STEP]
using RD_bounds_sublistD_i_b
[PROOF STATE]
proof (prove)
using this:
{length p - 1 |p. valid_path ?Pi p \<and> distinct p} \<noteq> {}

goal (1 subgoal):
 1. {length p - 1 |p. valid_path Pi p \<and> distinct p} \<noteq> {}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
{length p - 1 |p. valid_path Pi p \<and> distinct p} \<noteq> {}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
from 1(1, 2)
[PROOF STATE]
proof (chain)
picking this:
s \<in> valid_states Pi
as \<in> valid_plans Pi
[PROOF STEP]
have c: "\<forall>x. (\<forall>y. y \<in> ?Q \<longrightarrow> y \<le> x) \<and> x \<in> ?Q \<longrightarrow> ?limit \<le> Max ?Q"
[PROOF STATE]
proof (prove)
using this:
s \<in> valid_states Pi
as \<in> valid_plans Pi

goal (1 subgoal):
 1. \<forall>x. (\<forall>y. y \<in> {length p - 1 |p. valid_path Pi p \<and> distinct p} \<longrightarrow> y \<le> x) \<and> x \<in> {length p - 1 |p. valid_path Pi p \<and> distinct p} \<longrightarrow> Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
using RD_bounds_sublistD_i_c
[PROOF STATE]
proof (prove)
using this:
s \<in> valid_states Pi
as \<in> valid_plans Pi
\<lbrakk>?s \<in> valid_states ?Pi; ?as \<in> valid_plans ?Pi; \<forall>y. y \<in> {length p - 1 |p. valid_path ?Pi p \<and> distinct p} \<longrightarrow> y \<le> ?x; ?x \<in> {length p - 1 |p. valid_path ?Pi p \<and> distinct p}\<rbrakk> \<Longrightarrow> Min (PLS ?s ?as) \<le> Max {length p - 1 |p. valid_path ?Pi p \<and> distinct p}

goal (1 subgoal):
 1. \<forall>x. (\<forall>y. y \<in> {length p - 1 |p. valid_path Pi p \<and> distinct p} \<longrightarrow> y \<le> x) \<and> x \<in> {length p - 1 |p. valid_path Pi p \<and> distinct p} \<longrightarrow> Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x. (\<forall>y. y \<in> {length p - 1 |p. valid_path Pi p \<and> distinct p} \<longrightarrow> y \<le> x) \<and> x \<in> {length p - 1 |p. valid_path Pi p \<and> distinct p} \<longrightarrow> Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
have "?limit \<le> Max ?Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
using MAX_SET_ELIM'[where P="?Q" and R="\<lambda>x. ?limit \<le> Max ?Q", OF a b c]
[PROOF STATE]
proof (prove)
using this:
Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
note b = this
[PROOF STATE]
proof (state)
this:
Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
from a b
[PROOF STATE]
proof (chain)
picking this:
x = Min (PLS s as)
Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
show "x \<le> Max ?Q"
[PROOF STATE]
proof (prove)
using this:
x = Min (PLS s as)
Min (PLS s as) \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
finite Pi
\<forall>y. y \<in> MPLS Pi \<longrightarrow> y \<le> x
x \<in> MPLS Pi

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
unfolding MPLS_def
[PROOF STATE]
proof (prove)
using this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
finite Pi
\<forall>y. y \<in> (\<lambda>(s, as). Inf (PLS s as)) ` {(s, as). s \<in> valid_states Pi \<and> as \<in> valid_plans Pi} \<longrightarrow> y \<le> x
x \<in> (\<lambda>(s, as). Inf (PLS s as)) ` {(s, as). s \<in> valid_states Pi \<and> as \<in> valid_plans Pi}

goal (1 subgoal):
 1. x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<le> Max {length p - 1 |p. valid_path Pi p \<and> distinct p}

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE type of `Pi` had to be fixed for use of `FINITE\_valid\_states`.\<close>


[STATEMENT]
lemma rel_msetI:
  assumes "list_all2 R xs ys" "mset xs = A" "mset ys = B"
  shows   "rel_mset R A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_mset R A B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
list_all2 R xs ys
mset xs = A
mset ys = B

goal (1 subgoal):
 1. rel_mset R A B
[PROOF STEP]
by (auto simp: rel_mset_def)


[STATEMENT]
lemma v_gs_mono: "X \<subseteq> Y \<Longrightarrow> v_gs X \<subseteq> v_gs Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<subseteq> Y \<Longrightarrow> v_gs X \<subseteq> v_gs Y
[PROOF STEP]
using v_gs_def
[PROOF STATE]
proof (prove)
using this:
v_gs ?X = v ` ?X

goal (1 subgoal):
 1. X \<subseteq> Y \<Longrightarrow> v_gs X \<subseteq> v_gs Y
[PROOF STEP]
by auto


[STATEMENT]
lemma singleton_poly_tuple:
"is_poly_tuple n [f] \<longleftrightarrow> f \<in> carrier (Q\<^sub>p[\<X>\<^bsub>n\<^esub>])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poly_tuple n [f] = (f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>]))
[PROOF STEP]
unfolding is_poly_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set [f] \<subseteq> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>])) = (f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>]))
[PROOF STEP]
by (metis (no_types, lifting) list.distinct(1) list.set_cases list.set_intros(1) set_ConsD subset_code(1))


[STATEMENT]
lemma fps_nth_deriv_const[simp]:
  "fps_nth_deriv n (fps_const c) = (if n = 0 then fps_const c else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_nth_deriv n (fps_const c) = (if n = 0 then fps_const c else 0)
[PROOF STEP]
by (cases n) simp_all


[STATEMENT]
lemma continuity_lem_lt0_expanded_var:
  fixes r:: "real"
  fixes a b c:: "real"
  shows "a*r^2 + b*r + c < 0 \<Longrightarrow>
    \<exists>y'> r. \<forall>x\<in>{r<..y'}. a*x^2 + b*x + c \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * r\<^sup>2 + b * r + c < 0 \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c \<le> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * r\<^sup>2 + b * r + c < 0 \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c \<le> 0
[PROOF STEP]
assume "a*r^2 + b*r + c < 0 "
[PROOF STATE]
proof (state)
this:
a * r\<^sup>2 + b * r + c < 0

goal (1 subgoal):
 1. a * r\<^sup>2 + b * r + c < 0 \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c \<le> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * r\<^sup>2 + b * r + c < 0
[PROOF STEP]
have " \<exists>y'> r. \<forall>x\<in>{r<..y'}. a*x^2 + b*x + c < 0"
[PROOF STATE]
proof (prove)
using this:
a * r\<^sup>2 + b * r + c < 0

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0
[PROOF STEP]
using continuity_lem_lt0_expanded
[PROOF STATE]
proof (prove)
using this:
a * r\<^sup>2 + b * r + c < 0
?a * ?r\<^sup>2 + ?b * ?r + ?c < 0 \<Longrightarrow> \<exists>y'>?r. \<forall>x\<in>{?r<..y'}. ?a * x\<^sup>2 + ?b * x + ?c < 0

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0

goal (1 subgoal):
 1. a * r\<^sup>2 + b * r + c < 0 \<Longrightarrow> \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c \<le> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0
[PROOF STEP]
show " \<exists>y'> r. \<forall>x\<in>{r<..y'}. a*x^2 + b*x + c \<le> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c \<le> 0
[PROOF STEP]
using less_eq_real_def
[PROOF STATE]
proof (prove)
using this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c < 0
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)

goal (1 subgoal):
 1. \<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c \<le> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y'>r. \<forall>x\<in>{r<..y'}. a * x\<^sup>2 + b * x + c \<le> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monomial_functions:
  assumes "c \<in> carrier R"
  shows "monomial c n \<in> carrier (Fun R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomial c n \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
apply(rule function_ring_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. a \<in> carrier R \<Longrightarrow> monomial c n a \<in> carrier R
 2. \<And>a. a \<notin> carrier R \<Longrightarrow> monomial c n a = undefined
[PROOF STEP]
unfolding monomial_function_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. a \<in> carrier R \<Longrightarrow> (\<lambda>x\<in>carrier R. c \<otimes> x [^] n) a \<in> carrier R
 2. \<And>a. a \<notin> carrier R \<Longrightarrow> (\<lambda>x\<in>carrier R. c \<otimes> x [^] n) a = undefined
[PROOF STEP]
apply (simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. a \<notin> carrier R \<Longrightarrow> (\<lambda>x\<in>carrier R. c \<otimes> x [^] n) a = undefined
[PROOF STEP]
by simp


[STATEMENT]
lemma approx_from_above_dense_linorder:
  fixes x::"'a::{dense_linorder, linorder_topology, first_countable_topology}"
  assumes "x < y"
  shows "\<exists>u. (\<forall>n. u n > x) \<and> (u \<longlonglongrightarrow> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
obtain A :: "nat \<Rightarrow> 'a set" where A: "\<And>i. open (A i)" "\<And>i. x \<in> A i"
                                      "\<And>F. (\<forall>n. F n \<in> A n) \<Longrightarrow> F \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>\<And>i. open (A i); \<And>i. x \<in> A i; \<And>F. \<forall>n. F n \<in> A n \<Longrightarrow> F \<longlonglongrightarrow> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis first_countable_topology_class.countable_basis)
[PROOF STATE]
proof (state)
this:
open (A ?i)
x \<in> A ?i
\<forall>n. ?F n \<in> A n \<Longrightarrow> ?F \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
define u where "u = (\<lambda>n. SOME z. z \<in> A n \<and> z > x)"
[PROOF STATE]
proof (state)
this:
u = (\<lambda>n. SOME z. z \<in> A n \<and> x < z)

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
have "\<exists>z. z \<in> U \<and> x < z" if "x \<in> U" "open U" for U
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> x < z
[PROOF STEP]
using open_right[OF \<open>open U\<close> \<open>x \<in> U\<close> \<open>x < y\<close>]
[PROOF STATE]
proof (prove)
using this:
\<exists>b>x. {x..<b} \<subseteq> U

goal (1 subgoal):
 1. \<exists>z. z \<in> U \<and> x < z
[PROOF STEP]
by (meson atLeastLessThan_iff dense less_imp_le subset_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z
[PROOF STEP]
have *: "u n \<in> A n \<and> x < u n" for n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z

goal (1 subgoal):
 1. u n \<in> A n \<and> x < u n
[PROOF STEP]
using \<open>x \<in> A n\<close> \<open>open (A n)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z
x \<in> A n
open (A n)

goal (1 subgoal):
 1. u n \<in> A n \<and> x < u n
[PROOF STEP]
unfolding u_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> ?U; open ?U\<rbrakk> \<Longrightarrow> \<exists>z. z \<in> ?U \<and> x < z
x \<in> A n
open (A n)

goal (1 subgoal):
 1. (SOME z. z \<in> A n \<and> x < z) \<in> A n \<and> x < (SOME z. z \<in> A n \<and> x < z)
[PROOF STEP]
by (metis (no_types, lifting) someI_ex)
[PROOF STATE]
proof (state)
this:
u ?n \<in> A ?n \<and> x < u ?n

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u ?n \<in> A ?n \<and> x < u ?n
[PROOF STEP]
have "u \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> A ?n \<and> x < u ?n

goal (1 subgoal):
 1. u \<longlonglongrightarrow> x
[PROOF STEP]
using A(3)
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> A ?n \<and> x < u ?n
\<forall>n. ?F n \<in> A n \<Longrightarrow> ?F \<longlonglongrightarrow> x

goal (1 subgoal):
 1. u \<longlonglongrightarrow> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<longlonglongrightarrow> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> x
u ?n \<in> A ?n \<and> x < u ?n

goal (1 subgoal):
 1. \<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>u. (\<forall>n. x < u n) \<and> u \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_smult_le: "degree (smult a p) \<le> degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (smult a p) \<le> degree p
[PROOF STEP]
by (rule degree_le) (simp add: coeff_eq_0)


[STATEMENT]
lemma eqvtSubstClosed:
  fixes Rel :: "(pi \<times> pi) set"

  assumes eqvtRel: "eqvt Rel"

  shows "eqvt (substClosed Rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqvt (substClosed Rel)
[PROOF STEP]
proof(simp add: eqvt_def substClosed_def, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b perma \<sigma>. \<forall>\<sigma>. (a[<\<sigma>>], b[<\<sigma>>]) \<in> Rel \<Longrightarrow> ((perma \<bullet> a)[<\<sigma>>], (perma \<bullet> b)[<\<sigma>>]) \<in> Rel
[PROOF STEP]
fix P Q perm s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b perma \<sigma>. \<forall>\<sigma>. (a[<\<sigma>>], b[<\<sigma>>]) \<in> Rel \<Longrightarrow> ((perma \<bullet> a)[<\<sigma>>], (perma \<bullet> b)[<\<sigma>>]) \<in> Rel
[PROOF STEP]
assume "\<forall>s. (P[<s>], Q[<s>]) \<in> Rel"
[PROOF STATE]
proof (state)
this:
\<forall>s. (P[<s>], Q[<s>]) \<in> Rel

goal (1 subgoal):
 1. \<And>a b perma \<sigma>. \<forall>\<sigma>. (a[<\<sigma>>], b[<\<sigma>>]) \<in> Rel \<Longrightarrow> ((perma \<bullet> a)[<\<sigma>>], (perma \<bullet> b)[<\<sigma>>]) \<in> Rel
[PROOF STEP]
hence "(P[<(rev (perm::name prm) \<bullet> s)>], Q[<(rev perm \<bullet> s)>]) \<in> Rel"
[PROOF STATE]
proof (prove)
using this:
\<forall>s. (P[<s>], Q[<s>]) \<in> Rel

goal (1 subgoal):
 1. (P[<(rev perm \<bullet> s)>], Q[<(rev perm \<bullet> s)>]) \<in> Rel
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(P[<(rev perm \<bullet> s)>], Q[<(rev perm \<bullet> s)>]) \<in> Rel

goal (1 subgoal):
 1. \<And>a b perma \<sigma>. \<forall>\<sigma>. (a[<\<sigma>>], b[<\<sigma>>]) \<in> Rel \<Longrightarrow> ((perma \<bullet> a)[<\<sigma>>], (perma \<bullet> b)[<\<sigma>>]) \<in> Rel
[PROOF STEP]
with eqvtRel
[PROOF STATE]
proof (chain)
picking this:
eqvt Rel
(P[<(rev perm \<bullet> s)>], Q[<(rev perm \<bullet> s)>]) \<in> Rel
[PROOF STEP]
have "(perm \<bullet> (P[<(rev perm \<bullet> s)>]), perm \<bullet> (Q[<(rev perm \<bullet> s)>])) \<in> Rel"
[PROOF STATE]
proof (prove)
using this:
eqvt Rel
(P[<(rev perm \<bullet> s)>], Q[<(rev perm \<bullet> s)>]) \<in> Rel

goal (1 subgoal):
 1. (perm \<bullet> P[<(rev perm \<bullet> s)>], perm \<bullet> Q[<(rev perm \<bullet> s)>]) \<in> Rel
[PROOF STEP]
by(rule eqvtRelI)
[PROOF STATE]
proof (state)
this:
(perm \<bullet> P[<(rev perm \<bullet> s)>], perm \<bullet> Q[<(rev perm \<bullet> s)>]) \<in> Rel

goal (1 subgoal):
 1. \<And>a b perma \<sigma>. \<forall>\<sigma>. (a[<\<sigma>>], b[<\<sigma>>]) \<in> Rel \<Longrightarrow> ((perma \<bullet> a)[<\<sigma>>], (perma \<bullet> b)[<\<sigma>>]) \<in> Rel
[PROOF STEP]
thus "((perm \<bullet> P)[<s>], (perm \<bullet> Q)[<s>]) \<in> Rel"
[PROOF STATE]
proof (prove)
using this:
(perm \<bullet> P[<(rev perm \<bullet> s)>], perm \<bullet> Q[<(rev perm \<bullet> s)>]) \<in> Rel

goal (1 subgoal):
 1. ((perm \<bullet> P)[<s>], (perm \<bullet> Q)[<s>]) \<in> Rel
[PROOF STEP]
by(simp add: name_per_rev)
[PROOF STATE]
proof (state)
this:
((perm \<bullet> P)[<s>], (perm \<bullet> Q)[<s>]) \<in> Rel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_rexp_antisym: "\<lbrakk>le_rexp r s; le_rexp s r\<rbrakk> \<Longrightarrow> r = s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.le_rexp r s; local.le_rexp s r\<rbrakk> \<Longrightarrow> r = s
[PROOF STEP]
by (induction r s rule: le_rexp.induct) (auto dest: le_rexp_Zero)


[STATEMENT]
lemma n_left_distrib_var: "test p \<Longrightarrow> p \<cdot> (x + y) = p \<cdot> x + p \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. test p \<Longrightarrow> p \<cdot> (x + y) = p \<cdot> x + p \<cdot> y
[PROOF STEP]
using n_left_distrib
[PROOF STATE]
proof (prove)
using this:
!?x \<cdot> (?y + ?z) = !?x \<cdot> ?y + !?x \<cdot> ?z

goal (1 subgoal):
 1. test p \<Longrightarrow> p \<cdot> (x + y) = p \<cdot> x + p \<cdot> y
[PROOF STEP]
by auto


[STATEMENT]
lemma disj_of_clause_is_nnf[simp,intro!]: "is_nnf (disj_of_clause F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_nnf (disj_of_clause F)
[PROOF STEP]
unfolding disj_of_clause_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_nnf \<^bold>\<Or>map form_of_lit F
[PROOF STEP]
by simp


[STATEMENT]
lemma dim_le_card: assumes "V \<subseteq> span W" "finite W" shows "dim V \<le> card W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
obtain A where "independent A" "A \<subseteq> V" "V \<subseteq> span A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>independent A; A \<subseteq> V; V \<subseteq> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using maximal_independent_subset[of V]
[PROOF STATE]
proof (prove)
using this:
(\<And>B. \<lbrakk>B \<subseteq> V; independent B; V \<subseteq> span B\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>independent A; A \<subseteq> V; V \<subseteq> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
independent A
A \<subseteq> V
V \<subseteq> span A

goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
with assms independent_span_bound[of W A] basis_card_eq_dim[of A V]
[PROOF STATE]
proof (chain)
picking this:
V \<subseteq> span W
finite W
\<lbrakk>finite W; independent A; A \<subseteq> span W\<rbrakk> \<Longrightarrow> finite A \<and> card A \<le> card W
\<lbrakk>A \<subseteq> V; V \<subseteq> span A; independent A\<rbrakk> \<Longrightarrow> card A = dim V
independent A
A \<subseteq> V
V \<subseteq> span A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
V \<subseteq> span W
finite W
\<lbrakk>finite W; independent A; A \<subseteq> span W\<rbrakk> \<Longrightarrow> finite A \<and> card A \<le> card W
\<lbrakk>A \<subseteq> V; V \<subseteq> span A; independent A\<rbrakk> \<Longrightarrow> card A = dim V
independent A
A \<subseteq> V
V \<subseteq> span A

goal (1 subgoal):
 1. dim V \<le> card W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim V \<le> card W

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma foldl_ins_treap_of:
  assumes "distinct ys" "inj_on fst (set ys)" "inj_on snd (set ys)"
 shows "(foldl (\<lambda>t' (x, p). ins x p t') Leaf ys) = treap_of (set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>t' (x, p). ins x p t') \<langle>\<rangle> ys = treap_of (set ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct ys
inj_on fst (set ys)
inj_on snd (set ys)

goal (1 subgoal):
 1. foldl (\<lambda>t' (x, p). ins x p t') \<langle>\<rangle> ys = treap_of (set ys)
[PROOF STEP]
by (intro treap_unique) (auto simp: treap_Leaf foldl_ins_treap foldl_ins_set_tree
                                                  treap_treap_of treap_of_set_tree_unique)


[STATEMENT]
lemma reconstruct_is_original_poly:
  "reconstruct_poly (lead_coeff p) (complex_roots_complex p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reconstruct_poly (lead_coeff p) (complex_roots_complex p) = p
[PROOF STEP]
using complex_roots(1)
[PROOF STATE]
proof (prove)
using this:
Polynomial.smult (lead_coeff ?p) (\<Prod>a\<leftarrow>complex_roots_complex ?p. [:- a, 1:]) = ?p

goal (1 subgoal):
 1. reconstruct_poly (lead_coeff p) (complex_roots_complex p) = p
[PROOF STEP]
by (simp add: reconstruct_poly_def)


[STATEMENT]
lemma bij_prod_encode: "bij prod_encode"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij prod_encode
[PROOF STEP]
by (rule bijI [OF inj_prod_encode surj_prod_encode])