[STATEMENT]
theorem cond_3:
  assumes "s\<^sub>o \<le> ego.s_stop" "ego.s_stop < other.s_stop"
  shows "collision {0..} \<longleftrightarrow> (a\<^sub>o > a\<^sub>e \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> sqrt D2 > v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
have "v\<^sub>o \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v\<^sub>o \<noteq> 0
[PROOF STEP]
using assms(1) assms(2) movement.s_def movement.t_stop_def
[PROOF STATE]
proof (prove)
using this:
s\<^sub>o \<le> ego.s_stop
ego.s_stop < other.s_stop
movement.s ?a ?v ?s0.0 ?t = (if ?t \<le> 0 then ?s0.0 else if ?t \<le> movement.t_stop ?a ?v then movement.p ?a ?v ?s0.0 ?t else movement.p_max ?a ?v ?s0.0)
movement.t_stop ?a ?v = - ?v / ?a

goal (1 subgoal):
 1. v\<^sub>o \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v\<^sub>o \<noteq> 0

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
with hyps
[PROOF STATE]
proof (chain)
picking this:
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
v\<^sub>o \<noteq> 0
[PROOF STEP]
have "v\<^sub>o > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
v\<^sub>o \<noteq> 0

goal (1 subgoal):
 1. 0 < v\<^sub>o
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < v\<^sub>o

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
note hyps = hyps this
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
define t1 where "t1 = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (state)
this:
t1 = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
define t2 where "t2 = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (state)
this:
t2 = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
define bounded where "bounded \<equiv> \<lambda>t. (0 \<le> t \<and> t \<le> ego.t_stop \<and> t \<le> other.t_stop)"
[PROOF STATE]
proof (state)
this:
bounded \<equiv> \<lambda>t. 0 \<le> t \<and> t \<le> ego.t_stop \<and> t \<le> other.t_stop

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
have ego_other_conv:
    "\<And>t. bounded t \<Longrightarrow> ego.p t = other.p t \<longleftrightarrow> ego_other.p t = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. bounded t \<Longrightarrow> (ego.p t = other.p t) = (ego_other.p t = 0)
[PROOF STEP]
by (auto simp: movement.p_def field_split_simps)
[PROOF STATE]
proof (state)
this:
bounded ?t \<Longrightarrow> (ego.p ?t = other.p ?t) = (ego_other.p ?t = 0)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
let ?r = "{0 <..< min ego.t_stop other.t_stop}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
have D2: "D2 = (v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D2 = (v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
D2 = (v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
define D where "D = D2"
[PROOF STATE]
proof (state)
this:
D = D2

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
note D = D_def[symmetric]
[PROOF STATE]
proof (state)
this:
D2 = D

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
define x1 where "x1 \<equiv> (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (2 * ((a\<^sub>o - a\<^sub>e) / 2))"
[PROOF STATE]
proof (state)
this:
x1 \<equiv> (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (2 * ((a\<^sub>o - a\<^sub>e) / 2))

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
define x2 where "x2 \<equiv> (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (2 * ((a\<^sub>o - a\<^sub>e) / 2))"
[PROOF STATE]
proof (state)
this:
x2 \<equiv> (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (2 * ((a\<^sub>o - a\<^sub>e) / 2))

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
have x2: "x2 =(- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by (simp add: x2_def field_split_simps)
[PROOF STATE]
proof (state)
this:
x2 = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
have x1: "x1 =(- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by (simp add: x1_def field_split_simps)
[PROOF STATE]
proof (state)
this:
x1 = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
from collision_within_less[OF assms]
[PROOF STATE]
proof (chain)
picking this:
collision {0..} = collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
have coll_eq: "collision {0..} = collision ?r"
[PROOF STATE]
proof (prove)
using this:
collision {0..} = collision {0<..<min ego.t_stop other.t_stop}

goal (1 subgoal):
 1. collision {0..} = collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
by (auto simp add: bounded_def)
[PROOF STATE]
proof (state)
this:
collision {0..} = collision {0<..<min ego.t_stop other.t_stop}

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
collision {0..} = collision {0<..<min ego.t_stop other.t_stop}

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (a\<^sub>o > a\<^sub>e \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> sqrt D2 > v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. collision {0<..<min ego.t_stop other.t_stop} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
assume H: "a\<^sub>e < a\<^sub>o" "v\<^sub>o < v\<^sub>e" "0 \<le> D2"
[PROOF STATE]
proof (state)
this:
a\<^sub>e < a\<^sub>o
v\<^sub>o < v\<^sub>e
0 \<le> D2

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
assume sqrt: "sqrt D2 > v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o"
[PROOF STATE]
proof (state)
this:
v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
have nz: "(a\<^sub>o - a\<^sub>e) / 2 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a\<^sub>o - a\<^sub>e) / 2 \<noteq> 0
[PROOF STEP]
using \<open>a\<^sub>e < a\<^sub>o\<close>
[PROOF STATE]
proof (prove)
using this:
a\<^sub>e < a\<^sub>o

goal (1 subgoal):
 1. (a\<^sub>o - a\<^sub>e) / 2 \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a\<^sub>o - a\<^sub>e) / 2 \<noteq> 0

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
note sol = quadratic_eq_zeroes_iff[OF D2 x1_def[THEN meta_eq_to_obj_eq] x2_def[THEN meta_eq_to_obj_eq] nz]
[PROOF STATE]
proof (state)
this:
((a\<^sub>o - a\<^sub>e) / 2 * ?x\<^sup>2 + (v\<^sub>o - v\<^sub>e) * ?x + (s\<^sub>o - s\<^sub>e) = 0) = (0 \<le> D2 \<and> (?x = x1 \<or> ?x = x2))

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
from sol[of x2] \<open>0 \<le> D2\<close>
[PROOF STATE]
proof (chain)
picking this:
((a\<^sub>o - a\<^sub>e) / 2 * x2\<^sup>2 + (v\<^sub>o - v\<^sub>e) * x2 + (s\<^sub>o - s\<^sub>e) = 0) = (0 \<le> D2 \<and> (x2 = x1 \<or> x2 = x2))
0 \<le> D2
[PROOF STEP]
have "other.p x2 = ego.p x2"
[PROOF STATE]
proof (prove)
using this:
((a\<^sub>o - a\<^sub>e) / 2 * x2\<^sup>2 + (v\<^sub>o - v\<^sub>e) * x2 + (s\<^sub>o - s\<^sub>e) = 0) = (0 \<le> D2 \<and> (x2 = x1 \<or> x2 = x2))
0 \<le> D2

goal (1 subgoal):
 1. other.p x2 = ego.p x2
[PROOF STEP]
by (auto simp: ego.p_def other.p_def field_split_simps)
[PROOF STATE]
proof (state)
this:
other.p x2 = ego.p x2

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
other.p x2 = ego.p x2

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
have "x2 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x2
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < x2 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> 0 < x2"
[PROOF STATE]
proof (state)
this:
\<not> 0 < x2

goal (1 subgoal):
 1. \<not> 0 < x2 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < x2
[PROOF STEP]
have "ego_other.p x2 \<ge> ego_other.p 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < x2

goal (1 subgoal):
 1. ego_other.p 0 \<le> ego_other.p x2
[PROOF STEP]
using H hyps
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < x2
a\<^sub>e < a\<^sub>o
v\<^sub>o < v\<^sub>e
0 \<le> D2
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o

goal (1 subgoal):
 1. ego_other.p 0 \<le> ego_other.p x2
[PROOF STEP]
by (intro DERIV_nonpos_imp_nonincreasing[of x2])
          (auto intro!: exI[where x="ego_other.p' x" for x] derivative_eq_intros
            simp: ego_other.p'_def add_nonpos_nonpos mult_nonneg_nonpos)
[PROOF STATE]
proof (state)
this:
ego_other.p 0 \<le> ego_other.p x2

goal (1 subgoal):
 1. \<not> 0 < x2 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ego_other.p 0 \<le> ego_other.p x2

goal (1 subgoal):
 1. \<not> 0 < x2 \<Longrightarrow> False
[PROOF STEP]
have "ego_other.p 0 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < ego_other.p 0
[PROOF STEP]
using hyps
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o

goal (1 subgoal):
 1. 0 < ego_other.p 0
[PROOF STEP]
by (simp add: ego_other.p_def)
[PROOF STATE]
proof (state)
this:
0 < ego_other.p 0

goal (1 subgoal):
 1. \<not> 0 < x2 \<Longrightarrow> False
[PROOF STEP]
finally (xtrans)
[PROOF STATE]
proof (chain)
picking this:
0 < ego_other.p x2
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
0 < ego_other.p x2

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>other.p x2 = ego.p x2\<close>
[PROOF STATE]
proof (prove)
using this:
0 < ego_other.p x2
other.p x2 = ego.p x2

goal (1 subgoal):
 1. False
[PROOF STEP]
by (simp add: movement.p_def field_split_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < x2

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < x2

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
have "x2 < other.t_stop"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 < other.t_stop
[PROOF STEP]
using sqrt H hyps
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
a\<^sub>e < a\<^sub>o
v\<^sub>o < v\<^sub>e
0 \<le> D2
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o

goal (1 subgoal):
 1. x2 < other.t_stop
[PROOF STEP]
by (auto simp: x2 other.t_stop_def field_split_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
x2 < other.t_stop

goal (5 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
 5. \<lbrakk>a\<^sub>e < a\<^sub>o; v\<^sub>o < v\<^sub>e; 0 \<le> D2; v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop
[PROOF STEP]
show "collision {0<..<min ego.t_stop other.t_stop}"
[PROOF STATE]
proof (prove)
using this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop

goal (1 subgoal):
 1. collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
proof (cases "x2 < ego.t_stop", goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop
\<not> x2 < ego.t_stop

goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop
\<not> x2 < ego.t_stop
[PROOF STEP]
have "other.s x2 = other.p x2"
[PROOF STATE]
proof (prove)
using this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop
\<not> x2 < ego.t_stop

goal (1 subgoal):
 1. other.s x2 = other.p x2
[PROOF STEP]
by (auto simp: other.s_def)
[PROOF STATE]
proof (state)
this:
other.s x2 = other.p x2

goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
other.s x2 = other.p x2

goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
from 2
[PROOF STATE]
proof (chain)
picking this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop
\<not> x2 < ego.t_stop
[PROOF STEP]
have "\<dots> \<le> ego.p ego.t_stop"
[PROOF STATE]
proof (prove)
using this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop
\<not> x2 < ego.t_stop

goal (1 subgoal):
 1. other.p x2 \<le> ego.p ego.t_stop
[PROOF STEP]
by (auto intro!: ego.p_antimono)
[PROOF STATE]
proof (state)
this:
other.p x2 \<le> ego.p ego.t_stop

goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
other.p x2 \<le> ego.p ego.t_stop

goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
have "\<dots> = ego.s x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ego.p ego.t_stop = ego.s x2
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
other.p x2 = ego.p x2
0 < x2
x2 < other.t_stop
\<not> x2 < ego.t_stop

goal (1 subgoal):
 1. ego.p ego.t_stop = ego.s x2
[PROOF STEP]
by (auto simp: ego.s_def ego.p_t_stop)
[PROOF STATE]
proof (state)
this:
ego.p ego.t_stop = ego.s x2

goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
other.s x2 \<le> ego.s x2
[PROOF STEP]
have "other.s x2 \<le> ego.s x2"
[PROOF STATE]
proof (prove)
using this:
other.s x2 \<le> ego.s x2

goal (1 subgoal):
 1. other.s x2 \<le> ego.s x2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
other.s x2 \<le> ego.s x2

goal (2 subgoals):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
 2. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; \<not> x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
from ego_other_ivt[OF this]
[PROOF STATE]
proof (chain)
picking this:
collision {0..x2}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
collision {0..x2}

goal (1 subgoal):
 1. collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
unfolding coll_eq[symmetric]
[PROOF STATE]
proof (prove)
using this:
collision {0..x2}

goal (1 subgoal):
 1. collision {0..}
[PROOF STEP]
by (rule collision_subset) auto
[PROOF STATE]
proof (state)
this:
collision {0<..<min ego.t_stop other.t_stop}

goal (1 subgoal):
 1. \<lbrakk>other.p x2 = ego.p x2; 0 < x2; x2 < other.t_stop; x2 < ego.t_stop\<rbrakk> \<Longrightarrow> collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
qed (auto simp: collision_def ego.s_def other.s_def not_le intro!: bexI[where x=x2])
[PROOF STATE]
proof (state)
this:
collision {0<..<min ego.t_stop other.t_stop}

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
let ?max = "max ego.t_stop other.t_stop"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
let ?min = "min ego.t_stop other.t_stop"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
assume "collision ?r"
[PROOF STATE]
proof (state)
this:
collision {0<..<min ego.t_stop other.t_stop}

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
collision {0<..<min ego.t_stop other.t_stop}
[PROOF STEP]
obtain t where t: "ego.p t = other.p t" "0 < t" "t < ?min"
[PROOF STATE]
proof (prove)
using this:
collision {0<..<min ego.t_stop other.t_stop}

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>ego.p t = other.p t; 0 < t; t < min ego.t_stop other.t_stop\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: collision_def ego.s_def other.s_def)
[PROOF STATE]
proof (state)
this:
ego.p t = other.p t
0 < t
t < min ego.t_stop other.t_stop

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ego.p t = other.p t
0 < t
t < min ego.t_stop other.t_stop
[PROOF STEP]
have "t < - (v\<^sub>e / a\<^sub>e)" "t < - (v\<^sub>o / a\<^sub>o)" "t < other.t_stop"
[PROOF STATE]
proof (prove)
using this:
ego.p t = other.p t
0 < t
t < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. t < - (v\<^sub>e / a\<^sub>e) &&& t < - (v\<^sub>o / a\<^sub>o) &&& t < other.t_stop
[PROOF STEP]
by (simp_all add: ego.t_stop_def other.t_stop_def)
[PROOF STATE]
proof (state)
this:
t < - (v\<^sub>e / a\<^sub>e)
t < - (v\<^sub>o / a\<^sub>o)
t < other.t_stop

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
from t
[PROOF STATE]
proof (chain)
picking this:
ego.p t = other.p t
0 < t
t < min ego.t_stop other.t_stop
[PROOF STEP]
have "ego_other.p t = 0"
[PROOF STATE]
proof (prove)
using this:
ego.p t = other.p t
0 < t
t < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. ego_other.p t = 0
[PROOF STEP]
by (auto simp: movement.p_def field_split_simps)
[PROOF STATE]
proof (state)
this:
ego_other.p t = 0

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
from t
[PROOF STATE]
proof (chain)
picking this:
ego.p t = other.p t
0 < t
t < min ego.t_stop other.t_stop
[PROOF STEP]
have "t < ?max"
[PROOF STATE]
proof (prove)
using this:
ego.p t = other.p t
0 < t
t < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. t < max ego.t_stop other.t_stop
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t < max ego.t_stop other.t_stop

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
from hyps assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o
s\<^sub>o \<le> ego.s_stop
ego.s_stop < other.s_stop
[PROOF STEP]
have "0 < ego_other.p 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o
s\<^sub>o \<le> ego.s_stop
ego.s_stop < other.s_stop

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

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
from ego_other.p_def[abs_def, THEN meta_eq_to_obj_eq]
[PROOF STATE]
proof (chain)
picking this:
ego_other.p = (\<lambda>t. s\<^sub>o - s\<^sub>e + (v\<^sub>o - v\<^sub>e) * t + 1 / 2 * (a\<^sub>o - a\<^sub>e) * t\<^sup>2)
[PROOF STEP]
have eop_eq: "ego_other.p = (\<lambda>t. 1 / 2 * (a\<^sub>o - a\<^sub>e) * t\<^sup>2 + (v\<^sub>o - v\<^sub>e) * t + (s\<^sub>o - s\<^sub>e))"
[PROOF STATE]
proof (prove)
using this:
ego_other.p = (\<lambda>t. s\<^sub>o - s\<^sub>e + (v\<^sub>o - v\<^sub>e) * t + 1 / 2 * (a\<^sub>o - a\<^sub>e) * t\<^sup>2)

goal (1 subgoal):
 1. ego_other.p = (\<lambda>t. 1 / 2 * (a\<^sub>o - a\<^sub>e) * t\<^sup>2 + (v\<^sub>o - v\<^sub>e) * t + (s\<^sub>o - s\<^sub>e))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
ego_other.p = (\<lambda>t. 1 / 2 * (a\<^sub>o - a\<^sub>e) * t\<^sup>2 + (v\<^sub>o - v\<^sub>e) * t + (s\<^sub>o - s\<^sub>e))

goal (4 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> a\<^sub>e < a\<^sub>o
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 4. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
show "a\<^sub>o > a\<^sub>e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a\<^sub>e < a\<^sub>o
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a\<^sub>e < a\<^sub>o
[PROOF STEP]
have "ego.p other.t_stop \<le> ego.p_max"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ego.p other.t_stop \<le> ego.p_max
[PROOF STEP]
by (rule ego.p_max)
[PROOF STATE]
proof (state)
this:
ego.p other.t_stop \<le> ego.p_max

goal (1 subgoal):
 1. a\<^sub>e < a\<^sub>o
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ego.p other.t_stop \<le> ego.p_max

goal (1 subgoal):
 1. a\<^sub>e < a\<^sub>o
[PROOF STEP]
have "... \<le> other.p other.t_stop"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ego.p_max \<le> other.p other.t_stop
[PROOF STEP]
using hyps assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o
s\<^sub>o \<le> ego.s_stop
ego.s_stop < other.s_stop

goal (1 subgoal):
 1. ego.p_max \<le> other.p other.t_stop
[PROOF STEP]
by (auto simp:other.s_def ego.s_def ego.p_t_stop split:if_splits)
[PROOF STATE]
proof (state)
this:
ego.p_max \<le> other.p other.t_stop

goal (1 subgoal):
 1. a\<^sub>e < a\<^sub>o
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ego.p other.t_stop \<le> other.p other.t_stop
[PROOF STEP]
have "0 \<le> ego_other.p other.t_stop"
[PROOF STATE]
proof (prove)
using this:
ego.p other.t_stop \<le> other.p other.t_stop

goal (1 subgoal):
 1. 0 \<le> ego_other.p other.t_stop
[PROOF STEP]
by (auto simp add:movement.p_def field_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> ego_other.p other.t_stop

goal (1 subgoal):
 1. a\<^sub>e < a\<^sub>o
[PROOF STEP]
from p_convex[OF eop_eq, of 0 t other.t_stop, simplified \<open>ego_other.p t = 0\<close>,
        OF \<open>0 < t\<close> \<open>t < other.t_stop\<close> \<open>0 < ego_other.p 0\<close> \<open>0 \<le> ego_other.p other.t_stop\<close>]
[PROOF STATE]
proof (chain)
picking this:
0 < 1 / 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
show "a\<^sub>o > a\<^sub>e"
[PROOF STATE]
proof (prove)
using this:
0 < 1 / 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. a\<^sub>e < a\<^sub>o
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
a\<^sub>e < a\<^sub>o

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a\<^sub>e < a\<^sub>o

goal (3 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
have rewr: "4 * ((a\<^sub>o - a\<^sub>e) / 2) = 2 * (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * ((a\<^sub>o - a\<^sub>e) / 2) = 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
4 * ((a\<^sub>o - a\<^sub>e) / 2) = 2 * (a\<^sub>o - a\<^sub>e)

goal (3 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
from \<open>a\<^sub>o > a\<^sub>e\<close> \<open>ego_other.p t = 0\<close> ego_other.p_all_zeroes[OF D2[symmetric], of t]
[PROOF STATE]
proof (chain)
picking this:
a\<^sub>e < a\<^sub>o
ego_other.p t = 0
(ego_other.p t = 0) = (a\<^sub>o - a\<^sub>e \<noteq> 0 \<and> 0 \<le> (v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e) \<and> (t = (- (v\<^sub>o - v\<^sub>e) + sqrt ((v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e))) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt ((v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e))) / (a\<^sub>o - a\<^sub>e)) \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e = 0 \<and> s\<^sub>o - s\<^sub>e = 0 \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e \<noteq> 0 \<and> t = - (s\<^sub>o - s\<^sub>e) / (v\<^sub>o - v\<^sub>e))
[PROOF STEP]
have "0 \<le> D2" and disj: "(t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e))"
[PROOF STATE]
proof (prove)
using this:
a\<^sub>e < a\<^sub>o
ego_other.p t = 0
(ego_other.p t = 0) = (a\<^sub>o - a\<^sub>e \<noteq> 0 \<and> 0 \<le> (v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e) \<and> (t = (- (v\<^sub>o - v\<^sub>e) + sqrt ((v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e))) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt ((v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e))) / (a\<^sub>o - a\<^sub>e)) \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e = 0 \<and> s\<^sub>o - s\<^sub>e = 0 \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e \<noteq> 0 \<and> t = - (s\<^sub>o - s\<^sub>e) / (v\<^sub>o - v\<^sub>e))

goal (1 subgoal):
 1. 0 \<le> D2 &&& t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
using hyps assms
[PROOF STATE]
proof (prove)
using this:
a\<^sub>e < a\<^sub>o
ego_other.p t = 0
(ego_other.p t = 0) = (a\<^sub>o - a\<^sub>e \<noteq> 0 \<and> 0 \<le> (v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e) \<and> (t = (- (v\<^sub>o - v\<^sub>e) + sqrt ((v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e))) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt ((v\<^sub>o - v\<^sub>e)\<^sup>2 - 4 * ((a\<^sub>o - a\<^sub>e) / 2) * (s\<^sub>o - s\<^sub>e))) / (a\<^sub>o - a\<^sub>e)) \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e = 0 \<and> s\<^sub>o - s\<^sub>e = 0 \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e \<noteq> 0 \<and> t = - (s\<^sub>o - s\<^sub>e) / (v\<^sub>o - v\<^sub>e))
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o
s\<^sub>o \<le> ego.s_stop
ego.s_stop < other.s_stop

goal (1 subgoal):
 1. 0 \<le> D2 &&& t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
unfolding rewr
[PROOF STATE]
proof (prove)
using this:
a\<^sub>e < a\<^sub>o
ego_other.p t = 0
(ego_other.p t = 0) = (a\<^sub>o - a\<^sub>e \<noteq> 0 \<and> 0 \<le> D2 \<and> (t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)) \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e = 0 \<and> s\<^sub>o - s\<^sub>e = 0 \<or> a\<^sub>o - a\<^sub>e = 0 \<and> v\<^sub>o - v\<^sub>e \<noteq> 0 \<and> t = - (s\<^sub>o - s\<^sub>e) / (v\<^sub>o - v\<^sub>e))
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o
s\<^sub>o \<le> ego.s_stop
ego.s_stop < other.s_stop

goal (1 subgoal):
 1. 0 \<le> D2 &&& t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
0 \<le> D2
t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (3 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> 0 \<le> D2
 3. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
show "0 \<le> D2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> D2
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
0 \<le> D2

goal (2 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
from add_strict_mono[OF \<open>t < - (v\<^sub>e / a\<^sub>e)\<close> \<open>t < - (v\<^sub>o / a\<^sub>o)\<close>] \<open>0 < t\<close> \<open>a\<^sub>o > a\<^sub>e\<close>
[PROOF STATE]
proof (chain)
picking this:
t + t < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)
0 < t
a\<^sub>e < a\<^sub>o
[PROOF STEP]
have "0 < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)"
[PROOF STATE]
proof (prove)
using this:
t + t < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)
0 < t
a\<^sub>e < a\<^sub>o

goal (1 subgoal):
 1. 0 < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
0 < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)

goal (2 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)
[PROOF STEP]
have "0 > v\<^sub>e * a\<^sub>o + a\<^sub>e * v\<^sub>o"
[PROOF STATE]
proof (prove)
using this:
0 < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)

goal (1 subgoal):
 1. v\<^sub>e * a\<^sub>o + a\<^sub>e * v\<^sub>o < 0
[PROOF STEP]
using hyps
[PROOF STATE]
proof (prove)
using this:
0 < - (v\<^sub>e / a\<^sub>e) + - (v\<^sub>o / a\<^sub>o)
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o

goal (1 subgoal):
 1. v\<^sub>e * a\<^sub>o + a\<^sub>e * v\<^sub>o < 0
[PROOF STEP]
by (simp add: field_split_simps split: if_splits)
[PROOF STATE]
proof (state)
this:
v\<^sub>e * a\<^sub>o + a\<^sub>e * v\<^sub>o < 0

goal (2 subgoals):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>o < v\<^sub>e
 2. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
show "v\<^sub>o < v\<^sub>e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v\<^sub>o < v\<^sub>e
[PROOF STEP]
using \<open>a\<^sub>e < a\<^sub>o\<close> \<open>movement.p (a\<^sub>o - a\<^sub>e) (v\<^sub>o - v\<^sub>e) (s\<^sub>o - s\<^sub>e) t = 0\<close> in_front  t(2)
[PROOF STATE]
proof (prove)
using this:
a\<^sub>e < a\<^sub>o
ego_other.p t = 0
s\<^sub>e < s\<^sub>o
0 < t

goal (1 subgoal):
 1. v\<^sub>o < v\<^sub>e
[PROOF STEP]
apply (auto simp: movement.p_def divide_less_0_iff algebra_simps power2_eq_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a\<^sub>e < a\<^sub>o; s\<^sub>o + (t * v\<^sub>o + (a\<^sub>o * (t * t) - a\<^sub>e * (t * t)) / 2) = s\<^sub>e + t * v\<^sub>e; s\<^sub>e < s\<^sub>o; 0 < t\<rbrakk> \<Longrightarrow> v\<^sub>o < v\<^sub>e
[PROOF STEP]
by (smt divide_less_0_iff mult_le_cancel_right mult_mono mult_nonneg_nonneg nonneg_vel_ego)
[PROOF STATE]
proof (state)
this:
v\<^sub>o < v\<^sub>e

goal (1 subgoal):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
from disj
[PROOF STATE]
proof (chain)
picking this:
t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
have "x2 < ?min"
[PROOF STATE]
proof (prove)
using this:
t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<or> t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. x2 < min ego.t_stop other.t_stop
[PROOF STEP]
proof rule
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
 2. t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
assume "t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (state)
this:
t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (2 subgoals):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
 2. t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. x2 < min ego.t_stop other.t_stop
[PROOF STEP]
using \<open>t < ?min\<close>
[PROOF STATE]
proof (prove)
using this:
t = (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e)
t < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. x2 < min ego.t_stop other.t_stop
[PROOF STEP]
by (simp add: x2)
[PROOF STATE]
proof (state)
this:
x2 < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
assume "t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (state)
this:
t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
have "\<dots> \<ge> x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 \<le> (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
unfolding x2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (v\<^sub>o - v\<^sub>e) - sqrt D2) / (a\<^sub>o - a\<^sub>e) \<le> (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
apply (rule divide_right_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - (v\<^sub>o - v\<^sub>e) - sqrt D2 \<le> - (v\<^sub>o - v\<^sub>e) + sqrt D2
 2. 0 \<le> a\<^sub>o - a\<^sub>e
[PROOF STEP]
apply (subst (2) diff_conv_add_uminus)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - (v\<^sub>o - v\<^sub>e) + - sqrt D2 \<le> - (v\<^sub>o - v\<^sub>e) + sqrt D2
 2. 0 \<le> a\<^sub>o - a\<^sub>e
[PROOF STEP]
apply (rule add_left_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - sqrt D2 \<le> sqrt D2
 2. 0 \<le> a\<^sub>o - a\<^sub>e
[PROOF STEP]
using \<open>a\<^sub>o > a\<^sub>e\<close> \<open>D2 \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a\<^sub>e < a\<^sub>o
0 \<le> D2

goal (2 subgoals):
 1. - sqrt D2 \<le> sqrt D2
 2. 0 \<le> a\<^sub>o - a\<^sub>e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x2 \<le> (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
also (xtrans)
[PROOF STATE]
proof (state)
this:
x2 \<le> (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
note \<open>t < ?min\<close>
[PROOF STATE]
proof (state)
this:
t < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. t = (- (v\<^sub>o - v\<^sub>e) + sqrt D2) / (a\<^sub>o - a\<^sub>e) \<Longrightarrow> x2 < min ego.t_stop other.t_stop
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x2 < min ego.t_stop other.t_stop
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x2 < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. x2 < min ego.t_stop other.t_stop
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x2 < min ego.t_stop other.t_stop

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x2 < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. collision {0<..<min ego.t_stop other.t_stop} \<Longrightarrow> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x2 < min ego.t_stop other.t_stop
[PROOF STEP]
show "sqrt D2 > v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o"
[PROOF STATE]
proof (prove)
using this:
x2 < min ego.t_stop other.t_stop

goal (1 subgoal):
 1. v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
using hyps \<open>a\<^sub>o > a\<^sub>e\<close>
[PROOF STATE]
proof (prove)
using this:
x2 < min ego.t_stop other.t_stop
0 \<le> v\<^sub>e
0 \<le> v\<^sub>o
a\<^sub>e < 0
a\<^sub>o < 0
s\<^sub>e < s\<^sub>o
0 < v\<^sub>o
a\<^sub>e < a\<^sub>o

goal (1 subgoal):
 1. v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2
[PROOF STEP]
by (auto simp: x2 field_split_simps other.t_stop_def)
[PROOF STATE]
proof (state)
this:
v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
collision {0<..<min ego.t_stop other.t_stop} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)

goal (1 subgoal):
 1. collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
collision {0..} = (a\<^sub>e < a\<^sub>o \<and> v\<^sub>o < v\<^sub>e \<and> 0 \<le> D2 \<and> v\<^sub>e - a\<^sub>e / a\<^sub>o * v\<^sub>o < sqrt D2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma replicate_upd_inj: "\<lbrakk>q < n; (replicate n False)[q:=True] = (replicate n False)[p:=True]\<rbrakk> \<Longrightarrow> (q = p)" (is "\<lbrakk>_ ;?lhs = ?rhs\<rbrakk> \<Longrightarrow>  _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
assume q: "q < n" and r: "?lhs = ?rhs"
[PROOF STATE]
proof (state)
this:
q < n
(replicate n False)[q := True] = (replicate n False)[p := True]

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
q < n
(replicate n False)[q := True] = (replicate n False)[p := True]

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
assume "p \<noteq> q"
[PROOF STATE]
proof (state)
this:
p \<noteq> q

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
with q
[PROOF STATE]
proof (chain)
picking this:
q < n
p \<noteq> q
[PROOF STEP]
have "?lhs ! q = True"
[PROOF STATE]
proof (prove)
using this:
q < n
p \<noteq> q

goal (1 subgoal):
 1. (replicate n False)[q := True] ! q = True
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(replicate n False)[q := True] ! q = True

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(replicate n False)[q := True] ! q = True

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
from \<open>p \<noteq> q\<close> q
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> q
q < n
[PROOF STEP]
have "?rhs ! q = False"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q
q < n

goal (1 subgoal):
 1. (replicate n False)[p := True] ! q = False
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(replicate n False)[p := True] ! q = False

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(replicate n False)[q := True] ! q = True
(replicate n False)[p := True] ! q = False
[PROOF STEP]
have "?lhs \<noteq> ?rhs"
[PROOF STATE]
proof (prove)
using this:
(replicate n False)[q := True] ! q = True
(replicate n False)[p := True] ! q = False

goal (1 subgoal):
 1. (replicate n False)[q := True] \<noteq> (replicate n False)[p := True]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(replicate n False)[q := True] \<noteq> (replicate n False)[p := True]

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
p \<noteq> q \<Longrightarrow> (replicate n False)[q := True] \<noteq> (replicate n False)[p := True]

goal (1 subgoal):
 1. \<lbrakk>q < n; (replicate n False)[q := True] = (replicate n False)[p := True]\<rbrakk> \<Longrightarrow> q = p
[PROOF STEP]
with r
[PROOF STATE]
proof (chain)
picking this:
(replicate n False)[q := True] = (replicate n False)[p := True]
p \<noteq> q \<Longrightarrow> (replicate n False)[q := True] \<noteq> (replicate n False)[p := True]
[PROOF STEP]
show "q = p"
[PROOF STATE]
proof (prove)
using this:
(replicate n False)[q := True] = (replicate n False)[p := True]
p \<noteq> q \<Longrightarrow> (replicate n False)[q := True] \<noteq> (replicate n False)[p := True]

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma locally_connected_open_connected_component:
  "locally connected S \<longleftrightarrow>
   (\<forall>t x. openin (top_of_set S) t \<and> x \<in> t
          \<longrightarrow> openin (top_of_set S) (connected_component_set t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally connected S = (\<forall>t x. openin (top_of_set S) t \<and> x \<in> t \<longrightarrow> openin (top_of_set S) (connected_component_set t x))
[PROOF STEP]
by (metis locally_connected_1 locally_connected_2 locally_connected_3)


[STATEMENT]
lemma HaddP_subst [simp]: "(HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
obtain s::name where "atom s \<sharp> (x,y,z,t,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s. atom s \<sharp> (x, y, z, t, i) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom s \<sharp> (x, y, z, t, i)

goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom s \<sharp> (x, y, z, t, i)

goal (1 subgoal):
 1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
by (auto simp: HaddP.simps [of s])
[PROOF STATE]
proof (state)
this:
(HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sign_r_pos_plus_imp:
  assumes "sign_r_pos p x" "sign_r_pos q x"
  shows "sign_r_pos (p+q) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_r_pos (p + q) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sign_r_pos p x
sign_r_pos q x

goal (1 subgoal):
 1. sign_r_pos (p + q) x
[PROOF STEP]
unfolding sign_r_pos_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right x. 0 < poly p x
\<forall>\<^sub>F x in at_right x. 0 < poly q x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right x. 0 < poly (p + q) x
[PROOF STEP]
by eventually_elim auto


[STATEMENT]
lemma real_of_nat_div: "d dvd n \<Longrightarrow> real(n div d) = real n / real d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd n \<Longrightarrow> real (n div d) = real n / real d
[PROOF STEP]
by (subst real_of_nat_div_aux) (auto simp add: dvd_eq_mod_eq_0 [symmetric])


[STATEMENT]
lemma sameDom_sym:
"sameDom inp inp' = sameDom inp' inp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sameDom inp inp' = sameDom inp' inp
[PROOF STEP]
unfolding sameDom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i. (inp i = None) = (inp' i = None)) = (\<forall>i. (inp' i = None) = (inp i = None))
[PROOF STEP]
by auto


[STATEMENT]
lemma isCont_mult [simp]: "isCont f a \<Longrightarrow> isCont g a \<Longrightarrow> isCont (\<lambda>x. f x * g x) a"
  for f g :: "'a::t2_space \<Rightarrow> 'b::real_normed_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x * g x) a
[PROOF STEP]
by (fact continuous_mult)


[STATEMENT]
lemma fds_deriv_fds_integral [simp]:
    "fds_nth f (Suc 0) = 0 \<Longrightarrow> fds_deriv (fds_integral c f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth f (Suc 0) = (0::'a) \<Longrightarrow> fds_deriv (fds_integral c f) = f
[PROOF STEP]
by (simp add: fds_deriv_def fds_integral_def fds_eq_iff)


[STATEMENT]
lemma var_list_segment_entry:
  assumes "k < j - i"
  assumes "i \<le> j"
  shows "var_list_segment i j ! k = pvar Q\<^sub>p (i + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. var_list_segment i j ! k = pvar Q\<^sub>p (i + k)
[PROOF STEP]
using assms var_list_segment_length
[PROOF STATE]
proof (prove)
using this:
k < j - i
i \<le> j
?i \<le> ?j \<Longrightarrow> length (var_list_segment ?i ?j) = ?j - ?i

goal (1 subgoal):
 1. var_list_segment i j ! k = pvar Q\<^sub>p (i + k)
[PROOF STEP]
unfolding var_list_segment_def
[PROOF STATE]
proof (prove)
using this:
k < j - i
i \<le> j
?i \<le> ?j \<Longrightarrow> length (map (pvar Q\<^sub>p) [?i..<?j]) = ?j - ?i

goal (1 subgoal):
 1. map (pvar Q\<^sub>p) [i..<j] ! k = pvar Q\<^sub>p (i + k)
[PROOF STEP]
using nth_map_upt
[PROOF STATE]
proof (prove)
using this:
k < j - i
i \<le> j
?i \<le> ?j \<Longrightarrow> length (map (pvar Q\<^sub>p) [?i..<?j]) = ?j - ?i
?i < ?n - ?m \<Longrightarrow> map ?f [?m..<?n] ! ?i = ?f (?m + ?i)

goal (1 subgoal):
 1. map (pvar Q\<^sub>p) [i..<j] ! k = pvar Q\<^sub>p (i + k)
[PROOF STEP]
by blast


[STATEMENT]
lemma inj_on_Prod_primes:
  assumes "\<And>P p. P \<in> A \<Longrightarrow> p \<in> P \<Longrightarrow> prime p"
  assumes "\<And>P. P \<in> A \<Longrightarrow> finite P"
  shows   "inj_on Prod A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on Prod A
[PROOF STEP]
proof (rule inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; \<Prod>x = \<Prod>y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix P Q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; \<Prod>x = \<Prod>y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume PQ: "P \<in> A" "Q \<in> A" "\<Prod>P = \<Prod>Q"
[PROOF STATE]
proof (state)
this:
P \<in> A
Q \<in> A
\<Prod>P = \<Prod>Q

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; \<Prod>x = \<Prod>y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with prime_factorization_unique'[of "mset_set P" "mset_set Q"] assms[of P] assms[of Q]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>p\<in>#mset_set P. prime p; \<forall>p\<in>#mset_set Q. prime p; (\<Prod>i\<in>#mset_set P. i) = (\<Prod>i\<in>#mset_set Q. i)\<rbrakk> \<Longrightarrow> mset_set P = mset_set Q
\<lbrakk>P \<in> A; ?p1 \<in> P\<rbrakk> \<Longrightarrow> prime ?p1
P \<in> A \<Longrightarrow> finite P
\<lbrakk>Q \<in> A; ?p1 \<in> Q\<rbrakk> \<Longrightarrow> prime ?p1
Q \<in> A \<Longrightarrow> finite Q
P \<in> A
Q \<in> A
\<Prod>P = \<Prod>Q
[PROOF STEP]
have "mset_set P = mset_set Q"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>p\<in>#mset_set P. prime p; \<forall>p\<in>#mset_set Q. prime p; (\<Prod>i\<in>#mset_set P. i) = (\<Prod>i\<in>#mset_set Q. i)\<rbrakk> \<Longrightarrow> mset_set P = mset_set Q
\<lbrakk>P \<in> A; ?p1 \<in> P\<rbrakk> \<Longrightarrow> prime ?p1
P \<in> A \<Longrightarrow> finite P
\<lbrakk>Q \<in> A; ?p1 \<in> Q\<rbrakk> \<Longrightarrow> prime ?p1
Q \<in> A \<Longrightarrow> finite Q
P \<in> A
Q \<in> A
\<Prod>P = \<Prod>Q

goal (1 subgoal):
 1. mset_set P = mset_set Q
[PROOF STEP]
by (auto simp: prod_unfold_prod_mset)
[PROOF STATE]
proof (state)
this:
mset_set P = mset_set Q

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> A; y \<in> A; \<Prod>x = \<Prod>y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
with assms[of P] assms[of Q] PQ
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>P \<in> A; ?p1 \<in> P\<rbrakk> \<Longrightarrow> prime ?p1
P \<in> A \<Longrightarrow> finite P
\<lbrakk>Q \<in> A; ?p1 \<in> Q\<rbrakk> \<Longrightarrow> prime ?p1
Q \<in> A \<Longrightarrow> finite Q
P \<in> A
Q \<in> A
\<Prod>P = \<Prod>Q
mset_set P = mset_set Q
[PROOF STEP]
show "P = Q"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>P \<in> A; ?p1 \<in> P\<rbrakk> \<Longrightarrow> prime ?p1
P \<in> A \<Longrightarrow> finite P
\<lbrakk>Q \<in> A; ?p1 \<in> Q\<rbrakk> \<Longrightarrow> prime ?p1
Q \<in> A \<Longrightarrow> finite Q
P \<in> A
Q \<in> A
\<Prod>P = \<Prod>Q
mset_set P = mset_set Q

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma epi_compose_rev:
   "\<lbrakk>f \<in> hom G H; g \<in> hom H K; (g \<circ> f) \<in> epi G K\<rbrakk> \<Longrightarrow> g \<in> epi H K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> hom G H; g \<in> hom H K; g \<circ> f \<in> epi G K\<rbrakk> \<Longrightarrow> g \<in> epi H K
[PROOF STEP]
by (fastforce simp: epi_def hom_def Pi_iff image_def set_eq_iff)


[STATEMENT]
lemma strict_mono_leD: "strict_mono r \<Longrightarrow> m \<le> n \<Longrightarrow> r m \<le> r n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>strict_mono r; m \<le> n\<rbrakk> \<Longrightarrow> r m \<le> r n
[PROOF STEP]
by (erule (1) monoD [OF strict_mono_mono])


[STATEMENT]
lemma psi_inner_psi'_l:
  "inner_prod \<psi> (psi'_l l) = (alpha_l l * ccos (\<theta> / 2) - beta_l l * csin (\<theta> / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
have "inner_prod \<psi> (psi'_l l) = inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
unfolding psi'_l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha> - beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
apply (subst inner_prod_minus_distrib_right[of _ N])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<psi> \<in> carrier_vec N
 2. alpha_l l \<cdot>\<^sub>v \<alpha> \<in> carrier_vec N
 3. beta_l l \<cdot>\<^sub>v \<beta> \<in> carrier_vec N
 4. inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>) = inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod \<psi> (psi'_l l) = inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>)

goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod \<psi> (psi'_l l) = inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>)

goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
have "\<dots> = alpha_l l * (inner_prod \<psi> \<alpha>) - beta_l l * (inner_prod \<psi> \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>) = alpha_l l * inner_prod \<psi> \<alpha> - beta_l l * inner_prod \<psi> \<beta>
[PROOF STEP]
using \<psi>_dim \<alpha>_dim \<beta>_dim
[PROOF STATE]
proof (prove)
using this:
\<psi> \<in> carrier_vec N
dim_vec \<psi> = N
\<alpha> \<in> carrier_vec N
dim_vec \<alpha> = N
\<beta> \<in> carrier_vec N
dim_vec \<beta> = N

goal (1 subgoal):
 1. inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>) = alpha_l l * inner_prod \<psi> \<alpha> - beta_l l * inner_prod \<psi> \<beta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>) = alpha_l l * inner_prod \<psi> \<alpha> - beta_l l * inner_prod \<psi> \<beta>

goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod \<psi> (alpha_l l \<cdot>\<^sub>v \<alpha>) - inner_prod \<psi> (beta_l l \<cdot>\<^sub>v \<beta>) = alpha_l l * inner_prod \<psi> \<alpha> - beta_l l * inner_prod \<psi> \<beta>

goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
have "\<dots> = alpha_l l * (ccos (\<theta> / 2)) - beta_l l * (csin (\<theta> / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alpha_l l * inner_prod \<psi> \<alpha> - beta_l l * inner_prod \<psi> \<beta> = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
using psi_inner_alpha psi_inner_beta
[PROOF STATE]
proof (prove)
using this:
inner_prod \<psi> \<alpha> = complex_of_real (cos (\<theta> / 2))
inner_prod \<psi> \<beta> = complex_of_real (sin (\<theta> / 2))

goal (1 subgoal):
 1. alpha_l l * inner_prod \<psi> \<alpha> - beta_l l * inner_prod \<psi> \<beta> = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
alpha_l l * inner_prod \<psi> \<alpha> - beta_l l * inner_prod \<psi> \<beta> = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))

goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))

goal (1 subgoal):
 1. inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod \<psi> (psi'_l l) = alpha_l l * complex_of_real (cos (\<theta> / 2)) - beta_l l * complex_of_real (sin (\<theta> / 2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma primitive_part_idemp[simp]:
  fixes f :: "'a :: {semiring_gcd,normalization_semidom_multiplicative} poly"
  shows "primitive_part (primitive_part f) = primitive_part f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primitive_part (primitive_part f) = primitive_part f
[PROOF STEP]
by (metis content_primitive_part[of f] primitive_part_eq_0_iff primitive_part_prim)