[STATEMENT]
lemma (in nomulti_digraph) graph_conversion_bij2: "digraph_iso G (to_pre_digraph (from_pre_digraph G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
define iso
    where "iso = \<lparr>
      iso_verts = id :: 'a \<Rightarrow> 'a,
      iso_arcs = arc_to_ends G,
      iso_head = snd,
      iso_tail = fst
    \<rparr>"
[PROOF STATE]
proof (state)
this:
iso = \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr>

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
have "inj_on (iso_verts iso) (pre_digraph.verts G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (iso_verts iso) (pre_digraph.verts G)
[PROOF STEP]
unfolding iso_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (iso_verts \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr>) (pre_digraph.verts G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on (iso_verts iso) (pre_digraph.verts G)

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on (iso_verts iso) (pre_digraph.verts G)

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
have "inj_on (iso_arcs iso) (pre_digraph.arcs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (iso_arcs iso) (pre_digraph.arcs G)
[PROOF STEP]
unfolding iso_def arc_to_ends_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (iso_arcs \<lparr>iso_verts = id, iso_arcs = \<lambda>e. (tail G e, head G e), iso_head = snd, iso_tail = fst\<rparr>) (pre_digraph.arcs G)
[PROOF STEP]
by (simp add: arc_to_ends_def inj_onI no_multi_arcs)
[PROOF STATE]
proof (state)
this:
inj_on (iso_arcs iso) (pre_digraph.arcs G)

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on (iso_arcs iso) (pre_digraph.arcs G)

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
have "\<forall>a \<in> pre_digraph.arcs G.
    iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a)
    \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a)
[PROOF STEP]
unfolding iso_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>pre_digraph.arcs G. iso_verts \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> (tail G a) = iso_tail \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> (iso_arcs \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> a) \<and> iso_verts \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> (head G a) = iso_head \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> (iso_arcs \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> a)
[PROOF STEP]
by (simp add: arc_to_ends_def)
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a)

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on (iso_verts iso) (pre_digraph.verts G)
inj_on (iso_arcs iso) (pre_digraph.arcs G)
\<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a)
[PROOF STEP]
have "digraph_isomorphism iso"
[PROOF STATE]
proof (prove)
using this:
inj_on (iso_verts iso) (pre_digraph.verts G)
inj_on (iso_arcs iso) (pre_digraph.arcs G)
\<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a)

goal (1 subgoal):
 1. digraph_isomorphism iso
[PROOF STEP]
unfolding digraph_isomorphism_def
[PROOF STATE]
proof (prove)
using this:
inj_on (iso_verts iso) (pre_digraph.verts G)
inj_on (iso_arcs iso) (pre_digraph.arcs G)
\<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a)

goal (1 subgoal):
 1. wf_digraph G \<and> inj_on (iso_verts iso) (pre_digraph.verts G) \<and> inj_on (iso_arcs iso) (pre_digraph.arcs G) \<and> (\<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a))
[PROOF STEP]
using arc_to_ends_def wf_digraph_axioms
[PROOF STATE]
proof (prove)
using this:
inj_on (iso_verts iso) (pre_digraph.verts G)
inj_on (iso_arcs iso) (pre_digraph.arcs G)
\<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a)
arc_to_ends ?G ?e \<equiv> (tail ?G ?e, head ?G ?e)
wf_digraph G

goal (1 subgoal):
 1. wf_digraph G \<and> inj_on (iso_verts iso) (pre_digraph.verts G) \<and> inj_on (iso_arcs iso) (pre_digraph.arcs G) \<and> (\<forall>a\<in>pre_digraph.arcs G. iso_verts iso (tail G a) = iso_tail iso (iso_arcs iso a) \<and> iso_verts iso (head G a) = iso_head iso (iso_arcs iso a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
digraph_isomorphism iso

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
digraph_isomorphism iso

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
have "to_pre_digraph (from_pre_digraph G) = app_iso iso G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_pre_digraph (from_pre_digraph G) = app_iso iso G
[PROOF STEP]
unfolding to_pre_digraph_def from_pre_digraph_def iso_def app_iso_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>pre_digraph.verts = V\<^bsub>\<lparr>Graph.verts = pre_digraph.verts G, arcs = arcs_ends G\<rparr>\<^esub>, arcs = E\<^bsub>\<lparr>Graph.verts = pre_digraph.verts G, arcs = arcs_ends G\<rparr>\<^esub>, tail = fst, head = snd\<rparr> = \<lparr>pre_digraph.verts = iso_verts \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> ` pre_digraph.verts G, arcs = iso_arcs \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr> ` pre_digraph.arcs G, tail = iso_tail \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr>, head = iso_head \<lparr>iso_verts = id, iso_arcs = arc_to_ends G, iso_head = snd, iso_tail = fst\<rparr>\<rparr>
[PROOF STEP]
by (simp_all add: arcs_ends_def)
[PROOF STATE]
proof (state)
this:
to_pre_digraph (from_pre_digraph G) = app_iso iso G

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
digraph_isomorphism iso
to_pre_digraph (from_pre_digraph G) = app_iso iso G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism iso
to_pre_digraph (from_pre_digraph G) = app_iso iso G

goal (1 subgoal):
 1. digraph_iso G (to_pre_digraph (from_pre_digraph G))
[PROOF STEP]
unfolding digraph_iso_def
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism iso
to_pre_digraph (from_pre_digraph G) = app_iso iso G

goal (1 subgoal):
 1. \<exists>f. digraph_isomorphism f \<and> to_pre_digraph (from_pre_digraph G) = app_iso f G
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
digraph_iso G (to_pre_digraph (from_pre_digraph G))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plus_float_interval_mono:
  "plus_float_interval prec A B \<le> plus_float_interval prec X Y"
  if "A \<le> X" "B \<le> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. plus_float_interval prec A B \<le> plus_float_interval prec X Y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
A \<le> X
B \<le> Y

goal (1 subgoal):
 1. plus_float_interval prec A B \<le> plus_float_interval prec X Y
[PROOF STEP]
by (auto simp: less_eq_interval_def lower_plus_float_interval upper_plus_float_interval
                 float_plus_down.rep_eq float_plus_up.rep_eq plus_down_mono plus_up_mono)


[STATEMENT]
lemma \<mu>_cong: assumes "\<And> k. j < i \<Longrightarrow> k \<le> j \<Longrightarrow> f1 ! k = f2 ! k"
  and i: "i < length f1" "i < length f2"
  and "j < i \<Longrightarrow> f1 ! i = f2 ! i"
  shows "\<mu> f1 i j = \<mu> f2 i j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom f1) i j = gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom f2) i j
[PROOF STEP]
by (rule gs.\<mu>_cong, insert assms, auto)


[STATEMENT]
lemma cbox_in_cball':
  fixes x::"'a::euclidean_space"
  assumes "0 < r"
  shows "\<exists>b > 0. b \<le> r \<and> (\<exists>B. B = (\<Sum>i\<in>Basis. b *\<^sub>R i) \<and> (\<forall>y \<in> cbox (x - B) (x + B). y \<in> cball x r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b>0. b \<le> r \<and> (\<exists>B. B = sum ((*\<^sub>R) b) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r))
[PROOF STEP]
proof (rule, safe)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 < ?b
 2. ?b \<le> r
 3. \<exists>B. B = sum ((*\<^sub>R) ?b) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r)
[PROOF STEP]
have "r / sqrt (real DIM('a)) \<le> r / 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r / sqrt (real DIM('a)) \<le> r / 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. r / sqrt (real DIM('a)) \<le> r / 1
[PROOF STEP]
by (auto simp: divide_simps real_of_nat_ge_one_iff)
[PROOF STATE]
proof (state)
this:
r / sqrt (real DIM('a)) \<le> r / 1

goal (3 subgoals):
 1. 0 < ?b
 2. ?b \<le> r
 3. \<exists>B. B = sum ((*\<^sub>R) ?b) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r)
[PROOF STEP]
thus "r / sqrt (real DIM('a)) \<le> r"
[PROOF STATE]
proof (prove)
using this:
r / sqrt (real DIM('a)) \<le> r / 1

goal (1 subgoal):
 1. r / sqrt (real DIM('a)) \<le> r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r / sqrt (real DIM('a)) \<le> r

goal (2 subgoals):
 1. 0 < r / sqrt (real DIM('a))
 2. \<exists>B. B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < r / sqrt (real DIM('a))
 2. \<exists>B. B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r)
[PROOF STEP]
let ?B = "\<Sum>i\<in>Basis. (r / sqrt (real DIM('a))) *\<^sub>R i"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < r / sqrt (real DIM('a))
 2. \<exists>B. B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r)
[PROOF STEP]
show "\<exists>B. B = ?B \<and> (\<forall>y \<in> cbox (x - B) (x + B). y \<in> cball x r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B. B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r)
[PROOF STEP]
proof (rule, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis
 2. \<And>y. y \<in> cbox (x - ?B) (x + ?B) \<Longrightarrow> y \<in> cball x r
[PROOF STEP]
fix y::'a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis
 2. \<And>y. y \<in> cbox (x - ?B) (x + ?B) \<Longrightarrow> y \<in> cball x r
[PROOF STEP]
assume "y \<in> cbox (x - ?B) (x + ?B)"
[PROOF STATE]
proof (state)
this:
y \<in> cbox (x - sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) (x + sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis)

goal (2 subgoals):
 1. ?B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis
 2. \<And>y. y \<in> cbox (x - ?B) (x + ?B) \<Longrightarrow> y \<in> cball x r
[PROOF STEP]
hence bounds:
      "\<And>i. i \<in> Basis \<Longrightarrow> (x - ?B) \<bullet> i \<le> y \<bullet> i"
      "\<And>i. i \<in> Basis \<Longrightarrow> y \<bullet> i \<le> (x + ?B) \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
y \<in> cbox (x - sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) (x + sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis)

goal (1 subgoal):
 1. (\<And>i. i \<in> Basis \<Longrightarrow> (x - sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> i \<le> y \<bullet> i) &&& (\<And>i. i \<in> Basis \<Longrightarrow> y \<bullet> i \<le> (x + sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> i)
[PROOF STEP]
by (auto simp: mem_box)
[PROOF STATE]
proof (state)
this:
?i1 \<in> Basis \<Longrightarrow> (x - sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> ?i1 \<le> y \<bullet> ?i1
?i1 \<in> Basis \<Longrightarrow> y \<bullet> ?i1 \<le> (x + sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> ?i1

goal (2 subgoals):
 1. ?B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis
 2. \<And>y. y \<in> cbox (x - ?B) (x + ?B) \<Longrightarrow> y \<in> cball x r
[PROOF STEP]
show "y \<in> cball x r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> cball x r
[PROOF STEP]
proof (intro cube_in_cball)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < r
 2. \<And>i. i \<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt (real DIM('a))
[PROOF STEP]
fix i :: 'a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < r
 2. \<And>i. i \<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt (real DIM('a))
[PROOF STEP]
assume "i\<in> Basis"
[PROOF STATE]
proof (state)
this:
i \<in> Basis

goal (2 subgoals):
 1. 0 < r
 2. \<And>i. i \<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt (real DIM('a))
[PROOF STEP]
with bounds
[PROOF STATE]
proof (chain)
picking this:
?i1 \<in> Basis \<Longrightarrow> (x - sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> ?i1 \<le> y \<bullet> ?i1
?i1 \<in> Basis \<Longrightarrow> y \<bullet> ?i1 \<le> (x + sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> ?i1
i \<in> Basis
[PROOF STEP]
have bounds_comp:
        "x \<bullet> i - r / sqrt (real DIM('a)) \<le> y \<bullet> i"
        "y \<bullet> i \<le> x \<bullet> i + r / sqrt (real DIM('a))"
[PROOF STATE]
proof (prove)
using this:
?i1 \<in> Basis \<Longrightarrow> (x - sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> ?i1 \<le> y \<bullet> ?i1
?i1 \<in> Basis \<Longrightarrow> y \<bullet> ?i1 \<le> (x + sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis) \<bullet> ?i1
i \<in> Basis

goal (1 subgoal):
 1. x \<bullet> i - r / sqrt (real DIM('a)) \<le> y \<bullet> i &&& y \<bullet> i \<le> x \<bullet> i + r / sqrt (real DIM('a))
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
x \<bullet> i - r / sqrt (real DIM('a)) \<le> y \<bullet> i
y \<bullet> i \<le> x \<bullet> i + r / sqrt (real DIM('a))

goal (2 subgoals):
 1. 0 < r
 2. \<And>i. i \<in> Basis \<Longrightarrow> dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt (real DIM('a))
[PROOF STEP]
thus "dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt (real DIM('a))"
[PROOF STATE]
proof (prove)
using this:
x \<bullet> i - r / sqrt (real DIM('a)) \<le> y \<bullet> i
y \<bullet> i \<le> x \<bullet> i + r / sqrt (real DIM('a))

goal (1 subgoal):
 1. dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt (real DIM('a))
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
x \<bullet> i - r / sqrt (real DIM('a)) \<le> y \<bullet> i
y \<bullet> i \<le> x \<bullet> i + r / sqrt (real DIM('a))

goal (1 subgoal):
 1. \<bar>x \<bullet> i - y \<bullet> i\<bar> \<le> r / sqrt (real DIM('a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (x \<bullet> i) (y \<bullet> i) \<le> r / sqrt (real DIM('a))

goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
qed (auto simp add: assms)
[PROOF STATE]
proof (state)
this:
y \<in> cball x r

goal (1 subgoal):
 1. sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis
[PROOF STEP]
qed (rule)
[PROOF STATE]
proof (state)
this:
\<exists>B. B = sum ((*\<^sub>R) (r / sqrt (real DIM('a)))) Basis \<and> (\<forall>y\<in>cbox (x - B) (x + B). y \<in> cball x r)

goal (1 subgoal):
 1. 0 < r / sqrt (real DIM('a))
[PROOF STEP]
qed (auto simp: assms)


[STATEMENT]
lemma to_fun_diff:
  assumes "p \<in> carrier P"
  assumes "q \<in> carrier P"
  assumes "a \<in> carrier R"
  shows "to_fun (p \<ominus>\<^bsub>P\<^esub> q) a = to_fun p a \<ominus> to_fun q a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (p \<ominus>\<^bsub>P\<^esub> q) a = to_fun p a \<ominus> to_fun q a
[PROOF STEP]
using to_fun_plus[of "\<ominus>\<^bsub>P\<^esub> q" p a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<ominus>\<^bsub>P\<^esub> q \<in> carrier P; p \<in> carrier P; a \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (p \<oplus>\<^bsub>P\<^esub> \<ominus>\<^bsub>P\<^esub> q) a = to_fun p a \<oplus> to_fun (\<ominus>\<^bsub>P\<^esub> q) a

goal (1 subgoal):
 1. to_fun (p \<ominus>\<^bsub>P\<^esub> q) a = to_fun p a \<ominus> to_fun q a
[PROOF STEP]
by (simp add: P.minus_eq R.minus_eq assms(1) assms(2) assms(3) to_fun_minus)


[STATEMENT]
lemma intersects_x_axis_positive_iff:
  assumes "is_poincare_line H" and "H \<noteq> x_axis"
  shows "intersects_x_axis_positive H \<longleftrightarrow>
         (\<exists> x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis)" (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. intersects_x_axis_positive H = (\<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. intersects_x_axis_positive H \<Longrightarrow> \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis
 2. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis \<Longrightarrow> intersects_x_axis_positive H
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
intersects_x_axis_positive H

goal (2 subgoals):
 1. intersects_x_axis_positive H \<Longrightarrow> \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis
 2. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis \<Longrightarrow> intersects_x_axis_positive H
[PROOF STEP]
thus ?rhs
[PROOF STATE]
proof (prove)
using this:
intersects_x_axis_positive H

goal (1 subgoal):
 1. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis
[PROOF STEP]
using intersects_x_axis_positive_iff'[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
intersects_x_axis_positive H
intersects_x_axis_positive H = (calc_x_axis_intersection H \<in> unit_disc \<and> calc_x_axis_intersection H \<in> circline_set H \<inter> positive_x_axis)

goal (1 subgoal):
 1. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis

goal (1 subgoal):
 1. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis \<Longrightarrow> intersects_x_axis_positive H
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis \<Longrightarrow> intersects_x_axis_positive H
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis

goal (1 subgoal):
 1. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis \<Longrightarrow> intersects_x_axis_positive H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis
[PROOF STEP]
obtain x where "x \<in> unit_disc" "x \<in> circline_set H \<inter> positive_x_axis"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> unit_disc; x \<in> circline_set H \<inter> positive_x_axis\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> unit_disc
x \<in> circline_set H \<inter> positive_x_axis

goal (1 subgoal):
 1. \<exists>x. x \<in> unit_disc \<and> x \<in> circline_set H \<inter> positive_x_axis \<Longrightarrow> intersects_x_axis_positive H
[PROOF STEP]
thus ?lhs
[PROOF STATE]
proof (prove)
using this:
x \<in> unit_disc
x \<in> circline_set H \<inter> positive_x_axis

goal (1 subgoal):
 1. intersects_x_axis_positive H
[PROOF STEP]
using unique_calc_x_axis_intersection[OF assms, of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> unit_disc
x \<in> circline_set H \<inter> positive_x_axis
\<lbrakk>x \<in> unit_disc; x \<in> circline_set H \<inter> circline_set x_axis\<rbrakk> \<Longrightarrow> x = calc_x_axis_intersection H

goal (1 subgoal):
 1. intersects_x_axis_positive H
[PROOF STEP]
using intersects_x_axis_positive_iff'[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
x \<in> unit_disc
x \<in> circline_set H \<inter> positive_x_axis
\<lbrakk>x \<in> unit_disc; x \<in> circline_set H \<inter> circline_set x_axis\<rbrakk> \<Longrightarrow> x = calc_x_axis_intersection H
intersects_x_axis_positive H = (calc_x_axis_intersection H \<in> unit_disc \<and> calc_x_axis_intersection H \<in> circline_set H \<inter> positive_x_axis)

goal (1 subgoal):
 1. intersects_x_axis_positive H
[PROOF STEP]
unfolding positive_x_axis_def
[PROOF STATE]
proof (prove)
using this:
x \<in> unit_disc
x \<in> circline_set H \<inter> {z \<in> circline_set x_axis. z \<noteq> \<infinity>\<^sub>h \<and> 0 < Re (to_complex z)}
\<lbrakk>x \<in> unit_disc; x \<in> circline_set H \<inter> circline_set x_axis\<rbrakk> \<Longrightarrow> x = calc_x_axis_intersection H
intersects_x_axis_positive H = (calc_x_axis_intersection H \<in> unit_disc \<and> calc_x_axis_intersection H \<in> circline_set H \<inter> {z \<in> circline_set x_axis. z \<noteq> \<infinity>\<^sub>h \<and> 0 < Re (to_complex z)})

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_bounded_finite:
  assumes "bounded A" shows "emeasure lborel A < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel A < \<infinity>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure lborel A < \<infinity>
[PROOF STEP]
obtain a b where "A \<subseteq> cbox a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. A \<subseteq> cbox a b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson bounded_subset_cbox_symmetric \<open>bounded A\<close>)
[PROOF STATE]
proof (state)
this:
A \<subseteq> cbox a b

goal (1 subgoal):
 1. emeasure lborel A < \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> cbox a b
[PROOF STEP]
have "emeasure lborel A \<le> emeasure lborel (cbox a b)"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> cbox a b

goal (1 subgoal):
 1. emeasure lborel A \<le> emeasure lborel (cbox a b)
[PROOF STEP]
by (intro emeasure_mono) auto
[PROOF STATE]
proof (state)
this:
emeasure lborel A \<le> emeasure lborel (cbox a b)

goal (1 subgoal):
 1. emeasure lborel A < \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel A \<le> emeasure lborel (cbox a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
emeasure lborel A \<le> emeasure lborel (cbox a b)

goal (1 subgoal):
 1. emeasure lborel A < \<infinity>
[PROOF STEP]
by (auto simp: emeasure_lborel_cbox_eq prod_nonneg less_top[symmetric] top_unique split: if_split_asm)
[PROOF STATE]
proof (state)
this:
emeasure lborel A < \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma self_financingE:
  assumes "self_financing Mkt p"
  shows "\<forall>n. val_process Mkt p n = cls_val_process Mkt p n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
show "val_process Mkt p n = cls_val_process Mkt p n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> val_process Mkt p n = cls_val_process Mkt p n
 2. n \<noteq> 0 \<Longrightarrow> val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> val_process Mkt p n = cls_val_process Mkt p n
 2. n \<noteq> 0 \<Longrightarrow> val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
self_financing Mkt p

goal (1 subgoal):
 1. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
unfolding self_financing_def
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0
\<forall>n. val_process Mkt p (Suc n) = cls_val_process Mkt p (Suc n)

goal (1 subgoal):
 1. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
by (metis up_cl_proc.elims)
[PROOF STATE]
proof (state)
this:
val_process Mkt p n = cls_val_process Mkt p n

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n = 0 \<Longrightarrow> val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. val_process Mkt p n = cls_val_process Mkt p n
[PROOF STEP]
by (simp add: cls_val_process_def val_process_def)
[PROOF STATE]
proof (state)
this:
val_process Mkt p n = cls_val_process Mkt p n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
val_process Mkt p n = cls_val_process Mkt p n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_chart_smooth_on: "k-smooth_on (codomain c) (inv_chart c)" if "c \<in> manifold_eucl.atlas k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on (codomain c) (inv_chart c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k-smooth_on (codomain c) (inv_chart c)
[PROOF STEP]
have "k-smooth_compat c chart_eucl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_compat c chart_eucl
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c \<in> manifold_eucl.atlas k

goal (1 subgoal):
 1. k-smooth_compat c chart_eucl
[PROOF STEP]
by (auto intro!: manifold_eucl.atlas_is_atlas)
[PROOF STATE]
proof (state)
this:
k-smooth_compat c chart_eucl

goal (1 subgoal):
 1. k-smooth_on (codomain c) (inv_chart c)
[PROOF STEP]
from smooth_compat_D1[OF this]
[PROOF STATE]
proof (chain)
picking this:
k-smooth_on (apply_chart c ` (domain c \<inter> domain chart_eucl)) (apply_chart chart_eucl \<circ> inv_chart c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k-smooth_on (apply_chart c ` (domain c \<inter> domain chart_eucl)) (apply_chart chart_eucl \<circ> inv_chart c)

goal (1 subgoal):
 1. k-smooth_on (codomain c) (inv_chart c)
[PROOF STEP]
by (auto simp: o_def image_domain_eq)
[PROOF STATE]
proof (state)
this:
k-smooth_on (codomain c) (inv_chart c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ladder_stepdown_i_0:
  assumes "length L > 1"
  shows "ladder_i (ladder_stepdown L) 0 = ladder_i L 1 + ladder_ix L 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ladder_i (ladder_stepdown L) 0 = ladder_i L 1 + ladder_ix L 1
[PROOF STEP]
using ladder_stepdown_prepare[OF assms] ladder_i_def ladder_j_def deriv_j_def
[PROOF STATE]
proof (prove)
using this:
L = (ladder_n L 0, ladder_j L 0, ladder_i L 0) # (ladder_n L 1, ladder_j L 1, ladder_ix L 1) # drop 2 L
ladder_i ?L ?index = (if ?index = 0 then deriv_i (hd ?L) else ladder_j ?L (?index - 1))
ladder_j ?L ?index = deriv_j (?L ! ?index)
deriv_j ?d = fst (snd ?d)

goal (1 subgoal):
 1. ladder_i (ladder_stepdown L) 0 = ladder_i L 1 + ladder_ix L 1
[PROOF STEP]
by (metis One_nat_def deriv_i_def diff_Suc_1 ladder_stepdown.simps(3) list.sel(1)
    snd_conv zero_neq_one)


[STATEMENT]
lemma urel_integer_inverse: assumes x: "urel_integer x x'"
  shows "urel_integer (inverse_p_integer pp x) (inverse_p p x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel_integer (inverse_p_integer pp x) (inverse_p p x')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. urel_integer (inverse_p_integer pp x) (inverse_p p x')
[PROOF STEP]
have p: "urel_integer (pp - 2) (int (nat (p - 2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel_integer (pp - 2) (int (nat (p - 2)))
[PROOF STEP]
using p2
[PROOF STATE]
proof (prove)
using this:
2 \<le> p

goal (1 subgoal):
 1. urel_integer (pp - 2) (int (nat (p - 2)))
[PROOF STEP]
unfolding urel_integer_def
[PROOF STATE]
proof (prove)
using this:
2 \<le> p

goal (1 subgoal):
 1. int (nat (p - 2)) = int_of_integer (pp - 2) \<and> 0 \<le> int (nat (p - 2)) \<and> int (nat (p - 2)) < p
[PROOF STEP]
unfolding ppp
[PROOF STATE]
proof (prove)
using this:
2 \<le> int_of_integer pp

goal (1 subgoal):
 1. int (nat (int_of_integer pp - 2)) = int_of_integer (pp - 2) \<and> 0 \<le> int (nat (int_of_integer pp - 2)) \<and> int (nat (int_of_integer pp - 2)) < int_of_integer pp
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
urel_integer (pp - 2) (int (nat (p - 2)))

goal (1 subgoal):
 1. urel_integer (inverse_p_integer pp x) (inverse_p p x')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel_integer (inverse_p_integer pp x) (inverse_p p x')
[PROOF STEP]
unfolding inverse_p_integer_def inverse_p_def urel_integer_eq[OF x urel_integer_0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel_integer (if x' = 0 then 0 else power_p_integer pp x (pp - 2)) (if x' = 0 then 0 else power_p p x' (nat (p - 2)))
[PROOF STEP]
using urel_integer_0 urel_integer_power[OF x p]
[PROOF STATE]
proof (prove)
using this:
urel_integer 0 0
urel_integer (power_p_integer pp x (pp - 2)) (power_p p x' (nat (p - 2)))

goal (1 subgoal):
 1. urel_integer (if x' = 0 then 0 else power_p_integer pp x (pp - 2)) (if x' = 0 then 0 else power_p p x' (nat (p - 2)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
urel_integer (inverse_p_integer pp x) (inverse_p p x')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cnj_mono: "insert A H \<turnstile> B \<Longrightarrow> insert C H \<turnstile> D \<Longrightarrow> insert (A AND C) H \<turnstile> B AND D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>insert A H \<turnstile> B; insert C H \<turnstile> D\<rbrakk> \<Longrightarrow> insert (A AND C) H \<turnstile> B AND D
[PROOF STEP]
by (metis cnj_E1 cnj_E2 cnj_I Hyp Un_absorb2 cut insertI1 subset_insertI)


[STATEMENT]
lemma bij: "bij f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij f
[PROOF STEP]
proof (rule bijI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj f
 2. surj f
[PROOF STEP]
show "inj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f
[PROOF STEP]
proof (rule injI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. f x = f y \<Longrightarrow> x = y
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. f x = f y \<Longrightarrow> x = y
[PROOF STEP]
assume "f x = f y"
[PROOF STATE]
proof (state)
this:
f x = f y

goal (1 subgoal):
 1. \<And>x y. f x = f y \<Longrightarrow> x = y
[PROOF STEP]
thus "x = y"
[PROOF STATE]
proof (prove)
using this:
f x = f y

goal (1 subgoal):
 1. x = y
[PROOF STEP]
using bij_betw_imp_inj_on[OF bij_betw_vertices] inj_onD[of f "\<Union>X" x y]
            vertex_map trivial_outside
[PROOF STATE]
proof (prove)
using this:
f x = f y
inj_on f (\<Union> X)
\<lbrakk>inj_on f (\<Union> X); f x = f y; x \<in> \<Union> X; y \<in> \<Union> X\<rbrakk> \<Longrightarrow> x = y
?x \<in> \<Union> X \<Longrightarrow> f ?x \<in> \<Union> X
?v \<notin> \<Union> X \<Longrightarrow> f ?v = ?v

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by    (cases "x\<in>\<Union>X" "y\<in>\<Union>X" rule: two_cases) auto
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj f

goal (1 subgoal):
 1. surj f
[PROOF STEP]
show "surj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj f
[PROOF STEP]
unfolding surj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. \<exists>x. y = f x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<exists>x. y = f x
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<exists>x. y = f x
[PROOF STEP]
show "\<exists>x. y = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. y = f x
[PROOF STEP]
using bij_betw_imp_surj_on[OF bij_betw_vertices]
            trivial_outside[THEN sym, of y]
[PROOF STATE]
proof (prove)
using this:
f ` \<Union> X = \<Union> X
y \<notin> \<Union> X \<Longrightarrow> y = f y

goal (1 subgoal):
 1. \<exists>x. y = f x
[PROOF STEP]
by    (cases "y\<in>\<Union>X") auto
[PROOF STATE]
proof (state)
this:
\<exists>x. y = f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
surj f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonzero_Complexs_divide: "a \<in> \<complex> \<Longrightarrow> b \<in> \<complex> \<Longrightarrow> b \<noteq> 0 \<Longrightarrow> a / b \<in> \<complex>"
  for a b :: "'a::complex_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> \<complex>; b \<in> \<complex>; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> a / b \<in> \<complex>
[PROOF STEP]
by (simp add: divide_inverse)


[STATEMENT]
lemma forall_vector_7:
 "(\<forall>v::'a::zero^7. P v) \<longleftrightarrow> (\<forall>x1 x2 x3 x4 x5 x6 x7. P(vector[x1, x2, x3, x4, x5, x6, x7]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>v. P v) = (\<forall>x1 x2 x3 x4 x5 x6 x7. P (vector [x1, x2, x3, x4, x5, x6, x7]))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<forall>x1 x2 x3 x4 x5 x6 x7. P (vector [x1, x2, x3, x4, x5, x6, x7]) \<Longrightarrow> P v
[PROOF STEP]
apply (erule_tac x="v$1" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<forall>x2 x3 x4 x5 x6 x7. P (vector [v $ 1, x2, x3, x4, x5, x6, x7]) \<Longrightarrow> P v
[PROOF STEP]
apply (erule_tac x="v$2" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<forall>x3 x4 x5 x6 x7. P (vector [v $ 1, v $ 2, x3, x4, x5, x6, x7]) \<Longrightarrow> P v
[PROOF STEP]
apply (erule_tac x="v$3" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<forall>x4 x5 x6 x7. P (vector [v $ 1, v $ 2, v $ 3, x4, x5, x6, x7]) \<Longrightarrow> P v
[PROOF STEP]
apply (erule_tac x="v$4" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<forall>x5 x6 x7. P (vector [v $ 1, v $ 2, v $ 3, v $ 4, x5, x6, x7]) \<Longrightarrow> P v
[PROOF STEP]
apply (erule_tac x="v$5" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<forall>x6 x7. P (vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, x6, x7]) \<Longrightarrow> P v
[PROOF STEP]
apply (erule_tac x="v$6" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. \<forall>x7. P (vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, x7]) \<Longrightarrow> P v
[PROOF STEP]
apply (erule_tac x="v$7" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. P (vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, v $ 7]) \<Longrightarrow> P v
[PROOF STEP]
apply (subgoal_tac "vector [v$1, v$2, v$3, v$4, v$5, v$6, v$7] = v")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>v. \<lbrakk>P (vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, v $ 7]); vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, v $ 7] = v\<rbrakk> \<Longrightarrow> P v
 2. \<And>v. P (vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, v $ 7]) \<Longrightarrow> vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, v $ 7] = v
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. P (vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, v $ 7]) \<Longrightarrow> vector [v $ 1, v $ 2, v $ 3, v $ 4, v $ 5, v $ 6, v $ 7] = v
[PROOF STEP]
apply (vector vector_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v. P (\<chi>i. if i = 1 then v $ 1 else ((\<lambda>x. 0::'a)(7 := v $ 7, 6 := v $ 6, 5 := v $ 5, 4 := v $ 4, 3 := v $ 3, 2 := v $ 2)) i) \<Longrightarrow> \<forall>i. i \<noteq> 7 \<longrightarrow> i \<noteq> 6 \<longrightarrow> i \<noteq> 5 \<longrightarrow> i \<noteq> 4 \<longrightarrow> i \<noteq> 3 \<longrightarrow> i \<noteq> 2 \<longrightarrow> i \<noteq> 1 \<longrightarrow> v $ i = (0::'a)
[PROOF STEP]
apply (simp add: forall_7)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma num_succtran_zero: "\<lbrakk>succ_tran G v = {}\<rbrakk> \<Longrightarrow> num_reachable G v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. succ_tran G v = {} \<Longrightarrow> num_reachable G v = 0
[PROOF STEP]
unfolding num_reachable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. succ_tran G v = {} \<Longrightarrow> card (succ_tran G v) = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma det_perm_rows_If: "det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * det B else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
 2. \<not> ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
assume "\<not> f permutes UNIV"
[PROOF STATE]
proof (state)
this:
\<not> f permutes UNIV

goal (2 subgoals):
 1. ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
 2. \<not> ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> f permutes UNIV

goal (2 subgoals):
 1. ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
 2. \<not> ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
with bij_imp_permutes[of f UNIV]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>bij f; \<And>x. x \<notin> UNIV \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> f permutes UNIV
\<not> f permutes UNIV
[PROOF STEP]
have "\<not> inj f"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij f; \<And>x. x \<notin> UNIV \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> f permutes UNIV
\<not> f permutes UNIV

goal (1 subgoal):
 1. \<not> inj f
[PROOF STEP]
using finite_UNIV_inj_surj[of f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bij f; \<And>x. x \<notin> UNIV \<Longrightarrow> f x = x\<rbrakk> \<Longrightarrow> f permutes UNIV
\<not> f permutes UNIV
\<lbrakk>finite UNIV; inj f\<rbrakk> \<Longrightarrow> surj f

goal (1 subgoal):
 1. \<not> inj f
[PROOF STEP]
by (auto simp: bij_betw_def)
[PROOF STATE]
proof (state)
this:
\<not> inj f

goal (2 subgoals):
 1. ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
 2. \<not> ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> inj f
[PROOF STEP]
obtain i j where "f i = f j" "i \<noteq> j"
[PROOF STATE]
proof (prove)
using this:
\<not> inj f

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>f i = f j; i \<noteq> j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
f i = f j
i \<noteq> j

goal (2 subgoals):
 1. ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
 2. \<not> ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f i = f j
i \<noteq> j

goal (2 subgoals):
 1. ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
 2. \<not> ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f i = f j
i \<noteq> j
[PROOF STEP]
have "row (perm_rows B f) i = row (perm_rows B f) j"
[PROOF STATE]
proof (prove)
using this:
f i = f j
i \<noteq> j

goal (1 subgoal):
 1. Square_Matrix.row (perm_rows B f) i = Square_Matrix.row (perm_rows B f) j
[PROOF STEP]
by transfer (auto simp: vec_eq_iff)
[PROOF STATE]
proof (state)
this:
Square_Matrix.row (perm_rows B f) i = Square_Matrix.row (perm_rows B f) j

goal (2 subgoals):
 1. ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
 2. \<not> ?P \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> f permutes UNIV
f i = f j
i \<noteq> j
Square_Matrix.row (perm_rows B f) i = Square_Matrix.row (perm_rows B f) j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> f permutes UNIV
f i = f j
i \<noteq> j
Square_Matrix.row (perm_rows B f) i = Square_Matrix.row (perm_rows B f) j

goal (1 subgoal):
 1. Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
by (simp add: det_identical_rows)
[PROOF STATE]
proof (state)
this:
Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))

goal (1 subgoal):
 1. \<not> \<not> f permutes UNIV \<Longrightarrow> Square_Matrix.det (perm_rows B f) = (if f permutes UNIV then of_int (sign f) * Square_Matrix.det B else (0::'a))
[PROOF STEP]
qed (simp add: det_perm_rows)


[STATEMENT]
lemma (in domain) is_root_imp_pdivides:
  assumes "p \<in> carrier (poly_ring R)"
  shows "is_root p x \<Longrightarrow> [ \<one>, \<ominus> x ] pdivides p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
let ?b = "[ \<one> , \<ominus> x ]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
interpret UP: domain "poly_ring R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain (poly_ring R)
[PROOF STEP]
using univ_poly_is_domain[OF carrier_is_subring]
[PROOF STATE]
proof (prove)
using this:
domain (poly_ring R)

goal (1 subgoal):
 1. domain (poly_ring R)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
assume "is_root p x"
[PROOF STATE]
proof (state)
this:
is_root p x

goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
hence x: "x \<in> carrier R" and is_root: "eval p x = \<zero>"
[PROOF STATE]
proof (prove)
using this:
is_root p x

goal (1 subgoal):
 1. x \<in> carrier R &&& local.eval p x = \<zero>
[PROOF STEP]
unfolding is_root_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R \<and> local.eval p x = \<zero> \<and> p \<noteq> []

goal (1 subgoal):
 1. x \<in> carrier R &&& local.eval p x = \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier R
local.eval p x = \<zero>

goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
hence b: "?b \<in> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
local.eval p x = \<zero>

goal (1 subgoal):
 1. [\<one>, \<ominus> x] \<in> carrier (poly_ring R)
[PROOF STEP]
unfolding sym[OF univ_poly_carrier] polynomial_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
local.eval p x = \<zero>

goal (1 subgoal):
 1. [\<one>, \<ominus> x] = [] \<or> set [\<one>, \<ominus> x] \<subseteq> carrier R \<and> lead_coeff [\<one>, \<ominus> x] \<noteq> \<zero>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[\<one>, \<ominus> x] \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[\<one>, \<ominus> x] \<in> carrier (poly_ring R)
[PROOF STEP]
obtain q r where q: "q \<in> carrier (poly_ring R)" and r: "r \<in> carrier (poly_ring R)"
    and long_divides: "p = (?b \<otimes>\<^bsub>poly_ring R\<^esub> q) \<oplus>\<^bsub>poly_ring R\<^esub> r" "r = [] \<or> degree r < degree ?b"
[PROOF STATE]
proof (prove)
using this:
[\<one>, \<ominus> x] \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. (\<And>q r. \<lbrakk>q \<in> carrier (poly_ring R); r \<in> carrier (poly_ring R); p = [\<one>, \<ominus> x] \<otimes>\<^bsub>poly_ring R\<^esub> q \<oplus>\<^bsub>poly_ring R\<^esub> r; r = [] \<or> degree r < degree [\<one>, \<ominus> x]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using long_division_theorem[OF carrier_is_subring, of p ?b] assms
[PROOF STATE]
proof (prove)
using this:
[\<one>, \<ominus> x] \<in> carrier (poly_ring R)
\<lbrakk>polynomial (carrier R) p; polynomial (carrier R) [\<one>, \<ominus> x]; [\<one>, \<ominus> x] \<noteq> []; lead_coeff [\<one>, \<ominus> x] \<in> Units (R\<lparr>carrier := carrier R\<rparr>)\<rbrakk> \<Longrightarrow> \<exists>q r. polynomial (carrier R) q \<and> polynomial (carrier R) r \<and> p = [\<one>, \<ominus> x] \<otimes>\<^bsub>poly_ring R\<^esub> q \<oplus>\<^bsub>poly_ring R\<^esub> r \<and> (r = [] \<or> degree r < degree [\<one>, \<ominus> x])
p \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. (\<And>q r. \<lbrakk>q \<in> carrier (poly_ring R); r \<in> carrier (poly_ring R); p = [\<one>, \<ominus> x] \<otimes>\<^bsub>poly_ring R\<^esub> q \<oplus>\<^bsub>poly_ring R\<^esub> r; r = [] \<or> degree r < degree [\<one>, \<ominus> x]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: univ_poly_carrier)
[PROOF STATE]
proof (state)
this:
q \<in> carrier (poly_ring R)
r \<in> carrier (poly_ring R)
p = [\<one>, \<ominus> x] \<otimes>\<^bsub>poly_ring R\<^esub> q \<oplus>\<^bsub>poly_ring R\<^esub> r
r = [] \<or> degree r < degree [\<one>, \<ominus> x]

goal (1 subgoal):
 1. is_root p x \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
proof (cases "r = []")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r = [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
 2. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r = []

goal (2 subgoals):
 1. r = [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
 2. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r = []
[PROOF STEP]
have "r = \<zero>\<^bsub>poly_ring R\<^esub>"
[PROOF STATE]
proof (prove)
using this:
r = []

goal (1 subgoal):
 1. r = \<zero>\<^bsub>poly_ring R\<^esub>
[PROOF STEP]
unfolding univ_poly_zero[of R "carrier R"]
[PROOF STATE]
proof (prove)
using this:
r = []

goal (1 subgoal):
 1. r = []
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
r = \<zero>\<^bsub>poly_ring R\<^esub>

goal (2 subgoals):
 1. r = [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
 2. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
r = \<zero>\<^bsub>poly_ring R\<^esub>

goal (1 subgoal):
 1. [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
using long_divides(1) q r b dividesI[OF q, of p ?b]
[PROOF STATE]
proof (prove)
using this:
r = \<zero>\<^bsub>poly_ring R\<^esub>
p = [\<one>, \<ominus> x] \<otimes>\<^bsub>poly_ring R\<^esub> q \<oplus>\<^bsub>poly_ring R\<^esub> r
q \<in> carrier (poly_ring R)
r \<in> carrier (poly_ring R)
[\<one>, \<ominus> x] \<in> carrier (poly_ring R)
p = [\<one>, \<ominus> x] \<otimes>\<^bsub>poly_ring R\<^esub> q \<Longrightarrow> [\<one>, \<ominus> x] divides\<^bsub>poly_ring R\<^esub> p

goal (1 subgoal):
 1. [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
by (simp add: pdivides_def)
[PROOF STATE]
proof (state)
this:
[\<one>, \<ominus> x] pdivides p

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r \<noteq> []

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<noteq> []
[PROOF STEP]
have "length r = Suc 0"
[PROOF STATE]
proof (prove)
using this:
r \<noteq> []

goal (1 subgoal):
 1. length r = Suc 0
[PROOF STEP]
using long_divides(2) le_SucE
[PROOF STATE]
proof (prove)
using this:
r \<noteq> []
r = [] \<or> degree r < degree [\<one>, \<ominus> x]
\<lbrakk>?m \<le> Suc ?n; ?m \<le> ?n \<Longrightarrow> ?R; ?m = Suc ?n \<Longrightarrow> ?R\<rbrakk> \<Longrightarrow> ?R

goal (1 subgoal):
 1. length r = Suc 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
length r = Suc 0

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length r = Suc 0
[PROOF STEP]
obtain a where "r = [ a ]" and a: "a \<in> carrier R" and "a \<noteq> \<zero>"
[PROOF STATE]
proof (prove)
using this:
length r = Suc 0

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>r = [a]; a \<in> carrier R; a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
length r = Suc 0
r \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>r = [a]; a \<in> carrier R; a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding sym[OF univ_poly_carrier] polynomial_def
[PROOF STATE]
proof (prove)
using this:
length r = Suc 0
r = [] \<or> set r \<subseteq> carrier R \<and> lead_coeff r \<noteq> \<zero>

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>r = [a]; a \<in> carrier R; a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis False length_0_conv length_Suc_conv list.sel(1) list.set_sel(1) subset_code(1))
[PROOF STATE]
proof (state)
this:
r = [a]
a \<in> carrier R
a \<noteq> \<zero>

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
have "eval p x = ((eval ?b x) \<otimes> (eval q x)) \<oplus> (eval r x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval p x = local.eval [\<one>, \<ominus> x] x \<otimes> local.eval q x \<oplus> local.eval r x
[PROOF STEP]
using long_divides(1) ring_hom_memE[OF eval_is_hom[OF carrier_is_subring x]]
[PROOF STATE]
proof (prove)
using this:
p = [\<one>, \<ominus> x] \<otimes>\<^bsub>poly_ring R\<^esub> q \<oplus>\<^bsub>poly_ring R\<^esub> r
?x \<in> carrier (poly_ring R) \<Longrightarrow> local.eval ?x x \<in> carrier R
\<lbrakk>?x \<in> carrier (poly_ring R); ?y \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> local.eval (?x \<otimes>\<^bsub>poly_ring R\<^esub> ?y) x = local.eval ?x x \<otimes> local.eval ?y x
\<lbrakk>?x \<in> carrier (poly_ring R); ?y \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> local.eval (?x \<oplus>\<^bsub>poly_ring R\<^esub> ?y) x = local.eval ?x x \<oplus> local.eval ?y x
local.eval \<one>\<^bsub>poly_ring R\<^esub> x = \<one>

goal (1 subgoal):
 1. local.eval p x = local.eval [\<one>, \<ominus> x] x \<otimes> local.eval q x \<oplus> local.eval r x
[PROOF STEP]
by (simp add: b q r)
[PROOF STATE]
proof (state)
this:
local.eval p x = local.eval [\<one>, \<ominus> x] x \<otimes> local.eval q x \<oplus> local.eval r x

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.eval p x = local.eval [\<one>, \<ominus> x] x \<otimes> local.eval q x \<oplus> local.eval r x

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
have " ... = eval r x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.eval [\<one>, \<ominus> x] x \<otimes> local.eval q x \<oplus> local.eval r x = local.eval r x
[PROOF STEP]
using ring_hom_memE[OF eval_is_hom[OF carrier_is_subring x]] x b q r
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier (poly_ring R) \<Longrightarrow> local.eval ?x x \<in> carrier R
\<lbrakk>?x \<in> carrier (poly_ring R); ?y \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> local.eval (?x \<otimes>\<^bsub>poly_ring R\<^esub> ?y) x = local.eval ?x x \<otimes> local.eval ?y x
\<lbrakk>?x \<in> carrier (poly_ring R); ?y \<in> carrier (poly_ring R)\<rbrakk> \<Longrightarrow> local.eval (?x \<oplus>\<^bsub>poly_ring R\<^esub> ?y) x = local.eval ?x x \<oplus> local.eval ?y x
local.eval \<one>\<^bsub>poly_ring R\<^esub> x = \<one>
x \<in> carrier R
[\<one>, \<ominus> x] \<in> carrier (poly_ring R)
q \<in> carrier (poly_ring R)
r \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. local.eval [\<one>, \<ominus> x] x \<otimes> local.eval q x \<oplus> local.eval r x = local.eval r x
[PROOF STEP]
by (auto, algebra)
[PROOF STATE]
proof (state)
this:
local.eval [\<one>, \<ominus> x] x \<otimes> local.eval q x \<oplus> local.eval r x = local.eval r x

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.eval p x = local.eval r x
[PROOF STEP]
have "a = \<zero>"
[PROOF STATE]
proof (prove)
using this:
local.eval p x = local.eval r x

goal (1 subgoal):
 1. a = \<zero>
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
local.eval p x = local.eval r x
a \<in> carrier R

goal (1 subgoal):
 1. a = \<zero>
[PROOF STEP]
unfolding \<open>r = [ a ]\<close> is_root
[PROOF STATE]
proof (prove)
using this:
\<zero> = local.eval [a] x
a \<in> carrier R

goal (1 subgoal):
 1. a = \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a = \<zero>

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
with \<open>a \<noteq> \<zero>\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> \<zero>
a = \<zero>
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<zero>
a = \<zero>

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

goal (1 subgoal):
 1. r \<noteq> [] \<Longrightarrow> [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. [\<one>, \<ominus> x] pdivides p
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
[\<one>, \<ominus> x] pdivides p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
[\<one>, \<ominus> x] pdivides p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma parts_UN_subset2: "parts(\<Union>x\<in>A. H x) \<subseteq> (\<Union>x\<in>A. parts(H x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parts (\<Union> (H ` A)) \<subseteq> (\<Union>x\<in>A. parts (H x))
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> parts (\<Union> (H ` A)) \<Longrightarrow> x \<in> (\<Union>x\<in>A. parts (H x))
[PROOF STEP]
apply (erule parts.induct, blast+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rel_sum_map1:
  "rel_sum R1 R2 (map_sum f1 f2 x) y \<longleftrightarrow> rel_sum (\<lambda>x. R1 (f1 x)) (\<lambda>x. R2 (f2 x)) x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_sum R1 R2 (map_sum f1 f2 x) y = rel_sum (\<lambda>x. R1 (f1 x)) (\<lambda>x. R2 (f2 x)) x y
[PROOF STEP]
by (rule sum.rel_map(1))


[STATEMENT]
lemma set1_FGcontra_bound:
  fixes x :: "(_, 'co1, 'co2, 'co3, 'co4, 'co5,
    'contra1, 'contra2, 'contra3, 'contra4, 'contra5, 'f1, 'f2) FGcontra"
  shows "card_of (set1_FGcontra x) <o (bd_FGcontra :: ('co1, 'co2, 'co3, 'co4, 'co5,
    'contra1, 'contra2, 'contra3, 'contra4, 'contra5, 'f1, 'f2) FGcontrabd rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |set1_FGcontra x| <o bd_FGcontra
[PROOF STEP]
unfolding set1_FGcontra_def bd_FGcontra_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |set1_F x| <o bd_F
[PROOF STEP]
using set1_F_bound
[PROOF STATE]
proof (prove)
using this:
|set1_F ?x| <o bd_F

goal (1 subgoal):
 1. |set1_F x| <o bd_F
[PROOF STEP]
.


[STATEMENT]
lemma "(x \<le> y - z) = (x + z \<le> (y::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y - z) = (x + z \<le> y)
[PROOF STEP]
by arith


[STATEMENT]
lemma "(x \<le> -x) = (x \<le> (0::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> - x) = (x \<le> 0)
[PROOF STEP]
by arith


[STATEMENT]
lemma det_Gauss_Jordan_column_k_det_P:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
assumes det: "det_P * det B = det A"
shows "(fst (Gauss_Jordan_column_k_det_P (det_P,i,A) k)) * det B = det (snd (snd (Gauss_Jordan_column_k_det_P (det_P,i,A) k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_column_k_det_P (det_P, i, A) k) * det B = det (snd (snd (Gauss_Jordan_column_k_det_P (det_P, i, A) k)))
[PROOF STEP]
proof (unfold Gauss_Jordan_column_k_det_P_def Let_def, auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * det_P * det B = det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * det_P * det B = det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
assume i_not_nrows: "i \<noteq> nrows A"
and i_less_m: "from_nat i \<le> m"
and Amk_not_0: "A $ m $ from_nat k \<noteq> 0"
[PROOF STATE]
proof (state)
this:
i \<noteq> nrows A
mod_type_class.from_nat i \<le> m
A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>i \<noteq> nrows A; mod_type_class.from_nat i \<le> m; A $ m $ mod_type_class.from_nat k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * det_P * det B = det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
show  "fst (Gauss_Jordan_in_ij_det_P A (from_nat i) (from_nat k)) * det_P * det B =
        det (snd (Gauss_Jordan_in_ij_det_P A (from_nat i) (from_nat k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * det_P * det B = det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
unfolding mult.assoc det
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * det A = det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
unfolding det_Gauss_Jordan_in_ij_det_P
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k))) = det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)) * det_P * det B = det (snd (Gauss_Jordan_in_ij_det_P A (mod_type_class.from_nat i) (mod_type_class.from_nat k)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_sequence_of:
  assumes "bij_betw enum {0..<card A} A"
  shows "bij_betw (sequence_of A enum) {f. f \<in> A \<rightarrow>\<^sub>E B \<and> inj_on f A} {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (sequence_of A enum) {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
proof (rule bij_betw_byWitness[where f'="function_of A enum"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<forall>a\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum a) = a
 2. \<forall>a'\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum a') = a'
 3. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
 4. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
show "\<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. \<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f
[PROOF STEP]
by (auto simp add: function_of_sequence_of)
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>{f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}. function_of A enum (sequence_of A enum f) = f

goal (3 subgoals):
 1. \<forall>a'\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum a') = a'
 2. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
 3. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
show "\<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. \<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs
[PROOF STEP]
by (auto simp add: sequence_of_function_of)
[PROOF STATE]
proof (state)
this:
\<forall>xs\<in>{xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}. sequence_of A enum (function_of A enum xs) = xs

goal (2 subgoals):
 1. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
 2. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
show "sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}
[PROOF STEP]
by (simp add: image_sequence_of_inj)
[PROOF STATE]
proof (state)
this:
sequence_of A enum ` {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A} \<subseteq> {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs}

goal (1 subgoal):
 1. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
show "function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij_betw enum {0..<card A} A

goal (1 subgoal):
 1. function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}
[PROOF STEP]
by (simp add: image_function_of_distinct)
[PROOF STATE]
proof (state)
this:
function_of A enum ` {xs. set xs \<subseteq> B \<and> length xs = card A \<and> distinct xs} \<subseteq> {f \<in> A \<rightarrow>\<^sub>E B. inj_on f A}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma F2set1_bd: "|F2set1 x| <o bd_F1 +c bd_F2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |F2set1 x| <o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule ordLess_ordLeq_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. |F2set1 x| <o ?r'
 2. ?r' \<le>o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule F2.set_bd(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bd_F2 \<le>o bd_F1 +c bd_F2
[PROOF STEP]
apply (rule ordLeq_csum2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Card_order bd_F2
[PROOF STEP]
apply (rule F2.bd_Card_order)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma minus_extended_simps[simp]:
  "Fin x - Fin y = Fin(x - y)"
  "Fin x - Pinf  = Minf"
  "Fin x - Minf  = Pinf"
  "Pinf  - Fin y = Pinf"
  "Pinf  - Minf  = Pinf"
  "Minf  - Fin y = Minf"
  "Minf  - Pinf  = Minf"
  "Minf  - Minf  = Pinf"
  "Pinf  - Pinf  = Pinf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Fin x - Fin y = Fin (x - y) &&& Fin x - \<infinity> = -\<infinity>) &&& Fin x - -\<infinity> = \<infinity> &&& \<infinity> - Fin y = \<infinity>) &&& (\<infinity> - -\<infinity> = \<infinity> &&& -\<infinity> - Fin y = -\<infinity>) &&& -\<infinity> - \<infinity> = -\<infinity> &&& -\<infinity> - -\<infinity> = \<infinity> &&& \<infinity> - \<infinity> = \<infinity>
[PROOF STEP]
by (simp_all add: minus_extended_def)


[STATEMENT]
lemma Stirling_Suc_n_n: "Stirling (Suc n) n = (Suc n choose 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Stirling (Suc n) n = Suc n choose 2
[PROOF STEP]
by (induction n) (auto simp: choose_two)


[STATEMENT]
lemma tendsto_prod' [tendsto_intros]:
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::topological_comm_monoid_mult"
  shows "(\<And>i. i \<in> I \<Longrightarrow> (f i \<longlongrightarrow> a i) F) \<Longrightarrow> ((\<lambda>x. \<Prod>i\<in>I. f i x) \<longlongrightarrow> (\<Prod>i\<in>I. a i)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> (f i \<longlongrightarrow> a i) F) \<Longrightarrow> ((\<lambda>x. \<Prod>i\<in>I. f i x) \<longlongrightarrow> prod a I) F
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (simp_all add: tendsto_mult)


[STATEMENT]
lemma setsum_eq_zero [simp]:
  fixes f::"nat \<Rightarrow> nat"
  shows "(\<Sum>i < n. f i) = 0 \<longleftrightarrow> (\<forall>i < n. f i = 0)"
    "(\<Sum>i \<le> n. f i) = 0 \<longleftrightarrow> (\<forall>i \<le> n. f i = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum f {..<n} = 0) = (\<forall>i<n. f i = 0) &&& (sum f {..n} = 0) = (\<forall>i\<le>n. f i = 0)
[PROOF STEP]
by (auto)


[STATEMENT]
lemma (in cpx_sq_mat) proj_measurement_id:
  assumes "proj_measurement p M"
  shows "sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..< p} = 1\<^sub>m dimR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<p} = 1\<^sub>m dimR
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
proj_measurement p M

goal (1 subgoal):
 1. local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<p} = 1\<^sub>m dimR
[PROOF STEP]
unfolding proj_measurement_def
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>i. meas_outcome_val (M i)) {..<p} \<and> (\<forall>j<p. meas_outcome_prj (M j) \<in> fc_mats \<and> projector (meas_outcome_prj (M j))) \<and> (\<forall>i<p. \<forall>j<p. i \<noteq> j \<longrightarrow> meas_outcome_prj (M i) * meas_outcome_prj (M j) = 0\<^sub>m dimR dimR) \<and> local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<p} = 1\<^sub>m dimR

goal (1 subgoal):
 1. local.sum_mat (\<lambda>j. meas_outcome_prj (M j)) {..<p} = 1\<^sub>m dimR
[PROOF STEP]
by simp


[STATEMENT]
lemma filter_transitions_path :
  assumes "path (filter_transitions M P) q p"
  shows "path M q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M q p
[PROOF STEP]
using path_begin_state[OF assms]
        transition_subset_path[of "filter_transitions M P" M, OF _ assms]
[PROOF STATE]
proof (prove)
using this:
q \<in> FSM.states (FSM.filter_transitions M P)
\<lbrakk>FSM.transitions (FSM.filter_transitions M P) \<subseteq> FSM.transitions M; q \<in> FSM.states M\<rbrakk> \<Longrightarrow> path M q p

goal (1 subgoal):
 1. path M q p
[PROOF STEP]
unfolding filter_transitions_simps
[PROOF STATE]
proof (prove)
using this:
q \<in> FSM.states M
\<lbrakk>{t \<in> FSM.transitions M. P t} \<subseteq> FSM.transitions M; q \<in> FSM.states M\<rbrakk> \<Longrightarrow> path M q p

goal (1 subgoal):
 1. path M q p
[PROOF STEP]
by blast


[STATEMENT]
lemma DirProd_list_is_group:
  assumes "\<And>i. i < length Gs \<Longrightarrow> group (Gs ! i)" shows "group (DirProd_list Gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (DirProd_list Gs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i < length Gs \<Longrightarrow> Group.group (Gs ! ?i)

goal (1 subgoal):
 1. Group.group (DirProd_list Gs)
[PROOF STEP]
proof (induct Gs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> Group.group ([] ! i)) \<Longrightarrow> Group.group (DirProd_list [])
 2. \<And>a Gs. \<lbrakk>(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs); \<And>i. i < length (a # Gs) \<Longrightarrow> Group.group ((a # Gs) ! i)\<rbrakk> \<Longrightarrow> Group.group (DirProd_list (a # Gs))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
?i < length [] \<Longrightarrow> Group.group ([] ! ?i)

goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> Group.group ([] ! i)) \<Longrightarrow> Group.group (DirProd_list [])
 2. \<And>a Gs. \<lbrakk>(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs); \<And>i. i < length (a # Gs) \<Longrightarrow> Group.group ((a # Gs) ! i)\<rbrakk> \<Longrightarrow> Group.group (DirProd_list (a # Gs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?i < length [] \<Longrightarrow> Group.group ([] ! ?i)

goal (1 subgoal):
 1. Group.group (DirProd_list [])
[PROOF STEP]
unfolding DirProd_list_def
[PROOF STATE]
proof (prove)
using this:
?i < length [] \<Longrightarrow> Group.group ([] ! ?i)

goal (1 subgoal):
 1. Group.group (foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) [] nil_monoid)
[PROOF STEP]
by (unfold_locales, auto simp add: Units_def)
[PROOF STATE]
proof (state)
this:
Group.group (DirProd_list [])

goal (1 subgoal):
 1. \<And>a Gs. \<lbrakk>(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs); \<And>i. i < length (a # Gs) \<Longrightarrow> Group.group ((a # Gs) ! i)\<rbrakk> \<Longrightarrow> Group.group (DirProd_list (a # Gs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Gs. \<lbrakk>(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs); \<And>i. i < length (a # Gs) \<Longrightarrow> Group.group ((a # Gs) ! i)\<rbrakk> \<Longrightarrow> Group.group (DirProd_list (a # Gs))
[PROOF STEP]
case (Cons G Gs)
[PROOF STATE]
proof (state)
this:
(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs)
?i < length (G # Gs) \<Longrightarrow> Group.group ((G # Gs) ! ?i)

goal (1 subgoal):
 1. \<And>a Gs. \<lbrakk>(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs); \<And>i. i < length (a # Gs) \<Longrightarrow> Group.group ((a # Gs) ! i)\<rbrakk> \<Longrightarrow> Group.group (DirProd_list (a # Gs))
[PROOF STEP]
hence is_group: "group (G \<times>\<times> (DirProd_list Gs))"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs)
?i < length (G # Gs) \<Longrightarrow> Group.group ((G # Gs) ! ?i)

goal (1 subgoal):
 1. Group.group (G \<times>\<times> DirProd_list Gs)
[PROOF STEP]
using DirProd_group[of G "DirProd_list Gs"]
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs)
?i < length (G # Gs) \<Longrightarrow> Group.group ((G # Gs) ! ?i)
\<lbrakk>Group.group G; Group.group (DirProd_list Gs)\<rbrakk> \<Longrightarrow> Group.group (G \<times>\<times> DirProd_list Gs)

goal (1 subgoal):
 1. Group.group (G \<times>\<times> DirProd_list Gs)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Group.group (G \<times>\<times> DirProd_list Gs)

goal (1 subgoal):
 1. \<And>a Gs. \<lbrakk>(\<And>i. i < length Gs \<Longrightarrow> Group.group (Gs ! i)) \<Longrightarrow> Group.group (DirProd_list Gs); \<And>i. i < length (a # Gs) \<Longrightarrow> Group.group ((a # Gs) ! i)\<rbrakk> \<Longrightarrow> Group.group (DirProd_list (a # Gs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (DirProd_list (G # Gs))
[PROOF STEP]
using group.inj_imp_image_group_is_group[OF is_group inj_on_DirProd_carrier]
[PROOF STATE]
proof (prove)
using this:
Group.group (image_group (\<lambda>(g, gs). g # gs) (G \<times>\<times> DirProd_list Gs))

goal (1 subgoal):
 1. Group.group (DirProd_list (G # Gs))
[PROOF STEP]
unfolding DirProd_list_def
[PROOF STATE]
proof (prove)
using this:
Group.group (image_group (\<lambda>(g, gs). g # gs) (G \<times>\<times> foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) Gs nil_monoid))

goal (1 subgoal):
 1. Group.group (foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) (G # Gs) nil_monoid)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Group.group (DirProd_list (G # Gs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hoare_weaken_right[trans]: \<open>hoare A p B \<Longrightarrow> B \<le> C \<Longrightarrow> hoare A p C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>hoare A p B; B \<le> C\<rbrakk> \<Longrightarrow> hoare A p C
[PROOF STEP]
unfolding hoare_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<psi>\<in>space_as_set A. program p *\<^sub>V \<psi> \<in> space_as_set B; B \<le> C\<rbrakk> \<Longrightarrow> \<forall>\<psi>\<in>space_as_set A. program p *\<^sub>V \<psi> \<in> space_as_set C
[PROOF STEP]
by (meson in_mono less_eq_ccsubspace.rep_eq)


[STATEMENT]
lemma rsa_bij_betw:
  assumes "coprime e ((P - 1)*(Q - 1))"
    and "prime P"
    and "prime Q"
    and "P \<noteq> Q"
  shows "bij_betw (F ((P * Q), e)) (range ((P * Q), e)) (range ((P * Q), e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))
[PROOF STEP]
have PQ_not_0: "prime P \<longrightarrow> prime Q \<longrightarrow> P * Q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime P \<longrightarrow> prime Q \<longrightarrow> P * Q \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
coprime e ((P - 1) * (Q - 1))
prime P
prime Q
P \<noteq> Q

goal (1 subgoal):
 1. prime P \<longrightarrow> prime Q \<longrightarrow> P * Q \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime P \<longrightarrow> prime Q \<longrightarrow> P * Q \<noteq> 0

goal (1 subgoal):
 1. bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))
[PROOF STEP]
have "inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)}
[PROOF STEP]
apply(simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{..<P * Q}. \<forall>y\<in>{..<P * Q}. x ^ e mod (P * Q) = y ^ e mod (P * Q) \<longrightarrow> x = y
[PROOF STEP]
using rsa_bijection assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>coprime ?e ((?P - 1) * (?Q - 1)); prime ?P; prime ?Q; ?P \<noteq> ?Q; ?x < ?P * ?Q; ?y < ?P * ?Q; ?x ^ ?e mod (?P * ?Q) = ?y ^ ?e mod (?P * ?Q)\<rbrakk> \<Longrightarrow> ?x = ?y
coprime e ((P - 1) * (Q - 1))
prime P
prime Q
P \<noteq> Q

goal (1 subgoal):
 1. \<forall>x\<in>{..<P * Q}. \<forall>y\<in>{..<P * Q}. x ^ e mod (P * Q) = y ^ e mod (P * Q) \<longrightarrow> x = y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)}

goal (1 subgoal):
 1. bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)}

goal (1 subgoal):
 1. bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))
[PROOF STEP]
have "(\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) ` {..<fst (P * Q, e)} = {..<fst (P * Q, e)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) ` {..<fst (P * Q, e)} = {..<fst (P * Q, e)}
[PROOF STEP]
apply(simp add: assms(2) assms(3) prime_gt_0_nat PQ_not_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x ^ e mod (P * Q)) ` {..<P * Q} = {..<P * Q}
[PROOF STEP]
apply(rule endo_inj_surj; auto simp add: assms(2) assms(3) image_subsetI prime_gt_0_nat PQ_not_0 inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x < P * Q; y < P * Q; x ^ e mod (P * Q) = y ^ e mod (P * Q)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using rsa_bijection assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>coprime ?e ((?P - 1) * (?Q - 1)); prime ?P; prime ?Q; ?P \<noteq> ?Q; ?x < ?P * ?Q; ?y < ?P * ?Q; ?x ^ ?e mod (?P * ?Q) = ?y ^ ?e mod (?P * ?Q)\<rbrakk> \<Longrightarrow> ?x = ?y
coprime e ((P - 1) * (Q - 1))
prime P
prime Q
P \<noteq> Q

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x < P * Q; y < P * Q; x ^ e mod (P * Q) = y ^ e mod (P * Q)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) ` {..<fst (P * Q, e)} = {..<fst (P * Q, e)}

goal (1 subgoal):
 1. bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)}
(\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) ` {..<fst (P * Q, e)} = {..<fst (P * Q, e)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)}
(\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) ` {..<fst (P * Q, e)} = {..<fst (P * Q, e)}

goal (1 subgoal):
 1. bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))
[PROOF STEP]
unfolding bij_betw_def F_def range_def
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)}
(\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) ` {..<fst (P * Q, e)} = {..<fst (P * Q, e)}

goal (1 subgoal):
 1. inj_on (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) {..<fst (P * Q, e)} \<and> (\<lambda>x. x ^ snd (P * Q, e) mod fst (P * Q, e)) ` {..<fst (P * Q, e)} = {..<fst (P * Q, e)}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
bij_betw (F (P * Q, e)) (local.range (P * Q, e)) (local.range (P * Q, e))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma HFinite_Infinitesimal_diff_mult:
  "x \<in> HFinite - Infinitesimal \<Longrightarrow> y \<in> HFinite - Infinitesimal \<Longrightarrow> x * y \<in> HFinite - Infinitesimal"
  for x y :: "'a::real_normed_div_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> HFinite - Infinitesimal; y \<in> HFinite - Infinitesimal\<rbrakk> \<Longrightarrow> x * y \<in> HFinite - Infinitesimal
[PROOF STEP]
by (simp add: HFinite_mult not_Infinitesimal_mult)


[STATEMENT]
lemma eint_ex_split: "(\<exists>c::eint. P c) \<longleftrightarrow> P \<infinity> \<or> (\<exists>c::int. P c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>c. P c) = (P \<infinity> \<or> (\<exists>x. P (eint x)))
[PROOF STEP]
by (metis eint.exhaust)


[STATEMENT]
lemma has_integral_cbox:
  "(f has_integral I) (cbox a b) \<longleftrightarrow> ((\<lambda>p. \<Sum>(x,k)\<in>p. content k *\<^sub>R f x) \<longlongrightarrow> I) (division_filter (cbox a b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral I) (cbox a b) = (sum (\<lambda>(x, k). content k *\<^sub>R f x) \<longlongrightarrow> I) (division_filter (cbox a b))
[PROOF STEP]
by (auto simp add: has_integral_def)


[STATEMENT]
lemma final_lemma7:
     "final =
      (\<Inter>v \<in> V. \<Inter>w \<in> V.
       ((reachable v) <==> {s. (root,v) \<in> REACHABLE}) \<inter>
       (-{s. (v,w) \<in> E} \<union> (nmsg_eq 0 (v,w))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. final = (\<Inter>v\<in>V. \<Inter>w\<in>V. (Reachability.reachable v <==> {s. (root, v) \<in> REACHABLE}) \<inter> (- {s. (v, w) \<in> E} \<union> nmsg_eq 0 (v, w)))
[PROOF STEP]
apply (unfold final_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>v\<in>V. Reachability.reachable v <==> {s. (root, v) \<in> REACHABLE}) \<inter> \<Inter> (nmsg_eq 0 ` E) = (\<Inter>v\<in>V. \<Inter>w\<in>V. (Reachability.reachable v <==> {s. (root, v) \<in> REACHABLE}) \<inter> (- {s. (v, w) \<in> E} \<union> nmsg_eq 0 (v, w)))
[PROOF STEP]
apply (rule subset_antisym, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>v\<in>V. \<Inter>w\<in>V. (Reachability.reachable v <==> {s. (root, v) \<in> REACHABLE}) \<inter> (- {s. (v, w) \<in> E} \<union> nmsg_eq 0 (v, w))) \<subseteq> (\<Inter>v\<in>V. Reachability.reachable v <==> {s. (root, v) \<in> REACHABLE}) \<inter> \<Inter> (nmsg_eq 0 ` E)
[PROOF STEP]
apply (auto split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa a b. \<lbrakk>\<forall>x\<in>V. ((root, x) \<in> REACHABLE \<longrightarrow> xa \<in> Reachability.reachable x <==> UNIV \<and> (\<forall>xb\<in>V. (x, xb) \<in> E \<longrightarrow> xa \<in> nmsg_eq 0 (x, xb))) \<and> ((root, x) \<in> REACHABLE \<or> xa \<in> Reachability.reachable x <==> {} \<and> (\<forall>xb\<in>V. (x, xb) \<in> E \<longrightarrow> xa \<in> nmsg_eq 0 (x, xb))); (a, b) \<in> E; x \<in> V\<rbrakk> \<Longrightarrow> xa \<in> nmsg_eq 0 (a, b)
 2. \<And>x a b. \<lbrakk>V = {}; (a, b) \<in> E\<rbrakk> \<Longrightarrow> x \<in> nmsg_eq 0 (a, b)
[PROOF STEP]
apply (blast dest: E_imp_in_V_L E_imp_in_V_R)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma get_odd_double: "\<exists>i. get_odd n = 2 * i + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i. get_odd n = 2 * i + 1
[PROOF STEP]
using get_odd
[PROOF STATE]
proof (prove)
using this:
odd (get_odd ?n)

goal (1 subgoal):
 1. \<exists>i. get_odd n = 2 * i + 1
[PROOF STEP]
by (blast elim: oddE)


[STATEMENT]
lemma multiset_filter_mono'':
  assumes "A \<subseteq># B" "\<And>x. x \<in># A \<Longrightarrow> P x \<Longrightarrow> Q x"
  shows "filter_mset P A \<subseteq># filter_mset Q B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P A \<subseteq># filter_mset Q B
[PROOF STEP]
using assms multiset_filter_mono multiset_filter_mono'
[PROOF STATE]
proof (prove)
using this:
A \<subseteq># B
\<lbrakk>?x \<in># A; P ?x\<rbrakk> \<Longrightarrow> Q ?x
?A \<subseteq># ?B \<Longrightarrow> filter_mset ?f ?A \<subseteq># filter_mset ?f ?B
(\<And>x. \<lbrakk>x \<in># ?A; ?P x\<rbrakk> \<Longrightarrow> ?Q x) \<Longrightarrow> filter_mset ?P ?A \<subseteq># filter_mset ?Q ?A

goal (1 subgoal):
 1. filter_mset P A \<subseteq># filter_mset Q B
[PROOF STEP]
by (metis subset_mset.order_trans)


[STATEMENT]
lemma foldr_max:
  fixes xs :: \<open>nat list\<close>
  shows \<open>foldr max xs 0 = (if xs = [] then 0 else Max (set xs))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr max xs 0 = (if xs = [] then 0 else Max (set xs))
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma pac_ideal_Xsq2_iff:
  \<open>Var c ^ 2 \<in> pac_ideal A \<longleftrightarrow> Var c \<in> pac_ideal A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Var c)\<^sup>2 \<in> pac_ideal A) = (Var c \<in> pac_ideal A)
[PROOF STEP]
unfolding pac_ideal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Var c)\<^sup>2 \<in> More_Modules.ideal (A \<union> polynomial_bool)) = (Var c \<in> More_Modules.ideal (A \<union> polynomial_bool))
[PROOF STEP]
apply (subst (2) ideal.span_add_eq[symmetric, OF X2_X_in_pac_ideal[of c, unfolded pac_ideal_def]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Var c)\<^sup>2 \<in> More_Modules.ideal (A \<union> polynomial_bool)) = ((Var c)\<^sup>2 - Var c + Var c \<in> More_Modules.ideal (A \<union> polynomial_bool))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_nat_eq: "of_nat n = w \<longleftrightarrow> (\<exists>q. n = unat w + q * 2 ^ LENGTH('a))"
  for w :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (word_of_nat n = w) = (\<exists>q. n = unat w + q * 2 ^ LENGTH('a))
[PROOF STEP]
using mod_div_mult_eq [of n "2 ^ LENGTH('a)", symmetric]
[PROOF STATE]
proof (prove)
using this:
n = n mod 2 ^ LENGTH('a) + n div 2 ^ LENGTH('a) * 2 ^ LENGTH('a)

goal (1 subgoal):
 1. (word_of_nat n = w) = (\<exists>q. n = unat w + q * 2 ^ LENGTH('a))
[PROOF STEP]
by (auto simp flip: take_bit_eq_mod simp add: unsigned_of_nat)


[STATEMENT]
lemma reduce_system_matrix_signs_helper_R:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "(nat list*nat list) list"
  fixes signs :: "rat list list"
  fixes S:: "nat list"
  assumes well_def_h: "\<forall>x. List.member S x \<longrightarrow> x < length signs"
  assumes nonzero: "p \<noteq> 0"
  shows "matrix_A_R (take_indices signs S) subsets = take_cols_from_matrix (matrix_A_R signs subsets) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_mat_R (take_indices signs S) subsets = take_cols_from_matrix (M_mat_R signs subsets) S
[PROOF STEP]
using reduce_system_matrix_signs_helper_aux_R alt_matrix_char_R assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>x. List.member ?S x \<longrightarrow> x < length ?signs; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> alt_matrix_A_R (take_indices ?signs ?S) ?subsets = take_cols_from_matrix (alt_matrix_A_R ?signs ?subsets) ?S
alt_matrix_A_R ?signs ?subsets = M_mat_R ?signs ?subsets
\<forall>x. List.member S x \<longrightarrow> x < length signs
p \<noteq> 0

goal (1 subgoal):
 1. M_mat_R (take_indices signs S) subsets = take_cols_from_matrix (M_mat_R signs subsets) S
[PROOF STEP]
by auto


[STATEMENT]
lemma point_ordinate_add [simp]:
  "ordinate (A + B) = ordinate A + ordinate B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordinate (A + B) = ordinate A + ordinate B
[PROOF STEP]
by (simp add: point_add_def)


[STATEMENT]
theorem CE_sound: "CE_holds var \<phi> \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CE_holds var \<phi> \<psi>
[PROOF STEP]
apply(simp only: CE_holds_def valid_def iff_sem)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>I \<nu>. is_interp I \<longrightarrow> (\<nu> \<in> fml_sem I \<phi>) = (\<nu> \<in> fml_sem I \<psi>)) \<longrightarrow> (\<forall>I \<nu>. is_interp I \<longrightarrow> (\<nu> \<in> fml_sem I (InContext var \<phi>)) = (\<nu> \<in> fml_sem I (InContext var \<psi>)))
[PROOF STEP]
apply(rule allI | rule impI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I \<nu>. \<lbrakk>\<forall>I \<nu>. is_interp I \<longrightarrow> (\<nu> \<in> fml_sem I \<phi>) = (\<nu> \<in> fml_sem I \<psi>); is_interp I\<rbrakk> \<Longrightarrow> (\<nu> \<in> fml_sem I (InContext var \<phi>)) = (\<nu> \<in> fml_sem I (InContext var \<psi>))
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I \<nu>. \<lbrakk>\<forall>I. is_interp I \<longrightarrow> (\<forall>a b. ((a, b) \<in> fml_sem I \<phi>) = ((a, b) \<in> fml_sem I \<psi>)); is_interp I\<rbrakk> \<Longrightarrow> (\<nu> \<in> Contexts I var (fml_sem I \<phi>)) = (\<nu> \<in> Contexts I var (fml_sem I \<psi>))
[PROOF STEP]
apply(metis subsetI subset_antisym surj_pair)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_mat_vec_scalar: "A *v v = mk_vec (\<lambda> i. scalar_product (row i A) v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v v = local.mk_vec (\<lambda>i. scalar_product (row i A) v)
[PROOF STEP]
unfolding vec_eq_iff matrix_vector_mult_def scalar_product_def mk_mat_def mk_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. (\<chi>i. \<Sum>j\<in>UNIV. A $h i $h j * v $h j) $h i = (\<chi>i. \<Sum>ia\<in>UNIV. row i A $h ia * v $h ia) $h i
[PROOF STEP]
by (auto simp: row_def column_def)