[STATEMENT]
lemma f_eq': "f x = m * x + f 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = m * x + f 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x = m * x + f 0
[PROOF STEP]
have rec: "f (b + 1) = f b + m" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (b + 1) = f b + m
[PROOF STEP]
using f_eq[of 0 b] f_eq[of "-1" "b + 1"]
[PROOF STATE]
proof (prove)
using this:
f (2 * 0) + 2 * f b = f (f (0 + b))
f (2 * - 1) + 2 * f (b + 1) = f (f (- 1 + (b + 1)))

goal (1 subgoal):
 1. f (b + 1) = f b + m
[PROOF STEP]
by (simp add: m_def)
[PROOF STATE]
proof (state)
this:
f (?b + 1) = f ?b + m

goal (1 subgoal):
 1. f x = m * x + f 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f (?b + 1) = f ?b + m

goal (1 subgoal):
 1. f x = m * x + f 0
[PROOF STEP]
have "f (b - 1) = f b - m" for b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (b - 1) = f b - m
[PROOF STEP]
using rec[of "b - 1"]
[PROOF STATE]
proof (prove)
using this:
f (b - 1 + 1) = f (b - 1) + m

goal (1 subgoal):
 1. f (b - 1) = f b - m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (?b - 1) = f ?b - m

goal (1 subgoal):
 1. f x = m * x + f 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f (?b + 1) = f ?b + m
f (?b - 1) = f ?b - m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (?b + 1) = f ?b + m
f (?b - 1) = f ?b - m

goal (1 subgoal):
 1. f x = m * x + f 0
[PROOF STEP]
by (induction x rule: int_induct[of _ 0]) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
f x = m * x + f 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma valid_all_lift:
  assumes "\<And>x. \<lbrace>P x\<rbrace> p \<lbrace>Q x\<rbrace>"
  shows "\<lbrace>\<lambda>s. \<forall>x. P x s\<rbrace> p \<lbrace>\<lambda>s. \<forall>x. Q x s\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>\<lambda>s. \<forall>x. P x s\<rbrace> p \<lbrace>\<lambda>s. \<forall>x. Q x s\<rbrace>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrace>P ?x\<rbrace> p \<lbrace>Q ?x\<rbrace>

goal (1 subgoal):
 1. \<lbrace>\<lambda>s. \<forall>x. P x s\<rbrace> p \<lbrace>\<lambda>s. \<forall>x. Q x s\<rbrace>
[PROOF STEP]
by (fastforce simp: valid_proc_def intro: vcg_all_lift)


[STATEMENT]
lemma quotientD: "equiv X R \<Longrightarrow> A \<in> X // R \<Longrightarrow> x \<in> A \<Longrightarrow> A = R `` {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>equiv X R; A \<in> X // R; x \<in> A\<rbrakk> \<Longrightarrow> A = R `` {x}
[PROOF STEP]
by (metis Image_singleton_iff equiv_class_eq_iff quotientE)


[STATEMENT]
lemma common_denom: assumes cd: "common_denom xs = (dd,ys)"
  shows "xs = map (\<lambda> i. of_int i / of_int dd) ys" "dd > 0"
  "\<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys &&& 0 < dd &&& (\<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. 0 < dd
 3. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
let ?nds = "map quotient_of xs"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. 0 < dd
 3. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
define nds where "nds = ?nds"
[PROOF STATE]
proof (state)
this:
nds = map quotient_of xs

goal (3 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. 0 < dd
 3. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
let ?denom = "list_lcm (map snd nds)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. 0 < dd
 3. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
let ?ints = "map (\<lambda> (n,d). n * dd div d) nds"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. 0 < dd
 3. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
from cd[unfolded common_denom_def Let_def]
[PROOF STATE]
proof (chain)
picking this:
(lcm_list (map snd (map quotient_of xs)), map (\<lambda>(n, y). n * lcm_list (map snd (map quotient_of xs)) div y) (map quotient_of xs)) = (dd, ys)
[PROOF STEP]
have dd: "dd = ?denom" and ys: "ys = ?ints"
[PROOF STATE]
proof (prove)
using this:
(lcm_list (map snd (map quotient_of xs)), map (\<lambda>(n, y). n * lcm_list (map snd (map quotient_of xs)) div y) (map quotient_of xs)) = (dd, ys)

goal (1 subgoal):
 1. dd = lcm_list (map snd nds) &&& ys = map (\<lambda>(n, d). n * dd div d) nds
[PROOF STEP]
unfolding nds_def
[PROOF STATE]
proof (prove)
using this:
(lcm_list (map snd (map quotient_of xs)), map (\<lambda>(n, y). n * lcm_list (map snd (map quotient_of xs)) div y) (map quotient_of xs)) = (dd, ys)

goal (1 subgoal):
 1. dd = lcm_list (map snd (map quotient_of xs)) &&& ys = map (\<lambda>(n, d). n * dd div d) (map quotient_of xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dd = lcm_list (map snd nds)
ys = map (\<lambda>(n, d). n * dd div d) nds

goal (3 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. 0 < dd
 3. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
show dd0: "dd > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < dd
[PROOF STEP]
unfolding dd
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < lcm_list (map snd nds)
[PROOF STEP]
by (intro list_lcm_pos(3), auto simp: nds_def quotient_of_nonzero)
[PROOF STATE]
proof (state)
this:
0 < dd

goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 < dd

goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
assume x: "x \<in> set xs"
[PROOF STATE]
proof (state)
this:
x \<in> set xs

goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
obtain p q where quot: "quotient_of x = (p,q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q. quotient_of x = (p, q) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
quotient_of x = (p, q)

goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> set xs
[PROOF STEP]
have "(p,q) \<in> set nds"
[PROOF STATE]
proof (prove)
using this:
x \<in> set xs

goal (1 subgoal):
 1. (p, q) \<in> set nds
[PROOF STEP]
unfolding nds_def
[PROOF STATE]
proof (prove)
using this:
x \<in> set xs

goal (1 subgoal):
 1. (p, q) \<in> set (map quotient_of xs)
[PROOF STEP]
using quot
[PROOF STATE]
proof (prove)
using this:
x \<in> set xs
quotient_of x = (p, q)

goal (1 subgoal):
 1. (p, q) \<in> set (map quotient_of xs)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(p, q) \<in> set nds

goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
hence "q \<in> set (map snd nds)"
[PROOF STATE]
proof (prove)
using this:
(p, q) \<in> set nds

goal (1 subgoal):
 1. q \<in> set (map snd nds)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
q \<in> set (map snd nds)

goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
from list_lcm[OF this]
[PROOF STATE]
proof (chain)
picking this:
q dvd lcm_list (map snd nds)
[PROOF STEP]
have q: "q dvd dd"
[PROOF STATE]
proof (prove)
using this:
q dvd lcm_list (map snd nds)

goal (1 subgoal):
 1. q dvd dd
[PROOF STEP]
unfolding dd
[PROOF STATE]
proof (prove)
using this:
q dvd lcm_list (map snd nds)

goal (1 subgoal):
 1. q dvd lcm_list (map snd nds)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
q dvd dd

goal (2 subgoals):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
 2. \<And>x. x \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
show "rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x
[PROOF STEP]
unfolding quot split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int (p * dd div q) / rat_of_int dd = x
[PROOF STEP]
unfolding quotient_of_div[OF quot]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q
[PROOF STEP]
have f1: "q * (dd div q) = dd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q * (dd div q) = dd
[PROOF STEP]
using dvd_mult_div_cancel q
[PROOF STATE]
proof (prove)
using this:
?a dvd ?b \<Longrightarrow> ?a * (?b div ?a) = ?b
q dvd dd

goal (1 subgoal):
 1. q * (dd div q) = dd
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
q * (dd div q) = dd

goal (1 subgoal):
 1. rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q
[PROOF STEP]
have "rat_of_int (dd div q) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int (dd div q) \<noteq> 0
[PROOF STEP]
using dd0 dvd_mult_div_cancel q
[PROOF STATE]
proof (prove)
using this:
0 < dd
?a dvd ?b \<Longrightarrow> ?a * (?b div ?a) = ?b
q dvd dd

goal (1 subgoal):
 1. rat_of_int (dd div q) \<noteq> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
rat_of_int (dd div q) \<noteq> 0

goal (1 subgoal):
 1. rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q
[PROOF STEP]
thus "rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q"
[PROOF STATE]
proof (prove)
using this:
rat_of_int (dd div q) \<noteq> 0

goal (1 subgoal):
 1. rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
rat_of_int (dd div q) \<noteq> 0
q * (dd div q) = dd

goal (1 subgoal):
 1. rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q
[PROOF STEP]
by (metis (no_types) div_mult_swap mult_divide_mult_cancel_right of_int_mult q)
[PROOF STATE]
proof (state)
this:
rat_of_int (p * dd div q) / rat_of_int dd = rat_of_int p / rat_of_int q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = x

goal (1 subgoal):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of ?x2 of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = ?x2

goal (1 subgoal):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
[PROOF STEP]
note main = this
[PROOF STATE]
proof (state)
this:
?x2 \<in> set xs \<Longrightarrow> rat_of_int (case quotient_of ?x2 of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd = ?x2

goal (1 subgoal):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
[PROOF STEP]
show "xs = map (\<lambda> i. of_int i / of_int dd) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys
[PROOF STEP]
unfolding ys map_map o_def nds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = map (\<lambda>x. rat_of_int (case quotient_of x of (n, x) \<Rightarrow> n * dd div x) / rat_of_int dd) xs
[PROOF STEP]
by (rule sym, rule map_idI, rule main)
[PROOF STATE]
proof (state)
this:
xs = map (\<lambda>i. rat_of_int i / rat_of_int dd) ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_freshAbs_psubstAbs_updEnv:
assumes "wls (asSort xs) X" and "wlsAbs (us,s) A" and "wlsEnv rho"
and "freshAbs xs x A"
shows "(A $[rho [x \<leftarrow> X]_xs]) = (A $[rho])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[rho [x \<leftarrow> X]_xs] = A $[rho]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls (asSort xs) X
wlsAbs (us, s) A
wlsEnv rho
freshAbs xs x A

goal (1 subgoal):
 1. A $[rho [x \<leftarrow> X]_xs] = A $[rho]
[PROOF STEP]
by(simp add: freshAbs_psubstAbs_updEnv)


[STATEMENT]
lemma remove_singleton_from_tagged_division_of:
  assumes "A tagged_division_of {a::real..b}" "a < b"
  assumes "x \<in> {a..b}"
  shows   "\<exists>k c d. c < d \<and> (k, {c..d}) \<in> A \<and> x \<in> {c..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k c d. c < d \<and> (k, {c..d}) \<in> A \<and> x \<in> {c..d}
[PROOF STEP]
using remove_singleton_from_division_of[OF division_of_tagged_division[OF assms(1)] assms(2)]
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a..b} \<Longrightarrow> \<exists>c d. c < d \<and> {c..d} \<in> snd ` A \<and> ?x \<in> {c..d}

goal (1 subgoal):
 1. \<exists>k c d. c < d \<and> (k, {c..d}) \<in> A \<and> x \<in> {c..d}
[PROOF STEP]
(*sledgehammer*)
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a..b} \<Longrightarrow> \<exists>c d. c < d \<and> {c..d} \<in> snd ` A \<and> ?x \<in> {c..d}

goal (1 subgoal):
 1. \<exists>k c d. c < d \<and> (k, {c..d}) \<in> A \<and> x \<in> {c..d}
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a..b} \<Longrightarrow> \<exists>c d. c < d \<and> {c..d} \<in> snd ` A \<and> ?x \<in> {c..d}
x \<in> {a..b}

goal (1 subgoal):
 1. \<exists>k c d. c < d \<and> (k, {c..d}) \<in> A \<and> x \<in> {c..d}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma no_better_subset_pref :
  assumes "x \<succeq> y"
  shows "no_better_than y carrier relation \<subseteq> no_better_than x carrier relation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. no_better_than y carrier relation \<subseteq> no_better_than x carrier relation
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> no_better_than y carrier relation \<Longrightarrow> xa \<in> no_better_than x carrier relation
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> no_better_than y carrier relation \<Longrightarrow> xa \<in> no_better_than x carrier relation
[PROOF STEP]
assume "a \<in> no_better_than y carrier relation"
[PROOF STATE]
proof (state)
this:
a \<in> no_better_than y carrier relation

goal (1 subgoal):
 1. \<And>xa. xa \<in> no_better_than y carrier relation \<Longrightarrow> xa \<in> no_better_than x carrier relation
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> no_better_than y carrier relation
[PROOF STEP]
show "a \<in> no_better_than x carrier relation"
[PROOF STATE]
proof (prove)
using this:
a \<in> no_better_than y carrier relation

goal (1 subgoal):
 1. a \<in> no_better_than x carrier relation
[PROOF STEP]
by (metis (no_types, lifting) assms mem_Collect_eq no_better_than_def transE transitivity)
[PROOF STATE]
proof (state)
this:
a \<in> no_better_than x carrier relation

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in module) rmult_0 [simp]:
  assumes 0: "r\<in>carrier R"
  shows "r\<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub>=\<zero>\<^bsub>M\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<odot>\<^bsub>M\<^esub> \<zero>\<^bsub>M\<^esub> = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
by (metis M.zero_closed R.zero_closed assms lmult_0 r_null smult_assoc1)


[STATEMENT]
lemma all_surj_conv' [reversal_rule]: assumes "surj f" shows "Pure.all (P oo f) \<equiv> Pure.all P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pure.all (P oo f) \<equiv> Pure.all P
[PROOF STEP]
unfolding COMP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. PROP P (f x)) \<equiv> Pure.all P
[PROOF STEP]
using all_surj_conv[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. PROP ?P (f x)) \<equiv> (\<And>y. PROP ?P y)

goal (1 subgoal):
 1. (\<And>x. PROP P (f x)) \<equiv> Pure.all P
[PROOF STEP]
.


[STATEMENT]
lemma linear_split_alt: "linear_split xs x = (takeWhile (\<lambda>(_,s). s<x) xs, dropWhile (\<lambda>(_,s). s<x) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear_split xs x = (takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. linear_split xs x = (takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)
[PROOF STEP]
have "linear_split_help xs x prev = (prev @ takeWhile (\<lambda>(_, s). s < x) xs, dropWhile (\<lambda>(_, s). s < x) xs)"
    for prev
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear_split_help xs x prev = (prev @ takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)
[PROOF STEP]
apply (induction xs arbitrary: prev)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>prev. linear_split_help [] x prev = (prev @ takeWhile (\<lambda>(uu_, s). s < x) [], dropWhile (\<lambda>(uu_, s). s < x) [])
 2. \<And>a xs prev. (\<And>prev. linear_split_help xs x prev = (prev @ takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)) \<Longrightarrow> linear_split_help (a # xs) x prev = (prev @ takeWhile (\<lambda>(uu_, s). s < x) (a # xs), dropWhile (\<lambda>(uu_, s). s < x) (a # xs))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
linear_split_help xs x ?prev = (?prev @ takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)

goal (1 subgoal):
 1. linear_split xs x = (takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
linear_split_help xs x ?prev = (?prev @ takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)

goal (1 subgoal):
 1. linear_split xs x = (takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
linear_split xs x = (takeWhile (\<lambda>(uu_, s). s < x) xs, dropWhile (\<lambda>(uu_, s). s < x) xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_row_mat_of_rows_list[simp]:
  shows "dim_row (mat_of_rows_list nr ls) = length ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_of_rows_list nr ls) = length ls
[PROOF STEP]
unfolding mat_of_rows_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (length ls) nr (\<lambda>(i, y). ls ! i ! y)) = length ls
[PROOF STEP]
by auto


[STATEMENT]
lemma no_inflow_s: "\<forall>e \<in> incoming s. f e = 0" (is ?thesis)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e\<in>incoming s. f e = (0::'capacity)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>e\<in>incoming s. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(\<forall>e \<in> incoming s. f e = 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>e\<in>incoming s. f e = (0::'capacity))

goal (1 subgoal):
 1. \<not> (\<forall>e\<in>incoming s. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>e\<in>incoming s. f e = (0::'capacity))
[PROOF STEP]
obtain e where obt1: "e \<in> incoming s \<and> f e \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>e\<in>incoming s. f e = (0::'capacity))

goal (1 subgoal):
 1. (\<And>e. e \<in> incoming s \<and> f e \<noteq> (0::'capacity) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
e \<in> incoming s \<and> f e \<noteq> (0::'capacity)

goal (1 subgoal):
 1. \<not> (\<forall>e\<in>incoming s. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e \<in> incoming s \<and> f e \<noteq> (0::'capacity)
[PROOF STEP]
have "e \<in> E"
[PROOF STATE]
proof (prove)
using this:
e \<in> incoming s \<and> f e \<noteq> (0::'capacity)

goal (1 subgoal):
 1. e \<in> E
[PROOF STEP]
using incoming_def
[PROOF STATE]
proof (prove)
using this:
e \<in> incoming s \<and> f e \<noteq> (0::'capacity)
incoming ?v \<equiv> {(u, ?v) |u. (u, ?v) \<in> E}

goal (1 subgoal):
 1. e \<in> E
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
e \<in> E

goal (1 subgoal):
 1. \<not> (\<forall>e\<in>incoming s. f e = (0::'capacity)) \<Longrightarrow> False
[PROOF STEP]
thus "False"
[PROOF STATE]
proof (prove)
using this:
e \<in> E

goal (1 subgoal):
 1. False
[PROOF STEP]
using obt1 no_incoming_s incoming_def
[PROOF STATE]
proof (prove)
using this:
e \<in> E
e \<in> incoming s \<and> f e \<noteq> (0::'capacity)
\<forall>u. (u, s) \<notin> E
incoming ?v \<equiv> {(u, ?v) |u. (u, ?v) \<in> E}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integrable_0: "(\<lambda>x. 0) integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 0::'b) integrable_on S
[PROOF STEP]
unfolding integrable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y. ((\<lambda>x. 0::'b) has_integral y) S
[PROOF STEP]
using has_integral_0
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. 0::?'a) has_integral (0::?'a)) ?S

goal (1 subgoal):
 1. \<exists>y. ((\<lambda>x. 0::'b) has_integral y) S
[PROOF STEP]
by auto


[STATEMENT]
lemma AA6: "\<turnstile> \<box>[P \<longrightarrow> Q]_v \<and> \<diamond>\<langle>P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>[P \<longrightarrow> Q]_v \<and> \<diamond>\<langle>P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> \<box>[P \<longrightarrow> Q]_v \<and> \<diamond>\<langle>P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v
[PROOF STEP]
have "\<turnstile> \<diamond>\<langle>(P \<longrightarrow> Q) \<and> P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<diamond>\<langle>(P \<longrightarrow> Q) \<and> P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v
[PROOF STEP]
by (rule AA7) auto
[PROOF STATE]
proof (state)
this:
\<turnstile> \<diamond>\<langle>(P \<longrightarrow> Q) \<and> P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v

goal (1 subgoal):
 1. \<turnstile> \<box>[P \<longrightarrow> Q]_v \<and> \<diamond>\<langle>P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v
[PROOF STEP]
with AA2
[PROOF STATE]
proof (chain)
picking this:
\<turnstile> \<box>[?P]_?v \<and> \<diamond>\<langle>?Q\<rangle>_?v \<longrightarrow> \<diamond>\<langle>?P \<and> ?Q\<rangle>_?v
\<turnstile> \<diamond>\<langle>(P \<longrightarrow> Q) \<and> P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>[?P]_?v \<and> \<diamond>\<langle>?Q\<rangle>_?v \<longrightarrow> \<diamond>\<langle>?P \<and> ?Q\<rangle>_?v
\<turnstile> \<diamond>\<langle>(P \<longrightarrow> Q) \<and> P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v

goal (1 subgoal):
 1. \<turnstile> \<box>[P \<longrightarrow> Q]_v \<and> \<diamond>\<langle>P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v
[PROOF STEP]
by (rule lift_imp_trans)
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>[P \<longrightarrow> Q]_v \<and> \<diamond>\<langle>P\<rangle>_v \<longrightarrow> \<diamond>\<langle>Q\<rangle>_v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_subterms_subset_Union: "t \<in> subterms\<^sub>s\<^sub>e\<^sub>t M \<Longrightarrow> subterms t \<subseteq> subterms\<^sub>s\<^sub>e\<^sub>t M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<sqsubseteq>\<^sub>s\<^sub>e\<^sub>t M \<Longrightarrow> subterms t \<subseteq> subterms\<^sub>s\<^sub>e\<^sub>t M
[PROOF STEP]
using subterms_subset
[PROOF STATE]
proof (prove)
using this:
?t' \<sqsubseteq> ?t \<Longrightarrow> subterms ?t' \<subseteq> subterms ?t

goal (1 subgoal):
 1. t \<sqsubseteq>\<^sub>s\<^sub>e\<^sub>t M \<Longrightarrow> subterms t \<subseteq> subterms\<^sub>s\<^sub>e\<^sub>t M
[PROOF STEP]
by auto


[STATEMENT]
lemma non_empty_col_map_conv:
  assumes "j < dim_col N"
  shows "non_empty_col N j \<longleftrightarrow> \<B>s ! j \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. non_empty_col N j = (\<B>s ! j \<noteq> {})
[PROOF STEP]
proof (intro iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. non_empty_col N j \<Longrightarrow> \<B>s ! j \<noteq> {}
 2. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
assume "non_empty_col N j"
[PROOF STATE]
proof (state)
this:
non_empty_col N j

goal (2 subgoals):
 1. non_empty_col N j \<Longrightarrow> \<B>s ! j \<noteq> {}
 2. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
non_empty_col N j
[PROOF STEP]
obtain i where ilt: "i < dim_row N" and "(col N j) $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
non_empty_col N j

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < dim_row N; col N j $ i \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using non_empty_col_obtains assms
[PROOF STATE]
proof (prove)
using this:
non_empty_col N j
\<lbrakk>non_empty_col ?M ?j; \<And>i. \<lbrakk>i < dim_row ?M; col ?M ?j $ i \<noteq> (0::?'a)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
j < dim_col N

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < dim_row N; col N j $ i \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i < dim_row N
col N j $ i \<noteq> 0

goal (2 subgoals):
 1. non_empty_col N j \<Longrightarrow> \<B>s ! j \<noteq> {}
 2. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row N
col N j $ i \<noteq> 0
[PROOF STEP]
have "(col N j) $ i = 1"
[PROOF STATE]
proof (prove)
using this:
i < dim_row N
col N j $ i \<noteq> 0

goal (1 subgoal):
 1. col N j $ i = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row N
col N j $ i \<noteq> 0
j < dim_col N

goal (1 subgoal):
 1. col N j $ i = 1
[PROOF STEP]
by (metis N_col_def_indiv(1) N_col_def_indiv(2) dim_col_is_b dim_row_is_v)
[PROOF STATE]
proof (state)
this:
col N j $ i = 1

goal (2 subgoals):
 1. non_empty_col N j \<Longrightarrow> \<B>s ! j \<noteq> {}
 2. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
col N j $ i = 1
[PROOF STEP]
have "\<V>s ! i \<in> \<B>s ! j"
[PROOF STATE]
proof (prove)
using this:
col N j $ i = 1

goal (1 subgoal):
 1. \<V>s ! i \<in> \<B>s ! j
[PROOF STEP]
by (smt (verit, best) assms ilt inc_mat_col_def dim_col_is_b inc_mat_dim_col inc_mat_dim_row)
[PROOF STATE]
proof (state)
this:
\<V>s ! i \<in> \<B>s ! j

goal (2 subgoals):
 1. non_empty_col N j \<Longrightarrow> \<B>s ! j \<noteq> {}
 2. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
thus "\<B>s ! j \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<V>s ! i \<in> \<B>s ! j

goal (1 subgoal):
 1. \<B>s ! j \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<B>s ! j \<noteq> {}

goal (1 subgoal):
 1. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
assume a: "\<B>s ! j \<noteq> {}"
[PROOF STATE]
proof (state)
this:
\<B>s ! j \<noteq> {}

goal (1 subgoal):
 1. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
have "\<B>s ! j \<in># \<B>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<B>s ! j \<in># \<B>
[PROOF STEP]
using assms dim_col_is_b
[PROOF STATE]
proof (prove)
using this:
j < dim_col N
dim_col N = \<b>

goal (1 subgoal):
 1. \<B>s ! j \<in># \<B>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<B>s ! j \<in># \<B>

goal (1 subgoal):
 1. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<B>s ! j \<in># \<B>
[PROOF STEP]
obtain x where "x \<in> \<B>s ! j" and "x \<in> \<V>"
[PROOF STATE]
proof (prove)
using this:
\<B>s ! j \<in># \<B>

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> \<B>s ! j; x \<in> \<V>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using wellformed a
[PROOF STATE]
proof (prove)
using this:
\<B>s ! j \<in># \<B>
?b \<in># \<B> \<Longrightarrow> ?b \<subseteq> \<V>
\<B>s ! j \<noteq> {}

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> \<B>s ! j; x \<in> \<V>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> \<B>s ! j
x \<in> \<V>

goal (1 subgoal):
 1. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<B>s ! j
x \<in> \<V>
[PROOF STEP]
obtain i where "\<V>s ! i \<in> \<B>s ! j" and "i < dim_row N"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<B>s ! j
x \<in> \<V>

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>\<V>s ! i \<in> \<B>s ! j; i < dim_row N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using dim_row_is_v
[PROOF STATE]
proof (prove)
using this:
x \<in> \<B>s ! j
x \<in> \<V>
dim_row N = \<v>

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>\<V>s ! i \<in> \<B>s ! j; i < dim_row N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using valid_points_index_cons
[PROOF STATE]
proof (prove)
using this:
x \<in> \<B>s ! j
x \<in> \<V>
dim_row N = \<v>
?x \<in> \<V> \<Longrightarrow> \<exists>i. \<V>s ! i = ?x \<and> i < \<v>

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>\<V>s ! i \<in> \<B>s ! j; i < dim_row N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<V>s ! i \<in> \<B>s ! j
i < dim_row N

goal (1 subgoal):
 1. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<V>s ! i \<in> \<B>s ! j
i < dim_row N
[PROOF STEP]
have "N $$ (i, j) = 1"
[PROOF STATE]
proof (prove)
using this:
\<V>s ! i \<in> \<B>s ! j
i < dim_row N

goal (1 subgoal):
 1. N $$ (i, j) = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<V>s ! i \<in> \<B>s ! j
i < dim_row N
j < dim_col N

goal (1 subgoal):
 1. N $$ (i, j) = 1
[PROOF STEP]
by (meson inc_mat_of_index)
[PROOF STATE]
proof (state)
this:
N $$ (i, j) = 1

goal (1 subgoal):
 1. \<B>s ! j \<noteq> {} \<Longrightarrow> non_empty_col N j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N $$ (i, j) = 1
[PROOF STEP]
show "non_empty_col N j"
[PROOF STATE]
proof (prove)
using this:
N $$ (i, j) = 1

goal (1 subgoal):
 1. non_empty_col N j
[PROOF STEP]
using non_empty_col_alt_def
[PROOF STATE]
proof (prove)
using this:
N $$ (i, j) = 1
?j < dim_col ?M \<Longrightarrow> non_empty_col ?M ?j = (\<exists>i<dim_row ?M. ?M $$ (i, ?j) \<noteq> (0::?'a))

goal (1 subgoal):
 1. non_empty_col N j
[PROOF STEP]
using \<open>i < dim_row N\<close> assms
[PROOF STATE]
proof (prove)
using this:
N $$ (i, j) = 1
?j < dim_col ?M \<Longrightarrow> non_empty_col ?M ?j = (\<exists>i<dim_row ?M. ?M $$ (i, ?j) \<noteq> (0::?'a))
i < dim_row N
j < dim_col N

goal (1 subgoal):
 1. non_empty_col N j
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
non_empty_col N j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in is_iso_ntcf) iso_ntcf_inv_ntcf_NTMap_app_is_the_inverse[cat_cs_intros]:
  assumes "a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>"
  shows "inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>
[PROOF STEP]
have "is_inverse \<BB> (inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>) (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_inverse \<BB> (inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>) (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)
[PROOF STEP]
by (rule iso_ntcf_inv_ntcf_NTMap_app_is_inverse[OF assms])
[PROOF STATE]
proof (state)
this:
is_inverse \<BB> (inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>) (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)

goal (1 subgoal):
 1. inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>
[PROOF STEP]
from NTDom.HomCod.cat_is_inverse_eq_the_inverse[OF this]
[PROOF STATE]
proof (chain)
picking this:
inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>

goal (1 subgoal):
 1. inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
inv_ntcf \<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr> = (\<NN>\<lparr>NTMap\<rparr>\<lparr>a\<rparr>)\<inverse>\<^sub>C\<^bsub>\<BB>\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma refl_on_LCoset_rel: "0\<in>H \<Longrightarrow> refl_on G (LCoset_rel H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'g) \<in> H \<Longrightarrow> refl_on G (LCoset_rel H)
[PROOF STEP]
using lcoset_rel_def
[PROOF STATE]
proof (prove)
using this:
lcoset_rel ?A \<equiv> {(x, y). - x + y \<in> ?A}

goal (1 subgoal):
 1. (0::'g) \<in> H \<Longrightarrow> refl_on G (LCoset_rel H)
[PROOF STEP]
by (fastforce intro: refl_onI)


[STATEMENT]
lemma norm_summable_imp_has_sum:
  fixes f :: "nat \<Rightarrow> 'a :: banach"
  assumes "summable (\<lambda>n. norm (f n))" and "f sums S"
  shows   "has_sum f (UNIV :: nat set) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum f UNIV S
[PROOF STEP]
unfolding has_sum_def tendsto_iff eventually_finite_subsets_at_top
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>X. finite X \<and> X \<subseteq> UNIV \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> UNIV \<longrightarrow> dist (sum f Y) S < e)
[PROOF STEP]
proof (safe, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>X. finite X \<and> X \<subseteq> UNIV \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> UNIV \<longrightarrow> dist (sum f Y) S < e)
[PROOF STEP]
case (1 \<epsilon>)
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>X. finite X \<and> X \<subseteq> UNIV \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> UNIV \<longrightarrow> dist (sum f Y) S < e)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. norm (f n))
[PROOF STEP]
obtain S' where S': "(\<lambda>n. norm (f n)) sums S'"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (f n))

goal (1 subgoal):
 1. (\<And>S'. (\<lambda>n. norm (f n)) sums S' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: summable_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. norm (f n)) sums S'

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>X. finite X \<and> X \<subseteq> UNIV \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> UNIV \<longrightarrow> dist (sum f Y) S < e)
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
0 < \<epsilon>
(\<lambda>n. norm (f n)) sums S'
[PROOF STEP]
obtain N where N: "\<And>n. n \<ge> N \<Longrightarrow> \<bar>S' - (\<Sum>i<n. norm (f i))\<bar> < \<epsilon>"
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>
(\<lambda>n. norm (f n)) sums S'

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> \<bar>S' - (\<Sum>i<n. norm (f i))\<bar> < \<epsilon>) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: tendsto_iff eventually_at_top_linorder sums_def dist_norm abs_minus_commute)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> \<bar>S' - (\<Sum>i<?n. norm (f i))\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>X. finite X \<and> X \<subseteq> UNIV \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> UNIV \<longrightarrow> dist (sum f Y) S < e)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>X. finite X \<and> X \<subseteq> UNIV \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> UNIV \<longrightarrow> dist (sum f Y) S < \<epsilon>)
[PROOF STEP]
proof (rule exI[of _ "{..<N}"], safe, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
case (2 Y)
[PROOF STATE]
proof (state)
this:
finite Y
{..<N} \<subseteq> Y
Y \<subseteq> UNIV

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
from 2
[PROOF STATE]
proof (chain)
picking this:
finite Y
{..<N} \<subseteq> Y
Y \<subseteq> UNIV
[PROOF STEP]
have "(\<lambda>n. if n \<in> Y then 0 else f n) sums (S - sum f Y)"
[PROOF STATE]
proof (prove)
using this:
finite Y
{..<N} \<subseteq> Y
Y \<subseteq> UNIV

goal (1 subgoal):
 1. (\<lambda>n. if n \<in> Y then 0::'a else f n) sums (S - sum f Y)
[PROOF STEP]
by (intro sums_If_finite_set'[OF \<open>f sums S\<close>]) (auto simp: sum_negf)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n \<in> Y then 0::'a else f n) sums (S - sum f Y)

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
hence "S - sum f Y = (\<Sum>n. if n \<in> Y then 0 else f n)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if n \<in> Y then 0::'a else f n) sums (S - sum f Y)

goal (1 subgoal):
 1. S - sum f Y = (\<Sum>n. if n \<in> Y then 0::'a else f n)
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
S - sum f Y = (\<Sum>n. if n \<in> Y then 0::'a else f n)

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S - sum f Y = (\<Sum>n. if n \<in> Y then 0::'a else f n)

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
have "norm \<dots> \<le> (\<Sum>n. norm (if n \<in> Y then 0 else f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>n. if n \<in> Y then 0::'a else f n) \<le> (\<Sum>n. norm (if n \<in> Y then 0::'a else f n))
[PROOF STEP]
by (rule summable_norm[OF summable_comparison_test'[OF assms(1)]]) auto
[PROOF STATE]
proof (state)
this:
norm (\<Sum>n. if n \<in> Y then 0::'a else f n) \<le> (\<Sum>n. norm (if n \<in> Y then 0::'a else f n))

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (\<Sum>n. if n \<in> Y then 0::'a else f n) \<le> (\<Sum>n. norm (if n \<in> Y then 0::'a else f n))

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
have "\<dots> \<le> (\<Sum>n. if n < N then 0 else norm (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. norm (if n \<in> Y then 0::'a else f n)) \<le> (\<Sum>n. if n < N then 0 else norm (f n))
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
finite Y
{..<N} \<subseteq> Y
Y \<subseteq> UNIV

goal (1 subgoal):
 1. (\<Sum>n. norm (if n \<in> Y then 0::'a else f n)) \<le> (\<Sum>n. if n < N then 0 else norm (f n))
[PROOF STEP]
by (intro suminf_le summable_comparison_test'[OF assms(1)]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n. norm (if n \<in> Y then 0::'a else f n)) \<le> (\<Sum>n. if n < N then 0 else norm (f n))

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. norm (if n \<in> Y then 0::'a else f n)) \<le> (\<Sum>n. if n < N then 0 else norm (f n))

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
have "(\<lambda>n. if n \<in> {..<N} then 0 else norm (f n)) sums (S' - (\<Sum>i<N. norm (f i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. if n \<in> {..<N} then 0 else norm (f n)) sums (S' - (\<Sum>i<N. norm (f i)))
[PROOF STEP]
by (intro sums_If_finite_set'[OF S']) (auto simp: sum_negf)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if n \<in> {..<N} then 0 else norm (f n)) sums (S' - (\<Sum>i<N. norm (f i)))

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
hence "(\<Sum>n. if n < N then 0 else norm (f n)) = S' - (\<Sum>i<N. norm (f i))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if n \<in> {..<N} then 0 else norm (f n)) sums (S' - (\<Sum>i<N. norm (f i)))

goal (1 subgoal):
 1. (\<Sum>n. if n < N then 0 else norm (f n)) = S' - (\<Sum>i<N. norm (f i))
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. if n < N then 0 else norm (f n)) = S' - (\<Sum>i<N. norm (f i))

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. if n < N then 0 else norm (f n)) = S' - (\<Sum>i<N. norm (f i))

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
have "S' - (\<Sum>i<N. norm (f i)) \<le> \<bar>S' - (\<Sum>i<N. norm (f i))\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' - (\<Sum>i<N. norm (f i)) \<le> \<bar>S' - (\<Sum>i<N. norm (f i))\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S' - (\<Sum>i<N. norm (f i)) \<le> \<bar>S' - (\<Sum>i<N. norm (f i))\<bar>

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S' - (\<Sum>i<N. norm (f i)) \<le> \<bar>S' - (\<Sum>i<N. norm (f i))\<bar>

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
have "\<dots> < \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>S' - (\<Sum>i<N. norm (f i))\<bar> < \<epsilon>
[PROOF STEP]
by (rule N) auto
[PROOF STATE]
proof (state)
this:
\<bar>S' - (\<Sum>i<N. norm (f i))\<bar> < \<epsilon>

goal (2 subgoals):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
 2. \<And>Y. \<lbrakk>finite Y; {..<N} \<subseteq> Y; Y \<subseteq> UNIV\<rbrakk> \<Longrightarrow> dist (sum f Y) S < \<epsilon>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (S - sum f Y) < \<epsilon>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
norm (S - sum f Y) < \<epsilon>

goal (1 subgoal):
 1. dist (sum f Y) S < \<epsilon>
[PROOF STEP]
by (simp add: dist_norm norm_minus_commute)
[PROOF STATE]
proof (state)
this:
dist (sum f Y) S < \<epsilon>

goal (1 subgoal):
 1. \<And>x. x < N \<Longrightarrow> x \<in> UNIV
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<exists>X. finite X \<and> X \<subseteq> UNIV \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> UNIV \<longrightarrow> dist (sum f Y) S < \<epsilon>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sumset_iterated_Suc [simp]: "sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
interpret comp_fun_commute_on "{..k}" "sumset \<circ> (\<lambda>_. A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute_on {..k} (sumset \<circ> (\<lambda>_. A))
[PROOF STEP]
using sumset_assoc sumset_commute
[PROOF STATE]
proof (prove)
using this:
sumset (sumset ?A ?B) ?C = sumset ?A (sumset ?B ?C)
sumset ?A ?B = sumset ?B ?A

goal (1 subgoal):
 1. comp_fun_commute_on {..k} (sumset \<circ> (\<lambda>_. A))
[PROOF STEP]
by (auto simp: comp_fun_commute_on_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
have "?lhs = (sumset \<circ> (\<lambda>_. A)) k (Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} {..<k})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset_iterated A (Suc k) = (sumset \<circ> (\<lambda>_. A)) k (Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} {..<k})
[PROOF STEP]
unfolding sumset_iterated_def lessThan_Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} (insert k {..<k}) = (sumset \<circ> (\<lambda>_. A)) k (Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} {..<k})
[PROOF STEP]
by (subst fold_insert, auto)
[PROOF STATE]
proof (state)
this:
sumset_iterated A (Suc k) = (sumset \<circ> (\<lambda>_. A)) k (Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} {..<k})

goal (1 subgoal):
 1. sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sumset_iterated A (Suc k) = (sumset \<circ> (\<lambda>_. A)) k (Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} {..<k})

goal (1 subgoal):
 1. sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sumset \<circ> (\<lambda>_. A)) k (Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} {..<k}) = sumset A (sumset_iterated A k)
[PROOF STEP]
by (simp add: sumset_iterated_def)
[PROOF STATE]
proof (state)
this:
(sumset \<circ> (\<lambda>_. A)) k (Finite_Set.fold (sumset \<circ> (\<lambda>_. A)) {\<zero>} {..<k}) = sumset A (sumset_iterated A k)

goal (1 subgoal):
 1. sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)

goal (1 subgoal):
 1. sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sumset_iterated A (Suc k) = sumset A (sumset_iterated A k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_iterator_product_correct :
  assumes it_a: "set_iterator it_a S_a"
  assumes it_b: "\<And>a. a \<in> S_a \<Longrightarrow> set_iterator (it_b a) (S_b a)"
  shows "set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)
[PROOF STEP]
note res' = set_iterator_genord_product_correct [OF it_a[unfolded set_iterator_def],
     of it_b S_b "\<lambda>_ _ _. True", OF it_b[unfolded set_iterator_def]]
[PROOF STATE]
proof (state)
this:
(\<And>a. a \<in> S_a \<Longrightarrow> a \<in> S_a) \<Longrightarrow> set_iterator_genord (set_iterator_product it_a it_b) (Sigma S_a S_b) (set_iterator_product_order (\<lambda>_ _. True) (\<lambda>_ _ _. True))

goal (1 subgoal):
 1. set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)
[PROOF STEP]
note res = set_iterator_intro [OF res']
[PROOF STATE]
proof (state)
this:
(\<And>a. a \<in> S_a \<Longrightarrow> a \<in> S_a) \<Longrightarrow> set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)

goal (1 subgoal):
 1. set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>a. a \<in> S_a \<Longrightarrow> a \<in> S_a) \<Longrightarrow> set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)

goal (1 subgoal):
 1. set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_iterator (set_iterator_product it_a it_b) (Sigma S_a S_b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_imp_bounded [intro]: "finite S \<Longrightarrow> bounded S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> bounded S
[PROOF STEP]
by (induct set: finite) simp_all


[STATEMENT]
lemma support_on_if_subset: "support_on A (\<lambda>x. if P x then a else 0) \<subseteq> {x \<in> A. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. support_on A (\<lambda>x. if P x then a else (0::'b)) \<subseteq> {x \<in> A. P x}
[PROOF STEP]
by (auto simp: support_on_def)


[STATEMENT]
lemma approx_SComplex_mult_cancel_iff1 [simp]:
     "\<lbrakk>a \<in> SComplex; a \<noteq> 0\<rbrakk> \<Longrightarrow> (a*w \<approx> a*z) = (w \<approx> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> SComplex; a \<noteq> 0\<rbrakk> \<Longrightarrow> (a * w \<approx> a * z) = (w \<approx> z)
[PROOF STEP]
by (metis HFinite_star_of SComplex_iff approx_SComplex_mult_cancel approx_mult2)


[STATEMENT]
lemma set_mono_strict_prefix: "strict_prefix xs ys \<Longrightarrow> set xs \<subseteq> set (butlast ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_prefix xs ys \<Longrightarrow> set xs \<subseteq> set (butlast ys)
[PROOF STEP]
by (metis append_butlast_last_id strict_prefixE strict_prefix_simps(1) prefix_snoc set_mono_prefix)


[STATEMENT]
lemma mset_msort:
  "mset (msort xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (msort xs) = mset xs
[PROOF STEP]
by (induct xs rule: msort.induct)
    (simp_all, metis append_take_drop_id mset.simps(2) mset_append)


[STATEMENT]
lemma block_comp_incomplete: "incomplete_block bl \<Longrightarrow> card (bl\<^sup>c) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card bl < \<v> \<and> bl \<in># \<B> \<Longrightarrow> 0 < card (bl\<^sup>c)
[PROOF STEP]
using block_complement_size
[PROOF STATE]
proof (prove)
using this:
?b \<subseteq> \<V> \<Longrightarrow> card (?b\<^sup>c) = \<v> - card ?b

goal (1 subgoal):
 1. card bl < \<v> \<and> bl \<in># \<B> \<Longrightarrow> 0 < card (bl\<^sup>c)
[PROOF STEP]
by (simp add: wellformed)


[STATEMENT]
lemma wf_if_measure_in_wf:
  \<open>wf R \<Longrightarrow> (\<And>a b. (a, b) \<in> S \<Longrightarrow> (\<nu> a, \<nu> b)\<in>R) \<Longrightarrow> wf S\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf R; \<And>a b. (a, b) \<in> S \<Longrightarrow> (\<nu> a, \<nu> b) \<in> R\<rbrakk> \<Longrightarrow> wf S
[PROOF STEP]
by (metis in_inv_image wfE_min wfI_min wf_inv_image)


[STATEMENT]
lemma basis_reduction_add_row_weak:
  assumes Linvw: "LLL_invariant_weak' i fs"
  and i: "i < m"  and j: "j < i"
  and fs': "fs' = fs[ i := fs ! i - c \<cdot>\<^sub>v fs ! j]"
shows "LLL_invariant_weak' i fs'"
  "g_bnd B fs \<Longrightarrow> g_bnd B fs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LLL_invariant_weak' i fs' &&& (g_bnd B fs \<Longrightarrow> g_bnd B fs')
[PROOF STEP]
proof (atomize(full), goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
note Linv = LLL_invw'_imp_w[OF Linvw]
[PROOF STATE]
proof (state)
this:
LLL_invariant_weak fs

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
note main = basis_reduction_add_row_main[OF Linv i j fs']
[PROOF STATE]
proof (state)
this:
LLL_invariant_weak fs'
LLL_invariant True i fs \<Longrightarrow> LLL_invariant True i fs'
\<lbrakk>c = round (gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) i j); \<mu>_small_row i fs (Suc j)\<rbrakk> \<Longrightarrow> \<mu>_small_row i fs' j
c = round (gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) i j) \<Longrightarrow> \<bar>gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs') i j\<bar> \<le> 1 / 2
LLL_measure i fs' = LLL_measure i fs
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i = gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ?i
\<lbrakk>?i' < m; ?j' < m\<rbrakk> \<Longrightarrow> gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs') ?i' ?j' = (if ?i' = i \<and> ?j' \<le> j then gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) i ?j' - rat_of_int c * gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) j ?j' else gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) ?i' ?j')
?ii \<le> m \<Longrightarrow> d fs' ?ii = d fs ?ii

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
have bnd: "g_bnd B fs \<Longrightarrow> g_bnd B fs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g_bnd B fs \<Longrightarrow> g_bnd B fs'
[PROOF STEP]
using main(6)
[PROOF STATE]
proof (prove)
using this:
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i = gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ?i

goal (1 subgoal):
 1. g_bnd B fs \<Longrightarrow> g_bnd B fs'
[PROOF STEP]
unfolding g_bnd_def
[PROOF STATE]
proof (prove)
using this:
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i = gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ?i

goal (1 subgoal):
 1. \<forall>i<m. \<parallel>gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) i\<parallel>\<^sup>2 \<le> B \<Longrightarrow> \<forall>i<m. \<parallel>gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') i\<parallel>\<^sup>2 \<le> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g_bnd B fs \<Longrightarrow> g_bnd B fs'

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
note new = LLL_inv_wD[OF main(1)]
[PROOF STATE]
proof (state)
this:
gs.lin_indpt_list (map of_int_hom.vec_hom fs')
length (map of_int_hom.vec_hom fs') = m
set fs' \<subseteq> carrier_vec n
?i < m \<Longrightarrow> fs' ! ?i \<in> carrier_vec n
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i \<in> Rn
length fs' = m
lattice_of fs' = L

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
note old = LLL_invD_weak[OF Linvw]
[PROOF STATE]
proof (state)
this:
gs.lin_indpt_list (map of_int_hom.vec_hom fs)
length (map of_int_hom.vec_hom fs) = m
set fs \<subseteq> carrier_vec n
?i < m \<Longrightarrow> fs ! ?i \<in> carrier_vec n
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ?i \<in> Rn
length fs = m
lattice_of fs = L
gram_schmidt_fs.weakly_reduced n (map of_int_hom.vec_hom fs) \<alpha> i
i \<le> m

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
have red: "weakly_reduced fs' i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gram_schmidt_fs.weakly_reduced n (map of_int_hom.vec_hom fs') \<alpha> i
[PROOF STEP]
using \<open>weakly_reduced fs i\<close> main(6) \<open>i < m\<close>
[PROOF STATE]
proof (prove)
using this:
gram_schmidt_fs.weakly_reduced n (map of_int_hom.vec_hom fs) \<alpha> i
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i = gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ?i
i < m

goal (1 subgoal):
 1. gram_schmidt_fs.weakly_reduced n (map of_int_hom.vec_hom fs') \<alpha> i
[PROOF STEP]
unfolding gram_schmidt_fs.weakly_reduced_def
[PROOF STATE]
proof (prove)
using this:
\<forall>ia. Suc ia < i \<longrightarrow> \<parallel>gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ia\<parallel>\<^sup>2 \<le> \<alpha> * \<parallel>gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) (Suc ia)\<parallel>\<^sup>2
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i = gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ?i
i < m

goal (1 subgoal):
 1. \<forall>ia. Suc ia < i \<longrightarrow> \<parallel>gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ia\<parallel>\<^sup>2 \<le> \<alpha> * \<parallel>gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') (Suc ia)\<parallel>\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gram_schmidt_fs.weakly_reduced n (map of_int_hom.vec_hom fs') \<alpha> i

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
have inv: "LLL_invariant_weak' i fs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LLL_invariant_weak' i fs'
[PROOF STEP]
using LLL_inv_wD[OF main(1)] \<open>i < m\<close>
[PROOF STATE]
proof (prove)
using this:
gs.lin_indpt_list (map of_int_hom.vec_hom fs')
length (map of_int_hom.vec_hom fs') = m
set fs' \<subseteq> carrier_vec n
?i < m \<Longrightarrow> fs' ! ?i \<in> carrier_vec n
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i \<in> Rn
length fs' = m
lattice_of fs' = L
i < m

goal (1 subgoal):
 1. LLL_invariant_weak' i fs'
[PROOF STEP]
by (intro LLL_invI_weak, auto intro: red)
[PROOF STATE]
proof (state)
this:
LLL_invariant_weak' i fs'

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
using inv red main bnd
[PROOF STATE]
proof (prove)
using this:
LLL_invariant_weak' i fs'
gram_schmidt_fs.weakly_reduced n (map of_int_hom.vec_hom fs') \<alpha> i
LLL_invariant_weak fs'
LLL_invariant True i fs \<Longrightarrow> LLL_invariant True i fs'
\<lbrakk>c = round (gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) i j); \<mu>_small_row i fs (Suc j)\<rbrakk> \<Longrightarrow> \<mu>_small_row i fs' j
c = round (gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) i j) \<Longrightarrow> \<bar>gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs') i j\<bar> \<le> 1 / 2
LLL_measure i fs' = LLL_measure i fs
?i < m \<Longrightarrow> gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs') ?i = gram_schmidt_fs.gso n (map of_int_hom.vec_hom fs) ?i
\<lbrakk>?i' < m; ?j' < m\<rbrakk> \<Longrightarrow> gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs') ?i' ?j' = (if ?i' = i \<and> ?j' \<le> j then gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) i ?j' - rat_of_int c * gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) j ?j' else gram_schmidt_fs.\<mu> n (map of_int_hom.vec_hom fs) ?i' ?j')
?ii \<le> m \<Longrightarrow> d fs' ?ii = d fs ?ii
g_bnd B fs \<Longrightarrow> g_bnd B fs'

goal (1 subgoal):
 1. LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LLL_invariant_weak' i fs' \<and> (g_bnd B fs \<longrightarrow> g_bnd B fs')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma f2r2f_inv2 [simp]: "\<F> \<circ> \<R> = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<F> \<circ> \<R> = id
[PROOF STEP]
unfolding f2r_def r2f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>R. (``) R \<circ> \<eta>) \<circ> (\<lambda>f. {(x, y). y \<in> f x}) = id
[PROOF STEP]
by force


[STATEMENT]
lemma supp_uminus [simp]: "supp (\<lambda>x. -f x :: 'a :: group_add) = supp f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (\<lambda>x. - f x) = supp f
[PROOF STEP]
by (auto simp: supp_def)


[STATEMENT]
lemma mod_exp_nat_aux_correct:
  "mod_exp_nat_aux m y x n mod m = (x ^ n * y) mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_exp_nat_aux m y x n mod m = x ^ n * y mod m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mod_exp_nat_aux m y x n mod m = x ^ n * y mod m
[PROOF STEP]
have "mod_exp_nat_aux m y x n = ((\<lambda>y. x * y mod m) ^^ n) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_exp_nat_aux m y x n = ((\<lambda>y. x * y mod m) ^^ n) y
[PROOF STEP]
by (simp add: mod_exp_nat_aux_def mod_exp_nat.efficient_power_correct)
[PROOF STATE]
proof (state)
this:
mod_exp_nat_aux m y x n = ((\<lambda>y. x * y mod m) ^^ n) y

goal (1 subgoal):
 1. mod_exp_nat_aux m y x n mod m = x ^ n * y mod m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mod_exp_nat_aux m y x n = ((\<lambda>y. x * y mod m) ^^ n) y

goal (1 subgoal):
 1. mod_exp_nat_aux m y x n mod m = x ^ n * y mod m
[PROOF STEP]
have "((\<lambda>y. x * y mod m) ^^ n) y mod m = (x ^ n * y) mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. x * y mod m) ^^ n) y mod m = x ^ n * y mod m
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<lambda>y. x * y mod m) ^^ 0) y mod m = x ^ 0 * y mod m
 2. \<And>n. ((\<lambda>y. x * y mod m) ^^ n) y mod m = x ^ n * y mod m \<Longrightarrow> ((\<lambda>y. x * y mod m) ^^ Suc n) y mod m = x ^ Suc n * y mod m
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. x * y mod m) ^^ n) y mod m = x ^ n * y mod m

goal (2 subgoals):
 1. ((\<lambda>y. x * y mod m) ^^ 0) y mod m = x ^ 0 * y mod m
 2. \<And>n. ((\<lambda>y. x * y mod m) ^^ n) y mod m = x ^ n * y mod m \<Longrightarrow> ((\<lambda>y. x * y mod m) ^^ Suc n) y mod m = x ^ Suc n * y mod m
[PROOF STEP]
hence "x * ((\<lambda>y. x * y mod m) ^^ n) y mod m = x * x ^ n * y mod m"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>y. x * y mod m) ^^ n) y mod m = x ^ n * y mod m

goal (1 subgoal):
 1. x * ((\<lambda>y. x * y mod m) ^^ n) y mod m = x * x ^ n * y mod m
[PROOF STEP]
by (metis mod_mult_right_eq mult.assoc)
[PROOF STATE]
proof (state)
this:
x * ((\<lambda>y. x * y mod m) ^^ n) y mod m = x * x ^ n * y mod m

goal (2 subgoals):
 1. ((\<lambda>y. x * y mod m) ^^ 0) y mod m = x ^ 0 * y mod m
 2. \<And>n. ((\<lambda>y. x * y mod m) ^^ n) y mod m = x ^ n * y mod m \<Longrightarrow> ((\<lambda>y. x * y mod m) ^^ Suc n) y mod m = x ^ Suc n * y mod m
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x * ((\<lambda>y. x * y mod m) ^^ n) y mod m = x * x ^ n * y mod m

goal (1 subgoal):
 1. ((\<lambda>y. x * y mod m) ^^ Suc n) y mod m = x ^ Suc n * y mod m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>y. x * y mod m) ^^ Suc n) y mod m = x ^ Suc n * y mod m

goal (1 subgoal):
 1. ((\<lambda>y. x * y mod m) ^^ 0) y mod m = x ^ 0 * y mod m
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
((\<lambda>y. x * y mod m) ^^ n) y mod m = x ^ n * y mod m

goal (1 subgoal):
 1. mod_exp_nat_aux m y x n mod m = x ^ n * y mod m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mod_exp_nat_aux m y x n mod m = x ^ n * y mod m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mod_exp_nat_aux m y x n mod m = x ^ n * y mod m

goal (1 subgoal):
 1. mod_exp_nat_aux m y x n mod m = x ^ n * y mod m
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mod_exp_nat_aux m y x n mod m = x ^ n * y mod m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [simp]: "nodes (rem_unPath ps G) = nodes G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (rem_unPath ps G) = nodes G
[PROOF STEP]
proof (induct ps)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. nodes (rem_unPath [] G) = nodes G
 2. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. nodes (rem_unPath [] G) = nodes G
 2. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (rem_unPath [] G) = nodes G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nodes (rem_unPath [] G) = nodes G

goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
nodes (rem_unPath xs G) = nodes G

goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
have "nodes (rem_unPath (x # xs) G)=nodes (del_unEdge
        (fst x) (fst (snd x)) (snd (snd x)) (rem_unPath xs G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (rem_unPath (x # xs) G) = nodes (del_unEdge (fst x) (fst (snd x)) (snd (snd x)) (rem_unPath xs G))
[PROOF STEP]
by (metis rem_unPath.simps(2) rem_unPath_com surjective_pairing)
[PROOF STATE]
proof (state)
this:
nodes (rem_unPath (x # xs) G) = nodes (del_unEdge (fst x) (fst (snd x)) (snd (snd x)) (rem_unPath xs G))

goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nodes (rem_unPath (x # xs) G) = nodes (del_unEdge (fst x) (fst (snd x)) (snd (snd x)) (rem_unPath xs G))

goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
have "...=nodes (rem_unPath xs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (del_unEdge (fst x) (fst (snd x)) (snd (snd x)) (rem_unPath xs G)) = nodes (rem_unPath xs G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nodes (del_unEdge (fst x) (fst (snd x)) (snd (snd x)) (rem_unPath xs G)) = nodes (rem_unPath xs G)

goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nodes (del_unEdge (fst x) (fst (snd x)) (snd (snd x)) (rem_unPath xs G)) = nodes (rem_unPath xs G)

goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
have "...=nodes G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (rem_unPath xs G) = nodes G
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
nodes (rem_unPath xs G) = nodes G

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

goal (1 subgoal):
 1. \<And>a ps. nodes (rem_unPath ps G) = nodes G \<Longrightarrow> nodes (rem_unPath (a # ps) G) = nodes G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nodes (rem_unPath (x # xs) G) = nodes G
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
nodes (rem_unPath (x # xs) G) = nodes G

goal (1 subgoal):
 1. nodes (rem_unPath (x # xs) G) = nodes G
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
nodes (rem_unPath (x # xs) G) = nodes G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem kingman_theorem_AE_aux2:
  assumes "subcocycle u"
  shows "\<exists>(g::'a\<Rightarrow>ereal). (g\<in>borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>n. u n x / n) \<longlonglongrightarrow> g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
define v where "v = (\<lambda>n x. u n x + birkhoff_sum (\<lambda>x. - u 1 x) n x)"
[PROOF STATE]
proof (state)
this:
v = (\<lambda>n x. u n x + birkhoff_sum (\<lambda>x. - u 1 x) n x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "subcocycle v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcocycle v
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcocycle (\<lambda>n x. u n x + birkhoff_sum (\<lambda>x. - u 1 x) n x)
[PROOF STEP]
apply (rule subcocycle_add[OF assms], rule subcocycle_birkhoff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. - u 1 x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subcocycle u

goal (1 subgoal):
 1. integrable M (\<lambda>x. - u 1 x)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. integrable M (u n)) \<and> (\<forall>n m x. u (n + m) x \<le> u n x + u m ((T ^^ n) x))

goal (1 subgoal):
 1. integrable M (\<lambda>x. - u 1 x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subcocycle v

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "\<exists>(gv::'a\<Rightarrow>ereal). (gv\<in>borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>n. v n x / n) \<longlonglongrightarrow> gv x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)
[PROOF STEP]
apply (rule kingman_theorem_AE_aux1[OF \<open>subcocycle v\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. v 1 x \<le> 0
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. u 1 x + birkhoff_sum (\<lambda>x. - u 1 x) 1 x \<le> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)
[PROOF STEP]
obtain gv where gv: "gv \<in> borel_measurable Invariants" "AE x in M. (\<lambda>n. v n x / n) \<longlonglongrightarrow> (gv x::ereal)" "\<And>x. gv x < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)

goal (1 subgoal):
 1. (\<And>gv. \<lbrakk>gv \<in> borel_measurable Invariants; AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x; \<And>x. gv x < \<infinity>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gv \<in> borel_measurable Invariants
AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
gv ?x3 < \<infinity>

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
define g where "g = (\<lambda>x. gv x + ereal(real_cond_exp M Invariants (u 1) x))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>x. gv x + ereal (real_cond_exp M Invariants (u 1) x))

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have g_meas: "g \<in> borel_measurable Invariants"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> borel_measurable Invariants
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. gv x + ereal (real_cond_exp M Invariants (u 1) x)) \<in> borel_measurable Invariants
[PROOF STEP]
using gv(1)
[PROOF STATE]
proof (prove)
using this:
gv \<in> borel_measurable Invariants

goal (1 subgoal):
 1. (\<lambda>x. gv x + ereal (real_cond_exp M Invariants (u 1) x)) \<in> borel_measurable Invariants
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g \<in> borel_measurable Invariants

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have g_fin: "\<And>x. g x < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. g x < \<infinity>
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. gv x + ereal (real_cond_exp M Invariants (u 1) x) < \<infinity>
[PROOF STEP]
using gv(3)
[PROOF STATE]
proof (prove)
using this:
gv ?x3 < \<infinity>

goal (1 subgoal):
 1. \<And>x. gv x + ereal (real_cond_exp M Invariants (u 1) x) < \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ?x3 < \<infinity>

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
apply (rule birkhoff_theorem_AE_nonergodic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (u 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subcocycle u

goal (1 subgoal):
 1. integrable M (u 1)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. integrable M (u n)) \<and> (\<forall>n m x. u (n + m) x \<le> u n x + u m ((T ^^ n) x))

goal (1 subgoal):
 1. integrable M (u 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
assume H: "(\<lambda>n. v n x / n) \<longlonglongrightarrow> (gv x)"
                    "(\<lambda>n. birkhoff_sum (u 1) n x / n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x"
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
have "(\<lambda>n. ereal(birkhoff_sum (u 1) n x / n)) \<longlonglongrightarrow> ereal(real_cond_exp M Invariants (u 1) x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. (\<lambda>n. ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants (u 1) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants (u 1) x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants (u 1) x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "u n x = v n x + birkhoff_sum (u 1) n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n x = v n x + birkhoff_sum (u 1) n x
[PROOF STEP]
unfolding v_def birkhoff_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n x = u n x + (\<Sum>i<n. - u 1 ((T ^^ i) x)) + (\<Sum>i<n. u 1 ((T ^^ i) x))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. - u (Suc 0) ((T ^^ i) x)) + (\<Sum>i<n. u (Suc 0) ((T ^^ i) x)) = 0
[PROOF STEP]
by (simp add: sum_negf)
[PROOF STATE]
proof (state)
this:
u n x = v n x + birkhoff_sum (u 1) n x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u n x = v n x + birkhoff_sum (u 1) n x
[PROOF STEP]
have "u n x / n = v n x / n + birkhoff_sum (u 1) n x / n"
[PROOF STATE]
proof (prove)
using this:
u n x = v n x + birkhoff_sum (u 1) n x

goal (1 subgoal):
 1. u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n
[PROOF STEP]
by (simp add: add_divide_distrib)
[PROOF STATE]
proof (state)
this:
u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n
[PROOF STEP]
have "ereal(u n x / n) = ereal(v n x / n) + ereal(birkhoff_sum (u 1) n x / n)"
[PROOF STATE]
proof (prove)
using this:
u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n

goal (1 subgoal):
 1. ereal (u n x / real n) = ereal (v n x / real n) + ereal (birkhoff_sum (u 1) n x / real n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (u n x / real n) = ereal (v n x / real n) + ereal (birkhoff_sum (u 1) n x / real n)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
ereal (u ?n5 x / real ?n5) = ereal (v ?n5 x / real ?n5) + ereal (birkhoff_sum (u 1) ?n5 x / real ?n5)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
ereal (u ?n5 x / real ?n5) = ereal (v ?n5 x / real ?n5) + ereal (birkhoff_sum (u 1) ?n5 x / real ?n5)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "(\<lambda>n. ereal(u n x / n)) \<longlonglongrightarrow> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
unfolding * g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (v n x / real n) + ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> gv x + ereal (real_cond_exp M Invariants (u 1) x)
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<not> (gv x = \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = - \<infinity> \<or> gv x = - \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = \<infinity>)
 2. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
 3. (\<lambda>xa. birkhoff_sum (u 1) xa x / real xa) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (3 subgoals):
 1. \<not> (gv x = \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = - \<infinity> \<or> gv x = - \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = \<infinity>)
 2. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
 3. (\<lambda>xa. birkhoff_sum (u 1) xa x / real xa) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5
[PROOF STEP]
have "AE x in M. (\<lambda>n. ereal(u n x / n)) \<longlonglongrightarrow> g x"
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
using gv(2)
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5
AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
using g_meas g_fin
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
g \<in> borel_measurable Invariants
g ?x3 < \<infinity>

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fpair_vcpower2I[intro]:
  assumes "a \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>" and "b \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>"
  shows "vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>
b \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>
[PROOF STEP]
obtain a' b'
    where a_def: "a = [a']\<^sub>\<circ>" and b_def: "b = [b']\<^sub>\<circ>" and "a'\<in>\<^sub>\<circ> A" and "b'\<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>
b \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>

goal (1 subgoal):
 1. (\<And>a' b'. \<lbrakk>a = [a']\<^sub>\<circ>; b = [b']\<^sub>\<circ>; a' \<in>\<^sub>\<circ> A; b' \<in>\<^sub>\<circ> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force elim: vcons_vcpower1E)
[PROOF STATE]
proof (state)
this:
a = [a']\<^sub>\<circ>
b = [b']\<^sub>\<circ>
a' \<in>\<^sub>\<circ> A
b' \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = [a']\<^sub>\<circ>
b = [b']\<^sub>\<circ>
a' \<in>\<^sub>\<circ> A
b' \<in>\<^sub>\<circ> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = [a']\<^sub>\<circ>
b = [b']\<^sub>\<circ>
a' \<in>\<^sub>\<circ> A
b' \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
by (auto simp: nat_omega_simps)
[PROOF STATE]
proof (state)
this:
vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem explosion_not_valid: "\<not> valid (Explosion (Pro ''p'') (Pro ''q''))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> valid (Imp' (Con' (Pro ''p'') (Neg' (Pro ''p''))) (Pro ''q''))
[PROOF STEP]
using explosion_counterexample transfer
[PROOF STATE]
proof (prove)
using this:
\<not> valid_in {1} (Imp' (Con' (Pro ''p'') (Neg' (Pro ''p''))) (Pro ''q''))
\<not> valid_in ?U ?p \<Longrightarrow> \<not> valid ?p

goal (1 subgoal):
 1. \<not> valid (Imp' (Con' (Pro ''p'') (Neg' (Pro ''p''))) (Pro ''q''))
[PROOF STEP]
by simp