[STATEMENT]
theorem wei_approx_\<Delta>:
"VARS (S :: 'a set) (X :: 'a set) (x :: 'a)
  { True }
  S := {};
  X := {};
  WHILE X \<noteq> V
  INV { \<exists>P. inv_partition S X P }
  DO x := (SOME x. x \<in> V - X);
     S := insert x S;
     X := X \<union> neighbors x \<union> {x}
  OD
  { approximation_miv \<Delta> S }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {True}
S := {}; X := {}; WHILE X \<noteq> V INV {\<exists>P. inv_partition S X P}  VAR {0}
DO x := (SOME x. x \<in> V - X); S := insert x S; X := X \<union> neighbors x \<union> {x} OD
{approximation_miv \<Delta> S}
[PROOF STEP]
proof (vcg, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>S X x. True \<Longrightarrow> Ex (inv_partition {} {})
 2. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 3. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
case (1 S X x)
[PROOF STATE]
proof (state)
this:
True

goal (3 subgoals):
 1. \<And>S X x. True \<Longrightarrow> Ex (inv_partition {} {})
 2. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 3. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
(* invariant initially true *)
  (* the invariant is initially true with the ghost variable P := {} *)
[PROOF STATE]
proof (state)
this:
True

goal (3 subgoals):
 1. \<And>S X x. True \<Longrightarrow> Ex (inv_partition {} {})
 2. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 3. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
have "inv_partition {} {} {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_partition {} {} {}
[PROOF STEP]
unfolding inv_partition_def inv_iv_def independent_vertices_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (({} \<subseteq> \<Union> E \<and> (\<forall>v1 v2. v1 \<in> {} \<and> v2 \<in> {} \<longrightarrow> {v1, v2} \<notin> E)) \<and> {} \<subseteq> V \<and> (\<forall>v1\<in>V - {}. \<forall>v2\<in>{}. {v1, v2} \<notin> E) \<and> {} \<subseteq> {}) \<and> \<Union> {} = {} \<and> (\<forall>p\<in>{}. \<exists>s\<in>V. p = {s} \<union> neighbors s) \<and> card {} = card {} \<and> finite {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv_partition {} {} {}

goal (3 subgoals):
 1. \<And>S X x. True \<Longrightarrow> Ex (inv_partition {} {})
 2. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 3. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv_partition {} {} {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
inv_partition {} {} {}

goal (1 subgoal):
 1. Ex (inv_partition {} {})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Ex (inv_partition {} {})

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
case (2 S X x)
[PROOF STATE]
proof (state)
this:
Ex (inv_partition S X) \<and> X \<noteq> V

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
(* invariant preserved by loop *)
  (* definedness of assignment *)
[PROOF STATE]
proof (state)
this:
Ex (inv_partition S X) \<and> X \<noteq> V

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
let ?x = "(SOME x. x \<in> V - X)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
from 2
[PROOF STATE]
proof (chain)
picking this:
Ex (inv_partition S X) \<and> X \<noteq> V
[PROOF STEP]
obtain P where I: "inv_partition S X P"
[PROOF STATE]
proof (prove)
using this:
Ex (inv_partition S X) \<and> X \<noteq> V

goal (1 subgoal):
 1. (\<And>P. inv_partition S X P \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inv_partition S X P

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv_partition S X P
[PROOF STEP]
have "V - X \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
inv_partition S X P

goal (1 subgoal):
 1. V - X \<noteq> {}
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
inv_partition S X P
Ex (inv_partition S X) \<and> X \<noteq> V

goal (1 subgoal):
 1. V - X \<noteq> {}
[PROOF STEP]
unfolding inv_partition_def
[PROOF STATE]
proof (prove)
using this:
inv_iv S X \<and> \<Union> P = X \<and> (\<forall>p\<in>P. \<exists>s\<in>V. p = {s} \<union> neighbors s) \<and> card P = card S \<and> finite P
(\<exists>P. inv_iv S X \<and> \<Union> P = X \<and> (\<forall>p\<in>P. \<exists>s\<in>V. p = {s} \<union> neighbors s) \<and> card P = card S \<and> finite P) \<and> X \<noteq> V

goal (1 subgoal):
 1. V - X \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
V - X \<noteq> {}

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V - X \<noteq> {}
[PROOF STEP]
have "?x \<in> V - X"
[PROOF STATE]
proof (prove)
using this:
V - X \<noteq> {}

goal (1 subgoal):
 1. (SOME x. x \<in> V - X) \<in> V - X
[PROOF STEP]
using some_in_eq
[PROOF STATE]
proof (prove)
using this:
V - X \<noteq> {}
((SOME x. x \<in> ?A) \<in> ?A) = (?A \<noteq> {})

goal (1 subgoal):
 1. (SOME x. x \<in> V - X) \<in> V - X
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(SOME x. x \<in> V - X) \<in> V - X

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
(* show that the invariant is true with the ghost variable P := insert ({?x} \<union> neighbors ?x) P *)
[PROOF STATE]
proof (state)
this:
(SOME x. x \<in> V - X) \<in> V - X

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
with I
[PROOF STATE]
proof (chain)
picking this:
inv_partition S X P
(SOME x. x \<in> V - X) \<in> V - X
[PROOF STEP]
have "inv_partition (insert ?x S) (X \<union> neighbors ?x \<union> {?x}) (insert ({?x} \<union> neighbors ?x) P)"
[PROOF STATE]
proof (prove)
using this:
inv_partition S X P
(SOME x. x \<in> V - X) \<in> V - X

goal (1 subgoal):
 1. inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}) (insert ({SOME x. x \<in> V - X} \<union> neighbors (SOME x. x \<in> V - X)) P)
[PROOF STEP]
using inv_partition_preserv
[PROOF STATE]
proof (prove)
using this:
inv_partition S X P
(SOME x. x \<in> V - X) \<in> V - X
\<lbrakk>inv_partition ?S ?X ?P; ?x \<in> V - ?X\<rbrakk> \<Longrightarrow> inv_partition (insert ?x ?S) (?X \<union> neighbors ?x \<union> {?x}) (insert ({?x} \<union> neighbors ?x) ?P)

goal (1 subgoal):
 1. inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}) (insert ({SOME x. x \<in> V - X} \<union> neighbors (SOME x. x \<in> V - X)) P)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}) (insert ({SOME x. x \<in> V - X} \<union> neighbors (SOME x. x \<in> V - X)) P)

goal (2 subgoals):
 1. \<And>S X x. Ex (inv_partition S X) \<and> X \<noteq> V \<Longrightarrow> Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
 2. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}) (insert ({SOME x. x \<in> V - X} \<union> neighbors (SOME x. x \<in> V - X)) P)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}) (insert ({SOME x. x \<in> V - X} \<union> neighbors (SOME x. x \<in> V - X)) P)

goal (1 subgoal):
 1. Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Ex (inv_partition (insert (SOME x. x \<in> V - X) S) (X \<union> neighbors (SOME x. x \<in> V - X) \<union> {SOME x. x \<in> V - X}))

goal (1 subgoal):
 1. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
case (3 S X x)
[PROOF STATE]
proof (state)
this:
Ex (inv_partition S X) \<and> \<not> X \<noteq> V

goal (1 subgoal):
 1. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
(* invariant implies post-condition *)
[PROOF STATE]
proof (state)
this:
Ex (inv_partition S X) \<and> \<not> X \<noteq> V

goal (1 subgoal):
 1. \<And>S X x. Ex (inv_partition S X) \<and> \<not> X \<noteq> V \<Longrightarrow> approximation_miv \<Delta> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Ex (inv_partition S X) \<and> \<not> X \<noteq> V
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Ex (inv_partition S X) \<and> \<not> X \<noteq> V

goal (1 subgoal):
 1. approximation_miv \<Delta> S
[PROOF STEP]
using inv_partition_approx
[PROOF STATE]
proof (prove)
using this:
Ex (inv_partition S X) \<and> \<not> X \<noteq> V
inv_partition ?S V ?P \<Longrightarrow> approximation_miv \<Delta> ?S

goal (1 subgoal):
 1. approximation_miv \<Delta> S
[PROOF STEP]
unfolding inv_approx_def
[PROOF STATE]
proof (prove)
using this:
Ex (inv_partition S X) \<and> \<not> X \<noteq> V
inv_partition ?S V ?P \<Longrightarrow> approximation_miv \<Delta> ?S

goal (1 subgoal):
 1. approximation_miv \<Delta> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
approximation_miv \<Delta> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [code]:
  "ExcessTable g =
   List.map_filter (\<lambda>v. let e = ExcessAt g v in if 0 < e then Some (v, e) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ExcessTable g = List.map_filter (\<lambda>v. let e = ExcessAt g v in if 0 < e then Some (v, e) else None)
[PROOF STEP]
by (rule ext) (simp add: ExcessTable_def map_filter_def)


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


[STATEMENT]
lemma env_restr_eqI: "(\<And>x. x \<in> S \<Longrightarrow> m\<^sub>1 x = m\<^sub>2 x) \<Longrightarrow> m\<^sub>1 f|` S = m\<^sub>2 f|` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> m\<^sub>1 x = m\<^sub>2 x) \<Longrightarrow> m\<^sub>1 f|` S = m\<^sub>2 f|` S
[PROOF STEP]
by (auto simp add: lookup_env_restr_eq)


[STATEMENT]
lemma null_part_sets[intro, simp]:
  assumes "S \<in> sets M" shows "null_part M S \<in> sets M" "emeasure M (null_part M S) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. null_part M S \<in> sets M &&& emeasure M (null_part M S) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. null_part M S \<in> sets M
 2. emeasure M (null_part M S) = 0
[PROOF STEP]
have S: "S \<in> sets (completion M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> sets (completion M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<in> sets M

goal (1 subgoal):
 1. S \<in> sets (completion M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<in> sets (completion M)

goal (2 subgoals):
 1. null_part M S \<in> sets M
 2. emeasure M (null_part M S) = 0
[PROOF STEP]
have *: "S - main_part M S \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S - main_part M S \<in> sets M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<in> sets M

goal (1 subgoal):
 1. S - main_part M S \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S - main_part M S \<in> sets M

goal (2 subgoals):
 1. null_part M S \<in> sets M
 2. emeasure M (null_part M S) = 0
[PROOF STEP]
from main_part_null_part_Un[OF S] main_part_null_part_Int[OF S]
[PROOF STATE]
proof (chain)
picking this:
main_part M S \<union> null_part M S = S
main_part M S \<inter> null_part M S = {}
[PROOF STEP]
have "S - main_part M S = null_part M S"
[PROOF STATE]
proof (prove)
using this:
main_part M S \<union> null_part M S = S
main_part M S \<inter> null_part M S = {}

goal (1 subgoal):
 1. S - main_part M S = null_part M S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S - main_part M S = null_part M S

goal (2 subgoals):
 1. null_part M S \<in> sets M
 2. emeasure M (null_part M S) = 0
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
S - main_part M S \<in> sets M
S - main_part M S = null_part M S
[PROOF STEP]
show sets: "null_part M S \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
S - main_part M S \<in> sets M
S - main_part M S = null_part M S

goal (1 subgoal):
 1. null_part M S \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
null_part M S \<in> sets M

goal (1 subgoal):
 1. emeasure M (null_part M S) = 0
[PROOF STEP]
from null_part[OF S]
[PROOF STATE]
proof (chain)
picking this:
\<exists>N. N \<in> null_sets M \<and> null_part M S \<subseteq> N
[PROOF STEP]
obtain N where "N \<in> null_sets M \<and> null_part M S \<subseteq> N"
[PROOF STATE]
proof (prove)
using this:
\<exists>N. N \<in> null_sets M \<and> null_part M S \<subseteq> N

goal (1 subgoal):
 1. (\<And>N. N \<in> null_sets M \<and> null_part M S \<subseteq> N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
N \<in> null_sets M \<and> null_part M S \<subseteq> N

goal (1 subgoal):
 1. emeasure M (null_part M S) = 0
[PROOF STEP]
with emeasure_eq_0[of N _ "null_part M S"] sets
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>N \<in> sets ?M; emeasure ?M N = 0; null_part M S \<subseteq> N\<rbrakk> \<Longrightarrow> emeasure ?M (null_part M S) = 0
null_part M S \<in> sets M
N \<in> null_sets M \<and> null_part M S \<subseteq> N
[PROOF STEP]
show "emeasure M (null_part M S) = 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>N \<in> sets ?M; emeasure ?M N = 0; null_part M S \<subseteq> N\<rbrakk> \<Longrightarrow> emeasure ?M (null_part M S) = 0
null_part M S \<in> sets M
N \<in> null_sets M \<and> null_part M S \<subseteq> N

goal (1 subgoal):
 1. emeasure M (null_part M S) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
emeasure M (null_part M S) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma regular_homogenous_system:
  fixes a11 a12 a21 a22 x1 x2 :: "'a::field"
  assumes "det2 a11 a12 a21 a22 \<noteq> 0"
  assumes "a11*x1 + a12*x2 = 0" and
          "a21*x1 + a22*x2 = 0"
  shows "x1 = 0 \<and> x2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
proof (cases "a11 = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a11 = (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
 2. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a11 = (0::'a)

goal (2 subgoals):
 1. a11 = (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
 2. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
det2 a11 a12 a21 a22 \<noteq> (0::'a)
a11 = (0::'a)
[PROOF STEP]
have "a12 \<noteq> 0" "a21 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
det2 a11 a12 a21 a22 \<noteq> (0::'a)
a11 = (0::'a)

goal (1 subgoal):
 1. a12 \<noteq> (0::'a) &&& a21 \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a12 \<noteq> (0::'a)
a21 \<noteq> (0::'a)

goal (2 subgoals):
 1. a11 = (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
 2. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a12 \<noteq> (0::'a)
a21 \<noteq> (0::'a)

goal (1 subgoal):
 1. x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
using \<open>a11 = 0\<close> assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
a12 \<noteq> (0::'a)
a21 \<noteq> (0::'a)
a11 = (0::'a)
a11 * x1 + a12 * x2 = (0::'a)
a21 * x1 + a22 * x2 = (0::'a)

goal (1 subgoal):
 1. x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = (0::'a) \<and> x2 = (0::'a)

goal (1 subgoal):
 1. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a11 \<noteq> (0::'a)

goal (1 subgoal):
 1. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
hence "x1 = - a12*x2 / a11"
[PROOF STATE]
proof (prove)
using this:
a11 \<noteq> (0::'a)

goal (1 subgoal):
 1. x1 = - a12 * x2 / a11
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
a11 \<noteq> (0::'a)
a11 * x1 + a12 * x2 = (0::'a)

goal (1 subgoal):
 1. x1 = - a12 * x2 / a11
[PROOF STEP]
by (metis eq_neg_iff_add_eq_0 mult_minus_left nonzero_mult_div_cancel_left)
[PROOF STATE]
proof (state)
this:
x1 = - a12 * x2 / a11

goal (1 subgoal):
 1. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
hence "a21 * (- a12 * x2 / a11) + a22 * x2 = 0"
[PROOF STATE]
proof (prove)
using this:
x1 = - a12 * x2 / a11

goal (1 subgoal):
 1. a21 * (- a12 * x2 / a11) + a22 * x2 = (0::'a)
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
x1 = - a12 * x2 / a11
a21 * x1 + a22 * x2 = (0::'a)

goal (1 subgoal):
 1. a21 * (- a12 * x2 / a11) + a22 * x2 = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a21 * (- a12 * x2 / a11) + a22 * x2 = (0::'a)

goal (1 subgoal):
 1. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
hence "a21 * (- a12 * x2) + a22 * x2 * a11 = 0"
[PROOF STATE]
proof (prove)
using this:
a21 * (- a12 * x2 / a11) + a22 * x2 = (0::'a)

goal (1 subgoal):
 1. a21 * (- a12 * x2) + a22 * x2 * a11 = (0::'a)
[PROOF STEP]
using  \<open>a11 \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a21 * (- a12 * x2 / a11) + a22 * x2 = (0::'a)
a11 \<noteq> (0::'a)

goal (1 subgoal):
 1. a21 * (- a12 * x2) + a22 * x2 * a11 = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a21 * (- a12 * x2) + a22 * x2 * a11 = (0::'a)

goal (1 subgoal):
 1. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
hence "(a11*a22 - a12*a21)*x2 = 0"
[PROOF STATE]
proof (prove)
using this:
a21 * (- a12 * x2) + a22 * x2 * a11 = (0::'a)

goal (1 subgoal):
 1. (a11 * a22 - a12 * a21) * x2 = (0::'a)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(a11 * a22 - a12 * a21) * x2 = (0::'a)

goal (1 subgoal):
 1. a11 \<noteq> (0::'a) \<Longrightarrow> x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(a11 * a22 - a12 * a21) * x2 = (0::'a)

goal (1 subgoal):
 1. x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
using assms(1) assms(2) \<open>a11 \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
(a11 * a22 - a12 * a21) * x2 = (0::'a)
det2 a11 a12 a21 a22 \<noteq> (0::'a)
a11 * x1 + a12 * x2 = (0::'a)
a11 \<noteq> (0::'a)

goal (1 subgoal):
 1. x1 = (0::'a) \<and> x2 = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = (0::'a) \<and> x2 = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_CompI [intro]:
     assumes "B.is_iso_class F" and "B.is_iso_class G"
     and "f \<in> F" and "g \<in> G" and "g \<star> f \<cong>\<^sub>B h"
     shows "h \<in> Comp G F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> Comp G F
[PROOF STEP]
unfolding Comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> {h. B.is_iso_class F \<and> B.is_iso_class G \<and> (\<exists>f g. f \<in> F \<and> g \<in> G \<and> g \<star> f \<cong>\<^sub>B h)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B.is_iso_class F
B.is_iso_class G
f \<in> F
g \<in> G
g \<star> f \<cong>\<^sub>B h

goal (1 subgoal):
 1. h \<in> {h. B.is_iso_class F \<and> B.is_iso_class G \<and> (\<exists>f g. f \<in> F \<and> g \<in> G \<and> g \<star> f \<cong>\<^sub>B h)}
[PROOF STEP]
by auto


[STATEMENT]
lemma multiply_invertible_mat: assumes lin: "lin_indep fs"
  and len: "length fs = m"
  and A: "A \<in> carrier_mat m m"
  and A_invertible: "\<exists> B. B \<in> carrier_mat m m \<and> B * A = 1\<^sub>m m"
  and fs'_prod: "fs' = Matrix.rows (A * mat_of_rows n fs)"
shows "lattice_of fs' = lattice_of fs"
  "lin_indep fs'"
  "length fs' = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of fs' = lattice_of fs &&& gs.lin_indpt_list (map of_int_hom.vec_hom fs') &&& length fs' = m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
let ?Mfs = "mat_of_rows n fs"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
let ?Mfs' = "mat_of_rows n fs'"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
from A_invertible
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. B \<in> carrier_mat m m \<and> B * A = 1\<^sub>m m
[PROOF STEP]
obtain B where B: "B \<in> carrier_mat m m" and inv: "B * A = 1\<^sub>m m"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. B \<in> carrier_mat m m \<and> B * A = 1\<^sub>m m

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>B \<in> carrier_mat m m; B * A = 1\<^sub>m m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat m m
B * A = 1\<^sub>m m

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
from lin
[PROOF STATE]
proof (chain)
picking this:
gs.lin_indpt_list (map of_int_hom.vec_hom fs)
[PROOF STEP]
have fs: "set fs \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
gs.lin_indpt_list (map of_int_hom.vec_hom fs)

goal (1 subgoal):
 1. set fs \<subseteq> carrier_vec n
[PROOF STEP]
unfolding gs.lin_indpt_list_def
[PROOF STATE]
proof (prove)
using this:
set (map of_int_hom.vec_hom fs) \<subseteq> Rn \<and> distinct (map of_int_hom.vec_hom fs) \<and> gs.lin_indpt (set (map of_int_hom.vec_hom fs))

goal (1 subgoal):
 1. set fs \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set fs \<subseteq> carrier_vec n

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
with len
[PROOF STATE]
proof (chain)
picking this:
length fs = m
set fs \<subseteq> carrier_vec n
[PROOF STEP]
have Mfs: "?Mfs \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
using this:
length fs = m
set fs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. mat_of_rows n fs \<in> carrier_mat m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_of_rows n fs \<in> carrier_mat m n

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
from A Mfs
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat m m
mat_of_rows n fs \<in> carrier_mat m n
[PROOF STEP]
have prod: "A * ?Mfs \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat m m
mat_of_rows n fs \<in> carrier_mat m n

goal (1 subgoal):
 1. A * mat_of_rows n fs \<in> carrier_mat m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * mat_of_rows n fs \<in> carrier_mat m n

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
hence fs': "length fs' = m" "set fs' \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
A * mat_of_rows n fs \<in> carrier_mat m n

goal (1 subgoal):
 1. length fs' = m &&& set fs' \<subseteq> carrier_vec n
[PROOF STEP]
unfolding fs'_prod
[PROOF STATE]
proof (prove)
using this:
A * mat_of_rows n fs \<in> carrier_mat m n

goal (1 subgoal):
 1. length (rows (A * mat_of_rows n fs)) = m &&& set (rows (A * mat_of_rows n fs)) \<subseteq> carrier_vec n
[PROOF STEP]
by (auto simp: Matrix.rows_def Matrix.row_def)
[PROOF STATE]
proof (state)
this:
length fs' = m
set fs' \<subseteq> carrier_vec n

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
have Mfs_prod': "?Mfs' = A * ?Mfs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows n fs' = A * mat_of_rows n fs
[PROOF STEP]
unfolding arg_cong[OF fs'_prod, of "mat_of_rows n"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_rows n (rows (A * mat_of_rows n fs)) = A * mat_of_rows n fs
[PROOF STEP]
by (intro eq_matI, auto simp: mat_of_rows_def)
[PROOF STATE]
proof (state)
this:
mat_of_rows n fs' = A * mat_of_rows n fs

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
have "B * ?Mfs' = B * (A * ?Mfs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * mat_of_rows n fs' = B * (A * mat_of_rows n fs)
[PROOF STEP]
unfolding Mfs_prod'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * (A * mat_of_rows n fs) = B * (A * mat_of_rows n fs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B * mat_of_rows n fs' = B * (A * mat_of_rows n fs)

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B * mat_of_rows n fs' = B * (A * mat_of_rows n fs)

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
have "\<dots> = (B * A) * ?Mfs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * (A * mat_of_rows n fs) = B * A * mat_of_rows n fs
[PROOF STEP]
by (subst assoc_mult_mat[OF _ A Mfs], insert B, auto)
[PROOF STATE]
proof (state)
this:
B * (A * mat_of_rows n fs) = B * A * mat_of_rows n fs

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B * (A * mat_of_rows n fs) = B * A * mat_of_rows n fs

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
have "B * A = 1\<^sub>m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * A = 1\<^sub>m m
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
B * A = 1\<^sub>m m

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B * A = 1\<^sub>m m

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
have "\<dots> * ?Mfs = ?Mfs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m m * mat_of_rows n fs = mat_of_rows n fs
[PROOF STEP]
using Mfs
[PROOF STATE]
proof (prove)
using this:
mat_of_rows n fs \<in> carrier_mat m n

goal (1 subgoal):
 1. 1\<^sub>m m * mat_of_rows n fs = mat_of_rows n fs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1\<^sub>m m * mat_of_rows n fs = mat_of_rows n fs

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
B * mat_of_rows n fs' = mat_of_rows n fs
[PROOF STEP]
have Mfs_prod: "?Mfs = B * ?Mfs'"
[PROOF STATE]
proof (prove)
using this:
B * mat_of_rows n fs' = mat_of_rows n fs

goal (1 subgoal):
 1. mat_of_rows n fs = B * mat_of_rows n fs'
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
mat_of_rows n fs = B * mat_of_rows n fs'

goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
interpret LLL: LLL_with_assms n m fs 2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LLL_with_assms n m fs 2
[PROOF STEP]
by (unfold_locales, auto simp: len lin)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. lattice_of fs' = lattice_of fs
 2. gs.lin_indpt_list (map of_int_hom.vec_hom fs')
 3. length fs' = m
[PROOF STEP]
from LLL.LLL_change_basis[OF fs'(2,1) B A Mfs_prod Mfs_prod']
[PROOF STATE]
proof (chain)
picking this:
lattice_of fs' = lattice_of fs
LLL_with_assms n m fs' 2
[PROOF STEP]
show latt': "lattice_of fs' = lattice_of fs" and lin': "gs.lin_indpt_list (RAT fs')"
    and len': "length fs' = m"
[PROOF STATE]
proof (prove)
using this:
lattice_of fs' = lattice_of fs
LLL_with_assms n m fs' 2

goal (1 subgoal):
 1. lattice_of fs' = lattice_of fs &&& gs.lin_indpt_list (map of_int_hom.vec_hom fs') &&& length fs' = m
[PROOF STEP]
by (auto simp add: LLL_with_assms_def)
[PROOF STATE]
proof (state)
this:
lattice_of fs' = lattice_of fs
gs.lin_indpt_list (map of_int_hom.vec_hom fs')
length fs' = m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma step_4_push_big_size_ok_3: "\<lbrakk>
  invar (States dir big small);
  4 \<le> remaining_steps (States dir big small);
  (step^^4) (States dir (Big.push x big) small) = States dir' big' small';
  size_new small + remaining_steps (States dir big small) + 2 \<le> 3 * size_new big
\<rbrakk> \<Longrightarrow> size_new small' + remaining_steps (States dir' big' small') + 2 \<le> 3 * size_new big'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); 4 \<le> remaining_steps (States dir big small); (step ^^ 4) (States dir (Big.push x big) small) = States dir' big' small'; size_new small + remaining_steps (States dir big small) + 2 \<le> 3 * size_new big\<rbrakk> \<Longrightarrow> size_new small' + remaining_steps (States dir' big' small') + 2 \<le> 3 * size_new big'
[PROOF STEP]
by (metis invar_push_big remaining_steps_n_steps_sub remaining_steps_push_big step_4_push_big_size_ok_3_aux step_n_push_size_new_big step_n_size_new_small)


[STATEMENT]
lemma fetch_aft_erase_c_o:
  "fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 4) Oc
 = (WB, Suc (2 * n + 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 4) Oc = (WB, Suc (2 * n + 2))
[PROOF STEP]
apply(subgoal_tac "length (mopup_a n) = 4 * n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (mopup_a n) = 4 * n \<Longrightarrow> fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 4) Oc = (WB, Suc (2 * n + 2))
 2. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(subgoal_tac "2*n + 4 = Suc (2*n + 3)", simp only: fetch.simps)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>length (mopup_a n) = 4 * n; 2 * n + 4 = Suc (2 * n + 3)\<rbrakk> \<Longrightarrow> (case nth_of (mopup_a n @ shift mopup_b (2 * n)) (2 * (2 * n + 3) + 1) of None \<Rightarrow> (Nop, 0) | Some i \<Rightarrow> i) = (WB, Suc (2 * n + 2))
 2. length (mopup_a n) = 4 * n \<Longrightarrow> 2 * n + 4 = Suc (2 * n + 3)
 3. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(auto simp: mopup_b_def nth_append shift.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma R5_d_ge_one_half: "pmf (sds R5) d \<ge> 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 \<le> pmf (sds R5) d
[PROOF STEP]
using R5_R10.strategyproofness(1) R5.support lottery_conditions[OF R5.wf]
[PROOF STATE]
proof (prove)
using this:
(pmf (sds R10) a < pmf (sds R5) d \<or> pmf (sds R10) a + (pmf (sds R10) c + pmf (sds R10) d) < pmf (sds R5) d + (pmf (sds R5) b + pmf (sds R5) a)) \<or> pmf (sds R10) a = pmf (sds R5) d \<and> pmf (sds R10) a + (pmf (sds R10) c + pmf (sds R10) d) = pmf (sds R5) d + (pmf (sds R5) b + pmf (sds R5) a)
pmf (sds R5) b = 0
0 \<le> pmf (sds R5) a
0 \<le> pmf (sds R5) b
0 \<le> pmf (sds R5) c
0 \<le> pmf (sds R5) d
pmf (sds R5) a + pmf (sds R5) b + pmf (sds R5) c + pmf (sds R5) d = 1

goal (1 subgoal):
 1. 1 / 2 \<le> pmf (sds R5) d
[PROOF STEP]
by auto


[STATEMENT]
lemma Y_arr_is_transformation:
    assumes "C.arr f"
    shows "natural_transformation Cop.comp S (Y (C.dom f)) (Y (C.cod f)) (Y f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natural_transformation (\<cdot>\<^sup>o\<^sup>p) (\<cdot>\<^sub>S) (Y (C.dom f)) (Y (C.cod f)) (Y f)
[PROOF STEP]
using assms Y_def [of f] map_def Hom.fixing_arr_gives_natural_transformation_2
            preserves_dom preserves_cod
[PROOF STATE]
proof (prove)
using this:
C.arr f
Y f \<equiv> Cop_S.Map (local.map f)
local.map \<equiv> local.curry Hom.sym Hom.sym Hom.sym
C.arr ?f2.0 \<Longrightarrow> natural_transformation (\<cdot>\<^sup>o\<^sup>p) (\<cdot>\<^sub>S) (\<lambda>f1. Hom.map (f1, C.dom ?f2.0)) (\<lambda>f1. Hom.map (f1, C.cod ?f2.0)) (\<lambda>f1. Hom.map (f1, ?f2.0))
C.arr ?f \<Longrightarrow> Cop_S.dom (local.map ?f) = local.map (C.dom ?f)
C.arr ?f \<Longrightarrow> Cop_S.cod (local.map ?f) = local.map (C.cod ?f)

goal (1 subgoal):
 1. natural_transformation (\<cdot>\<^sup>o\<^sup>p) (\<cdot>\<^sub>S) (Y (C.dom f)) (Y (C.cod f)) (Y f)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma pmf_bind_pmf_of_multiset:
  "A \<noteq> {#} \<Longrightarrow> pmf (pmf_of_multiset A \<bind> f) y =
     (\<Sum>x\<in>set_mset A. real (count A x) * pmf (f x) y) / real (size A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> {#} \<Longrightarrow> pmf (pmf_of_multiset A \<bind> f) y = (\<Sum>x\<in>set_mset A. real (count A x) * pmf (f x) y) / real (size A)
[PROOF STEP]
by (simp add: pmf_bind integral_pmf_of_multiset)


[STATEMENT]
lemma NSLIMSEQ_minus_cancel: "(\<lambda>n. - X n) \<longlonglongrightarrow>\<^sub>N\<^sub>S -a \<Longrightarrow> X \<longlonglongrightarrow>\<^sub>N\<^sub>S a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - X n) \<longlonglongrightarrow>\<^sub>N\<^sub>S - a \<Longrightarrow> X \<longlonglongrightarrow>\<^sub>N\<^sub>S a
[PROOF STEP]
by (drule NSLIMSEQ_minus) simp


[STATEMENT]
lemma beukers_integral1_conv_nn_integral:
  "beukers_integral1 r s = enn2real (beukers_nn_integral1 r s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. beukers_integral1 r s = enn2real (beukers_nn_integral1 r s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. beukers_integral1 r s = enn2real (beukers_nn_integral1 r s)
[PROOF STEP]
have "ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0" if "a \<in> {0<..<1}" "b \<in> {0<..<1}"
    for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0
[PROOF STEP]
using mult_strict_mono[of a 1 b 1] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a < 1; b < 1; 0 < 1; 0 \<le> b\<rbrakk> \<Longrightarrow> a * b < 1 * 1
a \<in> {0<..<1}
b \<in> {0<..<1}

goal (1 subgoal):
 1. ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0
[PROOF STEP]
by (intro divide_nonpos_nonneg mult_nonpos_nonneg) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0

goal (1 subgoal):
 1. beukers_integral1 r s = enn2real (beukers_nn_integral1 r s)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0

goal (1 subgoal):
 1. beukers_integral1 r s = enn2real (beukers_nn_integral1 r s)
[PROOF STEP]
unfolding beukers_integral1_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0

goal (1 subgoal):
 1. LBINT (x, y):{0<..<1} \<times> {0<..<1}. - ln (x * y) / (1 - x * y) * x ^ r * y ^ s = enn2real (beukers_nn_integral1 r s)
[PROOF STEP]
using beukers_nn_integral1_finite[of r s]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0
beukers_nn_integral1 r s < \<infinity>

goal (1 subgoal):
 1. LBINT (x, y):{0<..<1} \<times> {0<..<1}. - ln (x * y) / (1 - x * y) * x ^ r * y ^ s = enn2real (beukers_nn_integral1 r s)
[PROOF STEP]
by (intro set_integral_eq_nn_integral)
       (auto simp: case_prod_unfold beukers_nn_integral1_def
                   set_borel_measurable_def simp flip: borel_prod
             intro!: AE_I2 intro: divide_nonpos_nonneg mult_nonpos_nonneg)
[PROOF STATE]
proof (state)
this:
beukers_integral1 r s = enn2real (beukers_nn_integral1 r s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_to_iarray_Hermite_of[code_unfold]:
  shows "matrix_to_iarray (Hermite_of A ass res bezout)
  = Hermite_of_iarrays (matrix_to_iarray A) ass res bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_of A ass res bezout) = Hermite_of_iarrays (matrix_to_iarray A) ass res bezout
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_of A ass res bezout) = Hermite_of_iarrays (matrix_to_iarray A) ass res bezout
[PROOF STEP]
have n: "nrows A \<le> nrows (echelon_form_of A bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows A \<le> nrows (echelon_form_of A bezout)
[PROOF STEP]
unfolding nrows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('c) \<le> CARD('c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nrows A \<le> nrows (echelon_form_of A bezout)

goal (1 subgoal):
 1. matrix_to_iarray (Hermite_of A ass res bezout) = Hermite_of_iarrays (matrix_to_iarray A) ass res bezout
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_of A ass res bezout) = Hermite_of_iarrays (matrix_to_iarray A) ass res bezout
[PROOF STEP]
unfolding Hermite_of_def Hermite_of_iarrays_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_of_upt_row_i (echelon_form_of A bezout) (nrows A) ass res) = Hermite_of_upt_row_i_iarrays (echelon_form_of_iarrays (matrix_to_iarray A) bezout) (nrows_iarray (matrix_to_iarray A)) ass res
[PROOF STEP]
unfolding matrix_to_iarray_Hermite_of_upt_row_i[OF n]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hermite_of_upt_row_i_iarrays (matrix_to_iarray (echelon_form_of A bezout)) (nrows A) ass res = Hermite_of_upt_row_i_iarrays (echelon_form_of_iarrays (matrix_to_iarray A) bezout) (nrows_iarray (matrix_to_iarray A)) ass res
[PROOF STEP]
unfolding matrix_to_iarray_echelon_form_of
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hermite_of_upt_row_i_iarrays (echelon_form_of_iarrays (matrix_to_iarray A) bezout) (nrows A) ass res = Hermite_of_upt_row_i_iarrays (echelon_form_of_iarrays (matrix_to_iarray A) bezout) (nrows_iarray (matrix_to_iarray A)) ass res
[PROOF STEP]
unfolding matrix_to_iarray_nrows
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hermite_of_upt_row_i_iarrays (echelon_form_of_iarrays (matrix_to_iarray A) bezout) (nrows_iarray (matrix_to_iarray A)) ass res = Hermite_of_upt_row_i_iarrays (echelon_form_of_iarrays (matrix_to_iarray A) bezout) (nrows_iarray (matrix_to_iarray A)) ass res
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
matrix_to_iarray (Hermite_of A ass res bezout) = Hermite_of_iarrays (matrix_to_iarray A) ass res bezout

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dep3_event_old:
  "dep3_event Q R S x \<longleftrightarrow> Q \<noteq> R \<and> Q \<noteq> S \<and> R \<noteq> S \<and> Q \<in> SPRAY x \<and> R \<in> SPRAY x \<and> S \<in> SPRAY x
                       \<and> (\<exists>T\<in>\<P>. T \<notin> SPRAY x \<and> (\<exists>y\<in>Q. y \<in> T) \<and> (\<exists>y\<in>R. y \<in> T) \<and> (\<exists>y\<in>S. y \<in> T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dep3_event Q R S x = (Q \<noteq> R \<and> Q \<noteq> S \<and> R \<noteq> S \<and> Q \<in> SPRAY x \<and> R \<in> SPRAY x \<and> S \<in> SPRAY x \<and> (\<exists>T\<in>\<P>. T \<notin> SPRAY x \<and> (\<exists>y\<in>Q. y \<in> T) \<and> (\<exists>y\<in>R. y \<in> T) \<and> (\<exists>y\<in>S. y \<in> T)))
[PROOF STEP]
by (rule iffI; unfold dep3_event_def, (simp add: card_3_dist), blast)


[STATEMENT]
lemma iam_iteratei_aux_append:
  "n \<le> length xs \<Longrightarrow> iam_iteratei_aux n (Array (xs @ ys)) =
             iam_iteratei_aux n (Array xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> length xs \<Longrightarrow> iam_iteratei_aux n (Array (xs @ ys)) = iam_iteratei_aux n (Array xs)
[PROOF STEP]
apply (induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> length xs \<Longrightarrow> iam_iteratei_aux 0 (Array (xs @ ys)) = iam_iteratei_aux 0 (Array xs)
 2. \<And>n. \<lbrakk>n \<le> length xs \<Longrightarrow> iam_iteratei_aux n (Array (xs @ ys)) = iam_iteratei_aux n (Array xs); Suc n \<le> length xs\<rbrakk> \<Longrightarrow> iam_iteratei_aux (Suc n) (Array (xs @ ys)) = iam_iteratei_aux (Suc n) (Array xs)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> length xs \<Longrightarrow> iam_iteratei_aux n (Array (xs @ ys)) = iam_iteratei_aux n (Array xs); Suc n \<le> length xs\<rbrakk> \<Longrightarrow> iam_iteratei_aux (Suc n) (Array (xs @ ys)) = iam_iteratei_aux (Suc n) (Array xs)
[PROOF STEP]
apply (intro ext, auto split: option.split simp: nth_append)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in -) find_path1_ex_rule:
    assumes "finite (E\<^sup>*``{u0})"
    assumes "\<exists>v\<in>E\<^sup>+``{u0}. P v"
    shows "find_path1 E u0 P \<le> SPEC (\<lambda>r.
      \<exists>p v. r = Some (p,v) \<and> p\<noteq>[] \<and> P v \<and> path E u0 p v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_path1 E u0 P \<le> SPEC (\<lambda>r. \<exists>p v. r = Some (p, v) \<and> p \<noteq> [] \<and> P v \<and> path E u0 p v)
[PROOF STEP]
unfolding find_path1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ASSERT (finite (E\<^sup>* `` {u0})) \<bind> (\<lambda>_. SPEC (\<lambda>p. case p of None \<Rightarrow> \<forall>v\<in>E\<^sup>+ `` {u0}. \<not> P v | Some (p, v) \<Rightarrow> path E u0 p v \<and> P v \<and> p \<noteq> [])) \<le> SPEC (\<lambda>r. \<exists>p v. r = Some (p, v) \<and> p \<noteq> [] \<and> P v \<and> path E u0 p v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (E\<^sup>* `` {u0})
\<exists>v\<in>E\<^sup>+ `` {u0}. P v

goal (1 subgoal):
 1. ASSERT (finite (E\<^sup>* `` {u0})) \<bind> (\<lambda>_. SPEC (\<lambda>p. case p of None \<Rightarrow> \<forall>v\<in>E\<^sup>+ `` {u0}. \<not> P v | Some (p, v) \<Rightarrow> path E u0 p v \<and> P v \<and> p \<noteq> [])) \<le> SPEC (\<lambda>r. \<exists>p v. r = Some (p, v) \<and> p \<noteq> [] \<and> P v \<and> path E u0 p v)
[PROOF STEP]
by (fastforce split: option.splits)


[STATEMENT]
lemma mult_poly_by_monom_simps[simp]:
  \<open>mult_poly_by_monom t {#} = {#}\<close>
  \<open>mult_poly_by_monom t (ps + qs) =  mult_poly_by_monom t ps + mult_poly_by_monom t qs\<close>
  \<open>mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_poly_by_monom t {#} = {#} &&& mult_poly_by_monom t (ps + qs) = mult_poly_by_monom t ps + mult_poly_by_monom t qs &&& mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mult_poly_by_monom t {#} = {#}
 2. mult_poly_by_monom t (ps + qs) = mult_poly_by_monom t ps + mult_poly_by_monom t qs
 3. mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps)
[PROOF STEP]
interpret comp_fun_commute \<open>(\<lambda>xs. add_mset (xs + t))\<close> for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute (\<lambda>xs. add_mset (xs + t))
[PROOF STEP]
by standard auto
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mult_poly_by_monom t {#} = {#}
 2. mult_poly_by_monom t (ps + qs) = mult_poly_by_monom t ps + mult_poly_by_monom t qs
 3. mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps)
[PROOF STEP]
show
    \<open>mult_poly_by_monom t (ps + qs) =  mult_poly_by_monom t ps + mult_poly_by_monom t qs\<close> for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_poly_by_monom t (ps + qs) = mult_poly_by_monom t ps + mult_poly_by_monom t qs
[PROOF STEP]
by (induction ps)
      (auto simp: mult_poly_by_monom_def)
[PROOF STATE]
proof (state)
this:
mult_poly_by_monom ?t (ps + qs) = mult_poly_by_monom ?t ps + mult_poly_by_monom ?t qs

goal (2 subgoals):
 1. mult_poly_by_monom t {#} = {#}
 2. mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps)
[PROOF STEP]
show
    \<open>mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps)\<close>
    \<open>mult_poly_by_monom t {#} = {#}\<close>for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps) &&& mult_poly_by_monom t {#} = {#}
[PROOF STEP]
by (auto simp: mult_poly_by_monom_def)
[PROOF STATE]
proof (state)
this:
mult_poly_by_monom a (add_mset p ps) = add_mset (fst a + fst p, snd a * snd p) (mult_poly_by_monom a ps)
mult_poly_by_monom ?t {#} = {#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma short_ch_alt[chain_alts]:
  "short_ch X = (\<exists>x\<in>X. \<exists>y\<in>X. path_ex x y \<and> \<not>(\<exists>z\<in>X. z\<noteq>x \<and> z\<noteq>y))"
  "short_ch X = (\<exists>x y. X = {x,y} \<and> path_ex x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. short_ch X = (\<exists>x\<in>X. \<exists>y\<in>X. (\<exists>Q. path Q x y) \<and> \<not> (\<exists>z\<in>X. z \<noteq> x \<and> z \<noteq> y)) &&& short_ch X = (\<exists>x y. X = {x, y} \<and> (\<exists>Q. path Q x y))
[PROOF STEP]
unfolding short_ch_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card X = 2 \<and> (\<exists>P\<in>\<P>. X \<subseteq> P)) = (\<exists>x\<in>X. \<exists>y\<in>X. (\<exists>Q. path Q x y) \<and> \<not> (\<exists>z\<in>X. z \<noteq> x \<and> z \<noteq> y)) &&& (card X = 2 \<and> (\<exists>P\<in>\<P>. X \<subseteq> P)) = (\<exists>x y. X = {x, y} \<and> (\<exists>Q. path Q x y))
[PROOF STEP]
apply (simp add: card_2_iff', smt (verit, ccfv_SIG) in_mono subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card X = 2 \<and> (\<exists>P\<in>\<P>. X \<subseteq> P)) = (\<exists>x y. X = {x, y} \<and> (\<exists>Q. path Q x y))
[PROOF STEP]
by (metis card_2_iff empty_subsetI insert_subset)


[STATEMENT]
lemma univ_preserves:
assumes "equivP P \<phi> " and "f respectsP \<phi>" and "\<And> x. P x \<Longrightarrow> f x \<in> B"
shows "\<forall> X. (P///\<phi>) X \<longrightarrow> univ f X \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>X. (P /// \<phi>) X \<longrightarrow> Equiv_Relation2.univ f X \<in> B
[PROOF STEP]
by (metis Equiv_Relation2.univ_commute assms
          equivP_pick_preserves proj_pick)


[STATEMENT]
lemma Gcd_fin_greatest:
  "a dvd Gcd\<^sub>f\<^sub>i\<^sub>n A" if "finite A" and "\<And>b. b \<in> A \<Longrightarrow> a dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd Gcd\<^sub>f\<^sub>i\<^sub>n A
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
finite A
?b1 \<in> A \<Longrightarrow> a dvd ?b1

goal (1 subgoal):
 1. a dvd Gcd\<^sub>f\<^sub>i\<^sub>n A
[PROOF STEP]
by (induct A) simp_all


[STATEMENT]
lemma (in digraph_map) obtain_trail_in_fcs:
  assumes "a \<in> arcs G" "a0 \<in> face_cycle_set a" "an \<in> face_cycle_set a"
  obtains p where "trail (tail G a0) p (head G an)" "p \<noteq> []" "hd p = a0"  "last p = an"
    "set p \<subseteq> face_cycle_set a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have fcs_a: "face_cycle_set a = orbit face_cycle_succ a0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. face_cycle_set a = orbit face_cycle_succ a0
[PROOF STEP]
using assms face_cycle_eq
[PROOF STATE]
proof (prove)
using this:
a \<in> arcs G
a0 \<in> face_cycle_set a
an \<in> face_cycle_set a
?b \<in> face_cycle_set ?a \<Longrightarrow> face_cycle_set ?b = face_cycle_set ?a

goal (1 subgoal):
 1. face_cycle_set a = orbit face_cycle_succ a0
[PROOF STEP]
by (simp add: face_cycle_set_def)
[PROOF STATE]
proof (state)
this:
face_cycle_set a = orbit face_cycle_succ a0

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "a0 = (face_cycle_succ ^^ 0) a0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a0 = (face_cycle_succ ^^ 0) a0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a0 = (face_cycle_succ ^^ 0) a0

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "an = (face_cycle_succ ^^ funpow_dist face_cycle_succ a0 an) a0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. an = (face_cycle_succ ^^ funpow_dist face_cycle_succ a0 an) a0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> arcs G
a0 \<in> face_cycle_set a
an \<in> face_cycle_set a

goal (1 subgoal):
 1. an = (face_cycle_succ ^^ funpow_dist face_cycle_succ a0 an) a0
[PROOF STEP]
by (simp add: fcs_a funpow_dist_prop)
[PROOF STATE]
proof (state)
this:
an = (face_cycle_succ ^^ funpow_dist face_cycle_succ a0 an) a0

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define p where "p = map (\<lambda>n. (face_cycle_succ ^^ n) a0) [0..<Suc (funpow_dist face_cycle_succ a0 an)]"
[PROOF STATE]
proof (state)
this:
p = map (\<lambda>n. (face_cycle_succ ^^ n) a0) [0..<Suc (funpow_dist face_cycle_succ a0 an)]

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have p_nth: "\<And>i. i < length p \<Longrightarrow> p ! i = (face_cycle_succ ^^ i) a0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < length p \<Longrightarrow> p ! i = (face_cycle_succ ^^ i) a0
[PROOF STEP]
by (auto simp: p_def simp del: upt_Suc)
[PROOF STATE]
proof (state)
this:
?i4 < length p \<Longrightarrow> p ! ?i4 = (face_cycle_succ ^^ ?i4) a0

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have P2: "p \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> []
[PROOF STEP]
by (simp add: p_def)
[PROOF STATE]
proof (state)
this:
p \<noteq> []

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have P3: "hd p = a0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd p = a0
[PROOF STEP]
using \<open>a0 = _\<close>
[PROOF STATE]
proof (prove)
using this:
a0 = (face_cycle_succ ^^ 0) a0

goal (1 subgoal):
 1. hd p = a0
[PROOF STEP]
by (auto simp: p_def hd_map simp del: upt_Suc)
[PROOF STATE]
proof (state)
this:
hd p = a0

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have P4: "last p = an"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. last p = an
[PROOF STEP]
using \<open>an = _\<close>
[PROOF STATE]
proof (prove)
using this:
an = (face_cycle_succ ^^ funpow_dist face_cycle_succ a0 an) a0

goal (1 subgoal):
 1. last p = an
[PROOF STEP]
by (simp add: p_def)
[PROOF STATE]
proof (state)
this:
last p = an

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have P5: "set p \<subseteq> face_cycle_set a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set p \<subseteq> face_cycle_set a
[PROOF STEP]
unfolding p_def fcs_a orbit_altdef_permutation[OF permutation_face_cycle_succ]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>n. (face_cycle_succ ^^ n) a0) [0..<Suc (funpow_dist face_cycle_succ a0 an)]) \<subseteq> {(face_cycle_succ ^^ n) a0 |n. True}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set p \<subseteq> face_cycle_set a

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have P1: "trail (tail G a0) p (head G an)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
have "distinct p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct p
[PROOF STEP]
have "an \<in> orbit face_cycle_succ a0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. an \<in> orbit face_cycle_succ a0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> arcs G
a0 \<in> face_cycle_set a
an \<in> face_cycle_set a

goal (1 subgoal):
 1. an \<in> orbit face_cycle_succ a0
[PROOF STEP]
by (simp add: fcs_a)
[PROOF STATE]
proof (state)
this:
an \<in> orbit face_cycle_succ a0

goal (1 subgoal):
 1. distinct p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
an \<in> orbit face_cycle_succ a0
[PROOF STEP]
have "inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) {0..funpow_dist face_cycle_succ a0 an}"
[PROOF STATE]
proof (prove)
using this:
an \<in> orbit face_cycle_succ a0

goal (1 subgoal):
 1. inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) {0..funpow_dist face_cycle_succ a0 an}
[PROOF STEP]
by (rule inj_on_funpow_dist)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) {0..funpow_dist face_cycle_succ a0 an}

goal (1 subgoal):
 1. distinct p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) {0..funpow_dist face_cycle_succ a0 an}

goal (1 subgoal):
 1. distinct p
[PROOF STEP]
have "{0..funpow_dist face_cycle_succ a0 an} = (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..funpow_dist face_cycle_succ a0 an} = set [0..<Suc (funpow_dist face_cycle_succ a0 an)]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..funpow_dist face_cycle_succ a0 an} = set [0..<Suc (funpow_dist face_cycle_succ a0 an)]

goal (1 subgoal):
 1. distinct p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])
[PROOF STEP]
have "inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])"
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])

goal (1 subgoal):
 1. inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])

goal (1 subgoal):
 1. distinct p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])
[PROOF STEP]
show "distinct p"
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>n. (face_cycle_succ ^^ n) a0) (set [0..<Suc (funpow_dist face_cycle_succ a0 an)])

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

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

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
distinct p

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
have "a0 \<in> arcs G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a0 \<in> arcs G
[PROOF STEP]
by (metis assms(1-2) in_face_cycle_setD)
[PROOF STATE]
proof (state)
this:
a0 \<in> arcs G

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a0 \<in> arcs G
[PROOF STEP]
have "tail G a0 \<in> verts G"
[PROOF STATE]
proof (prove)
using this:
a0 \<in> arcs G

goal (1 subgoal):
 1. tail G a0 \<in> verts G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
tail G a0 \<in> verts G

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
tail G a0 \<in> verts G

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
have "set p \<subseteq> arcs G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set p \<subseteq> arcs G
[PROOF STEP]
using P5
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> face_cycle_set a

goal (1 subgoal):
 1. set p \<subseteq> arcs G
[PROOF STEP]
by (metis assms(1) in_face_cycle_setD subset_code(1))
[PROOF STATE]
proof (state)
this:
set p \<subseteq> arcs G

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set p \<subseteq> arcs G

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set p \<subseteq> arcs G
[PROOF STEP]
have "\<And>i. Suc i < length p \<Longrightarrow> p ! Suc i \<in> arcs G"
[PROOF STATE]
proof (prove)
using this:
set p \<subseteq> arcs G

goal (1 subgoal):
 1. \<And>i. Suc i < length p \<Longrightarrow> p ! Suc i \<in> arcs G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc ?i4 < length p \<Longrightarrow> p ! Suc ?i4 \<in> arcs G

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc ?i4 < length p \<Longrightarrow> p ! Suc ?i4 \<in> arcs G
[PROOF STEP]
have "\<And>i. Suc i < length p \<Longrightarrow> head G (p ! i) = tail G (p ! Suc i)"
[PROOF STATE]
proof (prove)
using this:
Suc ?i4 < length p \<Longrightarrow> p ! Suc ?i4 \<in> arcs G

goal (1 subgoal):
 1. \<And>i. Suc i < length p \<Longrightarrow> head G (p ! i) = tail G (p ! Suc i)
[PROOF STEP]
by (auto simp: p_nth tail_face_cycle_succ)
[PROOF STATE]
proof (state)
this:
Suc ?i4 < length p \<Longrightarrow> head G (p ! ?i4) = tail G (p ! Suc ?i4)

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
distinct p
tail G a0 \<in> verts G
set p \<subseteq> arcs G
Suc ?i4 < length p \<Longrightarrow> head G (p ! ?i4) = tail G (p ! Suc ?i4)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
distinct p
tail G a0 \<in> verts G
set p \<subseteq> arcs G
Suc ?i4 < length p \<Longrightarrow> head G (p ! ?i4) = tail G (p ! Suc ?i4)

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
using P2 P3 P4
[PROOF STATE]
proof (prove)
using this:
distinct p
tail G a0 \<in> verts G
set p \<subseteq> arcs G
Suc ?i4 < length p \<Longrightarrow> head G (p ! ?i4) = tail G (p ! Suc ?i4)
p \<noteq> []
hd p = a0
last p = an

goal (1 subgoal):
 1. trail (tail G a0) p (head G an)
[PROOF STEP]
unfolding trail_def awalk_def
[PROOF STATE]
proof (prove)
using this:
distinct p
tail G a0 \<in> verts G
set p \<subseteq> arcs G
Suc ?i4 < length p \<Longrightarrow> head G (p ! ?i4) = tail G (p ! Suc ?i4)
p \<noteq> []
hd p = a0
last p = an

goal (1 subgoal):
 1. (tail G a0 \<in> verts G \<and> set p \<subseteq> arcs G \<and> cas (tail G a0) p (head G an)) \<and> distinct p
[PROOF STEP]
by (auto intro: casI_nth)
[PROOF STATE]
proof (state)
this:
trail (tail G a0) p (head G an)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
trail (tail G a0) p (head G an)

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>trail (tail G a0) p (head G an); p \<noteq> []; hd p = a0; last p = an; set p \<subseteq> face_cycle_set a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from P1 P2 P3 P4 P5
[PROOF STATE]
proof (chain)
picking this:
trail (tail G a0) p (head G an)
p \<noteq> []
hd p = a0
last p = an
set p \<subseteq> face_cycle_set a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trail (tail G a0) p (head G an)
p \<noteq> []
hd p = a0
last p = an
set p \<subseteq> face_cycle_set a

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_left_comm:
  assumes "y \<in> A" and "x \<in> A" and "z \<in> A" shows "f y (f x z) = f x (f y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f y (f x z) = f x (f y z)
[PROOF STEP]
using comp_fun_commute_restrict assms
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. \<forall>x\<in>A. \<forall>z\<in>A. f y (f x z) = f x (f y z)
y \<in> A
x \<in> A
z \<in> A

goal (1 subgoal):
 1. f y (f x z) = f x (f y z)
[PROOF STEP]
by auto


[STATEMENT]
lemma unat_less_word_bits:
  fixes y :: machine_word
  shows "x < unat y \<Longrightarrow> x < 2 ^ word_bits"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < unat y \<Longrightarrow> x < 2 ^ word_bits
[PROOF STEP]
unfolding word_bits_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < unat y \<Longrightarrow> x < 2 ^ LENGTH(64)
[PROOF STEP]
by (rule order_less_trans [OF _ unat_lt2p])


[STATEMENT]
lemma mult_pos_pos[simp]: "0 < a \<Longrightarrow> 0 < b \<Longrightarrow> 0 < a * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) < a; (0::'a) < b\<rbrakk> \<Longrightarrow> (0::'a) < a * b
[PROOF STEP]
using mult_strict_left_mono [of 0 b a]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) < b; (0::'a) < a\<rbrakk> \<Longrightarrow> a * (0::'a) < a * b

goal (1 subgoal):
 1. \<lbrakk>(0::'a) < a; (0::'a) < b\<rbrakk> \<Longrightarrow> (0::'a) < a * b
[PROOF STEP]
by simp


[STATEMENT]
lemma factorization_m_prod: assumes "factorization_m f (c,fs)" "factorization_m g (d,gs)"
  shows "factorization_m (f * g) (c * d, fs + gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
note * = assms[unfolded factorization_m_def split]
[PROOF STATE]
proof (state)
this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
g =m smult d (\<Prod>\<^sub># gs) \<and> (\<forall>f\<in>#gs. irreducible\<^sub>d_m f \<and> monic (Mp f))

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
have "Mp (f * g) = Mp (Mp f * Mp g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * g =m Mp f * Mp g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f * g =m Mp f * Mp g

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f * g =m Mp f * Mp g

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
have "Mp f = Mp (smult c (prod_mset fs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f =m smult c (\<Prod>\<^sub># fs)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
g =m smult d (\<Prod>\<^sub># gs) \<and> (\<forall>f\<in>#gs. irreducible\<^sub>d_m f \<and> monic (Mp f))

goal (1 subgoal):
 1. f =m smult c (\<Prod>\<^sub># fs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f =m smult c (\<Prod>\<^sub># fs)

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f =m smult c (\<Prod>\<^sub># fs)

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
have "Mp g = Mp (smult d (prod_mset gs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g =m smult d (\<Prod>\<^sub># gs)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
g =m smult d (\<Prod>\<^sub># gs) \<and> (\<forall>f\<in>#gs. irreducible\<^sub>d_m f \<and> monic (Mp f))

goal (1 subgoal):
 1. g =m smult d (\<Prod>\<^sub># gs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g =m smult d (\<Prod>\<^sub># gs)

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f * g =m Mp (smult c (\<Prod>\<^sub># fs)) * Mp (smult d (\<Prod>\<^sub># gs))
[PROOF STEP]
have "Mp (f * g) = Mp (smult (c * d) (prod_mset (fs + gs)))"
[PROOF STATE]
proof (prove)
using this:
f * g =m Mp (smult c (\<Prod>\<^sub># fs)) * Mp (smult d (\<Prod>\<^sub># gs))

goal (1 subgoal):
 1. f * g =m smult (c * d) (\<Prod>\<^sub># (fs + gs))
[PROOF STEP]
unfolding mult_Mp
[PROOF STATE]
proof (prove)
using this:
f * g =m smult c (\<Prod>\<^sub># fs) * smult d (\<Prod>\<^sub># gs)

goal (1 subgoal):
 1. f * g =m smult (c * d) (\<Prod>\<^sub># (fs + gs))
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
f * g =m smult (c * d) (\<Prod>\<^sub># (fs + gs))

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
g =m smult d (\<Prod>\<^sub># gs) \<and> (\<forall>f\<in>#gs. irreducible\<^sub>d_m f \<and> monic (Mp f))
f * g =m smult (c * d) (\<Prod>\<^sub># (fs + gs))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
g =m smult d (\<Prod>\<^sub># gs) \<and> (\<forall>f\<in>#gs. irreducible\<^sub>d_m f \<and> monic (Mp f))
f * g =m smult (c * d) (\<Prod>\<^sub># (fs + gs))

goal (1 subgoal):
 1. factorization_m (f * g) (c * d, fs + gs)
[PROOF STEP]
unfolding factorization_m_def split
[PROOF STATE]
proof (prove)
using this:
f =m smult c (\<Prod>\<^sub># fs) \<and> (\<forall>f\<in>#fs. irreducible\<^sub>d_m f \<and> monic (Mp f))
g =m smult d (\<Prod>\<^sub># gs) \<and> (\<forall>f\<in>#gs. irreducible\<^sub>d_m f \<and> monic (Mp f))
f * g =m smult (c * d) (\<Prod>\<^sub># (fs + gs))

goal (1 subgoal):
 1. f * g =m smult (c * d) (\<Prod>\<^sub># (fs + gs)) \<and> (\<forall>f\<in>#fs + gs. irreducible\<^sub>d_m f \<and> monic (Mp f))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
factorization_m (f * g) (c * d, fs + gs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indexlt_subset_\<P>: "indexlt k' u' k u \<Longrightarrow> \<P> k' (Suc u') \<subseteq> \<P> k u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indexlt k' u' k u \<Longrightarrow> \<P> k' (Suc u') \<subseteq> \<P> k u
[PROOF STEP]
apply (rule_tac subset_\<P>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indexlt k' u' k u \<Longrightarrow> k' < k \<or> k' = k \<and> Suc u' \<le> u
[PROOF STEP]
apply (simp add: indexlt_simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k' < k \<or> k' = k \<and> u' < u \<Longrightarrow> k' < k \<or> k' = k \<and> Suc u' \<le> u
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma add_uminus_minus_mat: "A \<in> carrier_mat nr nc \<Longrightarrow> B \<in> carrier_mat nr nc \<Longrightarrow>
  A + (- B) = A - (B :: 'a :: group_add mat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; B \<in> carrier_mat nr nc\<rbrakk> \<Longrightarrow> A + - B = A - B
[PROOF STEP]
by (intro eq_matI, auto)


[STATEMENT]
lemma triangular_mat_R: "upper_triangular_mat (R_mat d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_triangular_mat (R_mat d)
[PROOF STEP]
using triangular_mat_P_upper
[PROOF STATE]
proof (prove)
using this:
upper_triangular_mat (P_upper ?d)

goal (1 subgoal):
 1. upper_triangular_mat (R_mat d)
[PROOF STEP]
unfolding upper_triangular_mat_def R_mat_def
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. j < i \<longrightarrow> P_upper ?d $ i $ j = 0

goal (1 subgoal):
 1. \<forall>i j. j < i \<longrightarrow> (l *\<^sub>R P_upper d) $ i $ j = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma symmetric_bibdII: "\<Lambda> * (\<v> - 1) = \<k> * (\<k> - 1) \<Longrightarrow> symmetric_bibd \<V> \<B> \<k> \<Lambda>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Lambda> * (\<v> - 1) = \<k> * (\<k> - 1) \<Longrightarrow> symmetric_bibd \<V> \<B> \<k> \<Lambda>
[PROOF STEP]
using symmetric_condition_1
[PROOF STATE]
proof (prove)
using this:
\<Lambda> * (\<v> - 1) = \<k> * (\<k> - 1) \<Longrightarrow> \<b> = \<v> \<and> \<r> = \<k>

goal (1 subgoal):
 1. \<Lambda> * (\<v> - 1) = \<k> * (\<k> - 1) \<Longrightarrow> symmetric_bibd \<V> \<B> \<k> \<Lambda>
[PROOF STEP]
by unfold_locales blast


[STATEMENT]
lemma (in prob_space) nn_integral_ge_const:
  "(AE x in M. c \<le> f x) \<Longrightarrow> c \<le> (\<integral>\<^sup>+x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. c \<le> f x \<Longrightarrow> c \<le> integral\<^sup>N M f
[PROOF STEP]
using nn_integral_mono_AE[of "\<lambda>x. c" f M] emeasure_space_1
[PROOF STATE]
proof (prove)
using this:
AE x in M. c \<le> f x \<Longrightarrow> \<integral>\<^sup>+ x. c \<partial>M \<le> integral\<^sup>N M f
emeasure M (space M) = 1

goal (1 subgoal):
 1. AE x in M. c \<le> f x \<Longrightarrow> c \<le> integral\<^sup>N M f
[PROOF STEP]
by (simp split: if_split_asm)


[STATEMENT]
lemma isState_purgeIdle:
"(\<exists> sl. purgeIdle sl = sll) \<longleftrightarrow> list_all isState sll"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>sl. purgeIdle sl = sll) = list_all isState sll
[PROOF STEP]
unfolding purgeIdle_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>sl. filter isState sl = sll) = list_all isState sll
[PROOF STEP]
by (metis Ball_set_list_all purgeIdle_def purgeIdle_set_isState filter_True)


[STATEMENT]
lemma eval_Pareto:
  assumes "is_pref_profile R"
  shows   "x \<prec>[Pareto(R)] y \<longleftrightarrow> (\<forall>i\<in>{A1,A2,A3}. x \<preceq>[R i] y) \<and> (\<exists>i\<in>{A1,A2,A3}. \<not>x \<succeq>[R i] y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<prec>[Pareto R] y = ((\<forall>i\<in>{A1, A2, A3}. R i x y) \<and> (\<exists>i\<in>{A1, A2, A3}. \<not> R i y x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<prec>[Pareto R] y = ((\<forall>i\<in>{A1, A2, A3}. R i x y) \<and> (\<exists>i\<in>{A1, A2, A3}. \<not> R i y x))
[PROOF STEP]
interpret R: pref_profile_wf agents alts
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_pref_profile R
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<prec>[Pareto R] y = ((\<forall>i\<in>{A1, A2, A3}. R i x y) \<and> (\<exists>i\<in>{A1, A2, A3}. \<not> R i y x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<prec>[Pareto R] y = ((\<forall>i\<in>{A1, A2, A3}. R i x y) \<and> (\<exists>i\<in>{A1, A2, A3}. \<not> R i y x))
[PROOF STEP]
unfolding R.Pareto_strict_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>i\<in>agents. R i x y) \<and> (\<exists>i\<in>agents. x \<prec>[R i] y)) = ((\<forall>i\<in>{A1, A2, A3}. R i x y) \<and> (\<exists>i\<in>{A1, A2, A3}. \<not> R i y x))
[PROOF STEP]
by (auto simp: strongly_preferred_def agents_eq)
[PROOF STATE]
proof (state)
this:
x \<prec>[Pareto R] y = ((\<forall>i\<in>{A1, A2, A3}. R i x y) \<and> (\<exists>i\<in>{A1, A2, A3}. \<not> R i y x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma single_valued_as_brE:
  assumes "single_valued R"
  obtains \<alpha> invar where "R=br \<alpha> invar"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<alpha> invar. R = br \<alpha> invar \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply (rule that[of "\<lambda>x. THE y. (x,y)\<in>R" "\<lambda>x. x\<in>Domain R"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<alpha> invar. R = br \<alpha> invar \<Longrightarrow> thesis) \<Longrightarrow> R = br (\<lambda>x. THE y. (x, y) \<in> R) (\<lambda>x. x \<in> Domain R)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
single_valued R

goal (1 subgoal):
 1. (\<And>\<alpha> invar. R = br \<alpha> invar \<Longrightarrow> thesis) \<Longrightarrow> R = br (\<lambda>x. THE y. (x, y) \<in> R) (\<lambda>x. x \<in> Domain R)
[PROOF STEP]
unfolding br_def
[PROOF STATE]
proof (prove)
using this:
single_valued R

goal (1 subgoal):
 1. (\<And>\<alpha> invar. R = {(c, a). a = \<alpha> c \<and> invar c} \<Longrightarrow> thesis) \<Longrightarrow> R = {(c, a). a = (THE y. (c, y) \<in> R) \<and> c \<in> Domain R}
[PROOF STEP]
by (auto dest: single_valuedD
    intro: the_equality[symmetric] theI)


[STATEMENT]
lemma count_space_singleton_conv_return:
  "count_space {x} = return (count_space {x}) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_space {x} = return (count_space {x}) x
[PROOF STEP]
proof (rule measure_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (count_space {x}) = sets (return (count_space {x}) x)
 2. \<And>A. A \<in> sets (count_space {x}) \<Longrightarrow> emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (count_space {x}) = sets (return (count_space {x}) x)
 2. \<And>A. A \<in> sets (count_space {x}) \<Longrightarrow> emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A
[PROOF STEP]
assume "A \<in> sets (count_space {x})"
[PROOF STATE]
proof (state)
this:
A \<in> sets (count_space {x})

goal (2 subgoals):
 1. sets (count_space {x}) = sets (return (count_space {x}) x)
 2. \<And>A. A \<in> sets (count_space {x}) \<Longrightarrow> emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A
[PROOF STEP]
hence "A \<subseteq> {x}"
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (count_space {x})

goal (1 subgoal):
 1. A \<subseteq> {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<subseteq> {x}

goal (2 subgoals):
 1. sets (count_space {x}) = sets (return (count_space {x}) x)
 2. \<And>A. A \<in> sets (count_space {x}) \<Longrightarrow> emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A
[PROOF STEP]
hence "A = {} \<or> A = {x}"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> {x}

goal (1 subgoal):
 1. A = {} \<or> A = {x}
[PROOF STEP]
by (cases "x \<in> A") auto
[PROOF STATE]
proof (state)
this:
A = {} \<or> A = {x}

goal (2 subgoals):
 1. sets (count_space {x}) = sets (return (count_space {x}) x)
 2. \<And>A. A \<in> sets (count_space {x}) \<Longrightarrow> emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A
[PROOF STEP]
thus "emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A"
[PROOF STATE]
proof (prove)
using this:
A = {} \<or> A = {x}

goal (1 subgoal):
 1. emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
emeasure (count_space {x}) A = emeasure (return (count_space {x}) x) A

goal (1 subgoal):
 1. sets (count_space {x}) = sets (return (count_space {x}) x)
[PROOF STEP]
qed auto


[STATEMENT]
lemma  expl_cond_expect_indic_borel_measurable:
  assumes "disc_fct Y"
  and "point_measurable M (space N) Y"
  and "B\<subseteq> space N"
  and "countable B"
  shows "(\<lambda>w. expl_cond_expect M Y X w * indicator (countable_preimages B Y n \<inter> space M) w)\<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
have "countable_preimages B Y n \<inter> space M \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable_preimages B Y n \<inter> space M \<in> sets M
[PROOF STEP]
using  assms
[PROOF STATE]
proof (prove)
using this:
disc_fct Y
point_measurable M (space N) Y
B \<subseteq> space N
countable B

goal (1 subgoal):
 1. countable_preimages B Y n \<inter> space M \<in> sets M
[PROOF STEP]
by (auto simp add: count_pre_meas)
[PROOF STATE]
proof (state)
this:
countable_preimages B Y n \<inter> space M \<in> sets M

goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
have "(expl_cond_expect M Y X)\<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expl_cond_expect M Y X \<in> borel_measurable M
[PROOF STEP]
using expl_cond_expect_point_meas[of Y M N X] assms
      disct_fct_point_measurable[of "expl_cond_expect M Y X"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>disc_fct Y; point_measurable M (space N) Y\<rbrakk> \<Longrightarrow> point_measurable M UNIV (expl_cond_expect M Y X)
disc_fct Y
point_measurable M (space N) Y
B \<subseteq> space N
countable B
\<lbrakk>disc_fct (expl_cond_expect M Y X); point_measurable ?M (space ?N) (expl_cond_expect M Y X)\<rbrakk> \<Longrightarrow> expl_cond_expect M Y X \<in> ?M \<rightarrow>\<^sub>M ?N

goal (1 subgoal):
 1. expl_cond_expect M Y X \<in> borel_measurable M
[PROOF STEP]
by (simp add: expl_cond_expect_disc_fct)
[PROOF STATE]
proof (state)
this:
expl_cond_expect M Y X \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
expl_cond_expect M Y X \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
have "(indicator (countable_preimages B Y n \<inter> space M))\<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator (countable_preimages B Y n \<inter> space M) \<in> borel_measurable M
[PROOF STEP]
using \<open>countable_preimages B Y n \<inter> space M \<in> sets M\<close> borel_measurable_indicator
[PROOF STATE]
proof (prove)
using this:
countable_preimages B Y n \<inter> space M \<in> sets M
?A \<in> sets ?M \<Longrightarrow> indicator ?A \<in> borel_measurable ?M

goal (1 subgoal):
 1. indicator (countable_preimages B Y n \<inter> space M) \<in> borel_measurable M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
indicator (countable_preimages B Y n \<inter> space M) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
expl_cond_expect M Y X \<in> borel_measurable M
indicator (countable_preimages B Y n \<inter> space M) \<in> borel_measurable M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
expl_cond_expect M Y X \<in> borel_measurable M
indicator (countable_preimages B Y n \<inter> space M) \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
using borel_measurable_times
[PROOF STATE]
proof (prove)
using this:
expl_cond_expect M Y X \<in> borel_measurable M
indicator (countable_preimages B Y n \<inter> space M) \<in> borel_measurable M
\<lbrakk>?f \<in> borel_measurable ?M; ?g \<in> borel_measurable ?M\<rbrakk> \<Longrightarrow> (\<lambda>x. ?f x * ?g x) \<in> borel_measurable ?M

goal (1 subgoal):
 1. (\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>w. expl_cond_expect M Y X w * indicat_real (countable_preimages B Y n \<inter> space M) w) \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma valof_uminus:
  assumes "is_finite a"
  shows "valof (- a) = - valof a" (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valof (- a) = - valof a
[PROOF STEP]
by (cases a rule: sign_cases)  (auto simp: valof_eq sign_minus_float)


[STATEMENT]
theorem (in eflowgraph) ntr_repr:
  "    (\<exists>w. ({#[entry fg (main fg)]#},w,c)\<in>trcl (tr fg))
   \<longleftrightarrow> (\<exists>w. ({#[entry fg (main fg)]#},w,c)\<in>trcl (ntr fg))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>w. ({#[entry fg (main fg)]#}, w, c) \<in> trcl (tr fg)) = (\<exists>w. ({#[entry fg (main fg)]#}, w, c) \<in> trcl (ntr fg))
[PROOF STEP]
by (auto simp add: initialproc_def intro!: normalize ntr_is_tr)


[STATEMENT]
lemma limit_ordinal_oLimitI:
"\<forall>n. f n < oLimit f \<Longrightarrow> limit_ordinal (oLimit f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. f n < oLimit f \<Longrightarrow> limit_ordinal (oLimit f)
[PROOF STEP]
apply (unfold limit_ordinal_def, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. f n < oLimit f \<Longrightarrow> 0 < oLimit f \<and> (\<forall>y. oLimit f \<noteq> oSuc y)
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>n. f n < oLimit f \<Longrightarrow> 0 < oLimit f
 2. \<forall>n. f n < oLimit f \<Longrightarrow> \<forall>y. oLimit f \<noteq> oSuc y
[PROOF STEP]
apply (rule order_le_less_trans[OF ordinal_0_le])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>n. f n < oLimit f \<Longrightarrow> ?y3 < oLimit f
 2. \<forall>n. f n < oLimit f \<Longrightarrow> \<forall>y. oLimit f \<noteq> oSuc y
[PROOF STEP]
apply (erule spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. f n < oLimit f \<Longrightarrow> \<forall>y. oLimit f \<noteq> oSuc y
[PROOF STEP]
apply (clarsimp simp add: less_oSuc_eq_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>\<forall>n. f n \<le> y; oLimit f = oSuc y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (drule oLimit_leI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>oLimit f = oSuc y; oLimit f \<le> y\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: linorder_not_less[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iMin_atLeastAtMost: "m \<le> n \<Longrightarrow> iMin {m..n} = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> iMin {m..n} = m
[PROOF STEP]
by (rule iMin_equality, simp_all)


[STATEMENT]
lemma RG_sum_list_rddg_closed :
  defines RG: "RG \<equiv> group_ring :: ('r::ring_1, 'g) aezfun set"
  assumes "set (map snd rgs) \<subseteq> G"
  shows   "(\<Sum>(r,g)\<leftarrow>rgs. r \<delta>\<delta> g) \<in> RG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(r, g)\<leftarrow>rgs. r \<delta>\<delta> g) \<in> RG
[PROOF STEP]
proof (rule Ring1.sum_list_closed_prod)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Ring1 RG
 2. set (map (\<lambda>(x, y). x \<delta>\<delta> y) rgs) \<subseteq> RG
[PROOF STEP]
from RG
[PROOF STATE]
proof (chain)
picking this:
RG \<equiv> group_ring
[PROOF STEP]
show "Ring1 RG"
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring

goal (1 subgoal):
 1. Ring1 RG
[PROOF STEP]
using Ring1_RG
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring
Ring1 group_ring

goal (1 subgoal):
 1. Ring1 RG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Ring1 RG

goal (1 subgoal):
 1. set (map (\<lambda>(x, y). x \<delta>\<delta> y) rgs) \<subseteq> RG
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
RG \<equiv> group_ring
set (map snd rgs) \<subseteq> G
[PROOF STEP]
show "set (map (case_prod aezdeltafun) rgs) \<subseteq> RG"
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring
set (map snd rgs) \<subseteq> G

goal (1 subgoal):
 1. set (map (\<lambda>(b, a). b \<delta>\<delta> a) rgs) \<subseteq> RG
[PROOF STEP]
using RG_aezdeltafun_closed
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring
set (map snd rgs) \<subseteq> G
?g \<in> G \<Longrightarrow> ?r \<delta>\<delta> ?g \<in> group_ring

goal (1 subgoal):
 1. set (map (\<lambda>(b, a). b \<delta>\<delta> a) rgs) \<subseteq> RG
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
set (map (\<lambda>(b, a). b \<delta>\<delta> a) rgs) \<subseteq> RG

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_list_boundedI:
  assumes "xs \<noteq> []" and "\<And>x. x \<in> set xs \<Longrightarrow> x \<le> a"
  shows "max_list xs \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_list xs \<le> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. max_list xs \<le> a
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
[PROOF STEP]
have "set xs \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. set xs \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set xs \<noteq> {}

goal (1 subgoal):
 1. max_list xs \<le> a
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
[PROOF STEP]
have "max_list xs = Max (set xs)"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []

goal (1 subgoal):
 1. max_list xs = Max (set xs)
[PROOF STEP]
by (rule max_list_Max)
[PROOF STATE]
proof (state)
this:
max_list xs = Max (set xs)

goal (1 subgoal):
 1. max_list xs \<le> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
max_list xs = Max (set xs)

goal (1 subgoal):
 1. max_list xs \<le> a
[PROOF STEP]
from finite_set \<open>set xs \<noteq> {}\<close> assms(2)
[PROOF STATE]
proof (chain)
picking this:
finite (set ?xs)
set xs \<noteq> {}
?x \<in> set xs \<Longrightarrow> ?x \<le> a
[PROOF STEP]
have "\<dots> \<le> a"
[PROOF STATE]
proof (prove)
using this:
finite (set ?xs)
set xs \<noteq> {}
?x \<in> set xs \<Longrightarrow> ?x \<le> a

goal (1 subgoal):
 1. Max (set xs) \<le> a
[PROOF STEP]
by (rule Max.boundedI)
[PROOF STATE]
proof (state)
this:
Max (set xs) \<le> a

goal (1 subgoal):
 1. max_list xs \<le> a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
max_list xs \<le> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
max_list xs \<le> a

goal (1 subgoal):
 1. max_list xs \<le> a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
max_list xs \<le> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_LIMSEQ: "summable f \<Longrightarrow> (\<lambda>n. \<Sum>i<n. f i) \<longlonglongrightarrow> suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f \<Longrightarrow> (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> suminf f
[PROOF STEP]
by (rule summable_sums [unfolded sums_def])


[STATEMENT]
lemma Ints_subset_Rats: "\<int> \<subseteq> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int> \<subseteq> \<rat>
[PROOF STEP]
using Ints_cases Rats_of_int
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?q \<in> \<int>; \<And>z. ?q = of_int z \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
of_int ?z \<in> \<rat>

goal (1 subgoal):
 1. \<int> \<subseteq> \<rat>
[PROOF STEP]
by blast


[STATEMENT]
lemma (in linorder) le_Max_insertI1: "\<lbrakk> finite A; x \<le> b \<rbrakk> \<Longrightarrow> x \<le> Max (insert b A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; x \<le> b\<rbrakk> \<Longrightarrow> x \<le> Max (insert b A)
[PROOF STEP]
by (metis Max_ge finite.insertI insert_iff order_trans)