[STATEMENT]
lemma paths_up_to_length_or_condition_with_witness'_set :
  assumes "q \<in> states M"
  shows   "paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q
            = {(prev@p,x) | p x . path M q p
                                  \<and> length p \<le> k
                                  \<and> P (prev@p) = Some x
                                  \<and> (\<forall> p' p'' . (p = p'@p'' \<and> p'' \<noteq> []) \<longrightarrow> P (prev@p') = None)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
q \<in> FSM.states M

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
proof (induction k arbitrary: q prev)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>k q prev. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
q \<in> FSM.states M

goal (2 subgoals):
 1. \<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>k q prev. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q \<in> FSM.states M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
q \<in> FSM.states M

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
proof (cases "P prev")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>a. \<lbrakk>q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
P prev = None

goal (2 subgoals):
 1. \<lbrakk>q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>a. \<lbrakk>q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P prev = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P prev = None

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. \<And>a. \<lbrakk>q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
case (Some w)
[PROOF STATE]
proof (state)
this:
P prev = Some w

goal (1 subgoal):
 1. \<And>a. \<lbrakk>q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P prev = Some w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P prev = Some w

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
by (simp add: "0.prems" nil)
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness' (h_from M) P prev 0 q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> 0 \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. \<And>k q prev. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k q prev. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
?q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P ?prev k ?q = {(?prev @ p, x) |p x. path M ?q p \<and> length p \<le> k \<and> P (?prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (?prev @ p') = None)}
q \<in> FSM.states M

goal (1 subgoal):
 1. \<And>k q prev. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P ?prev k ?q = {(?prev @ p, x) |p x. path M ?q p \<and> length p \<le> k \<and> P (?prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (?prev @ p') = None)}
q \<in> FSM.states M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P ?prev k ?q = {(?prev @ p, x) |p x. path M ?q p \<and> length p \<le> k \<and> P (?prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (?prev @ p') = None)}
q \<in> FSM.states M

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
proof (cases "P prev")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>a. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
case (Some w)
[PROOF STATE]
proof (state)
this:
P prev = Some w

goal (2 subgoals):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>a. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P prev = Some w
[PROOF STEP]
have "(prev,w) \<in> {(prev@p,x) | p x . path M q p
                                              \<and> length p \<le> Suc k
                                              \<and> P (prev@p) = Some x
                                              \<and> (\<forall> p' p'' . (p = p'@p'' \<and> p'' \<noteq> []) \<longrightarrow> P (prev@p') = None)}"
[PROOF STATE]
proof (prove)
using this:
P prev = Some w

goal (1 subgoal):
 1. (prev, w) \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
by (simp add: Suc.prems nil)
[PROOF STATE]
proof (state)
this:
(prev, w) \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (2 subgoals):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>a. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(prev, w) \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have "{(prev@p,x) | p x . path M q p
                                    \<and> length p \<le> Suc k
                                    \<and> P (prev@p) = Some x
                                    \<and> (\<forall> p' p'' . (p = p'@p'' \<and> p'' \<noteq> []) \<longrightarrow> P (prev@p') = None)}
              = {(prev,w)}"
[PROOF STATE]
proof (prove)
using this:
(prev, w) \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} = {(prev, w)}
[PROOF STEP]
using Some
[PROOF STATE]
proof (prove)
using this:
(prev, w) \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
P prev = Some w

goal (1 subgoal):
 1. {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} = {(prev, w)}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} = {(prev, w)}

goal (2 subgoals):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
 2. \<And>a. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = Some a\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} = {(prev, w)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} = {(prev, w)}

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
using Some
[PROOF STATE]
proof (prove)
using this:
{(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} = {(prev, w)}
P prev = Some w

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
P prev = None

goal (1 subgoal):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have "(\<Union>(image (\<lambda>(x,y,q') . paths_up_to_length_or_condition_with_witness' (h_from M) P (prev@[(q,x,y,q')]) k q') (h_from M q)))
            = {(prev@p,x) | p x . path M q p
                                  \<and> length p \<le> Suc k
                                  \<and> P (prev@p) = Some x
                                  \<and> (\<forall> p' p'' . (p = p'@p'' \<and> p'' \<noteq> []) \<longrightarrow> P (prev@p') = None)}"
         (is "?UN = ?PX")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have *: "\<And> pp . pp \<in> ?UN \<Longrightarrow> pp \<in> ?PX"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
fix pp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
assume "pp \<in> ?UN"
[PROOF STATE]
proof (state)
this:
pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
obtain x y q' where "(x,y,q') \<in> h_from M q"
                           and   "pp \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev@[(q,x,y,q')]) k q'"
[PROOF STATE]
proof (prove)
using this:
pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')

goal (1 subgoal):
 1. (\<And>x y q'. \<lbrakk>(x, y, q') \<in> h_from M q; pp \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x, y, q') \<in> h_from M q
pp \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q'

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, y, q') \<in> h_from M q
pp \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q'
[PROOF STEP]
have "(q,x,y,q') \<in> transitions M"
[PROOF STATE]
proof (prove)
using this:
(x, y, q') \<in> h_from M q
pp \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q'

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

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(q, x, y, q') \<in> FSM.transitions M
[PROOF STEP]
have "q' \<in> states M"
[PROOF STATE]
proof (prove)
using this:
(q, x, y, q') \<in> FSM.transitions M

goal (1 subgoal):
 1. q' \<in> FSM.states M
[PROOF STEP]
using fsm_transition_target
[PROOF STATE]
proof (prove)
using this:
(q, x, y, q') \<in> FSM.transitions M
?t \<in> FSM.transitions ?M \<Longrightarrow> t_target ?t \<in> FSM.states ?M

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

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
obtain p w where "pp = ((prev@[(q,x,y,q')])@p,w)"
                   and   "path M q' p"
                   and   "length p \<le> k"
                   and   "P ((prev @ [(q, x, y, q')]) @ p) = Some w"
                   and   "\<And> p' p''. p = p' @ p'' \<Longrightarrow> p'' \<noteq> [] \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ p') = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p w. \<lbrakk>pp = ((prev @ [(q, x, y, q')]) @ p, w); path M q' p; length p \<le> k; P ((prev @ [(q, x, y, q')]) @ p) = Some w; \<And>p' p''. \<lbrakk>p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ p') = None\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>pp \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev@[(q,x,y,q')]) k q'\<close>
[PROOF STATE]
proof (prove)
using this:
pp \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q'

goal (1 subgoal):
 1. (\<And>p w. \<lbrakk>pp = ((prev @ [(q, x, y, q')]) @ p, w); path M q' p; length p \<le> k; P ((prev @ [(q, x, y, q')]) @ p) = Some w; \<And>p' p''. \<lbrakk>p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ p') = None\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding Suc.IH[OF \<open>q' \<in> states M\<close>, of "prev@[(q,x,y,q')]"]
[PROOF STATE]
proof (prove)
using this:
pp \<in> {((prev @ [(q, x, y, q')]) @ p, xa) |p xa. path M q' p \<and> length p \<le> k \<and> P ((prev @ [(q, x, y, q')]) @ p) = Some xa \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P ((prev @ [(q, x, y, q')]) @ p') = None)}

goal (1 subgoal):
 1. (\<And>p w. \<lbrakk>pp = ((prev @ [(q, x, y, q')]) @ p, w); path M q' p; length p \<le> k; P ((prev @ [(q, x, y, q')]) @ p) = Some w; \<And>p' p''. \<lbrakk>p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ p') = None\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pp = ((prev @ [(q, x, y, q')]) @ p, w)
path M q' p
length p \<le> k
P ((prev @ [(q, x, y, q')]) @ p) = Some w
\<lbrakk>p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ ?p') = None

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have "path M q ((q,x,y,q')#p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M q ((q, x, y, q') # p)
[PROOF STEP]
using \<open>path M q' p\<close> \<open>(q,x,y,q') \<in> transitions M\<close>
[PROOF STATE]
proof (prove)
using this:
path M q' p
(q, x, y, q') \<in> FSM.transitions M

goal (1 subgoal):
 1. path M q ((q, x, y, q') # p)
[PROOF STEP]
by (simp add: path_prepend_t)
[PROOF STATE]
proof (state)
this:
path M q ((q, x, y, q') # p)

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
path M q ((q, x, y, q') # p)

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have "length ((q,x,y,q')#p) \<le> Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ((q, x, y, q') # p) \<le> Suc k
[PROOF STEP]
using \<open>length p \<le> k\<close>
[PROOF STATE]
proof (prove)
using this:
length p \<le> k

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

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
length ((q, x, y, q') # p) \<le> Suc k

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have "P (prev @ ([(q, x, y, q')] @ p)) = Some w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (prev @ [(q, x, y, q')] @ p) = Some w
[PROOF STEP]
using \<open>P ((prev @ [(q, x, y, q')]) @ p) = Some w\<close>
[PROOF STATE]
proof (prove)
using this:
P ((prev @ [(q, x, y, q')]) @ p) = Some w

goal (1 subgoal):
 1. P (prev @ [(q, x, y, q')] @ p) = Some w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P (prev @ [(q, x, y, q')] @ p) = Some w

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P (prev @ [(q, x, y, q')] @ p) = Some w

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have "\<And> p' p''. ((q,x,y,q')#p) = p' @ p'' \<Longrightarrow> p'' \<noteq> [] \<Longrightarrow> P (prev @ p') = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p' p''. \<lbrakk>(q, x, y, q') # p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ p') = None
[PROOF STEP]
using \<open>\<And> p' p''. p = p' @ p'' \<Longrightarrow> p'' \<noteq> [] \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ p') = None\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ ?p') = None

goal (1 subgoal):
 1. \<And>p' p''. \<lbrakk>(q, x, y, q') # p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ p') = None
[PROOF STEP]
using None
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [(q, x, y, q')]) @ ?p') = None
P prev = None

goal (1 subgoal):
 1. \<And>p' p''. \<lbrakk>(q, x, y, q') # p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ p') = None
[PROOF STEP]
by (metis (no_types, opaque_lifting) append.simps(1) append_Cons append_Nil2 append_assoc
                list.inject neq_Nil_conv)
[PROOF STATE]
proof (state)
this:
\<lbrakk>(q, x, y, q') # p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ ?p') = None

goal (1 subgoal):
 1. \<And>pp. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
path M q ((q, x, y, q') # p)
length ((q, x, y, q') # p) \<le> Suc k
P (prev @ [(q, x, y, q')] @ p) = Some w
\<lbrakk>(q, x, y, q') # p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ ?p') = None
[PROOF STEP]
show "pp \<in> ?PX"
[PROOF STATE]
proof (prove)
using this:
path M q ((q, x, y, q') # p)
length ((q, x, y, q') # p) \<le> Suc k
P (prev @ [(q, x, y, q')] @ p) = Some w
\<lbrakk>(q, x, y, q') # p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ ?p') = None

goal (1 subgoal):
 1. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
unfolding \<open>pp = ((prev@[(q,x,y,q')])@p,w)\<close>
[PROOF STATE]
proof (prove)
using this:
path M q ((q, x, y, q') # p)
length ((q, x, y, q') # p) \<le> Suc k
P (prev @ [(q, x, y, q')] @ p) = Some w
\<lbrakk>(q, x, y, q') # p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ ?p') = None

goal (1 subgoal):
 1. ((prev @ [(q, x, y, q')]) @ p, w) \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> ?pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
have **: "\<And> pp . pp \<in> ?PX \<Longrightarrow> pp \<in> ?UN"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
fix pp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
assume "pp \<in> ?PX"
[PROOF STATE]
proof (state)
this:
pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
obtain p' w where "pp = (prev @ p', w)"
                        and   "path M q p'"
                        and   "length p' \<le> Suc k"
                        and   "P (prev @ p') = Some w"
                        and   "\<And> p' p''. p' = p' @ p'' \<Longrightarrow> p'' \<noteq> [] \<Longrightarrow> P (prev @ p') = None"
[PROOF STATE]
proof (prove)
using this:
pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

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

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pp = (prev @ p', w)
path M q p'
length p' \<le> Suc k
P (prev @ p') = Some w
\<lbrakk>?p' = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ ?p') = None

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
obtain t p where "p' = t#p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t p. p' = t # p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>P (prev @ p') = Some w\<close>
[PROOF STATE]
proof (prove)
using this:
P (prev @ p') = Some w

goal (1 subgoal):
 1. (\<And>t p. p' = t # p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using None
[PROOF STATE]
proof (prove)
using this:
P (prev @ p') = Some w
P prev = None

goal (1 subgoal):
 1. (\<And>t p. p' = t # p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis append_Nil2 list.exhaust option.distinct(1))
[PROOF STATE]
proof (state)
this:
p' = t # p

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have "pp = ((prev @ [t])@p, w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pp = ((prev @ [t]) @ p, w)
[PROOF STEP]
using \<open>pp = (prev @ p', w)\<close>
[PROOF STATE]
proof (prove)
using this:
pp = (prev @ p', w)

goal (1 subgoal):
 1. pp = ((prev @ [t]) @ p, w)
[PROOF STEP]
unfolding \<open>p' = t#p\<close>
[PROOF STATE]
proof (prove)
using this:
pp = (prev @ t # p, w)

goal (1 subgoal):
 1. pp = ((prev @ [t]) @ p, w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pp = ((prev @ [t]) @ p, w)

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have "path M q (t#p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M q (t # p)
[PROOF STEP]
using \<open>path M q p'\<close>
[PROOF STATE]
proof (prove)
using this:
path M q p'

goal (1 subgoal):
 1. path M q (t # p)
[PROOF STEP]
unfolding \<open>p' = t#p\<close>
[PROOF STATE]
proof (prove)
using this:
path M q (t # p)

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

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have p2: "length (t#p) \<le> Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (t # p) \<le> Suc k
[PROOF STEP]
using \<open>length p' \<le> Suc k\<close>
[PROOF STATE]
proof (prove)
using this:
length p' \<le> Suc k

goal (1 subgoal):
 1. length (t # p) \<le> Suc k
[PROOF STEP]
unfolding \<open>p' = t#p\<close>
[PROOF STATE]
proof (prove)
using this:
length (t # p) \<le> Suc k

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

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have p3: "P ((prev @ [t])@p) = Some w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((prev @ [t]) @ p) = Some w
[PROOF STEP]
using \<open>P (prev @ p') = Some w\<close>
[PROOF STATE]
proof (prove)
using this:
P (prev @ p') = Some w

goal (1 subgoal):
 1. P ((prev @ [t]) @ p) = Some w
[PROOF STEP]
unfolding \<open>p' = t#p\<close>
[PROOF STATE]
proof (prove)
using this:
P (prev @ t # p) = Some w

goal (1 subgoal):
 1. P ((prev @ [t]) @ p) = Some w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P ((prev @ [t]) @ p) = Some w

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have p4: "\<And> p' p''. p = p' @ p'' \<Longrightarrow> p'' \<noteq> [] \<Longrightarrow> P ((prev@[t]) @ p') = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p' p''. \<lbrakk>p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [t]) @ p') = None
[PROOF STEP]
using \<open>\<And> p' p''. p' = p' @ p'' \<Longrightarrow> p'' \<noteq> [] \<Longrightarrow> P (prev @ p') = None\<close> \<open>pp \<in> ?PX\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p' = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ ?p') = None
pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. \<And>p' p''. \<lbrakk>p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [t]) @ p') = None
[PROOF STEP]
unfolding \<open>pp = ((prev @ [t]) @ p, w)\<close> \<open>p' = t#p\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p' = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P (prev @ ?p') = None
((prev @ [t]) @ p, w) \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. \<And>p' p''. \<lbrakk>p = p' @ p''; p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [t]) @ p') = None
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [t]) @ ?p') = None

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have "t \<in> transitions M" and p1: "path M (t_target t) p" and "t_source t = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> FSM.transitions M &&& path M (t_target t) p &&& t_source t = q
[PROOF STEP]
using \<open>path M q (t#p)\<close>
[PROOF STATE]
proof (prove)
using this:
path M q (t # p)

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

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in> FSM.transitions M
path M (t_target t) p
t_source t = q
[PROOF STEP]
have "t_target t \<in> states M"
              and "(t_input t, t_output t, t_target t) \<in> h_from M q"
              and "t_source t = q"
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
path M (t_target t) p
t_source t = q

goal (1 subgoal):
 1. t_target t \<in> FSM.states M &&& (t_input t, t_output t, t_target t) \<in> h_from M q &&& t_source t = q
[PROOF STEP]
using fsm_transition_target
[PROOF STATE]
proof (prove)
using this:
t \<in> FSM.transitions M
path M (t_target t) p
t_source t = q
?t \<in> FSM.transitions ?M \<Longrightarrow> t_target ?t \<in> FSM.states ?M

goal (1 subgoal):
 1. t_target t \<in> FSM.states M &&& (t_input t, t_output t, t_target t) \<in> h_from M q &&& t_source t = q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t_target t \<in> FSM.states M
(t_input t, t_output t, t_target t) \<in> h_from M q
t_source t = q

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t_target t \<in> FSM.states M
(t_input t, t_output t, t_target t) \<in> h_from M q
t_source t = q
[PROOF STEP]
have "t = (q,t_input t, t_output t, t_target t)"
[PROOF STATE]
proof (prove)
using this:
t_target t \<in> FSM.states M
(t_input t, t_output t, t_target t) \<in> h_from M q
t_source t = q

goal (1 subgoal):
 1. t = (q, t_input t, t_output t, t_target t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t = (q, t_input t, t_output t, t_target t)

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have "((prev @ [t])@p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev@[t]) k (t_target t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)
[PROOF STEP]
unfolding Suc.IH[OF \<open>t_target t \<in> states M\<close>, of "prev@[t]"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> {((prev @ [t]) @ p, x) |p x. path M (t_target t) p \<and> length p \<le> k \<and> P ((prev @ [t]) @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P ((prev @ [t]) @ p') = None)}
[PROOF STEP]
using p1 p2 p3 p4
[PROOF STATE]
proof (prove)
using this:
path M (t_target t) p
length (t # p) \<le> Suc k
P ((prev @ [t]) @ p) = Some w
\<lbrakk>p = ?p' @ ?p''; ?p'' \<noteq> []\<rbrakk> \<Longrightarrow> P ((prev @ [t]) @ ?p') = None

goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> {((prev @ [t]) @ p, x) |p x. path M (t_target t) p \<and> length p \<le> k \<and> P ((prev @ [t]) @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P ((prev @ [t]) @ p') = None)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)

goal (1 subgoal):
 1. \<And>pp. pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)
[PROOF STEP]
show "pp \<in> ?UN"
[PROOF STATE]
proof (prove)
using this:
((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)

goal (1 subgoal):
 1. pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
unfolding \<open>pp = ((prev @ [t])@p, w)\<close>
[PROOF STATE]
proof (prove)
using this:
((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)

goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) \<Longrightarrow> ((prev @ [t]) @ p, w) \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
have "paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)
                = paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, t_input t, t_output t, t_target t)]) k (t_target t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) = paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, t_input t, t_output t, t_target t)]) k (t_target t)
[PROOF STEP]
using \<open>t = (q, t_input t, t_output t, t_target t)\<close>
[PROOF STATE]
proof (prove)
using this:
t = (q, t_input t, t_output t, t_target t)

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) = paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, t_input t, t_output t, t_target t)]) k (t_target t)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) = paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, t_input t, t_output t, t_target t)]) k (t_target t)

goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) \<Longrightarrow> ((prev @ [t]) @ p, w) \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) = paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, t_input t, t_output t, t_target t)]) k (t_target t)
[PROOF STEP]
show "((prev @ [t]) @ p, w) \<in> (\<Union>(b, c, a)\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, b, c, a)]) k a)"
[PROOF STATE]
proof (prove)
using this:
paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) = paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, t_input t, t_output t, t_target t)]) k (t_target t)

goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> (\<Union>(b, c, a)\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, b, c, a)]) k a)
[PROOF STEP]
using \<open>((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)\<close>
                  \<open>(t_input t, t_output t, t_target t) \<in> h_from M q\<close>
[PROOF STATE]
proof (prove)
using this:
paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t) = paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, t_input t, t_output t, t_target t)]) k (t_target t)
((prev @ [t]) @ p, w) \<in> paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [t]) k (t_target t)
(t_input t, t_output t, t_target t) \<in> h_from M q

goal (1 subgoal):
 1. ((prev @ [t]) @ p, w) \<in> (\<Union>(b, c, a)\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, b, c, a)]) k a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((prev @ [t]) @ p, w) \<in> (\<Union>(b, c, a)\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, b, c, a)]) k a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?pp \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> ?pp \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')

goal (1 subgoal):
 1. (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
using subsetI[of ?UN ?PX, OF *] subsetI[of ?PX ?UN, OF **] subset_antisym
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<Longrightarrow> x \<in> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')) \<Longrightarrow> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') \<subseteq> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
(\<And>x. x \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<Longrightarrow> x \<in> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}) \<Longrightarrow> {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)} \<subseteq> (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q')
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> ?A = ?B

goal (1 subgoal):
 1. (\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. \<lbrakk>\<And>q prev. q \<in> FSM.states M \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev k q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}; q \<in> FSM.states M; P prev = None\<rbrakk> \<Longrightarrow> paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
using None
[PROOF STATE]
proof (prove)
using this:
(\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
P prev = None

goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
unfolding paths_up_to_length_or_condition_with_witness'.simps
[PROOF STATE]
proof (prove)
using this:
(\<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q') = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
P prev = None

goal (1 subgoal):
 1. (case P prev of None \<Rightarrow> \<Union>(x, y, q')\<in>h_from M q. paths_up_to_length_or_condition_with_witness' (h_from M) P (prev @ [(q, x, y, q')]) k q' | Some w \<Rightarrow> {(prev, w)}) = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness' (h_from M) P prev (Suc k) q = {(prev @ p, x) |p x. path M q p \<and> length p \<le> Suc k \<and> P (prev @ p) = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P (prev @ p') = None)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_eqI_truncate:
  assumes "\<And>m. m > 0 \<Longrightarrow> fds_truncate m f = fds_truncate m g"
  shows   "f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g
[PROOF STEP]
proof (rule fds_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
assume "n > 0"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
have "fds_nth f n = fds_nth (fds_truncate n f) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth f n = fds_nth (fds_truncate n f) n
[PROOF STEP]
by (simp add: fds_nth_truncate)
[PROOF STATE]
proof (state)
this:
fds_nth f n = fds_nth (fds_truncate n f) n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_nth f n = fds_nth (fds_truncate n f) n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
note assms[OF \<open>n > 0\<close>]
[PROOF STATE]
proof (state)
this:
fds_truncate n f = fds_truncate n g

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_truncate n f = fds_truncate n g

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
have "fds_nth (fds_truncate n g) n = fds_nth g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_truncate n g) n = fds_nth g n
[PROOF STEP]
by (simp add: fds_nth_truncate)
[PROOF STATE]
proof (state)
this:
fds_nth (fds_truncate n g) n = fds_nth g n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> fds_nth f n = fds_nth g n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_nth f n = fds_nth g n
[PROOF STEP]
show "fds_nth f n = fds_nth g n"
[PROOF STATE]
proof (prove)
using this:
fds_nth f n = fds_nth g n

goal (1 subgoal):
 1. fds_nth f n = fds_nth g n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_nth f n = fds_nth g n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ell_field) ppoint_mult_correct: "a \<in> carrier R \<Longrightarrow> b \<in> carrier R \<Longrightarrow> on_curvep a b p \<Longrightarrow>
  make_affine (ppoint_mult a n p) = point_mult a n (make_affine p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; on_curvep a b p\<rbrakk> \<Longrightarrow> make_affine (ppoint_mult a n p) = point_mult a n (make_affine p)
[PROOF STEP]
by (induct n) (simp_all add: padd_correct)


[STATEMENT]
lemma Suc_unat_diff_1:
  fixes x :: "'a :: len word"
  assumes lt: "1 \<le> x"
  shows "Suc (unat (x - 1)) = unat x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (unat (x - 1)) = unat x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Suc (unat (x - 1)) = unat x
[PROOF STEP]
have "0 < unat x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < unat x
[PROOF STEP]
by (rule order_less_le_trans [where y = 1], simp, subst unat_1 [symmetric],
        rule iffD1 [OF word_le_nat_alt lt])
[PROOF STATE]
proof (state)
this:
0 < unat x

goal (1 subgoal):
 1. Suc (unat (x - 1)) = unat x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < unat x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < unat x

goal (1 subgoal):
 1. Suc (unat (x - 1)) = unat x
[PROOF STEP]
by ((subst unat_sub [OF lt])+, simp only:  unat_1)
[PROOF STATE]
proof (state)
this:
Suc (unat (x - 1)) = unat x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_image_compose: "path_image (f \<circ> p) = f ` (path_image p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (f \<circ> p) = f ` path_image p
[PROOF STEP]
by (simp add: image_comp path_image_def)


[STATEMENT]
lemma Ssegment_not_inc_iff:"\<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow>
                  (a \<preceq>\<^bsub>D\<^esub> b) =  (b \<notin> Ssegment D a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> a \<preceq>\<^bsub>D\<^esub> b = (b \<notin> Ssegment D a)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; a \<preceq>\<^bsub>D\<^esub> b\<rbrakk> \<Longrightarrow> b \<notin> Ssegment D a
 2. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; b \<notin> Ssegment D a\<rbrakk> \<Longrightarrow> a \<preceq>\<^bsub>D\<^esub> b
[PROOF STEP]
apply (frule Torder.Order[of "D"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; a \<preceq>\<^bsub>D\<^esub> b; Order D\<rbrakk> \<Longrightarrow> b \<notin> Ssegment D a
 2. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; b \<notin> Ssegment D a\<rbrakk> \<Longrightarrow> a \<preceq>\<^bsub>D\<^esub> b
[PROOF STEP]
apply (simp add:Order.le_imp_less_or_eq,
        erule disjE, rule Ssegment_not_inc, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; Order D; a = b\<rbrakk> \<Longrightarrow> b \<notin> Ssegment D a
 2. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; b \<notin> Ssegment D a\<rbrakk> \<Longrightarrow> a \<preceq>\<^bsub>D\<^esub> b
[PROOF STEP]
apply (simp add: a_notin_Ssegment)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; b \<notin> Ssegment D a\<rbrakk> \<Longrightarrow> a \<preceq>\<^bsub>D\<^esub> b
[PROOF STEP]
apply (simp add:Ssegment_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Torder D; a \<in> carrier D; b \<in> carrier D; \<not> b \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> a \<preceq>\<^bsub>D\<^esub> b
[PROOF STEP]
apply ( simp add:Torder.not_less_le[THEN sym, of "D" "b" "a"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma signed_take_bit_numeral_minus_bit0 [simp]:
  \<open>signed_take_bit (numeral l) (- numeral (Num.Bit0 k)) = signed_take_bit (pred_numeral l) (- numeral k) * (2 :: int)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit (numeral l) (- numeral (num.Bit0 k)) = signed_take_bit (pred_numeral l) (- numeral k) * 2
[PROOF STEP]
by (simp add: signed_take_bit_rec)