[STATEMENT]
lemma binary_chinese_remainder_unique_nat:
  fixes m1 m2 :: nat
  assumes a: "coprime m1 m2"
    and nz: "m1 \<noteq> 0" "m2 \<noteq> 0"
  shows "\<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
obtain y where y1: "[y = u1] (mod m1)" and y2: "[y = u2] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. \<lbrakk>[y = u1] (mod m1); [y = u2] (mod m2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using binary_chinese_remainder_nat [OF a]
[PROOF STATE]
proof (prove)
using this:
\<exists>x. [x = ?u1.0] (mod m1) \<and> [x = ?u2.0] (mod m2)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>[y = u1] (mod m1); [y = u2] (mod m2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[y = u1] (mod m1)
[y = u2] (mod m2)

goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
let ?x = "y mod (m1 * m2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
from nz
[PROOF STATE]
proof (chain)
picking this:
m1 \<noteq> 0
m2 \<noteq> 0
[PROOF STEP]
have less: "?x < m1 * m2"
[PROOF STATE]
proof (prove)
using this:
m1 \<noteq> 0
m2 \<noteq> 0

goal (1 subgoal):
 1. y mod (m1 * m2) < m1 * m2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y mod (m1 * m2) < m1 * m2

goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
have 1: "[?x = u1] (mod m1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y mod (m1 * m2) = u1] (mod m1)
[PROOF STEP]
using y1 mod_mult_cong_right
[PROOF STATE]
proof (prove)
using this:
[y = u1] (mod m1)
[?c mod (?a * ?b) = ?d] (mod ?a) = [?c = ?d] (mod ?a)

goal (1 subgoal):
 1. [y mod (m1 * m2) = u1] (mod m1)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[y mod (m1 * m2) = u1] (mod m1)

goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
have 2: "[?x = u2] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y mod (m1 * m2) = u2] (mod m2)
[PROOF STEP]
using y2 mod_mult_cong_left
[PROOF STATE]
proof (prove)
using this:
[y = u2] (mod m2)
[?c mod (?b * ?a) = ?d] (mod ?a) = [?c = ?d] (mod ?a)

goal (1 subgoal):
 1. [y mod (m1 * m2) = u2] (mod m2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[y mod (m1 * m2) = u2] (mod m2)

goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
have "z = ?x" if "z < m1 * m2" "[z = u1] (mod m1)"  "[z = u2] (mod m2)" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z = y mod (m1 * m2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z = y mod (m1 * m2)
[PROOF STEP]
have "[?x = z] (mod m1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y mod (m1 * m2) = z] (mod m1)
[PROOF STEP]
by (metis "1" cong_def that(2))
[PROOF STATE]
proof (state)
this:
[y mod (m1 * m2) = z] (mod m1)

goal (1 subgoal):
 1. z = y mod (m1 * m2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[y mod (m1 * m2) = z] (mod m1)

goal (1 subgoal):
 1. z = y mod (m1 * m2)
[PROOF STEP]
have "[?x = z] (mod m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y mod (m1 * m2) = z] (mod m2)
[PROOF STEP]
by (metis "2" cong_def that(3))
[PROOF STATE]
proof (state)
this:
[y mod (m1 * m2) = z] (mod m2)

goal (1 subgoal):
 1. z = y mod (m1 * m2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[y mod (m1 * m2) = z] (mod m1)
[y mod (m1 * m2) = z] (mod m2)
[PROOF STEP]
have "[?x = z] (mod m1 * m2)"
[PROOF STATE]
proof (prove)
using this:
[y mod (m1 * m2) = z] (mod m1)
[y mod (m1 * m2) = z] (mod m2)

goal (1 subgoal):
 1. [y mod (m1 * m2) = z] (mod m1 * m2)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
[y mod (m1 * m2) = z] (mod m1)
[y mod (m1 * m2) = z] (mod m2)
coprime m1 m2

goal (1 subgoal):
 1. [y mod (m1 * m2) = z] (mod m1 * m2)
[PROOF STEP]
by (auto intro: coprime_cong_mult_nat simp add: mod_mult_cong_left mod_mult_cong_right)
[PROOF STATE]
proof (state)
this:
[y mod (m1 * m2) = z] (mod m1 * m2)

goal (1 subgoal):
 1. z = y mod (m1 * m2)
[PROOF STEP]
with \<open>z < m1 * m2\<close> \<open>?x < m1 * m2\<close>
[PROOF STATE]
proof (chain)
picking this:
z < m1 * m2
y mod (m1 * m2) < m1 * m2
[y mod (m1 * m2) = z] (mod m1 * m2)
[PROOF STEP]
show "z = ?x"
[PROOF STATE]
proof (prove)
using this:
z < m1 * m2
y mod (m1 * m2) < m1 * m2
[y mod (m1 * m2) = z] (mod m1 * m2)

goal (1 subgoal):
 1. z = y mod (m1 * m2)
[PROOF STEP]
by (auto simp add: cong_def)
[PROOF STATE]
proof (state)
this:
z = y mod (m1 * m2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z < m1 * m2; [?z = u1] (mod m1); [?z = u2] (mod m2)\<rbrakk> \<Longrightarrow> ?z = y mod (m1 * m2)

goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
with less 1 2
[PROOF STATE]
proof (chain)
picking this:
y mod (m1 * m2) < m1 * m2
[y mod (m1 * m2) = u1] (mod m1)
[y mod (m1 * m2) = u2] (mod m2)
\<lbrakk>?z < m1 * m2; [?z = u1] (mod m1); [?z = u2] (mod m2)\<rbrakk> \<Longrightarrow> ?z = y mod (m1 * m2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y mod (m1 * m2) < m1 * m2
[y mod (m1 * m2) = u1] (mod m1)
[y mod (m1 * m2) = u2] (mod m2)
\<lbrakk>?z < m1 * m2; [?z = u1] (mod m1); [?z = u2] (mod m2)\<rbrakk> \<Longrightarrow> ?z = y mod (m1 * m2)

goal (1 subgoal):
 1. \<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>!x. x < m1 * m2 \<and> [x = u1] (mod m1) \<and> [x = u2] (mod m2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma equivalentFormulaeReflexivity:
  fixes formula :: Formula
  shows "equivalentFormulae formula formula"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalentFormulae formula formula
[PROOF STEP]
unfolding equivalentFormulae_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>valuation. model valuation formula = model valuation formula
[PROOF STEP]
by auto


[STATEMENT]
lemma open_vimage_fst: "open S \<Longrightarrow> open (fst -` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S \<Longrightarrow> open (fst -` S)
[PROOF STEP]
by (simp add: fst_vimage_eq_Times open_Times)


[STATEMENT]
lemma algebraic_imp_represents_irreducible_cf_pos:
  assumes "algebraic (x::'a::field_char_0)"
  shows "\<exists>p. p represents x \<and> irreducible p \<and> lead_coeff p > 0 \<and> primitive p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. p represents x \<and> irreducible p \<and> 0 < lead_coeff p \<and> primitive p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>p. p represents x \<and> irreducible p \<and> 0 < lead_coeff p \<and> primitive p
[PROOF STEP]
from algebraic_imp_represents_irreducible[OF assms(1)]
[PROOF STATE]
proof (chain)
picking this:
\<exists>p. p represents x \<and> irreducible p
[PROOF STEP]
obtain p where px: "p represents x" and irr: "irreducible p"
[PROOF STATE]
proof (prove)
using this:
\<exists>p. p represents x \<and> irreducible p

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p represents x; irreducible p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p represents x
irreducible p

goal (1 subgoal):
 1. \<exists>p. p represents x \<and> irreducible p \<and> 0 < lead_coeff p \<and> primitive p
[PROOF STEP]
let ?p = "cf_pos_poly p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>p. p represents x \<and> irreducible p \<and> 0 < lead_coeff p \<and> primitive p
[PROOF STEP]
from px irr represents_imp_degree
[PROOF STATE]
proof (chain)
picking this:
p represents x
irreducible p
?p represents ?x \<Longrightarrow> degree ?p \<noteq> 0
[PROOF STEP]
have 1: "?p represents x" and 2: "irreducible ?p" and 3: "cf_pos ?p"
[PROOF STATE]
proof (prove)
using this:
p represents x
irreducible p
?p represents ?x \<Longrightarrow> degree ?p \<noteq> 0

goal (1 subgoal):
 1. cf_pos_poly p represents x &&& irreducible (cf_pos_poly p) &&& cf_pos (cf_pos_poly p)
[PROOF STEP]
by (auto intro: irreducible_cf_pos_poly)
[PROOF STATE]
proof (state)
this:
cf_pos_poly p represents x
irreducible (cf_pos_poly p)
cf_pos (cf_pos_poly p)

goal (1 subgoal):
 1. \<exists>p. p represents x \<and> irreducible p \<and> 0 < lead_coeff p \<and> primitive p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cf_pos_poly p represents x
irreducible (cf_pos_poly p)
cf_pos (cf_pos_poly p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cf_pos_poly p represents x
irreducible (cf_pos_poly p)
cf_pos (cf_pos_poly p)

goal (1 subgoal):
 1. \<exists>p. p represents x \<and> irreducible p \<and> 0 < lead_coeff p \<and> primitive p
[PROOF STEP]
by (auto intro: exI[of _ ?p] simp: cf_pos_def)
[PROOF STATE]
proof (state)
this:
\<exists>p. p represents x \<and> irreducible p \<and> 0 < lead_coeff p \<and> primitive p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_before_rel_on_elems: "list_before_rel l \<subseteq> set l \<times> set l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_before_rel l \<subseteq> set l \<times> set l
[PROOF STEP]
unfolding list_before_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(a, b). \<exists>l1 l2 l3. l = l1 @ a # l2 @ b # l3} \<subseteq> set l \<times> set l
[PROOF STEP]
by auto


[STATEMENT]
lemma pt_all_eqvt:
  fixes  pi :: "'x prm"
  and     x :: "'a"
  assumes pt: "pt TYPE('a) TYPE('x)"
  and     at: "at TYPE('x)"
  shows "pi\<bullet>(\<forall>(x::'a). P x) = (\<forall>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi \<bullet> (\<forall>x. P x) = (\<forall>x. pi \<bullet> P (rev pi \<bullet> x))
[PROOF STEP]
apply(auto simp add: perm_bool perm_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<forall>x. P (rev pi \<bullet> x) \<Longrightarrow> P x
[PROOF STEP]
apply(drule_tac x="pi\<bullet>x" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. P (rev pi \<bullet> pi \<bullet> x) \<Longrightarrow> P x
[PROOF STEP]
apply(simp add: pt_rev_pi[OF pt, OF at])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma max_node_is_Max_V: " E =  set la \<Longrightarrow> max_node la = Max (insert 0 V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E = set la \<Longrightarrow> max_node la = Max (insert 0 (fst ` E \<union> (snd \<circ> snd) ` E))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. E = set la \<Longrightarrow> max_node la = Max (insert 0 (fst ` E \<union> (snd \<circ> snd) ` E))
[PROOF STEP]
assume E: "E =  set la"
[PROOF STATE]
proof (state)
this:
E = set la

goal (1 subgoal):
 1. E = set la \<Longrightarrow> max_node la = Max (insert 0 (fst ` E \<union> (snd \<circ> snd) ` E))
[PROOF STEP]
have *: "fst ` set la \<union> (snd \<circ> snd) ` set la
             = (\<Union>x\<in>set la. case x of (x1, x1a, x2a) \<Rightarrow> {x1, x2a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst ` set la \<union> (snd \<circ> snd) ` set la = (\<Union>x\<in>set la. case x of (x1, x1a, x2a) \<Rightarrow> {x1, x2a})
[PROOF STEP]
by auto force
[PROOF STATE]
proof (state)
this:
fst ` set la \<union> (snd \<circ> snd) ` set la = (\<Union>x\<in>set la. case x of (x1, x1a, x2a) \<Rightarrow> {x1, x2a})

goal (1 subgoal):
 1. E = set la \<Longrightarrow> max_node la = Max (insert 0 (fst ` E \<union> (snd \<circ> snd) ` E))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_node la = Max (insert 0 (fst ` E \<union> (snd \<circ> snd) ` E))
[PROOF STEP]
unfolding E
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_node la = Max (insert 0 (fst ` set la \<union> (snd \<circ> snd) ` set la))
[PROOF STEP]
by (auto simp add:    max_node_def prod.case_distrib * )
[PROOF STATE]
proof (state)
this:
max_node la = Max (insert 0 (fst ` E \<union> (snd \<circ> snd) ` E))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_keys_mult_vecE:
  assumes "w \<in> keys (p ** q)"
  obtains u v where "u \<in> keys p" and "v \<in> keys q" and "component_of_term u = component_of_term v"
    and "w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
w \<in> keys (p ** q)
[PROOF STEP]
have "0 \<noteq> lookup (p ** q) w"
[PROOF STATE]
proof (prove)
using this:
w \<in> keys (p ** q)

goal (1 subgoal):
 1. (0::'b) \<noteq> lookup (p ** q) w
[PROOF STEP]
by (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
(0::'b) \<noteq> lookup (p ** q) w

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'b) \<noteq> lookup (p ** q) w

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "lookup (p ** q) w =
      lookup ((proj_poly (component_of_term w) p) * (proj_poly (component_of_term w) q)) (pp_of_term w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (p ** q) w = lookup (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q) (pp_of_term w)
[PROOF STEP]
by (fact lookup_mult_vec)
[PROOF STATE]
proof (state)
this:
lookup (p ** q) w = lookup (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q) (pp_of_term w)

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'b) \<noteq> lookup (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q) (pp_of_term w)
[PROOF STEP]
have "pp_of_term w \<in> keys ((proj_poly (component_of_term w) p) * (proj_poly (component_of_term w) q))"
[PROOF STATE]
proof (prove)
using this:
(0::'b) \<noteq> lookup (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q) (pp_of_term w)

goal (1 subgoal):
 1. pp_of_term w \<in> keys (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q)
[PROOF STEP]
by (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
pp_of_term w \<in> keys (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q)

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from this keys_mult
[PROOF STATE]
proof (chain)
picking this:
pp_of_term w \<in> keys (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q)
keys (?f * ?g) \<subseteq> {a + b |a b. a \<in> keys ?f \<and> b \<in> keys ?g}
[PROOF STEP]
have "pp_of_term w \<in> {t + s |t s. t \<in> keys (proj_poly (component_of_term w) p) \<and>
                                   s \<in> keys (proj_poly (component_of_term w) q)}"
[PROOF STATE]
proof (prove)
using this:
pp_of_term w \<in> keys (proj_poly (component_of_term w) p * proj_poly (component_of_term w) q)
keys (?f * ?g) \<subseteq> {a + b |a b. a \<in> keys ?f \<and> b \<in> keys ?g}

goal (1 subgoal):
 1. pp_of_term w \<in> {t + s |t s. t \<in> keys (proj_poly (component_of_term w) p) \<and> s \<in> keys (proj_poly (component_of_term w) q)}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
pp_of_term w \<in> {t + s |t s. t \<in> keys (proj_poly (component_of_term w) p) \<and> s \<in> keys (proj_poly (component_of_term w) q)}

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pp_of_term w \<in> {t + s |t s. t \<in> keys (proj_poly (component_of_term w) p) \<and> s \<in> keys (proj_poly (component_of_term w) q)}
[PROOF STEP]
obtain t s where 1: "t \<in> keys (proj_poly (component_of_term w) p)"
    and 2: "s \<in> keys (proj_poly (component_of_term w) q)"
    and eq: "pp_of_term w = t + s"
[PROOF STATE]
proof (prove)
using this:
pp_of_term w \<in> {t + s |t s. t \<in> keys (proj_poly (component_of_term w) p) \<and> s \<in> keys (proj_poly (component_of_term w) q)}

goal (1 subgoal):
 1. (\<And>t s. \<lbrakk>t \<in> keys (proj_poly (component_of_term w) p); s \<in> keys (proj_poly (component_of_term w) q); pp_of_term w = t + s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
t \<in> keys (proj_poly (component_of_term w) p)
s \<in> keys (proj_poly (component_of_term w) q)
pp_of_term w = t + s

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?u = "term_of_pair (t, component_of_term w)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?v = "term_of_pair (s, component_of_term w)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
t \<in> keys (proj_poly (component_of_term w) p)
[PROOF STEP]
have "?u \<in> keys p"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys (proj_poly (component_of_term w) p)

goal (1 subgoal):
 1. term_of_pair (t, component_of_term w) \<in> keys p
[PROOF STEP]
by (simp only: in_keys_iff lookup_proj_poly not_False_eq_True)
[PROOF STATE]
proof (state)
this:
term_of_pair (t, component_of_term w) \<in> keys p

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
term_of_pair (t, component_of_term w) \<in> keys p

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from 2
[PROOF STATE]
proof (chain)
picking this:
s \<in> keys (proj_poly (component_of_term w) q)
[PROOF STEP]
have "?v \<in> keys q"
[PROOF STATE]
proof (prove)
using this:
s \<in> keys (proj_poly (component_of_term w) q)

goal (1 subgoal):
 1. term_of_pair (s, component_of_term w) \<in> keys q
[PROOF STEP]
by (simp only: in_keys_iff lookup_proj_poly not_False_eq_True)
[PROOF STATE]
proof (state)
this:
term_of_pair (s, component_of_term w) \<in> keys q

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
term_of_pair (s, component_of_term w) \<in> keys q

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "component_of_term ?u = component_of_term ?v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. component_of_term (term_of_pair (t, component_of_term w)) = component_of_term (term_of_pair (s, component_of_term w))
[PROOF STEP]
by (simp add: term_simps)
[PROOF STATE]
proof (state)
this:
component_of_term (term_of_pair (t, component_of_term w)) = component_of_term (term_of_pair (s, component_of_term w))

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
component_of_term (term_of_pair (t, component_of_term w)) = component_of_term (term_of_pair (s, component_of_term w))

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "w = term_of_pair (pp_of_term ?u + pp_of_term ?v, component_of_term ?u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w = term_of_pair (pp_of_term (term_of_pair (t, component_of_term w)) + pp_of_term (term_of_pair (s, component_of_term w)), component_of_term (term_of_pair (t, component_of_term w)))
[PROOF STEP]
by (simp add: eq[symmetric] term_simps)
[PROOF STATE]
proof (state)
this:
w = term_of_pair (pp_of_term (term_of_pair (t, component_of_term w)) + pp_of_term (term_of_pair (s, component_of_term w)), component_of_term (term_of_pair (t, component_of_term w)))

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; component_of_term u = component_of_term v; w = term_of_pair (pp_of_term u + pp_of_term v, component_of_term u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
term_of_pair (t, component_of_term w) \<in> keys p
term_of_pair (s, component_of_term w) \<in> keys q
component_of_term (term_of_pair (t, component_of_term w)) = component_of_term (term_of_pair (s, component_of_term w))
w = term_of_pair (pp_of_term (term_of_pair (t, component_of_term w)) + pp_of_term (term_of_pair (s, component_of_term w)), component_of_term (term_of_pair (t, component_of_term w)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
term_of_pair (t, component_of_term w) \<in> keys p
term_of_pair (s, component_of_term w) \<in> keys q
component_of_term (term_of_pair (t, component_of_term w)) = component_of_term (term_of_pair (s, component_of_term w))
w = term_of_pair (pp_of_term (term_of_pair (t, component_of_term w)) + pp_of_term (term_of_pair (s, component_of_term w)), component_of_term (term_of_pair (t, component_of_term w)))

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_parallelI2: "\<lbrakk> a = b; as \<parallel> bs \<rbrakk> \<Longrightarrow> a # as \<parallel> b # bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a = b; as \<parallel> bs\<rbrakk> \<Longrightarrow> a # as \<parallel> b # bs
[PROOF STEP]
by (metis Cons_prefix_Cons parallelE parallelI)


[STATEMENT]
lemma proots_count_monom:
  assumes "0 \<notin> A"
  shows "proots_count (monom 1 d) A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (monom (1::'a) d) A = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<notin> A

goal (1 subgoal):
 1. proots_count (monom (1::'a) d) A = 0
[PROOF STEP]
by (auto simp: proots_count_def poly_monom)


[STATEMENT]
lemma mirror_card_eq[simp]: "sel_symm f \<Longrightarrow> card cf f (mirror t) = card cf f t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t) = JoinTree.card cf f t
[PROOF STEP]
proof(induction t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
case (Join l r)
[PROOF STATE]
proof (state)
this:
sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror l) = JoinTree.card cf f l
sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror r) = JoinTree.card cf f r
sel_symm f

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
let ?r = "mirror r" and ?l = "mirror l"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
have 0: "mset (inorder ?r) = mset (inorder r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (inorder (mirror r)) = mset (inorder r)
[PROOF STEP]
by (simp add: inorder_eq_mset)
[PROOF STATE]
proof (state)
this:
mset (inorder (mirror r)) = mset (inorder r)

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
have 1: "mset (inorder ?l) = mset (inorder l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (inorder (mirror l)) = mset (inorder l)
[PROOF STEP]
by (simp add: inorder_eq_mset)
[PROOF STATE]
proof (state)
this:
mset (inorder (mirror l)) = mset (inorder l)

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
have "card cf f (mirror (Join l r)) = card cf f (Join (mirror r) (mirror l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JoinTree.card cf f (mirror (Join l r)) = JoinTree.card cf f (Join (mirror r) (mirror l))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
JoinTree.card cf f (mirror (Join l r)) = JoinTree.card cf f (Join (mirror r) (mirror l))

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
JoinTree.card cf f (mirror (Join l r)) = JoinTree.card cf f (Join (mirror r) (mirror l))

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
have "\<dots> = list_sel f (inorder ?r) (inorder ?l) * card cf f r * card cf f l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JoinTree.card cf f (Join (mirror r) (mirror l)) = list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l
[PROOF STEP]
using Join
[PROOF STATE]
proof (prove)
using this:
sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror l) = JoinTree.card cf f l
sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror r) = JoinTree.card cf f r
sel_symm f

goal (1 subgoal):
 1. JoinTree.card cf f (Join (mirror r) (mirror l)) = list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
JoinTree.card cf f (Join (mirror r) (mirror l)) = list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
JoinTree.card cf f (Join (mirror r) (mirror l)) = list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
have "\<dots> = list_sel f (inorder r) (inorder ?l) * card cf f r * card cf f l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l = list_sel f (inorder r) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l
[PROOF STEP]
using 0 mset_x_eq_list_sel_eq
[PROOF STATE]
proof (prove)
using this:
mset (inorder (mirror r)) = mset (inorder r)
mset ?x = mset ?z \<Longrightarrow> list_sel ?f ?x ?y = list_sel ?f ?z ?y

goal (1 subgoal):
 1. list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l = list_sel f (inorder r) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l = list_sel f (inorder r) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
list_sel f (inorder (mirror r)) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l = list_sel f (inorder r) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
have "\<dots> = list_sel f (inorder r) (inorder l) * card cf f r * card cf f l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_sel f (inorder r) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l = list_sel f (inorder r) (inorder l) * JoinTree.card cf f r * JoinTree.card cf f l
[PROOF STEP]
using 1 mset_y_eq_list_sel_eq
[PROOF STATE]
proof (prove)
using this:
mset (inorder (mirror l)) = mset (inorder l)
mset ?y = mset ?y' \<Longrightarrow> list_sel ?f ?x ?y = list_sel ?f ?x ?y'

goal (1 subgoal):
 1. list_sel f (inorder r) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l = list_sel f (inorder r) (inorder l) * JoinTree.card cf f r * JoinTree.card cf f l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
list_sel f (inorder r) (inorder (mirror l)) * JoinTree.card cf f r * JoinTree.card cf f l = list_sel f (inorder r) (inorder l) * JoinTree.card cf f r * JoinTree.card cf f l

goal (2 subgoals):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
 2. \<And>t1 t2. \<lbrakk>sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t1) = JoinTree.card cf f t1; sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror t2) = JoinTree.card cf f t2; sel_symm f\<rbrakk> \<Longrightarrow> JoinTree.card cf f (mirror (Join t1 t2)) = JoinTree.card cf f (Join t1 t2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
JoinTree.card cf f (mirror (Join l r)) = list_sel f (inorder r) (inorder l) * JoinTree.card cf f r * JoinTree.card cf f l
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
JoinTree.card cf f (mirror (Join l r)) = list_sel f (inorder r) (inorder l) * JoinTree.card cf f r * JoinTree.card cf f l

goal (1 subgoal):
 1. JoinTree.card cf f (mirror (Join l r)) = JoinTree.card cf f (Join l r)
[PROOF STEP]
using list_sel_symm Join.prems
[PROOF STATE]
proof (prove)
using this:
JoinTree.card cf f (mirror (Join l r)) = list_sel f (inorder r) (inorder l) * JoinTree.card cf f r * JoinTree.card cf f l
sel_symm ?f \<Longrightarrow> list_sel ?f ?x ?y = list_sel ?f ?y ?x
sel_symm f

goal (1 subgoal):
 1. JoinTree.card cf f (mirror (Join l r)) = JoinTree.card cf f (Join l r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
JoinTree.card cf f (mirror (Join l r)) = JoinTree.card cf f (Join l r)

goal (1 subgoal):
 1. \<And>x. sel_symm f \<Longrightarrow> JoinTree.card cf f (mirror (Relation x)) = JoinTree.card cf f (Relation x)
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma cadjoint_univ_prop':
  fixes G :: "'b::chilbert_space \<Rightarrow> 'a::complex_inner"
  assumes a1: \<open>bounded_clinear G\<close>
  shows \<open>x \<bullet>\<^sub>C cadjoint G y = G x \<bullet>\<^sub>C y\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet>\<^sub>C cadjoint G y = G x \<bullet>\<^sub>C y
[PROOF STEP]
by (metis cadjoint_univ_prop assms cinner_commute')


[STATEMENT]
lemma (in cring) cgenideal_eq_genideal:
  assumes icarr: "i \<in> carrier R"
  shows "PIdl i = Idl {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PIdl i = Idl {i}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. PIdl i \<subseteq> Idl {i}
 2. Idl {i} \<subseteq> PIdl i
[PROOF STEP]
show "PIdl i \<subseteq> Idl {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. PIdl i \<subseteq> Idl {i}
[PROOF STEP]
by (simp add: cgenideal_minimal genideal_ideal genideal_self' icarr)
[PROOF STATE]
proof (state)
this:
PIdl i \<subseteq> Idl {i}

goal (1 subgoal):
 1. Idl {i} \<subseteq> PIdl i
[PROOF STEP]
show "Idl {i} \<subseteq> PIdl i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Idl {i} \<subseteq> PIdl i
[PROOF STEP]
by (simp add: cgenideal_ideal cgenideal_self genideal_minimal icarr)
[PROOF STATE]
proof (state)
this:
Idl {i} \<subseteq> PIdl i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_add_S_right: "x \<le>\<^sub>\<S> y \<Longrightarrow> x \<le>\<^sub>\<S> y \<oplus> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le>\<^sub>\<S> y \<Longrightarrow> x \<le>\<^sub>\<S> y \<oplus> z
[PROOF STEP]
unfolding leq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oplus> y = y \<Longrightarrow> x \<oplus> (y \<oplus> z) = y \<oplus> z
[PROOF STEP]
by (simp add: add_assoc [symmetric])


[STATEMENT]
lemma affine_hull_halfspace_le:
  fixes a :: "'a::euclidean_space"
  shows "affine hull {x. a \<bullet> x \<le> r} = (if a = 0 \<and> r < 0 then {} else UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
 2. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = (0::'a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
 2. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = (0::'a)

goal (1 subgoal):
 1. affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
[PROOF STEP]
have "affine hull closure {x. a \<bullet> x < r} = UNIV"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. affine hull closure {x. a \<bullet> x < r} = UNIV
[PROOF STEP]
using affine_hull_halfspace_lt closure_same_affine_hull
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)
affine hull {x. ?a \<bullet> x < ?r} = (if ?a = (0::?'a) \<and> ?r \<le> 0 then {} else UNIV)
affine hull closure ?S = affine hull ?S

goal (1 subgoal):
 1. affine hull closure {x. a \<bullet> x < r} = UNIV
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
affine hull closure {x. a \<bullet> x < r} = UNIV

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
affine hull closure {x. a \<bullet> x < r} = UNIV

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
have "{x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}
[PROOF STEP]
by (simp add: Collect_mono)
[PROOF STATE]
proof (state)
this:
{x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
affine hull closure {x. a \<bullet> x < r} = UNIV
{x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
affine hull closure {x. a \<bullet> x < r} = UNIV
{x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}

goal (1 subgoal):
 1. affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
using False antisym_conv hull_mono top_greatest
[PROOF STATE]
proof (prove)
using this:
affine hull closure {x. a \<bullet> x < r} = UNIV
{x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}
a \<noteq> (0::'a)
?y \<le> ?x \<Longrightarrow> (?x \<le> ?y) = (?x = ?y)
?s \<subseteq> ?t \<Longrightarrow> ?S hull ?s \<subseteq> ?S hull ?t
?a \<le> top

goal (1 subgoal):
 1. affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)
[PROOF STEP]
by (metis affine_hull_halfspace_lt)
[PROOF STATE]
proof (state)
this:
affine hull {x. a \<bullet> x \<le> r} = (if a = (0::'a) \<and> r < 0 then {} else UNIV)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sd2_at_most_sd4:
  assumes "a\<^sub>o > a\<^sub>e"
  shows "safe_distance_2r \<le> safe_distance_4r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
have "a\<^sub>o \<noteq> 0" and "a\<^sub>e \<noteq> 0" and "a\<^sub>o - a\<^sub>e \<noteq> 0" and "0 < 2 * (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a\<^sub>o \<noteq> 0 &&& a\<^sub>e \<noteq> 0) &&& a\<^sub>o - a\<^sub>e \<noteq> 0 &&& 0 < 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
using hyps assms(1)
[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
a\<^sub>e < a\<^sub>o

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

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
have "0 \<le> (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) * (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>)"
    (is "0 \<le> (?l1 + ?l2 + ?l3) * ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) * (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) * (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>)

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 \<le> (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) * (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>)

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
have "... = v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) * (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) = v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o
[PROOF STEP]
by (auto simp add:algebra_simps power_def)
[PROOF STATE]
proof (state)
this:
(- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) * (- v\<^sub>e * a\<^sub>o + v\<^sub>o * a\<^sub>e + a\<^sub>o * a\<^sub>e * \<delta>) = v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o
[PROOF STEP]
have "0 \<le> ?rhs"
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o

goal (1 subgoal):
 1. 0 \<le> v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
hence "(- v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o) * (a\<^sub>o * a\<^sub>e) \<le> (a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e + 2 * a\<^sub>e * \<delta> * v\<^sub>o) * (a\<^sub>o * a\<^sub>e)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> v\<^sub>e\<^sup>2 * a\<^sub>o\<^sup>2 + v\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 + a\<^sub>o\<^sup>2 * a\<^sub>e\<^sup>2 * \<delta>\<^sup>2 - 2 * v\<^sub>e * a\<^sub>o * v\<^sub>o * a\<^sub>e - 2 * a\<^sub>o\<^sup>2 * a\<^sub>e * \<delta> * v\<^sub>e + 2 * a\<^sub>o * a\<^sub>e\<^sup>2 * \<delta> * v\<^sub>o

goal (1 subgoal):
 1. (- v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o) * (a\<^sub>o * a\<^sub>e) \<le> (a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e + 2 * a\<^sub>e * \<delta> * v\<^sub>o) * (a\<^sub>o * a\<^sub>e)
[PROOF STEP]
by (auto simp add: algebra_simps power_def)
[PROOF STATE]
proof (state)
this:
(- v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o) * (a\<^sub>o * a\<^sub>e) \<le> (a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e + 2 * a\<^sub>e * \<delta> * v\<^sub>o) * (a\<^sub>o * a\<^sub>e)

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
hence "2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> v\<^sub>o\<^sup>2 + a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + v\<^sub>e\<^sup>2 + 2 * v\<^sub>o * \<delta> * a\<^sub>o - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (prove)
using this:
(- v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o) * (a\<^sub>o * a\<^sub>e) \<le> (a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e + 2 * a\<^sub>e * \<delta> * v\<^sub>o) * (a\<^sub>o * a\<^sub>e)

goal (1 subgoal):
 1. 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> v\<^sub>o\<^sup>2 + a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + v\<^sub>e\<^sup>2 + 2 * v\<^sub>o * \<delta> * a\<^sub>o - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by (auto simp add: ego2.decel other.decel)
[PROOF STATE]
proof (state)
this:
2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> v\<^sub>o\<^sup>2 + a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + v\<^sub>e\<^sup>2 + 2 * v\<^sub>o * \<delta> * a\<^sub>o - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
hence "2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (prove)
using this:
2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> v\<^sub>o\<^sup>2 + a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + v\<^sub>e\<^sup>2 + 2 * v\<^sub>o * \<delta> * a\<^sub>o - 2 * v\<^sub>e * v\<^sub>o - 2 * a\<^sub>o * \<delta> * v\<^sub>e - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by (auto simp add: algebra_simps power_def)
[PROOF STATE]
proof (state)
this:
2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
hence "v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * -a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * -a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)"
    (is "?lhs1 \<le> ?rhs1")
[PROOF STATE]
proof (prove)
using this:
2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 * a\<^sub>o / a\<^sub>e + v\<^sub>e\<^sup>2 + v\<^sub>o\<^sup>2 - v\<^sub>o\<^sup>2 * a\<^sub>e / a\<^sub>o \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - 2 * v\<^sub>o * \<delta> * a\<^sub>o + 2 * a\<^sub>e * \<delta> * v\<^sub>o - a\<^sub>o\<^sup>2 * \<delta>\<^sup>2 + a\<^sub>o * a\<^sub>e * \<delta>\<^sup>2 + 2 * v\<^sub>e * \<delta> * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by (simp add: \<open>a\<^sub>o \<noteq> 0\<close> \<open>a\<^sub>e \<noteq> 0\<close> power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
hence "v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 *(a\<^sub>o - a\<^sub>e)"
    (is "?lhs2 \<le> ?rhs2")
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) \<Longrightarrow> v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
assume "?lhs1 \<le> ?rhs1"
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) \<Longrightarrow> v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
have "?lhs1 = ?lhs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e = v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e = v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) \<Longrightarrow> v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e = v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) \<Longrightarrow> v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
have "?rhs1 = ?rhs2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) = (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
using \<open>a\<^sub>o - a\<^sub>e \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a\<^sub>o - a\<^sub>e \<noteq> 0

goal (1 subgoal):
 1. (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) = (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
(v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) = (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) \<Longrightarrow> v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e = v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e)
(v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) = (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e = v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e)
(v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) = (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
using \<open>?lhs1 \<le> ?rhs1\<close>
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e = v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e)
(v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) = (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>o + v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>o - v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * a\<^sub>e \<le> (v\<^sub>o + \<delta> * a\<^sub>o - v\<^sub>e)\<^sup>2 - v\<^sub>o * \<delta> * 2 * a\<^sub>o - v\<^sub>o * \<delta> * 2 * - a\<^sub>e - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * a\<^sub>o - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * - a\<^sub>e + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
hence "(v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o) * 2 * (a\<^sub>o - a\<^sub>e) \<le> ((v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1/2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>) * 2 *(a\<^sub>o - a\<^sub>e)"
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o * 2 * (a\<^sub>o - a\<^sub>e) \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) * 2 * (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> * 2 * (a\<^sub>o - a\<^sub>e) - a\<^sub>o * \<delta>\<^sup>2 / 2 * 2 * (a\<^sub>o - a\<^sub>e) + v\<^sub>e * \<delta> * 2 * (a\<^sub>o - a\<^sub>e)

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

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
hence "v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1/2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>"
[PROOF STATE]
proof (prove)
using this:
(v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o) * 2 * (a\<^sub>o - a\<^sub>e) \<le> ((v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>) * 2 * (a\<^sub>o - a\<^sub>e)

goal (1 subgoal):
 1. v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>
[PROOF STEP]
using \<open>a\<^sub>o > a\<^sub>e\<close> mult_le_cancel_iff1[OF \<open>0 < 2 * (a\<^sub>o - a\<^sub>e)\<close>, of "(v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o)"
    "(v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1/2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>"] semiring_normalization_rules(18)
[PROOF STATE]
proof (prove)
using this:
(v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o) * 2 * (a\<^sub>o - a\<^sub>e) \<le> ((v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>) * 2 * (a\<^sub>o - a\<^sub>e)
a\<^sub>e < a\<^sub>o
((v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o) * (2 * (a\<^sub>o - a\<^sub>e)) \<le> ((v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>) * (2 * (a\<^sub>o - a\<^sub>e))) = (v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>)
?lx * (?rx * ?ry) = ?lx * ?rx * ?ry

goal (1 subgoal):
 1. v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
using safe_distance_2r_def safe_distance_4r_def
[PROOF STATE]
proof (prove)
using this:
v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o \<le> (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>
safe_distance_2r = v\<^sub>e * \<delta> - v\<^sub>e\<^sup>2 / 2 / a\<^sub>e + v\<^sub>o\<^sup>2 / 2 / a\<^sub>o
safe_distance_4r = (v\<^sub>o + a\<^sub>o * \<delta> - v\<^sub>e)\<^sup>2 / 2 / (a\<^sub>o - a\<^sub>e) - v\<^sub>o * \<delta> - 1 / 2 * a\<^sub>o * \<delta>\<^sup>2 + v\<^sub>e * \<delta>

goal (1 subgoal):
 1. safe_distance_2r \<le> safe_distance_4r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
safe_distance_2r \<le> safe_distance_4r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma empty_tokens_have_charslength_0:
  "(\<And> t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0
[PROOF STEP]
proof (induct ts)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>t. t \<in> set [] \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength [] = 0
 2. \<And>a ts. \<lbrakk>(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0; \<And>t. t \<in> set (a # ts) \<Longrightarrow> chars_of_token t = []\<rbrakk> \<Longrightarrow> charslength (a # ts) = 0
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
?t \<in> set [] \<Longrightarrow> chars_of_token ?t = []

goal (2 subgoals):
 1. (\<And>t. t \<in> set [] \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength [] = 0
 2. \<And>a ts. \<lbrakk>(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0; \<And>t. t \<in> set (a # ts) \<Longrightarrow> chars_of_token t = []\<rbrakk> \<Longrightarrow> charslength (a # ts) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?t \<in> set [] \<Longrightarrow> chars_of_token ?t = []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?t \<in> set [] \<Longrightarrow> chars_of_token ?t = []

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

goal (1 subgoal):
 1. \<And>a ts. \<lbrakk>(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0; \<And>t. t \<in> set (a # ts) \<Longrightarrow> chars_of_token t = []\<rbrakk> \<Longrightarrow> charslength (a # ts) = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts. \<lbrakk>(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0; \<And>t. t \<in> set (a # ts) \<Longrightarrow> chars_of_token t = []\<rbrakk> \<Longrightarrow> charslength (a # ts) = 0
[PROOF STEP]
case (Cons t ts)
[PROOF STATE]
proof (state)
this:
(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0
?t \<in> set (t # ts) \<Longrightarrow> chars_of_token ?t = []

goal (1 subgoal):
 1. \<And>a ts. \<lbrakk>(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0; \<And>t. t \<in> set (a # ts) \<Longrightarrow> chars_of_token t = []\<rbrakk> \<Longrightarrow> charslength (a # ts) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0
?t \<in> set (t # ts) \<Longrightarrow> chars_of_token ?t = []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>t. t \<in> set ts \<Longrightarrow> chars_of_token t = []) \<Longrightarrow> charslength ts = 0
?t \<in> set (t # ts) \<Longrightarrow> chars_of_token ?t = []

goal (1 subgoal):
 1. charslength (t # ts) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
charslength (t # ts) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_as_mapping_empty :
  "set_as_mapping_image {} f = Mapping.empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_as_mapping_image {} f = Mapping.empty
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_as_mapping_image {} f = Mapping.empty
[PROOF STEP]
obtain m where "set_as_mapping_image {} f = m" and "Mapping.lookup m = set_as_map (f ` {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. \<lbrakk>set_as_mapping_image {} f = m; Mapping.lookup m = set_as_map (f ` {})\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using set_as_mapping_image_ob
[PROOF STATE]
proof (prove)
using this:
(\<And>m. \<lbrakk>set_as_mapping_image ?s ?f = m; Mapping.lookup m = set_as_map (?f ` ?s)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>set_as_mapping_image {} f = m; Mapping.lookup m = set_as_map (f ` {})\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set_as_mapping_image {} f = m
Mapping.lookup m = set_as_map (f ` {})

goal (1 subgoal):
 1. set_as_mapping_image {} f = Mapping.empty
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_as_mapping_image {} f = m
Mapping.lookup m = set_as_map (f ` {})
[PROOF STEP]
have "\<And> k . Mapping.lookup m k = None"
[PROOF STATE]
proof (prove)
using this:
set_as_mapping_image {} f = m
Mapping.lookup m = set_as_map (f ` {})

goal (1 subgoal):
 1. \<And>k. Mapping.lookup m k = None
[PROOF STEP]
unfolding set_as_map_def
[PROOF STATE]
proof (prove)
using this:
set_as_mapping_image {} f = m
Mapping.lookup m = (\<lambda>x. if \<exists>z. (x, z) \<in> f ` {} then Some {z. (x, z) \<in> f ` {}} else None)

goal (1 subgoal):
 1. \<And>k. Mapping.lookup m k = None
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Mapping.lookup m ?k = None

goal (1 subgoal):
 1. set_as_mapping_image {} f = Mapping.empty
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup m ?k = None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup m ?k = None

goal (1 subgoal):
 1. set_as_mapping_image {} f = Mapping.empty
[PROOF STEP]
unfolding \<open>set_as_mapping_image {} f = m\<close>
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup m ?k = None

goal (1 subgoal):
 1. m = Mapping.empty
[PROOF STEP]
by (simp add: mapping_eqI)
[PROOF STATE]
proof (state)
this:
set_as_mapping_image {} f = Mapping.empty

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma funpow_dist_0_eq:
  assumes "y \<in> orbit f x" shows "funpow_dist f x y = 0 \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (funpow_dist f x y = 0) = (x = y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<in> orbit f x

goal (1 subgoal):
 1. (funpow_dist f x y = 0) = (x = y)
[PROOF STEP]
by (auto simp: funpow_dist_0 dest: funpow_dist_prop)


[STATEMENT]
lemma dst_fwd_all_verts_ex: "\<exists>xs. forward xs \<and> distinct xs \<and> set xs = verts T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xs. forward xs \<and> distinct xs \<and> set xs = verts T
[PROOF STEP]
using dst_fwd_arcs_all_verts_ex forward_arcs_alt'[symmetric]
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. forward_arcs xs \<and> distinct xs \<and> set xs = verts T
forward_arcs ?xs = forward (rev ?xs)

goal (1 subgoal):
 1. \<exists>xs. forward xs \<and> distinct xs \<and> set xs = verts T
[PROOF STEP]
by auto


[STATEMENT]
lemma antisym_conv:
  assumes "y \<le>\<^sub>a x"
  shows "x \<le>\<^sub>a y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le>\<^sub>a y) = (x = y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<le>\<^sub>a x

goal (1 subgoal):
 1. (x \<le>\<^sub>a y) = (x = y)
[PROOF STEP]
by (blast intro: antisym)


[STATEMENT]
lemma comp_cont_image_spec: "continuous_on T f \<Longrightarrow> compact T \<Longrightarrow> compact {f t |t. t \<in> T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on T f; compact T\<rbrakk> \<Longrightarrow> compact {f t |t. t \<in> T}
[PROOF STEP]
using compact_continuous_image
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on ?s ?f; compact ?s\<rbrakk> \<Longrightarrow> compact (?f ` ?s)

goal (1 subgoal):
 1. \<lbrakk>continuous_on T f; compact T\<rbrakk> \<Longrightarrow> compact {f t |t. t \<in> T}
[PROOF STEP]
by (simp add: Setcompr_eq_image)


[STATEMENT]
lemma viewnres_split:
  "P (case_option f1 (case_prod f2) x) =
  ((x = None \<longrightarrow> P f1) \<and> (\<forall>a b. x = Some (a,b) \<longrightarrow> P (f2 a b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (case x of None \<Rightarrow> f1 | Some (xa, xb) \<Rightarrow> f2 xa xb) = ((x = None \<longrightarrow> P f1) \<and> (\<forall>a b. x = Some (a, b) \<longrightarrow> P (f2 a b)))
[PROOF STEP]
by (auto split: option.split prod.split)


[STATEMENT]
lemma negligible_inverse_powerI [negligible_intros]: "\<bar>k\<bar> > 1 \<Longrightarrow> negligible (\<lambda>\<eta>. 1 / k ^ \<eta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < \<bar>k\<bar> \<Longrightarrow> negligible (\<lambda>\<eta>. 1 / k ^ \<eta>)
[PROOF STEP]
using negligible_powerI[of "1 / k"]
[PROOF STATE]
proof (prove)
using this:
\<bar>1 / k\<bar> < 1 \<Longrightarrow> negligible ((^) (1 / k))

goal (1 subgoal):
 1. 1 < \<bar>k\<bar> \<Longrightarrow> negligible (\<lambda>\<eta>. 1 / k ^ \<eta>)
[PROOF STEP]
by(simp add: power_one_over)


[STATEMENT]
lemma le_imp_Di_subset:
  assumes "v \<le>\<^sub>v y"
  shows "Di i v \<subseteq> Di i y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Di i v \<subseteq> Di i y
[PROOF STEP]
using assms and le_trans
[PROOF STATE]
proof (prove)
using this:
v \<le>\<^sub>v y
\<lbrakk>?i \<le> ?j; ?j \<le> ?k\<rbrakk> \<Longrightarrow> ?i \<le> ?k

goal (1 subgoal):
 1. Di i v \<subseteq> Di i y
[PROOF STEP]
by (force simp: Di_def less_eq_def dij_def eij_def)


[STATEMENT]
lemma subset_fst_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> y \<in> B \<Longrightarrow> A \<subseteq> fst ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<times> B \<subseteq> S; y \<in> B\<rbrakk> \<Longrightarrow> A \<subseteq> fst ` S
[PROOF STEP]
unfolding image_def subset_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A \<times> B. x \<in> S; y \<in> B\<rbrakk> \<Longrightarrow> \<forall>x\<in>A. x \<in> {y. \<exists>x\<in>S. y = fst x}
[PROOF STEP]
by force


[STATEMENT]
lemma necess_cond_2_lhs: "size {# x \<in># (mset_set \<V> \<times># \<B>) . (fst x) \<in> (snd x)  #} = \<v> * \<r>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>
[PROOF STEP]
let ?M = "mset_set \<V>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>
[PROOF STEP]
have "\<And> p . p \<in># ?M \<Longrightarrow> size ({# bl \<in># \<B> . p \<in> bl #}) = \<r>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. p \<in># mset_set \<V> \<Longrightarrow> size (filter_mset ((\<in>) p) \<B>) = \<r>
[PROOF STEP]
using finite_sets rep_number_unfold_set r_gzero nat_eq_iff2
[PROOF STATE]
proof (prove)
using this:
finite \<V>
?x \<in> \<V> \<Longrightarrow> size (filter_mset ((\<in>) ?x) \<B>) = \<r>
0 < \<r>
(?m = nat ?w) = (if 0 \<le> ?w then ?w = int ?m else ?m = 0)

goal (1 subgoal):
 1. \<And>p. p \<in># mset_set \<V> \<Longrightarrow> size (filter_mset ((\<in>) p) \<B>) = \<r>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?p \<in># mset_set \<V> \<Longrightarrow> size (filter_mset ((\<in>) ?p) \<B>) = \<r>

goal (1 subgoal):
 1. size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?p \<in># mset_set \<V> \<Longrightarrow> size (filter_mset ((\<in>) ?p) \<B>) = \<r>
[PROOF STEP]
have "size (\<Sum>p\<in>#?M. ({#p#} \<times># {#bl \<in># \<B>. p \<in> bl#})) = size ?M * (\<r>)"
[PROOF STATE]
proof (prove)
using this:
?p \<in># mset_set \<V> \<Longrightarrow> size (filter_mset ((\<in>) ?p) \<B>) = \<r>

goal (1 subgoal):
 1. size (\<Sum>p\<in>#mset_set \<V>. {#p#} \<times># filter_mset ((\<in>) p) \<B>) = size (mset_set \<V>) * \<r>
[PROOF STEP]
using mset_points_distinct size_Union_distinct_cart_prod_filter
[PROOF STATE]
proof (prove)
using this:
?p \<in># mset_set \<V> \<Longrightarrow> size (filter_mset ((\<in>) ?p) \<B>) = \<r>
distinct_mset (mset_set \<V>)
\<lbrakk>distinct_mset ?M; \<And>p. p \<in># ?M \<Longrightarrow> size (filter_mset (?P p) ?B) = ?c\<rbrakk> \<Longrightarrow> size (\<Sum>p\<in>#?M. {#p#} \<times># filter_mset (?P p) ?B) = size ?M * ?c

goal (1 subgoal):
 1. size (\<Sum>p\<in>#mset_set \<V>. {#p#} \<times># filter_mset ((\<in>) p) \<B>) = size (mset_set \<V>) * \<r>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
size (\<Sum>p\<in>#mset_set \<V>. {#p#} \<times># filter_mset ((\<in>) p) \<B>) = size (mset_set \<V>) * \<r>

goal (1 subgoal):
 1. size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
size (\<Sum>p\<in>#mset_set \<V>. {#p#} \<times># filter_mset ((\<in>) p) \<B>) = size (mset_set \<V>) * \<r>

goal (1 subgoal):
 1. size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>
[PROOF STEP]
using r_gzero
[PROOF STATE]
proof (prove)
using this:
size (\<Sum>p\<in>#mset_set \<V>. {#p#} \<times># filter_mset ((\<in>) p) \<B>) = size (mset_set \<V>) * \<r>
0 < \<r>

goal (1 subgoal):
 1. size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>
[PROOF STEP]
by (simp add: set_break_down_left)
[PROOF STATE]
proof (state)
this:
size {#x \<in># mset_set \<V> \<times># \<B>. fst x \<in> snd x#} = \<v> * \<r>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma extract_subdiags_not_emp:
  fixes x::nat and l::"nat list"
  assumes "(B1, B2, B3, B4) = (split_block B x x)"
  shows "hd (extract_subdiags B (x#l)) = B1"
    "tl (extract_subdiags B (x#l)) = extract_subdiags B4 l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (extract_subdiags B (x # l)) = B1 &&& tl (extract_subdiags B (x # l)) = extract_subdiags B4 l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. hd (extract_subdiags B (x # l)) = B1
 2. tl (extract_subdiags B (x # l)) = extract_subdiags B4 l
[PROOF STEP]
show "hd (extract_subdiags B (x#l)) = B1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (extract_subdiags B (x # l)) = B1
[PROOF STEP]
unfolding  Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (extract_subdiags B (x # l)) = B1
[PROOF STEP]
by (metis (no_types) assms extract_subdiags.simps(2) list.sel(1) split_conv)
[PROOF STATE]
proof (state)
this:
hd (extract_subdiags B (x # l)) = B1

goal (1 subgoal):
 1. tl (extract_subdiags B (x # l)) = extract_subdiags B4 l
[PROOF STEP]
show "tl (extract_subdiags B (x # l)) = extract_subdiags B4 l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tl (extract_subdiags B (x # l)) = extract_subdiags B4 l
[PROOF STEP]
using assms extract_subdiags.simps(2)
[PROOF STATE]
proof (prove)
using this:
(B1, B2, B3, B4) = split_block B x x
extract_subdiags ?B (?x # ?xs) = (let (B1, B2, B3, B4) = split_block ?B ?x ?x in B1 # extract_subdiags B4 ?xs)

goal (1 subgoal):
 1. tl (extract_subdiags B (x # l)) = extract_subdiags B4 l
[PROOF STEP]
unfolding Let_def
[PROOF STATE]
proof (prove)
using this:
(B1, B2, B3, B4) = split_block B x x
extract_subdiags ?B (?x # ?xs) = (case split_block ?B ?x ?x of (B1, B2, B3, B4) \<Rightarrow> B1 # extract_subdiags B4 ?xs)

goal (1 subgoal):
 1. tl (extract_subdiags B (x # l)) = extract_subdiags B4 l
[PROOF STEP]
by (metis (no_types, lifting) list.sel(3) split_conv)
[PROOF STATE]
proof (state)
this:
tl (extract_subdiags B (x # l)) = extract_subdiags B4 l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma n_bool_lists_length: "xs \<in> set (n_bool_lists n x) \<Longrightarrow> length xs = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> set (n_bool_lists n x) \<Longrightarrow> length xs = x
[PROOF STEP]
by (induct x arbitrary: xs n) (auto split: if_splits)