[STATEMENT]
lemma set_ext [forward]: "\<forall>a. a \<in> S \<longleftrightarrow> a \<in> T \<Longrightarrow> S = T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. (a \<in> S) = (a \<in> T) \<Longrightarrow> S = T
[PROOF STEP]
by auto


[STATEMENT]
lemma hash_tree_of_zipper_same_path:
  "hash_tree h (tree_of_zipper\<^sub>m (p, v)) = hash_tree h (tree_of_zipper\<^sub>m (p, v'))
        \<longleftrightarrow> hash_tree h v = hash_tree h v'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (hash_tree h (tree_of_zipper\<^sub>m (p, v)) = hash_tree h (tree_of_zipper\<^sub>m (p, v'))) = (hash_tree h v = hash_tree h v')
[PROOF STEP]
by(induction p arbitrary: v v')(auto simp add: hash_rt_F\<^sub>m_def)


[STATEMENT]
lemma geral_U_is_expected_value_of_ocU:
  assumes "set_pmf p \<subseteq> outcomes"
  shows "general_U p = measure_pmf.expectation p ocU"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. general_U p = measure_pmf.expectation p ocU
[PROOF STEP]
using fnt assms
[PROOF STATE]
proof (prove)
using this:
finite outcomes
set_pmf p \<subseteq> outcomes

goal (1 subgoal):
 1. general_U p = measure_pmf.expectation p ocU
[PROOF STEP]
proof (induct rule: pmf_mix_induct')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
 2. \<And>p q a. \<lbrakk>set_pmf p \<subseteq> outcomes; set_pmf q \<subseteq> outcomes; a \<in> {0<..<1}; general_U p = measure_pmf.expectation p ocU; general_U q = measure_pmf.expectation q ocU\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
case (mix p q a)
[PROOF STATE]
proof (state)
this:
set_pmf p \<subseteq> outcomes
set_pmf q \<subseteq> outcomes
a \<in> {0<..<1}
general_U p = measure_pmf.expectation p ocU
general_U q = measure_pmf.expectation q ocU

goal (2 subgoals):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
 2. \<And>p q a. \<lbrakk>set_pmf p \<subseteq> outcomes; set_pmf q \<subseteq> outcomes; a \<in> {0<..<1}; general_U p = measure_pmf.expectation p ocU; general_U q = measure_pmf.expectation q ocU\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
hence "general_U (mix_pmf a p q) = a * general_U p + (1-a) * general_U q"
[PROOF STATE]
proof (prove)
using this:
set_pmf p \<subseteq> outcomes
set_pmf q \<subseteq> outcomes
a \<in> {0<..<1}
general_U p = measure_pmf.expectation p ocU
general_U q = measure_pmf.expectation q ocU

goal (1 subgoal):
 1. general_U (mix_pmf a p q) = a * general_U p + (1 - a) * general_U q
[PROOF STEP]
using general_U_is_linear_function[of p q a] mix.hyps assms lotteries_on_def mix.hyps
[PROOF STATE]
proof (prove)
using this:
set_pmf p \<subseteq> outcomes
set_pmf q \<subseteq> outcomes
a \<in> {0<..<1}
general_U p = measure_pmf.expectation p ocU
general_U q = measure_pmf.expectation q ocU
\<lbrakk>p \<in> local.\<P>; q \<in> local.\<P>; a \<in> {0..1}\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = a * general_U p + (1 - a) * general_U q
set_pmf p \<subseteq> outcomes
set_pmf q \<subseteq> outcomes
a \<in> {0<..<1}
general_U p = measure_pmf.expectation p ocU
general_U q = measure_pmf.expectation q ocU
set_pmf p \<subseteq> outcomes
Neumann_Morgenstern_Utility_Theorem.\<P> ?Oc = {p. set_pmf p \<subseteq> ?Oc}
set_pmf p \<subseteq> outcomes
set_pmf q \<subseteq> outcomes
a \<in> {0<..<1}
general_U p = measure_pmf.expectation p ocU
general_U q = measure_pmf.expectation q ocU

goal (1 subgoal):
 1. general_U (mix_pmf a p q) = a * general_U p + (1 - a) * general_U q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
general_U (mix_pmf a p q) = a * general_U p + (1 - a) * general_U q

goal (2 subgoals):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
 2. \<And>p q a. \<lbrakk>set_pmf p \<subseteq> outcomes; set_pmf q \<subseteq> outcomes; a \<in> {0<..<1}; general_U p = measure_pmf.expectation p ocU; general_U q = measure_pmf.expectation q ocU\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
general_U (mix_pmf a p q) = a * general_U p + (1 - a) * general_U q

goal (2 subgoals):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
 2. \<And>p q a. \<lbrakk>set_pmf p \<subseteq> outcomes; set_pmf q \<subseteq> outcomes; a \<in> {0<..<1}; general_U p = measure_pmf.expectation p ocU; general_U q = measure_pmf.expectation q ocU\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
have "... = a * measure_pmf.expectation p ocU + (1-a) * measure_pmf.expectation q ocU"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * general_U p + (1 - a) * general_U q = a * measure_pmf.expectation p ocU + (1 - a) * measure_pmf.expectation q ocU
[PROOF STEP]
by (simp add: mix.hyps(4) mix.hyps(5))
[PROOF STATE]
proof (state)
this:
a * general_U p + (1 - a) * general_U q = a * measure_pmf.expectation p ocU + (1 - a) * measure_pmf.expectation q ocU

goal (2 subgoals):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
 2. \<And>p q a. \<lbrakk>set_pmf p \<subseteq> outcomes; set_pmf q \<subseteq> outcomes; a \<in> {0<..<1}; general_U p = measure_pmf.expectation p ocU; general_U q = measure_pmf.expectation q ocU\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a * general_U p + (1 - a) * general_U q = a * measure_pmf.expectation p ocU + (1 - a) * measure_pmf.expectation q ocU

goal (2 subgoals):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
 2. \<And>p q a. \<lbrakk>set_pmf p \<subseteq> outcomes; set_pmf q \<subseteq> outcomes; a \<in> {0<..<1}; general_U p = measure_pmf.expectation p ocU; general_U q = measure_pmf.expectation q ocU\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
have "... = measure_pmf.expectation (mix_pmf a p q) ocU"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * measure_pmf.expectation p ocU + (1 - a) * measure_pmf.expectation q ocU = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
using general_U_is_linear_function expected_value_mix_pmf_distrib fnt infinite_super mix.hyps(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?p \<in> local.\<P>; ?q \<in> local.\<P>; ?\<alpha> \<in> {0..1}\<rbrakk> \<Longrightarrow> general_U (mix_pmf ?\<alpha> ?p ?q) = ?\<alpha> * general_U ?p + (1 - ?\<alpha>) * general_U ?q
\<lbrakk>finite (set_pmf ?p); finite (set_pmf ?q); ?a \<in> {0<..<1}\<rbrakk> \<Longrightarrow> measure_pmf.expectation (mix_pmf ?a ?p ?q) ?f = ?a * measure_pmf.expectation ?p ?f + (1 - ?a) * measure_pmf.expectation ?q ?f
finite outcomes
\<lbrakk>?S \<subseteq> ?T; infinite ?S\<rbrakk> \<Longrightarrow> infinite ?T
set_pmf p \<subseteq> outcomes

goal (1 subgoal):
 1. a * measure_pmf.expectation p ocU + (1 - a) * measure_pmf.expectation q ocU = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
by (metis fnt mix.hyps(2) mix.hyps(3))
[PROOF STATE]
proof (state)
this:
a * measure_pmf.expectation p ocU + (1 - a) * measure_pmf.expectation q ocU = measure_pmf.expectation (mix_pmf a p q) ocU

goal (2 subgoals):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
 2. \<And>p q a. \<lbrakk>set_pmf p \<subseteq> outcomes; set_pmf q \<subseteq> outcomes; a \<in> {0<..<1}; general_U p = measure_pmf.expectation p ocU; general_U q = measure_pmf.expectation q ocU\<rbrakk> \<Longrightarrow> general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU

goal (1 subgoal):
 1. general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
general_U (mix_pmf a p q) = measure_pmf.expectation (mix_pmf a p q) ocU

goal (1 subgoal):
 1. \<And>x. x \<in> outcomes \<Longrightarrow> general_U (return_pmf x) = measure_pmf.expectation (return_pmf x) ocU
[PROOF STEP]
qed (auto simp: support_in_outcomes assms fnt integral_measure_pmf_real ocU_def)


[STATEMENT]
lemma cf_cn_cov_rcomp_components:
  shows "cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>HomDom\<rparr> = op_cat \<BB> \<times>\<^sub>C \<GG>\<lparr>HomDom\<rparr>"
    and "cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>HomCod\<rparr> = \<SS>\<lparr>HomCod\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>HomDom\<rparr> = op_cat \<BB> \<times>\<^sub>C \<GG>\<lparr>HomDom\<rparr> &&& cf_cn_cov_rcomp \<BB> \<SS> \<GG>\<lparr>HomCod\<rparr> = \<SS>\<lparr>HomCod\<rparr>
[PROOF STEP]
unfolding cf_cn_cov_rcomp_def cf_cn_cov_bcomp_components dghm_id_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cat \<BB> \<times>\<^sub>C \<GG>\<lparr>HomDom\<rparr> = op_cat \<BB> \<times>\<^sub>C \<GG>\<lparr>HomDom\<rparr> &&& \<SS>\<lparr>HomCod\<rparr> = \<SS>\<lparr>HomCod\<rparr>
[PROOF STEP]
by simp_all


[STATEMENT]
lemma matrix_inv_invertible:
  assumes "invertible M"
  shows "invertible (matrix_inv M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (matrix_inv M)
[PROOF STEP]
using \<open>invertible M\<close> and matrix_inv
[PROOF STATE]
proof (prove)
using this:
invertible M
invertible ?M \<Longrightarrow> matrix_inv ?M ** ?M = mat (1::?'a)
invertible ?M \<Longrightarrow> ?M ** matrix_inv ?M = mat (1::?'a)

goal (1 subgoal):
 1. invertible (matrix_inv M)
[PROOF STEP]
unfolding invertible_def [of "matrix_inv M"]
[PROOF STATE]
proof (prove)
using this:
invertible M
invertible ?M \<Longrightarrow> matrix_inv ?M ** ?M = mat (1::?'a)
invertible ?M \<Longrightarrow> ?M ** matrix_inv ?M = mat (1::?'a)

goal (1 subgoal):
 1. \<exists>A'. matrix_inv M ** A' = mat (1::'a) \<and> A' ** matrix_inv M = mat (1::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma Suc_in_imp_not_subset_iMOD: "
  \<lbrakk> n \<in> S; Suc n \<in> S; m \<noteq> Suc 0 \<rbrakk> \<Longrightarrow> \<not> S \<subseteq> [r, mod m]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<in> S; Suc n \<in> S; m \<noteq> Suc 0\<rbrakk> \<Longrightarrow> \<not> S \<subseteq> [ r, mod m ]
[PROOF STEP]
by (blast intro: iMOD_Suc[THEN iffD1])


[STATEMENT]
lemma holomorphic_closed_preimage_constant:
  assumes "f holomorphic_on UNIV"
  shows "closed {z. f z = a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {z. f z = a}
[PROOF STEP]
using holomorphic_closedin_preimage_constant [OF assms]
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set UNIV) {z \<in> UNIV. f z = ?a}

goal (1 subgoal):
 1. closed {z. f z = a}
[PROOF STEP]
by simp


[STATEMENT]
lemma toList_intersect[simp, code abstract]:
  "toList (intersect xs ys) = List_local.intersection (toList xs) (toList ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toList (intersect xs ys) = intersection (toList xs) (toList ys)
[PROOF STEP]
unfolding intersect_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toList (ODList (intersection (toList xs) (toList ys))) = intersection (toList xs) (toList ys)
[PROOF STEP]
by (simp add: toList_ODList)


[STATEMENT]
lemma countable_basis_openI: "countable_basis open B"
  if "countable B" "topological_basis B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable_basis open B
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
countable B
topological_basis B

goal (1 subgoal):
 1. countable_basis open B
[PROOF STEP]
by unfold_locales
    (simp_all add: topological_basis topological_space.topological_basis topological_space_axioms)


[STATEMENT]
lemma finite_val_imp_nonzero:
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "val a \<noteq> \<infinity>"
  shows "a \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
val a \<noteq> \<infinity>

goal (1 subgoal):
 1. a \<in> nonzero Q\<^sub>p
[PROOF STEP]
unfolding val_def nonzero_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
(if a = \<zero> then \<infinity> else eint (ord a)) \<noteq> \<infinity>

goal (1 subgoal):
 1. a \<in> {a \<in> carrier Q\<^sub>p. a \<noteq> \<zero>}
[PROOF STEP]
by (metis (mono_tags, lifting) mem_Collect_eq)


[STATEMENT]
lemma nextss_Cons: "nextss g (x#xs) = set (nexts g x) \<union> nextss g xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nextss g (x # xs) = set (nexts g x) \<union> nextss g xs
[PROOF STEP]
unfolding nextss_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set g `` set (x # xs) = set (nexts g x) \<union> set g `` set xs
[PROOF STEP]
by (auto simp add:Image_def nexts_set)


[STATEMENT]
lemma XpZ_carrier:
  shows "XpZ \<in> carrier_mat 2 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. XpZ \<in> carrier_mat 2 2
[PROOF STEP]
unfolding XpZ_def X_def Z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (- 1 / sqrt 2) \<cdot>\<^sub>m (Matrix.mat 2 2 (\<lambda>(i, j). if i = j then 0 else 1) + Matrix.mat 2 2 (\<lambda>(i, j). if i \<noteq> j then 0 else if i = 0 then 1 else - 1)) \<in> carrier_mat 2 2
[PROOF STEP]
by simp


[STATEMENT]
lemma awalk_verts_append_cas:
  assumes "cas u (p @ q) v"
  shows "awalk_verts u (p @ q) = awalk_verts u p @ tl (awalk_verts (awlast u p) q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. awalk_verts u (p @ q) = awalk_verts u p @ tl (awalk_verts (awlast u p) q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cas u (p @ q) v

goal (1 subgoal):
 1. awalk_verts u (p @ q) = awalk_verts u p @ tl (awalk_verts (awlast u p) q)
[PROOF STEP]
proof (induct p arbitrary: u)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>u. cas u ([] @ q) v \<Longrightarrow> awalk_verts u ([] @ q) = awalk_verts u [] @ tl (awalk_verts (awlast u []) q)
 2. \<And>a p u. \<lbrakk>\<And>u. cas u (p @ q) v \<Longrightarrow> awalk_verts u (p @ q) = awalk_verts u p @ tl (awalk_verts (awlast u p) q); cas u ((a # p) @ q) v\<rbrakk> \<Longrightarrow> awalk_verts u ((a # p) @ q) = awalk_verts u (a # p) @ tl (awalk_verts (awlast u (a # p)) q)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
cas u ([] @ q) v

goal (2 subgoals):
 1. \<And>u. cas u ([] @ q) v \<Longrightarrow> awalk_verts u ([] @ q) = awalk_verts u [] @ tl (awalk_verts (awlast u []) q)
 2. \<And>a p u. \<lbrakk>\<And>u. cas u (p @ q) v \<Longrightarrow> awalk_verts u (p @ q) = awalk_verts u p @ tl (awalk_verts (awlast u p) q); cas u ((a # p) @ q) v\<rbrakk> \<Longrightarrow> awalk_verts u ((a # p) @ q) = awalk_verts u (a # p) @ tl (awalk_verts (awlast u (a # p)) q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cas u ([] @ q) v
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
cas u ([] @ q) v

goal (1 subgoal):
 1. awalk_verts u ([] @ q) = awalk_verts u [] @ tl (awalk_verts (awlast u []) q)
[PROOF STEP]
by (cases q) auto
[PROOF STATE]
proof (state)
this:
awalk_verts u ([] @ q) = awalk_verts u [] @ tl (awalk_verts (awlast u []) q)

goal (1 subgoal):
 1. \<And>a p u. \<lbrakk>\<And>u. cas u (p @ q) v \<Longrightarrow> awalk_verts u (p @ q) = awalk_verts u p @ tl (awalk_verts (awlast u p) q); cas u ((a # p) @ q) v\<rbrakk> \<Longrightarrow> awalk_verts u ((a # p) @ q) = awalk_verts u (a # p) @ tl (awalk_verts (awlast u (a # p)) q)
[PROOF STEP]
qed (auto simp: awalk_Cons_iff)


[STATEMENT]
lemma lift_to_metric_completion_isometry:
  fixes f::"('a::metric_space) \<Rightarrow> ('b::complete_space)"
  assumes "isometry_on UNIV f"
  shows "\<exists>g. isometry_on UNIV g
          \<and> range g = closure(range f)
          \<and> f = g o to_metric_completion
          \<and> (\<forall>x \<in> range to_metric_completion. g x = f (inv to_metric_completion x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
have *: "uniformly_continuous_on UNIV f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isUCont f
[PROOF STEP]
using assms isometry_on_uniformly_continuous
[PROOF STATE]
proof (prove)
using this:
isometry_on UNIV f
isometry_on ?X ?f \<Longrightarrow> uniformly_continuous_on ?X ?f

goal (1 subgoal):
 1. isUCont f
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
isUCont f

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
obtain g where g: "uniformly_continuous_on UNIV g"
                    "f = g o to_metric_completion"
                    "\<And>x. x \<in> range to_metric_completion \<Longrightarrow> g x = f (inv to_metric_completion x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>isUCont g; f = g \<circ> to_metric_completion; \<And>x. x \<in> range to_metric_completion \<Longrightarrow> g x = f (inv to_metric_completion x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lift_to_metric_completion[OF *]
[PROOF STATE]
proof (prove)
using this:
\<exists>g. isUCont g \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>isUCont g; f = g \<circ> to_metric_completion; \<And>x. x \<in> range to_metric_completion \<Longrightarrow> g x = f (inv to_metric_completion x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
isUCont g
f = g \<circ> to_metric_completion
?x \<in> range to_metric_completion \<Longrightarrow> g ?x = f (inv to_metric_completion ?x)

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
have *: "isometry_on (range to_metric_completion) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry_on (range to_metric_completion) g
[PROOF STEP]
apply (rule isometry_on_cong[OF _ g(3)], rule isometry_on_compose[of _ _ f])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. isometry_on (range to_metric_completion) (inv to_metric_completion)
 2. isometry_on (inv to_metric_completion ` range to_metric_completion) f
 3. \<And>x. x \<in> range to_metric_completion \<Longrightarrow> x \<in> range to_metric_completion
[PROOF STEP]
using assms isometry_on_inverse[OF to_metric_completion_isometry] isometry_on_subset
[PROOF STATE]
proof (prove)
using this:
isometry_on UNIV f
isometry_on (range to_metric_completion) (inv to_metric_completion)
?x \<in> UNIV \<Longrightarrow> inv to_metric_completion (to_metric_completion ?x) = ?x
?y \<in> range to_metric_completion \<Longrightarrow> to_metric_completion (inv to_metric_completion ?y) = ?y
bij_betw to_metric_completion UNIV (range to_metric_completion)
\<lbrakk>isometry_on ?X ?f; ?Y \<subseteq> ?X\<rbrakk> \<Longrightarrow> isometry_on ?Y ?f

goal (3 subgoals):
 1. isometry_on (range to_metric_completion) (inv to_metric_completion)
 2. isometry_on (inv to_metric_completion ` range to_metric_completion) f
 3. \<And>x. x \<in> range to_metric_completion \<Longrightarrow> x \<in> range to_metric_completion
[PROOF STEP]
by (auto) (fastforce)
[PROOF STATE]
proof (state)
this:
isometry_on (range to_metric_completion) g

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isometry_on (range to_metric_completion) g
[PROOF STEP]
have "isometry_on UNIV g"
[PROOF STATE]
proof (prove)
using this:
isometry_on (range to_metric_completion) g

goal (1 subgoal):
 1. isometry_on UNIV g
[PROOF STEP]
unfolding to_metric_completion_dense'[symmetric]
[PROOF STATE]
proof (prove)
using this:
isometry_on (range to_metric_completion) g

goal (1 subgoal):
 1. isometry_on (closure (range to_metric_completion)) g
[PROOF STEP]
apply (rule isometry_on_closure)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closure (range to_metric_completion)) g
[PROOF STEP]
using continuous_on_subset[OF uniformly_continuous_imp_continuous[OF g(1)]]
[PROOF STATE]
proof (prove)
using this:
?t \<subseteq> UNIV \<Longrightarrow> continuous_on ?t g

goal (1 subgoal):
 1. continuous_on (closure (range to_metric_completion)) g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isometry_on UNIV g

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
have "g`(range to_metric_completion) \<subseteq> range f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` range to_metric_completion \<subseteq> range f
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
isUCont g
f = g \<circ> to_metric_completion
?x \<in> range to_metric_completion \<Longrightarrow> g ?x = f (inv to_metric_completion ?x)

goal (1 subgoal):
 1. g ` range to_metric_completion \<subseteq> range f
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
using this:
isUCont g
f = (\<lambda>x. g (to_metric_completion x))
?x \<in> range to_metric_completion \<Longrightarrow> g ?x = f (inv to_metric_completion ?x)

goal (1 subgoal):
 1. g ` range to_metric_completion \<subseteq> range f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ` range to_metric_completion \<subseteq> range f

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g ` range to_metric_completion \<subseteq> range f

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
have "g`(closure (range to_metric_completion)) \<subseteq> closure (g`(range to_metric_completion))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ` closure (range to_metric_completion) \<subseteq> closure (g ` range to_metric_completion)
[PROOF STEP]
using uniformly_continuous_imp_continuous[OF g(1)]
[PROOF STATE]
proof (prove)
using this:
continuous_on UNIV g

goal (1 subgoal):
 1. g ` closure (range to_metric_completion) \<subseteq> closure (g ` range to_metric_completion)
[PROOF STEP]
by (meson closed_closure closure_subset continuous_on_subset image_closure_subset top_greatest)
[PROOF STATE]
proof (state)
this:
g ` closure (range to_metric_completion) \<subseteq> closure (g ` range to_metric_completion)

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
g ` range to_metric_completion \<subseteq> range f
g ` closure (range to_metric_completion) \<subseteq> closure (g ` range to_metric_completion)
[PROOF STEP]
have "range g \<subseteq> closure (range f)"
[PROOF STATE]
proof (prove)
using this:
g ` range to_metric_completion \<subseteq> range f
g ` closure (range to_metric_completion) \<subseteq> closure (g ` range to_metric_completion)

goal (1 subgoal):
 1. range g \<subseteq> closure (range f)
[PROOF STEP]
unfolding to_metric_completion_dense'
[PROOF STATE]
proof (prove)
using this:
g ` range to_metric_completion \<subseteq> range f
range g \<subseteq> closure (g ` range to_metric_completion)

goal (1 subgoal):
 1. range g \<subseteq> closure (range f)
[PROOF STEP]
by (simp add: g(2) image_comp)
[PROOF STATE]
proof (state)
this:
range g \<subseteq> closure (range f)

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
have "range f \<subseteq> range g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f \<subseteq> range g
[PROOF STEP]
using g(2)
[PROOF STATE]
proof (prove)
using this:
f = g \<circ> to_metric_completion

goal (1 subgoal):
 1. range f \<subseteq> range g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
range f \<subseteq> range g

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
range f \<subseteq> range g

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
have "closed (range g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (range g)
[PROOF STEP]
using isometry_on_complete_image[OF \<open>isometry_on UNIV g\<close>]
[PROOF STATE]
proof (prove)
using this:
complete UNIV \<Longrightarrow> complete (range g)

goal (1 subgoal):
 1. closed (range g)
[PROOF STEP]
by (simp add: complete_eq_closed)
[PROOF STATE]
proof (state)
this:
closed (range g)

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
range f \<subseteq> range g
closed (range g)
[PROOF STEP]
have "closure (range f) \<subseteq> range g"
[PROOF STATE]
proof (prove)
using this:
range f \<subseteq> range g
closed (range g)

goal (1 subgoal):
 1. closure (range f) \<subseteq> range g
[PROOF STEP]
by (simp add: closure_minimal)
[PROOF STATE]
proof (state)
this:
closure (range f) \<subseteq> range g

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closure (range f) \<subseteq> range g
[PROOF STEP]
have "range g = closure (range f)"
[PROOF STATE]
proof (prove)
using this:
closure (range f) \<subseteq> range g

goal (1 subgoal):
 1. range g = closure (range f)
[PROOF STEP]
using \<open>range g \<subseteq> closure (range f)\<close>
[PROOF STATE]
proof (prove)
using this:
closure (range f) \<subseteq> range g
range g \<subseteq> closure (range f)

goal (1 subgoal):
 1. range g = closure (range f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
range g = closure (range f)

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
range g = closure (range f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
range g = closure (range f)

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
using \<open>isometry_on UNIV g\<close> g
[PROOF STATE]
proof (prove)
using this:
range g = closure (range f)
isometry_on UNIV g
isUCont g
f = g \<circ> to_metric_completion
?x \<in> range to_metric_completion \<Longrightarrow> g ?x = f (inv to_metric_completion ?x)

goal (1 subgoal):
 1. \<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>g. isometry_on UNIV g \<and> range g = closure (range f) \<and> f = g \<circ> to_metric_completion \<and> (\<forall>x\<in>range to_metric_completion. g x = f (inv to_metric_completion x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_connected_space_euclidean_subtopology [simp]:
   "path_connected_space(subtopology euclidean S) \<longleftrightarrow> path_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected_space (top_of_set S) = path_connected S
[PROOF STEP]
using path_connectedin_topspace
[PROOF STATE]
proof (prove)
using this:
path_connectedin ?X (topspace ?X) = path_connected_space ?X

goal (1 subgoal):
 1. path_connected_space (top_of_set S) = path_connected S
[PROOF STEP]
by force


[STATEMENT]
lemma val_ring_add_closed:
  assumes "a \<in> \<O>\<^sub>p"
  assumes "b \<in> \<O>\<^sub>p"
  shows "a \<oplus> b \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<oplus> b \<in> \<O>\<^sub>p
[PROOF STEP]
using val_ring_subring subringE(7)
[PROOF STATE]
proof (prove)
using this:
subring \<O>\<^sub>p Q\<^sub>p
\<lbrakk>subring ?H ?R; ?h1.0 \<in> ?H; ?h2.0 \<in> ?H\<rbrakk> \<Longrightarrow> ?h1.0 \<oplus>\<^bsub>?R\<^esub> ?h2.0 \<in> ?H

goal (1 subgoal):
 1. a \<oplus> b \<in> \<O>\<^sub>p
[PROOF STEP]
by (metis assms(1) assms(2))


[STATEMENT]
lemma Prime_Pi[intro]: "Prime (Pi n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Prime (Pi n)
[PROOF STEP]
proof(induct n, auto simp: Pi.simps Np.simps)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Prime (Pi n) \<Longrightarrow> Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Prime (Pi n) \<Longrightarrow> Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
let ?setx = "{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Prime (Pi n) \<Longrightarrow> Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
show "Prime (Min ?setx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
have "finite ?setx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}

goal (1 subgoal):
 1. Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}

goal (1 subgoal):
 1. Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
have "?setx \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}
[PROOF STEP]
using prime_ex[of "Pi n"]
[PROOF STATE]
proof (prove)
using this:
\<exists>p>Pi n. p \<le> Suc (Pi n!) \<and> Prime p

goal (1 subgoal):
 1. {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}

goal (1 subgoal):
 1. Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}
[PROOF STEP]
show "?thesis"
[PROOF STATE]
proof (prove)
using this:
finite {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y}
{y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y} \<noteq> {}

goal (1 subgoal):
 1. Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})
[PROOF STEP]
apply(drule_tac Min_in, simp, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Prime (Min {y. y \<le> Suc (Pi n!) \<and> Pi n < y \<and> Prime y})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma as_lt_p: "\<And>x. x \<in> set as \<Longrightarrow> x < p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set as \<Longrightarrow> x < p
[PROOF STEP]
using as_range atLeastLessThan_iff
[PROOF STATE]
proof (prove)
using this:
set as \<subseteq> {..<n}
(?i \<in> {?l..<?u}) = (?l \<le> ?i \<and> ?i < ?u)

goal (1 subgoal):
 1. \<And>x. x \<in> set as \<Longrightarrow> x < p
[PROOF STEP]
by (intro order_less_le_trans[OF _ n_le_p]) blast


[STATEMENT]
lemma lnull_0_llength: "\<not>lnull xs \<Longrightarrow> enat 0 < llength xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> lnull xs \<Longrightarrow> enat 0 < llength xs
[PROOF STEP]
using zero_enat_def
[PROOF STATE]
proof (prove)
using this:
0 = enat 0

goal (1 subgoal):
 1. \<not> lnull xs \<Longrightarrow> enat 0 < llength xs
[PROOF STEP]
by auto


[STATEMENT]
lemma pcompose_uminus: "pcompose (-p) r = -pcompose p r"
  for p r :: "'a::comm_ring poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - p \<circ>\<^sub>p r = - (p \<circ>\<^sub>p r)
[PROOF STEP]
by (induct p) (simp_all add: pcompose_pCons)


[STATEMENT]
lemma favorites_permute:
  assumes i: "i \<in> agents" and perm: "\<sigma> permutes alts"
  shows   "favorites (permute_profile \<sigma> R) i = \<sigma> ` favorites R i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. favorites (permute_profile \<sigma> R) i = \<sigma> ` favorites R i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. favorites (permute_profile \<sigma> R) i = \<sigma> ` favorites R i
[PROOF STEP]
from i
[PROOF STATE]
proof (chain)
picking this:
i \<in> agents
[PROOF STEP]
interpret finite_total_preorder_on alts "R i"
[PROOF STATE]
proof (prove)
using this:
i \<in> agents

goal (1 subgoal):
 1. finite_total_preorder_on alts (R i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. favorites (permute_profile \<sigma> R) i = \<sigma> ` favorites R i
[PROOF STEP]
from perm
[PROOF STATE]
proof (chain)
picking this:
\<sigma> permutes alts
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes alts

goal (1 subgoal):
 1. favorites (permute_profile \<sigma> R) i = \<sigma> ` favorites R i
[PROOF STEP]
unfolding favorites_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes alts

goal (1 subgoal):
 1. Max_wrt (permute_profile \<sigma> R i) = \<sigma> ` Max_wrt (R i)
[PROOF STEP]
by (subst Max_wrt_map_relation_bij)
       (simp_all add: permute_profile_def map_relation_def permutes_bij)
[PROOF STATE]
proof (state)
this:
favorites (permute_profile \<sigma> R) i = \<sigma> ` favorites R i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_of_subtopology_subset:
   "(subtopology X U) closure_of S \<subseteq> (X closure_of S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subtopology X U closure_of S \<subseteq> X closure_of S
[PROOF STEP]
unfolding closure_of_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<inter> X closure_of (U \<inter> S) \<subseteq> X closure_of S
[PROOF STEP]
by clarsimp (meson closure_of_mono contra_subsetD inf.cobounded2)


[STATEMENT]
lemma prv_imp_eqv_transi_rev:
assumes "\<phi> \<in> fmla" and "\<chi>1 \<in> fmla" and "\<chi>2 \<in> fmla"
assumes "prv (imp \<phi> \<chi>2)" and "prv (eqv \<chi>1 \<chi>2)"
shows "prv (imp \<phi> \<chi>1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp \<phi> \<chi>1)
[PROOF STEP]
by (meson assms prv_eqv_sym prv_imp_eqv_transi)


[STATEMENT]
lemma cross_ratio_abs2:
  assumes "p \<noteq> q"
  shows "cross_ratio p q
  (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q))
  (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q))
  = j/i"
  (is "cross_ratio p q ?r ?s = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i
[PROOF STEP]
let ?u = "proj2_rep p"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i
[PROOF STEP]
let ?v = "proj2_rep q"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i
[PROOF STEP]
have "?u \<noteq> 0" and "?v \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_rep p \<noteq> 0 &&& proj2_rep q \<noteq> 0
[PROOF STEP]
by (rule proj2_rep_non_zero)+
[PROOF STATE]
proof (state)
this:
proj2_rep p \<noteq> 0
proj2_rep q \<noteq> 0

goal (1 subgoal):
 1. cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i
[PROOF STEP]
have "proj2_abs ?u = p" and "proj2_abs ?v = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_abs (proj2_rep p) = p &&& proj2_abs (proj2_rep q) = q
[PROOF STEP]
by (rule proj2_abs_rep)+
[PROOF STATE]
proof (state)
this:
proj2_abs (proj2_rep p) = p
proj2_abs (proj2_rep q) = q

goal (1 subgoal):
 1. cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i
[PROOF STEP]
with \<open>?u \<noteq> 0\<close> and \<open>?v \<noteq> 0\<close> and \<open>p \<noteq> q\<close> and cross_ratio_abs [of ?u ?v 1 1 i j]
[PROOF STATE]
proof (chain)
picking this:
proj2_rep p \<noteq> 0
proj2_rep q \<noteq> 0
p \<noteq> q
\<lbrakk>proj2_rep p \<noteq> 0; proj2_rep q \<noteq> 0; proj2_abs (proj2_rep p) \<noteq> proj2_abs (proj2_rep q); 1 \<noteq> 0; 1 \<noteq> 0\<rbrakk> \<Longrightarrow> cross_ratio (proj2_abs (proj2_rep p)) (proj2_abs (proj2_rep q)) (proj2_abs (i *\<^sub>R proj2_rep p + 1 *\<^sub>R proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + 1 *\<^sub>R proj2_rep q)) = 1 * j / (i * 1)
proj2_abs (proj2_rep p) = p
proj2_abs (proj2_rep q) = q
[PROOF STEP]
show "cross_ratio p q ?r ?s = j/i"
[PROOF STATE]
proof (prove)
using this:
proj2_rep p \<noteq> 0
proj2_rep q \<noteq> 0
p \<noteq> q
\<lbrakk>proj2_rep p \<noteq> 0; proj2_rep q \<noteq> 0; proj2_abs (proj2_rep p) \<noteq> proj2_abs (proj2_rep q); 1 \<noteq> 0; 1 \<noteq> 0\<rbrakk> \<Longrightarrow> cross_ratio (proj2_abs (proj2_rep p)) (proj2_abs (proj2_rep q)) (proj2_abs (i *\<^sub>R proj2_rep p + 1 *\<^sub>R proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + 1 *\<^sub>R proj2_rep q)) = 1 * j / (i * 1)
proj2_abs (proj2_rep p) = p
proj2_abs (proj2_rep q) = q

goal (1 subgoal):
 1. cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cross_ratio p q (proj2_abs (i *\<^sub>R proj2_rep p + proj2_rep q)) (proj2_abs (j *\<^sub>R proj2_rep p + proj2_rep q)) = j / i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pair_o_assoc[simp]:
  assumes [simp]: \<open>compatible F G\<close> \<open>compatible G H\<close> \<open>compatible F H\<close>
  shows \<open>(F; (G; H)) \<circ> assoc = ((F; G); H)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F;(G;H)) \<circ> assoc = ((F;G);H)
[PROOF STEP]
proof (rule tensor_extensionality3')
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. register ((F;(G;H)) \<circ> assoc)
 2. register ((F;G);H)
 3. \<And>f g h. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>register ((F; (G; H)) \<circ> assoc)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. register ((F;(G;H)) \<circ> assoc)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
register ((F;(G;H)) \<circ> assoc)

goal (2 subgoals):
 1. register ((F;G);H)
 2. \<And>f g h. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>register ((F; G); H)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. register ((F;G);H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
register ((F;G);H)

goal (1 subgoal):
 1. \<And>f g h. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>((F; (G; H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F; G); H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)\<close> for f g h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
by (simp add: register_pair_apply assoc_apply comp_update_assoc)
[PROOF STATE]
proof (state)
this:
((F;(G;H)) \<circ> assoc) ((?f \<otimes>\<^sub>u ?g) \<otimes>\<^sub>u ?h) = ((F;G);H) ((?f \<otimes>\<^sub>u ?g) \<otimes>\<^sub>u ?h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma square_irreflexive_part:
  "x * x - 1 \<le> (x - 1)\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
have "x * x = (x \<sqinter> 1) * x \<squnion> (x - 1) * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * x = (x \<sqinter> (1::'a)) * x \<squnion> (x - (1::'a)) * x
[PROOF STEP]
by (metis maddux_3_11_pp mult_right_dist_sup regular_one_closed)
[PROOF STATE]
proof (state)
this:
x * x = (x \<sqinter> (1::'a)) * x \<squnion> (x - (1::'a)) * x

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * x = (x \<sqinter> (1::'a)) * x \<squnion> (x - (1::'a)) * x

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
have "... \<le> 1 * x \<squnion> (x - 1) * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> (1::'a)) * x \<squnion> (x - (1::'a)) * x \<le> (1::'a) * x \<squnion> (x - (1::'a)) * x
[PROOF STEP]
using comp_isotone inf.cobounded2 semiring.add_right_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<le> ?y; ?w \<le> ?z\<rbrakk> \<Longrightarrow> ?x * ?w \<le> ?y * ?z
?a \<sqinter> ?b \<le> ?b
?a \<le> ?b \<Longrightarrow> ?a \<squnion> ?c \<le> ?b \<squnion> ?c

goal (1 subgoal):
 1. (x \<sqinter> (1::'a)) * x \<squnion> (x - (1::'a)) * x \<le> (1::'a) * x \<squnion> (x - (1::'a)) * x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x \<sqinter> (1::'a)) * x \<squnion> (x - (1::'a)) * x \<le> (1::'a) * x \<squnion> (x - (1::'a)) * x

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<sqinter> (1::'a)) * x \<squnion> (x - (1::'a)) * x \<le> (1::'a) * x \<squnion> (x - (1::'a)) * x

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
have "... \<le> 1 \<squnion> (x - 1) \<squnion> (x - 1) * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) * x \<squnion> (x - (1::'a)) * x \<le> (1::'a) \<squnion> (x - (1::'a)) \<squnion> (x - (1::'a)) * x
[PROOF STEP]
by (metis inf.cobounded2 maddux_3_11_pp mult_1_left regular_one_closed sup_left_isotone)
[PROOF STATE]
proof (state)
this:
(1::'a) * x \<squnion> (x - (1::'a)) * x \<le> (1::'a) \<squnion> (x - (1::'a)) \<squnion> (x - (1::'a)) * x

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) * x \<squnion> (x - (1::'a)) * x \<le> (1::'a) \<squnion> (x - (1::'a)) \<squnion> (x - (1::'a)) * x

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
have "... = (x - 1) * (x \<squnion> 1) \<squnion> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) \<squnion> (x - (1::'a)) \<squnion> (x - (1::'a)) * x = (x - (1::'a)) * (x \<squnion> (1::'a)) \<squnion> (1::'a)
[PROOF STEP]
by (simp add: mult_left_dist_sup sup_assoc sup_commute)
[PROOF STATE]
proof (state)
this:
(1::'a) \<squnion> (x - (1::'a)) \<squnion> (x - (1::'a)) * x = (x - (1::'a)) * (x \<squnion> (1::'a)) \<squnion> (1::'a)

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * x \<le> (x - (1::'a)) * (x \<squnion> (1::'a)) \<squnion> (1::'a)
[PROOF STEP]
have "x * x - 1 \<le> (x - 1) * (x \<squnion> 1)"
[PROOF STATE]
proof (prove)
using this:
x * x \<le> (x - (1::'a)) * (x \<squnion> (1::'a)) \<squnion> (1::'a)

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a)) * (x \<squnion> (1::'a))
[PROOF STEP]
using shunting_var_p
[PROOF STATE]
proof (prove)
using this:
x * x \<le> (x - (1::'a)) * (x \<squnion> (1::'a)) \<squnion> (1::'a)
(?x - ?y \<le> ?z) = (?x \<le> ?z \<squnion> - - ?y)

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a)) * (x \<squnion> (1::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x * x - (1::'a) \<le> (x - (1::'a)) * (x \<squnion> (1::'a))

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * x - (1::'a) \<le> (x - (1::'a)) * (x \<squnion> (1::'a))

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
have "... = (x - 1) * (x - 1) \<squnion> (x - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (1::'a)) * (x \<squnion> (1::'a)) = (x - (1::'a)) * (x - (1::'a)) \<squnion> (x - (1::'a))
[PROOF STEP]
by (metis comp_right_one inf.sup_monoid.add_commute maddux_3_21_pp mult_left_dist_sup regular_one_closed sup_commute)
[PROOF STATE]
proof (state)
this:
(x - (1::'a)) * (x \<squnion> (1::'a)) = (x - (1::'a)) * (x - (1::'a)) \<squnion> (x - (1::'a))

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x - (1::'a)) * (x \<squnion> (1::'a)) = (x - (1::'a)) * (x - (1::'a)) \<squnion> (x - (1::'a))

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
have "... \<le> (x - 1)\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - (1::'a)) * (x - (1::'a)) \<squnion> (x - (1::'a)) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
by (metis mult_left_isotone star.circ_increasing star.circ_mult_increasing star.circ_plus_same sup.bounded_iff)
[PROOF STATE]
proof (state)
this:
(x - (1::'a)) * (x - (1::'a)) \<squnion> (x - (1::'a)) \<le> (x - (1::'a))\<^sup>+

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+

goal (1 subgoal):
 1. x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x * x - (1::'a) \<le> (x - (1::'a))\<^sup>+

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prefix_tm_to_nat_list_cons:
 "\<exists>u v. tm_to_nat_list (x#xs) = u # v # tm_to_nat_list xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v. tm_to_nat_list (x # xs) = u # v # tm_to_nat_list xs
[PROOF STEP]
proof (cases x)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. x = (a, b) \<Longrightarrow> \<exists>u v. tm_to_nat_list (x # xs) = u # v # tm_to_nat_list xs
[PROOF STEP]
case (Pair a b)
[PROOF STATE]
proof (state)
this:
x = (a, b)

goal (1 subgoal):
 1. \<And>a b. x = (a, b) \<Longrightarrow> \<exists>u v. tm_to_nat_list (x # xs) = u # v # tm_to_nat_list xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = (a, b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = (a, b)

goal (1 subgoal):
 1. \<exists>u v. tm_to_nat_list (x # xs) = u # v # tm_to_nat_list xs
[PROOF STEP]
by (cases a)(auto)
[PROOF STATE]
proof (state)
this:
\<exists>u v. tm_to_nat_list (x # xs) = u # v # tm_to_nat_list xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remdups_adj_map_injective:
  assumes "inj f"
  shows "remdups_adj (map f xs) = map f (remdups_adj xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remdups_adj (map f xs) = map f (remdups_adj xs)
[PROOF STEP]
by (induct xs rule: remdups_adj.induct) (auto simp add: injD[OF assms])


[STATEMENT]
lemma Field_not_elem:
  "v \<notin> Field R \<Longrightarrow> \<forall>(x,y) \<in> R. x \<noteq> v \<and> y \<noteq> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> Field R \<Longrightarrow> \<forall>(x, y)\<in>R. x \<noteq> v \<and> y \<noteq> v
[PROOF STEP]
unfolding Field_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> Domain R \<union> Range R \<Longrightarrow> \<forall>(x, y)\<in>R. x \<noteq> v \<and> y \<noteq> v
[PROOF STEP]
by auto


[STATEMENT]
lemma sums_add: "f sums a \<Longrightarrow> g sums b \<Longrightarrow> (\<lambda>n. f n + g n) sums (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f sums a; g sums b\<rbrakk> \<Longrightarrow> (\<lambda>n. f n + g n) sums (a + b)
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> a; (\<lambda>n. sum g {..<n}) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> (\<lambda>n. \<Sum>n<n. f n + g n) \<longlonglongrightarrow> a + b
[PROOF STEP]
by (simp add: sum.distrib tendsto_add)


[STATEMENT]
lemma le_max3I1: "(n2::nat) \<le> max n1 (max n2 n3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n2 \<le> max n1 (max n2 n3)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n2 \<le> max n1 (max n2 n3)
[PROOF STEP]
have "n2 \<le> max n2 n3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n2 \<le> max n2 n3
[PROOF STEP]
by (rule max.cobounded1)
[PROOF STATE]
proof (state)
this:
n2 \<le> max n2 n3

goal (1 subgoal):
 1. n2 \<le> max n1 (max n2 n3)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n2 \<le> max n2 n3

goal (1 subgoal):
 1. n2 \<le> max n1 (max n2 n3)
[PROOF STEP]
have "max n2 n3 \<le> max n1 (max n2 n3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max n2 n3 \<le> max n1 (max n2 n3)
[PROOF STEP]
by (rule max.cobounded2)
[PROOF STATE]
proof (state)
this:
max n2 n3 \<le> max n1 (max n2 n3)

goal (1 subgoal):
 1. n2 \<le> max n1 (max n2 n3)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
n2 \<le> max n1 (max n2 n3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n2 \<le> max n1 (max n2 n3)

goal (1 subgoal):
 1. n2 \<le> max n1 (max n2 n3)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
n2 \<le> max n1 (max n2 n3)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_min_basis_pmdl:
  assumes "is_Groebner_basis (set xs)"
  shows "pmdl (set (comp_min_basis xs)) = pmdl (set xs)" (is "pmdl (set ?ys) = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmdl (set (comp_min_basis xs)) = pmdl (set xs)
[PROOF STEP]
using finite_set
[PROOF STATE]
proof (prove)
using this:
finite (set ?xs)

goal (1 subgoal):
 1. pmdl (set (comp_min_basis xs)) = pmdl (set xs)
[PROOF STEP]
proof (rule pmdl_eqI_adds_lt_finite)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pmdl (set (comp_min_basis xs)) \<subseteq> pmdl (set xs)
 2. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
from comp_min_basis_subset
[PROOF STATE]
proof (chain)
picking this:
set (comp_min_basis ?xs) \<subseteq> set ?xs
[PROOF STEP]
show *: "pmdl (set ?ys) \<subseteq> pmdl (set xs)"
[PROOF STATE]
proof (prove)
using this:
set (comp_min_basis ?xs) \<subseteq> set ?xs

goal (1 subgoal):
 1. pmdl (set (comp_min_basis xs)) \<subseteq> pmdl (set xs)
[PROOF STEP]
by (rule pmdl.span_mono)
[PROOF STATE]
proof (state)
this:
pmdl (set (comp_min_basis xs)) \<subseteq> pmdl (set xs)

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
assume "f \<in> pmdl (set xs)" and "f \<noteq> 0"
[PROOF STATE]
proof (state)
this:
f \<in> pmdl (set xs)
f \<noteq> 0

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
is_Groebner_basis (set xs)
f \<in> pmdl (set xs)
f \<noteq> 0
[PROOF STEP]
obtain g where "g \<in> set xs" and "g \<noteq> 0" and 1: "lt g adds\<^sub>t lt f"
[PROOF STATE]
proof (prove)
using this:
is_Groebner_basis (set xs)
f \<in> pmdl (set xs)
f \<noteq> 0

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g \<in> set xs; g \<noteq> 0; lt g adds\<^sub>t lt f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule GB_adds_lt)
[PROOF STATE]
proof (state)
this:
g \<in> set xs
g \<noteq> 0
lt g adds\<^sub>t lt f

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
from this(1, 2)
[PROOF STATE]
proof (chain)
picking this:
g \<in> set xs
g \<noteq> 0
[PROOF STEP]
obtain g' where "g' \<in> set ?ys" and 2: "lt g' adds\<^sub>t lt g"
[PROOF STATE]
proof (prove)
using this:
g \<in> set xs
g \<noteq> 0

goal (1 subgoal):
 1. (\<And>g'. \<lbrakk>g' \<in> set (comp_min_basis xs); lt g' adds\<^sub>t lt g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule comp_min_basis_adds)
[PROOF STATE]
proof (state)
this:
g' \<in> set (comp_min_basis xs)
lt g' adds\<^sub>t lt g

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
note this(1)
[PROOF STATE]
proof (state)
this:
g' \<in> set (comp_min_basis xs)

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g' \<in> set (comp_min_basis xs)

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
g' \<in> set (comp_min_basis xs)
[PROOF STEP]
have "g' \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
g' \<in> set (comp_min_basis xs)

goal (1 subgoal):
 1. g' \<noteq> 0
[PROOF STEP]
by (rule comp_min_basis_nonzero)
[PROOF STATE]
proof (state)
this:
g' \<noteq> 0

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g' \<noteq> 0

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
from 2 1
[PROOF STATE]
proof (chain)
picking this:
lt g' adds\<^sub>t lt g
lt g adds\<^sub>t lt f
[PROOF STEP]
have "lt g' adds\<^sub>t lt f"
[PROOF STATE]
proof (prove)
using this:
lt g' adds\<^sub>t lt g
lt g adds\<^sub>t lt f

goal (1 subgoal):
 1. lt g' adds\<^sub>t lt f
[PROOF STEP]
by (rule adds_term_trans)
[PROOF STATE]
proof (state)
this:
lt g' adds\<^sub>t lt f

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f \<in> pmdl (set xs); f \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
g' \<in> set (comp_min_basis xs)
g' \<noteq> 0
lt g' adds\<^sub>t lt f
[PROOF STEP]
show "\<exists>g\<in>set ?ys. g \<noteq> 0 \<and> lt g adds\<^sub>t lt f"
[PROOF STATE]
proof (prove)
using this:
g' \<in> set (comp_min_basis xs)
g' \<noteq> 0
lt g' adds\<^sub>t lt f

goal (1 subgoal):
 1. \<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g\<in>set (comp_min_basis xs). g \<noteq> 0 \<and> lt g adds\<^sub>t lt f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma qbs_eqI:
  assumes "qbs_Mx X = qbs_Mx Y"
  shows "X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y
[PROOF STEP]
by (metis Rep_quasi_borel_inverse prod.exhaust_sel qbs_Mx_def qbs_space_def assms qbs_space_eq_Mx[OF assms])


[STATEMENT]
lemma neg_le_minus_divideR_eq [field_simps]:
  "a \<le> - (b /\<^sub>R c) \<longleftrightarrow> - b \<le> c *\<^sub>R a" if "c < 0"
    for a b :: "'a :: ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> - (b /\<^sub>R c)) = (- b \<le> c *\<^sub>R a)
[PROOF STEP]
using that pos_le_minus_divideR_eq [of "- c" a "- b"]
[PROOF STATE]
proof (prove)
using this:
c < 0
0 < - c \<Longrightarrow> (a \<le> - (- b /\<^sub>R - c)) = (- c *\<^sub>R a \<le> - (- b))

goal (1 subgoal):
 1. (a \<le> - (b /\<^sub>R c)) = (- b \<le> c *\<^sub>R a)
[PROOF STEP]
by (simp add: minus_le_iff)


[STATEMENT]
lemma quotientfun_equality:
  assumes   "refl_on A r" "f respects r" "X\<in>A//r" "b\<in>f`X"
  shows     "quotientfun f X = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotientfun f X = b
[PROOF STEP]
unfolding quotientfun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE b. b \<in> f ` X) = b
[PROOF STEP]
using     assms(4) ex1_class_image[OF assms(1-3)]
[PROOF STATE]
proof (prove)
using this:
b \<in> f ` X
\<exists>!b. b \<in> f ` X

goal (1 subgoal):
 1. (THE b. b \<in> f ` X) = b
[PROOF STEP]
by        (auto intro: the1_equality)


[STATEMENT]
lemma all_roots_real_degree:
  assumes "all_roots_real p"
  shows "proots_count p UNIV =degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p UNIV = degree p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
all_roots_real p

goal (1 subgoal):
 1. proots_count p UNIV = degree p
[PROOF STEP]
proof (induct p rule:poly_root_induct_alt)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. all_roots_real 0 \<Longrightarrow> proots_count 0 UNIV = degree 0
 2. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 3. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
all_roots_real 0

goal (3 subgoals):
 1. all_roots_real 0 \<Longrightarrow> proots_count 0 UNIV = degree 0
 2. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 3. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
all_roots_real 0
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
all_roots_real 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using imaginary_unit.sel(2)
[PROOF STATE]
proof (prove)
using this:
all_roots_real 0
Im \<i> = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding all_roots_real_def
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>proots (map_poly complex_of_real 0). Im r = 0
Im \<i> = 1

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

goal (3 subgoals):
 1. all_roots_real 0 \<Longrightarrow> proots_count 0 UNIV = degree 0
 2. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 3. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
False

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

goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 2. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 2. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
case (no_proots p)
[PROOF STATE]
proof (state)
this:
poly p ?a \<noteq> 0
all_roots_real p

goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 2. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
from all_roots_real_const_iff[OF this(2)] this(1)
[PROOF STATE]
proof (chain)
picking this:
(degree p \<noteq> 0) = (\<exists>x. poly p x = 0)
poly p ?a \<noteq> 0
[PROOF STEP]
have "degree p=0"
[PROOF STATE]
proof (prove)
using this:
(degree p \<noteq> 0) = (\<exists>x. poly p x = 0)
poly p ?a \<noteq> 0

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

goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 2. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree p = 0
[PROOF STEP]
obtain a where "p=[:a:]" "a\<noteq>0"
[PROOF STATE]
proof (prove)
using this:
degree p = 0

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>p = [:a:]; a \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis degree_eq_zeroE no_proots.hyps poly_const_conv)
[PROOF STATE]
proof (state)
this:
p = [:a:]
a \<noteq> 0

goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 2. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = [:a:]
a \<noteq> 0
[PROOF STEP]
have "proots p={}"
[PROOF STATE]
proof (prove)
using this:
p = [:a:]
a \<noteq> 0

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

goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<And>a. poly p a \<noteq> 0; all_roots_real p\<rbrakk> \<Longrightarrow> proots_count p UNIV = degree p
 2. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proots p = {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
proots p = {}

goal (1 subgoal):
 1. proots_count p UNIV = degree p
[PROOF STEP]
using \<open>p=[:a:]\<close>
[PROOF STATE]
proof (prove)
using this:
proots p = {}
p = [:a:]

goal (1 subgoal):
 1. proots_count p UNIV = degree p
[PROOF STEP]
by (simp add:proots_count_def)
[PROOF STATE]
proof (state)
this:
proots_count p UNIV = degree p

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
case (root a p)
[PROOF STATE]
proof (state)
this:
all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p
all_roots_real ([:- a, 1:] * p)

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
define a1 where "a1=[:- a, 1:]"
[PROOF STATE]
proof (state)
this:
a1 = [:- a, 1:]

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
have "p\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
using root.prems
[PROOF STATE]
proof (prove)
using this:
all_roots_real ([:- a, 1:] * p)

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>all_roots_real 0; p = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using imaginary_unit.sel(2)
[PROOF STATE]
proof (prove)
using this:
Im \<i> = 1

goal (1 subgoal):
 1. \<lbrakk>all_roots_real 0; p = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
unfolding all_roots_real_def
[PROOF STATE]
proof (prove)
using this:
Im \<i> = 1

goal (1 subgoal):
 1. \<lbrakk>\<forall>r\<in>proots (map_poly complex_of_real 0). Im r = 0; p = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
have "a1\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a1 \<noteq> 0
[PROOF STEP]
unfolding a1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- a, 1:] \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a1 \<noteq> 0

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
have "proots_count (a1 * p) UNIV = proots_count a1 UNIV + proots_count p UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (a1 * p) UNIV = proots_count a1 UNIV + proots_count p UNIV
[PROOF STEP]
using \<open>p\<noteq>0\<close> \<open>a1\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
a1 \<noteq> 0

goal (1 subgoal):
 1. proots_count (a1 * p) UNIV = proots_count a1 UNIV + proots_count p UNIV
[PROOF STEP]
by (subst proots_count_times,auto)
[PROOF STATE]
proof (state)
this:
proots_count (a1 * p) UNIV = proots_count a1 UNIV + proots_count p UNIV

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proots_count (a1 * p) UNIV = proots_count a1 UNIV + proots_count p UNIV

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
have "... = 1 + degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count a1 UNIV + proots_count p UNIV = 1 + degree p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proots_count a1 UNIV + proots_count p UNIV = 1 + degree p
[PROOF STEP]
have "proots_count a1 UNIV = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count a1 UNIV = 1
[PROOF STEP]
unfolding a1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count [:- a, 1:] UNIV = 1
[PROOF STEP]
by (simp add: proots_count_pCons_1_iff)
[PROOF STATE]
proof (state)
this:
proots_count a1 UNIV = 1

goal (1 subgoal):
 1. proots_count a1 UNIV + proots_count p UNIV = 1 + degree p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
proots_count a1 UNIV = 1

goal (1 subgoal):
 1. proots_count a1 UNIV + proots_count p UNIV = 1 + degree p
[PROOF STEP]
have hyps:"proots_count p UNIV = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p UNIV = degree p
[PROOF STEP]
apply (rule root.hyps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_roots_real p
[PROOF STEP]
using root.prems[folded a1_def]
[PROOF STATE]
proof (prove)
using this:
all_roots_real (a1 * p)

goal (1 subgoal):
 1. all_roots_real p
[PROOF STEP]
unfolding all_roots_real_def
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<in>proots (map_poly complex_of_real (a1 * p)). Im r = 0

goal (1 subgoal):
 1. \<forall>r\<in>proots (map_poly complex_of_real p). Im r = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
proots_count p UNIV = degree p

goal (1 subgoal):
 1. proots_count a1 UNIV + proots_count p UNIV = 1 + degree p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
proots_count a1 UNIV = 1
proots_count p UNIV = degree p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
proots_count a1 UNIV = 1
proots_count p UNIV = degree p

goal (1 subgoal):
 1. proots_count a1 UNIV + proots_count p UNIV = 1 + degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
proots_count a1 UNIV + proots_count p UNIV = 1 + degree p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proots_count a1 UNIV + proots_count p UNIV = 1 + degree p

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proots_count a1 UNIV + proots_count p UNIV = 1 + degree p

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
have "... = degree (a1*p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + degree p = degree (a1 * p)
[PROOF STEP]
apply (subst degree_mult_eq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a1 \<noteq> 0
 2. p \<noteq> 0
 3. 1 + degree p = degree a1 + degree p
[PROOF STEP]
using \<open>a1\<noteq>0\<close> \<open>p\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
a1 \<noteq> 0
p \<noteq> 0

goal (3 subgoals):
 1. a1 \<noteq> 0
 2. p \<noteq> 0
 3. 1 + degree p = degree a1 + degree p
[PROOF STEP]
unfolding a1_def
[PROOF STATE]
proof (prove)
using this:
[:- a, 1:] \<noteq> 0
p \<noteq> 0

goal (3 subgoals):
 1. [:- a, 1:] \<noteq> 0
 2. p \<noteq> 0
 3. 1 + degree p = degree [:- a, 1:] + degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 + degree p = degree (a1 * p)

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>all_roots_real p \<Longrightarrow> proots_count p UNIV = degree p; all_roots_real ([:- a, 1:] * p)\<rbrakk> \<Longrightarrow> proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
proots_count (a1 * p) UNIV = degree (a1 * p)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
proots_count (a1 * p) UNIV = degree (a1 * p)

goal (1 subgoal):
 1. proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
unfolding a1_def
[PROOF STATE]
proof (prove)
using this:
proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)

goal (1 subgoal):
 1. proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
proots_count ([:- a, 1:] * p) UNIV = degree ([:- a, 1:] * p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem join_related [elim?]: "x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
assume "x \<sqsubseteq> y"
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> y

goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<sqsubseteq> y
[PROOF STEP]
have "dual y \<sqsubseteq> dual x"
[PROOF STATE]
proof (prove)
using this:
x \<sqsubseteq> y

goal (1 subgoal):
 1. dual y \<sqsubseteq> dual x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
dual y \<sqsubseteq> dual x

goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dual y \<sqsubseteq> dual x
[PROOF STEP]
have "dual y \<sqinter> dual x = dual y"
[PROOF STATE]
proof (prove)
using this:
dual y \<sqsubseteq> dual x

goal (1 subgoal):
 1. dual y \<sqinter> dual x = dual y
[PROOF STEP]
by (rule meet_related)
[PROOF STATE]
proof (state)
this:
dual y \<sqinter> dual x = dual y

goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dual y \<sqinter> dual x = dual y

goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
have "dual y \<sqinter> dual x = dual (y \<squnion> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual y \<sqinter> dual x = dual (y \<squnion> x)
[PROOF STEP]
by (simp only: dual_join)
[PROOF STATE]
proof (state)
this:
dual y \<sqinter> dual x = dual (y \<squnion> x)

goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dual y \<sqinter> dual x = dual (y \<squnion> x)

goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
have "y \<squnion> x = x \<squnion> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<squnion> x = x \<squnion> y
[PROOF STEP]
by (rule join_commute)
[PROOF STATE]
proof (state)
this:
y \<squnion> x = x \<squnion> y

goal (1 subgoal):
 1. x \<sqsubseteq> y \<Longrightarrow> x \<squnion> y = y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dual (x \<squnion> y) = dual y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dual (x \<squnion> y) = dual y

goal (1 subgoal):
 1. x \<squnion> y = y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<squnion> y = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closedin_Hausdorff_finite:
   "\<lbrakk>Hausdorff_space X; S \<subseteq> topspace X; finite S\<rbrakk> \<Longrightarrow> closedin X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Hausdorff_space X; S \<subseteq> topspace X; finite S\<rbrakk> \<Longrightarrow> closedin X S
[PROOF STEP]
by (simp add: compactin_imp_closedin finite_imp_compactin_eq)


[STATEMENT]
lemma sorted_stable_segment:
  "sorted cmp (stable_segment cmp x xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) xs)
[PROOF STEP]
proof (induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) [])
 2. \<And>a xs. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) xs) \<Longrightarrow> Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) (a # xs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) [])
 2. \<And>a xs. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) xs) \<Longrightarrow> Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) (a # xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) [])

goal (1 subgoal):
 1. \<And>a xs. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) xs) \<Longrightarrow> Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) xs) \<Longrightarrow> Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) (a # xs))
[PROOF STEP]
case (Cons y ys)
[PROOF STATE]
proof (state)
this:
Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) ys)

goal (1 subgoal):
 1. \<And>a xs. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) xs) \<Longrightarrow> Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) (a # xs))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) ys)

goal (1 subgoal):
 1. Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) (y # ys))
[PROOF STEP]
by (auto intro!: sorted_ConsI simp add: filter_eq_Cons_iff compare.sym)
      (auto dest: compare.trans_equiv simp add: compare.sym compare.greater_iff_sym_less)
[PROOF STATE]
proof (state)
this:
Sorting_Algorithms.sorted cmp (filter (\<lambda>y. compare cmp x y = Equiv) (y # ys))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma total_ordered_set_cong:
  assumes r: "\<And>a b. a \<in> A \<Longrightarrow> b \<in> A \<Longrightarrow> r a b \<longleftrightarrow> r' a b"
  shows "total_ordered_set A r \<longleftrightarrow> total_ordered_set A r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_ordered_set A r = total_ordered_set A r'
[PROOF STEP]
by (simp add: total_ordered_set_def r cong: total_quasi_ordered_set_cong antisymmetric_cong)


[STATEMENT]
lemma conj_refine: "c\<^sub>0 \<sqsubseteq> d \<Longrightarrow> c\<^sub>1 \<sqsubseteq> d \<Longrightarrow> c\<^sub>0 \<iinter> c\<^sub>1 \<sqsubseteq> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c\<^sub>0 \<sqsubseteq> d; c\<^sub>1 \<sqsubseteq> d\<rbrakk> \<Longrightarrow> c\<^sub>0 \<iinter> c\<^sub>1 \<sqsubseteq> d
variables:
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c\<^sub>0, c\<^sub>1, d :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
(* law 'refine-conjunction' *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c\<^sub>0 \<sqsubseteq> d; c\<^sub>1 \<sqsubseteq> d\<rbrakk> \<Longrightarrow> c\<^sub>0 \<iinter> c\<^sub>1 \<sqsubseteq> d
variables:
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c\<^sub>0, c\<^sub>1, d :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis conj_idem conj_mono)


[STATEMENT]
lemma length_postorder[simp]: "length (postorder t) = size t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (postorder t) = size t
[PROOF STEP]
by (induction t) auto


[STATEMENT]
lemma col_tranpose [simp]:
  assumes "dim_row M = n" and "i < n"
  shows "col (M\<^sup>t) i = row M i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col M\<^sup>t i = row M i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ia. ia < dim_vec (row M i) \<Longrightarrow> col M\<^sup>t i $ ia = row M i $ ia
 2. dim_vec (col M\<^sup>t i) = dim_vec (row M i)
[PROOF STEP]
show "dim_vec (col (M\<^sup>t) i) = dim_vec (row M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (col M\<^sup>t i) = dim_vec (row M i)
[PROOF STEP]
by (simp add: row_def col_def transpose_mat_def)
[PROOF STATE]
proof (state)
this:
dim_vec (col M\<^sup>t i) = dim_vec (row M i)

goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row M i) \<Longrightarrow> col M\<^sup>t i $ ia = row M i $ ia
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. ia < dim_vec (row M i) \<Longrightarrow> col M\<^sup>t i $ ia = row M i $ ia
[PROOF STEP]
show "\<And>j. j < dim_vec (row M i) \<Longrightarrow> col M\<^sup>t i $ j = row M i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j < dim_vec (row M i) \<Longrightarrow> col M\<^sup>t i $ j = row M i $ j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dim_row M = n
i < n

goal (1 subgoal):
 1. \<And>j. j < dim_vec (row M i) \<Longrightarrow> col M\<^sup>t i $ j = row M i $ j
[PROOF STEP]
by (simp add: transpose_mat_def)
[PROOF STATE]
proof (state)
this:
?j < dim_vec (row M i) \<Longrightarrow> col M\<^sup>t i $ ?j = row M i $ ?j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in valid_unMultigraph) rem_UnPath_cycle:
  assumes "finite E" "finite V" "is_trail v ps v'" "v=v'"
  shows "num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G" (is "?L=?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
proof  (cases "even(degree v' G)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. even (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
 2. odd (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
even (degree v' G)

goal (2 subgoals):
 1. even (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
 2. odd (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
hence "?L = num_of_odd_nodes G + (if even (degree v G)\<and> v\<noteq>v' then 2 else 0)"
[PROOF STATE]
proof (prove)
using this:
even (degree v' G)

goal (1 subgoal):
 1. num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G + (if even (degree v G) \<and> v \<noteq> v' then 2 else 0)
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) rem_UnPath_even)
[PROOF STATE]
proof (state)
this:
num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G + (if even (degree v G) \<and> v \<noteq> v' then 2 else 0)

goal (2 subgoals):
 1. even (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
 2. odd (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite E
finite V
is_trail v ps v'
v = v'
num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G + (if even (degree v G) \<and> v \<noteq> v' then 2 else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite E
finite V
is_trail v ps v'
v = v'
num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G + (if even (degree v G) \<and> v \<noteq> v' then 2 else 0)

goal (1 subgoal):
 1. num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G

goal (1 subgoal):
 1. odd (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. odd (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
odd (degree v' G)

goal (1 subgoal):
 1. odd (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
hence "?L = num_of_odd_nodes G + (if odd (degree v G)\<and> v\<noteq>v' then -2 else 0)"
[PROOF STATE]
proof (prove)
using this:
odd (degree v' G)

goal (1 subgoal):
 1. int (num_of_odd_nodes (rem_unPath ps G)) = int (num_of_odd_nodes G) + (if odd (degree v G) \<and> v \<noteq> v' then - 2 else 0)
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) rem_UnPath_odd)
[PROOF STATE]
proof (state)
this:
int (num_of_odd_nodes (rem_unPath ps G)) = int (num_of_odd_nodes G) + (if odd (degree v G) \<and> v \<noteq> v' then - 2 else 0)

goal (1 subgoal):
 1. odd (degree v' G) \<Longrightarrow> num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
int (num_of_odd_nodes (rem_unPath ps G)) = int (num_of_odd_nodes G) + (if odd (degree v G) \<and> v \<noteq> v' then - 2 else 0)

goal (1 subgoal):
 1. num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
using \<open>v = v'\<close>
[PROOF STATE]
proof (prove)
using this:
int (num_of_odd_nodes (rem_unPath ps G)) = int (num_of_odd_nodes G) + (if odd (degree v G) \<and> v \<noteq> v' then - 2 else 0)
v = v'

goal (1 subgoal):
 1. num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
num_of_odd_nodes (rem_unPath ps G) = num_of_odd_nodes G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem comb_planar_compat:
  assumes "comb_planar G"
  shows "kuratowski_planar G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kuratowski_planar G
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> kuratowski_planar G \<Longrightarrow> False
[PROOF STEP]
assume "\<not>?thesis"
[PROOF STATE]
proof (state)
this:
\<not> kuratowski_planar G

goal (1 subgoal):
 1. \<not> kuratowski_planar G \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> kuratowski_planar G
[PROOF STEP]
obtain G0 rev_G0 K rev_K where sub: "subgraph G0 G" "subdivision (K, rev_K) (G0, rev_G0)"
      and is_kur: "K\<^bsub>3,3\<^esub> K \<or> K\<^bsub>5\<^esub> K"
[PROOF STATE]
proof (prove)
using this:
\<not> kuratowski_planar G

goal (1 subgoal):
 1. (\<And>G0 K rev_K rev_G0. \<lbrakk>subgraph G0 G; subdivision (K, rev_K) (G0, rev_G0); K\<^bsub>3,3\<^esub> K \<or> K\<^bsub>5\<^esub> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding kuratowski_planar_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<nexists>H. subgraph H G \<and> (\<exists>K rev_K rev_H. subdivision (K, rev_K) (H, rev_H) \<and> (K\<^bsub>3,3\<^esub> K \<or> K\<^bsub>5\<^esub> K)))

goal (1 subgoal):
 1. (\<And>G0 K rev_K rev_G0. \<lbrakk>subgraph G0 G; subdivision (K, rev_K) (G0, rev_G0); K\<^bsub>3,3\<^esub> K \<or> K\<^bsub>5\<^esub> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subgraph G0 G
subdivision (K, rev_K) (G0, rev_G0)
K\<^bsub>3,3\<^esub> K \<or> K\<^bsub>5\<^esub> K

goal (1 subgoal):
 1. \<not> kuratowski_planar G \<Longrightarrow> False
[PROOF STEP]
have "comb_planar K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comb_planar K
[PROOF STEP]
using sub assms
[PROOF STATE]
proof (prove)
using this:
subgraph G0 G
subdivision (K, rev_K) (G0, rev_G0)
comb_planar G

goal (1 subgoal):
 1. comb_planar K
[PROOF STEP]
by (metis subgraph_comb_planar subdivision_comb_planar subdivision_bidir)
[PROOF STATE]
proof (state)
this:
comb_planar K

goal (1 subgoal):
 1. \<not> kuratowski_planar G \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
comb_planar K

goal (1 subgoal):
 1. \<not> kuratowski_planar G \<Longrightarrow> False
[PROOF STEP]
have "\<not>comb_planar K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> comb_planar K
[PROOF STEP]
using is_kur
[PROOF STATE]
proof (prove)
using this:
K\<^bsub>3,3\<^esub> K \<or> K\<^bsub>5\<^esub> K

goal (1 subgoal):
 1. \<not> comb_planar K
[PROOF STEP]
by (metis K5_not_comb_planar K33_not_comb_planar)
[PROOF STATE]
proof (state)
this:
\<not> comb_planar K

goal (1 subgoal):
 1. \<not> kuratowski_planar G \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
comb_planar K
\<not> comb_planar K
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
comb_planar K
\<not> comb_planar K

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NFOR_disjuncts: "nf_ACI \<psi> \<Longrightarrow> NFOR (disjuncts \<psi>) = \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nf_ACI \<psi> \<Longrightarrow> NFOR (disjuncts \<psi>) = \<psi>
[PROOF STEP]
using nFOR_disjuncts[of \<psi>]
[PROOF STATE]
proof (prove)
using this:
nf_ACI \<psi> \<Longrightarrow> nFOR (disjuncts_list \<psi>) = \<psi>

goal (1 subgoal):
 1. nf_ACI \<psi> \<Longrightarrow> NFOR (disjuncts \<psi>) = \<psi>
[PROOF STEP]
unfolding NFOR_def o_apply juncts_eq_set_juncts_list
[PROOF STATE]
proof (prove)
using this:
nf_ACI \<psi> \<Longrightarrow> nFOR (disjuncts_list \<psi>) = \<psi>

goal (1 subgoal):
 1. nf_ACI \<psi> \<Longrightarrow> nFOR (sorted_list_of_set (set (disjuncts_list \<psi>))) = \<psi>
[PROOF STEP]
by (metis finite_set finite_sorted_distinct_unique nf_ACI_D(1,3) sorted_list_of_set)


[STATEMENT]
lemma sums_add: "f sums a \<Longrightarrow> g sums b \<Longrightarrow> (\<lambda>n. f n + g n) sums (a + b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f sums a; g sums b\<rbrakk> \<Longrightarrow> (\<lambda>n. f n + g n) sums (a + b)
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> a; (\<lambda>n. sum g {..<n}) \<longlonglongrightarrow> b\<rbrakk> \<Longrightarrow> (\<lambda>n. \<Sum>n<n. f n + g n) \<longlonglongrightarrow> a + b
[PROOF STEP]
by (simp add: sum.distrib tendsto_add)


[STATEMENT]
lemma polar_pole: "polar (pole l) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polar (pole l) = l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. polar (pole l) = l
[PROOF STEP]
from pole_rep_non_zero
[PROOF STATE]
proof (chain)
picking this:
M *v proj2_line_rep ?l \<noteq> 0
[PROOF STEP]
have "polar (pole l) = proj2_line_abs (M *v (M *v proj2_line_rep l))"
[PROOF STATE]
proof (prove)
using this:
M *v proj2_line_rep ?l \<noteq> 0

goal (1 subgoal):
 1. polar (pole l) = proj2_line_abs (M *v (M *v proj2_line_rep l))
[PROOF STEP]
unfolding pole_def
[PROOF STATE]
proof (prove)
using this:
M *v proj2_line_rep ?l \<noteq> 0

goal (1 subgoal):
 1. polar (proj2_abs (M *v proj2_line_rep l)) = proj2_line_abs (M *v (M *v proj2_line_rep l))
[PROOF STEP]
by (rule polar_abs)
[PROOF STATE]
proof (state)
this:
polar (pole l) = proj2_line_abs (M *v (M *v proj2_line_rep l))

goal (1 subgoal):
 1. polar (pole l) = l
[PROOF STEP]
with M_self_inverse
[PROOF STATE]
proof (chain)
picking this:
M ** M = mat 1
polar (pole l) = proj2_line_abs (M *v (M *v proj2_line_rep l))
[PROOF STEP]
show "polar (pole l) = l"
[PROOF STATE]
proof (prove)
using this:
M ** M = mat 1
polar (pole l) = proj2_line_abs (M *v (M *v proj2_line_rep l))

goal (1 subgoal):
 1. polar (pole l) = l
[PROOF STEP]
by (simp add: matrix_vector_mul_assoc proj2_line_abs_rep
      matrix_vector_mul_lid)
[PROOF STATE]
proof (state)
this:
polar (pole l) = l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordered_incidence_sysI:
  assumes "finite_incidence_system \<V> \<B>"
  assumes "\<V>s \<in> permutations_of_set \<V>" and "\<B>s \<in> permutations_of_multiset \<B>"
  shows "ordered_incidence_system \<V>s \<B>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
have veq: "\<V> = set \<V>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<V> = set \<V>s
[PROOF STEP]
using assms permutations_of_setD(1)
[PROOF STATE]
proof (prove)
using this:
finite_incidence_system \<V> \<B>
\<V>s \<in> permutations_of_set \<V>
\<B>s \<in> permutations_of_multiset \<B>
?xs \<in> permutations_of_set ?A \<Longrightarrow> set ?xs = ?A

goal (1 subgoal):
 1. \<V> = set \<V>s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<V> = set \<V>s

goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
have beq: "\<B> = mset \<B>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B> = mset \<B>s
[PROOF STEP]
using assms permutations_of_multisetD
[PROOF STATE]
proof (prove)
using this:
finite_incidence_system \<V> \<B>
\<V>s \<in> permutations_of_set \<V>
\<B>s \<in> permutations_of_multiset \<B>
?xs \<in> permutations_of_multiset ?A \<Longrightarrow> mset ?xs = ?A

goal (1 subgoal):
 1. \<B> = mset \<B>s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<B> = mset \<B>s

goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
interpret fisys: finite_incidence_system "set \<V>s" "mset \<B>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_incidence_system (set \<V>s) (mset \<B>s)
[PROOF STEP]
using assms(1) veq beq
[PROOF STATE]
proof (prove)
using this:
finite_incidence_system \<V> \<B>
\<V> = set \<V>s
\<B> = mset \<B>s

goal (1 subgoal):
 1. finite_incidence_system (set \<V>s) (mset \<B>s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordered_incidence_system \<V>s \<B>s
[PROOF STEP]
proof (unfold_locales)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>b. b \<in># mset \<B>s \<Longrightarrow> b \<subseteq> set \<V>s
 2. distinct \<V>s
[PROOF STEP]
show "\<And>b. b \<in># mset \<B>s \<Longrightarrow> b \<subseteq> set \<V>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. b \<in># mset \<B>s \<Longrightarrow> b \<subseteq> set \<V>s
[PROOF STEP]
using fisys.wellformed
[PROOF STATE]
proof (prove)
using this:
?b \<in># mset \<B>s \<Longrightarrow> ?b \<subseteq> set \<V>s

goal (1 subgoal):
 1. \<And>b. b \<in># mset \<B>s \<Longrightarrow> b \<subseteq> set \<V>s
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?b \<in># mset \<B>s \<Longrightarrow> ?b \<subseteq> set \<V>s

goal (1 subgoal):
 1. distinct \<V>s
[PROOF STEP]
show "distinct \<V>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct \<V>s
[PROOF STEP]
using assms permutations_of_setD(2)
[PROOF STATE]
proof (prove)
using this:
finite_incidence_system \<V> \<B>
\<V>s \<in> permutations_of_set \<V>
\<B>s \<in> permutations_of_multiset \<B>
?xs \<in> permutations_of_set ?A \<Longrightarrow> distinct ?xs

goal (1 subgoal):
 1. distinct \<V>s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct \<V>s

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ordered_incidence_system \<V>s \<B>s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nfoldli_alt_simp[simp]:
  "nfoldli_alt [] c f s = RETURN s"
  "nfoldli_alt (x#ls) c f s = do {
    let b = c s;
    if b then f x s \<bind> nfoldli_alt ls c f else RETURN s
  }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfoldli_alt [] c f s = RETURN s &&& nfoldli_alt (x # ls) c f s = (let b = c s in if b then f x s \<bind> nfoldli_alt ls c f else RETURN s)
[PROOF STEP]
apply (subst nfoldli_alt_eq, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfoldli_alt (x # ls) c f s = (let b = c s in if b then f x s \<bind> nfoldli_alt ls c f else RETURN s)
[PROOF STEP]
apply (subst nfoldli_alt_eq, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done