[STATEMENT]
lemma hindered_reduce: \<comment> \<open>Lemma 6.7\<close>
  assumes u: "u \<le> weight \<Gamma>"
  assumes hindered_by: "hindered_by (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) \<epsilon>" (is "hindered_by ?\<Gamma> _")
  shows "hindered \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
note [simp] = u_finite
[PROOF STATE]
proof (state)
this:
u ?y \<noteq> \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
let ?TER = "TER\<^bsub>?\<Gamma>\<^esub>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
from hindered_by
[PROOF STATE]
proof (chain)
picking this:
hindered_by (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) \<epsilon>
[PROOF STEP]
obtain f
    where hindrance_by: "hindrance_by ?\<Gamma> f \<epsilon>"
    and f: "current ?\<Gamma> f"
    and w: "wave ?\<Gamma> f"
[PROOF STATE]
proof (prove)
using this:
hindered_by (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) \<epsilon>

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>hindrance_by (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f \<epsilon>; current (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f; wave (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by cases
[PROOF STATE]
proof (state)
this:
hindrance_by (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f \<epsilon>
current (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f
wave (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
from hindrance_by
[PROOF STATE]
proof (chain)
picking this:
hindrance_by (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f \<epsilon>
[PROOF STEP]
obtain a where a: "a \<in> A \<Gamma>" "a \<notin> \<E>\<^bsub>?\<Gamma>\<^esub> (?TER f)"
    and a_le: "d_OUT f a < weight \<Gamma> a"
    and \<epsilon>_less: "weight \<Gamma> a - d_OUT f a > \<epsilon>"
    and \<epsilon>_nonneg: "\<epsilon> \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
hindrance_by (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f \<epsilon>

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> A \<Gamma>; a \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f); d_OUT f a < weight \<Gamma> a; \<epsilon> < weight \<Gamma> a - d_OUT f a; 0 \<le> \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: u_A hindrance_by.simps)
[PROOF STATE]
proof (state)
this:
a \<in> A \<Gamma>
a \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
d_OUT f a < weight \<Gamma> a
\<epsilon> < weight \<Gamma> a - d_OUT f a
0 \<le> \<epsilon>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
current (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f
[PROOF STEP]
have f': "current \<Gamma> f"
[PROOF STATE]
proof (prove)
using this:
current (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) f

goal (1 subgoal):
 1. current \<Gamma> f
[PROOF STEP]
by(rule current_weight_mono)(auto intro: diff_le_self_ennreal)
[PROOF STATE]
proof (state)
this:
current \<Gamma> f

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
write Some ("\<langle>_\<rangle>")
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define edge'
    where "edge' xo yo =
      (case (xo, yo) of
        (None, Some y) \<Rightarrow> y \<in> \<^bold>V \<and> y \<notin> A \<Gamma>
      | (Some x, Some y) \<Rightarrow> edge \<Gamma> x y \<or> edge \<Gamma> y x
      | _ \<Rightarrow> False)" for xo yo
[PROOF STATE]
proof (state)
this:
edge' ?xo ?yo = (case (?xo, ?yo) of (None, None) \<Rightarrow> False | (None, \<langle>y\<rangle>) \<Rightarrow> y \<in> \<^bold>V \<and> y \<notin> A \<Gamma> | (\<langle>x\<rangle>, None) \<Rightarrow> False | (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> edge \<Gamma> x y \<or> edge \<Gamma> y x)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define cap
    where "cap e =
      (case e of
        (None, Some y) \<Rightarrow> if y \<in> \<^bold>V then u y else 0
      | (Some x, Some y) \<Rightarrow> if edge \<Gamma> x y \<and> x \<noteq> a then f (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) + 1 else 0
      | _ \<Rightarrow> 0)" for e
[PROOF STATE]
proof (state)
this:
cap ?e = (case ?e of (None, None) \<Rightarrow> 0 | (None, \<langle>y\<rangle>) \<Rightarrow> if y \<in> \<^bold>V then u y else 0 | (\<langle>x\<rangle>, None) \<Rightarrow> 0 | (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> if edge \<Gamma> x y \<and> x \<noteq> a then f (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) + 1 else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define \<Psi> where "\<Psi> = \<lparr>edge = edge', capacity = cap, source = None, sink = Some a\<rparr>"
[PROOF STATE]
proof (state)
this:
\<Psi> = \<lparr>edge = edge', capacity = cap, source = None, sink = \<langle>a\<rangle>\<rparr>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have edge'_simps [simp]:
    "edge' None \<langle>y\<rangle> \<longleftrightarrow> y \<in> \<^bold>V \<and> y \<notin> A \<Gamma>"
    "edge' xo None \<longleftrightarrow> False"
    "edge' \<langle>x\<rangle> \<langle>y\<rangle> \<longleftrightarrow> edge \<Gamma> x y \<or> edge \<Gamma> y x"
    for xo x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge' None \<langle>y\<rangle> = (y \<in> \<^bold>V \<and> y \<notin> A \<Gamma>) &&& edge' xo None = False &&& edge' \<langle>x\<rangle> \<langle>y\<rangle> = (edge \<Gamma> x y \<or> edge \<Gamma> y x)
[PROOF STEP]
by(simp_all add: edge'_def split: option.split)
[PROOF STATE]
proof (state)
this:
edge' None \<langle>?y\<rangle> = (?y \<in> \<^bold>V \<and> ?y \<notin> A \<Gamma>)
edge' ?xo None = False
edge' \<langle>?x\<rangle> \<langle>?y\<rangle> = (edge \<Gamma> ?x ?y \<or> edge \<Gamma> ?y ?x)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have edge_None1E [elim!]: thesis if "edge' None y" "\<And>z. \<lbrakk> y = \<langle>z\<rangle>; z \<in> \<^bold>V; z \<notin> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis" for y thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' None y
\<lbrakk>y = \<langle>?z\<rangle>; ?z \<in> \<^bold>V; ?z \<notin> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(simp add: edge'_def split: option.split_asm sum.split_asm)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' None ?y; \<And>z. \<lbrakk>?y = \<langle>z\<rangle>; z \<in> \<^bold>V; z \<notin> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have edge_Some1E [elim!]: thesis if "edge' \<langle>x\<rangle> y" "\<And>z. \<lbrakk> y = \<langle>z\<rangle>; edge \<Gamma> x z \<or> edge \<Gamma> z x \<rbrakk> \<Longrightarrow> thesis" for x y thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' \<langle>x\<rangle> y
\<lbrakk>y = \<langle>?z\<rangle>; edge \<Gamma> x ?z \<or> edge \<Gamma> ?z x\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(simp add: edge'_def split: option.split_asm sum.split_asm)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' \<langle>?x\<rangle> ?y; \<And>z. \<lbrakk>?y = \<langle>z\<rangle>; edge \<Gamma> ?x z \<or> edge \<Gamma> z ?x\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have edge_Some2E [elim!]: thesis if "edge' x \<langle>y\<rangle>" "\<lbrakk> x = None; y \<in> \<^bold>V; y \<notin> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis" "\<And>z. \<lbrakk> x = \<langle>z\<rangle>; edge \<Gamma> z y \<or> edge \<Gamma> y z \<rbrakk> \<Longrightarrow> thesis" for x y thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' x \<langle>y\<rangle>
\<lbrakk>x = None; y \<in> \<^bold>V; y \<notin> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis
\<lbrakk>x = \<langle>?z\<rangle>; edge \<Gamma> ?z y \<or> edge \<Gamma> y ?z\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(simp add: edge'_def split: option.split_asm sum.split_asm)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' ?x \<langle>?y\<rangle>; \<lbrakk>?x = None; ?y \<in> \<^bold>V; ?y \<notin> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis; \<And>z. \<lbrakk>?x = \<langle>z\<rangle>; edge \<Gamma> z ?y \<or> edge \<Gamma> ?y z\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have cap_simps [simp]:
    "cap (None, \<langle>y\<rangle>) = (if y \<in> \<^bold>V then u y else 0)"
    "cap (xo, None) = 0"
    "cap (\<langle>x\<rangle>, \<langle>y\<rangle>) =
    (if edge \<Gamma> x y \<and> x \<noteq> a then f (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) + 1 else 0)"
    for xo x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cap (None, \<langle>y\<rangle>) = (if y \<in> \<^bold>V then u y else 0) &&& cap (xo, None) = 0 &&& cap (\<langle>x\<rangle>, \<langle>y\<rangle>) = (if edge \<Gamma> x y \<and> x \<noteq> a then f (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) + 1 else 0)
[PROOF STEP]
by(simp_all add: cap_def split: option.split)
[PROOF STATE]
proof (state)
this:
cap (None, \<langle>?y\<rangle>) = (if ?y \<in> \<^bold>V then u ?y else 0)
cap (?xo, None) = 0
cap (\<langle>?x\<rangle>, \<langle>?y\<rangle>) = (if edge \<Gamma> ?x ?y \<and> ?x \<noteq> a then f (?x, ?y) else if edge \<Gamma> ?y ?x then max (weight \<Gamma> ?x) (weight \<Gamma> ?y) + 1 else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have \<Psi>_sel [simp]:
    "edge \<Psi> = edge'"
    "capacity \<Psi> = cap"
    "source \<Psi> = None"
    "sink \<Psi> = \<langle>a\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (edge \<Psi> = edge' &&& capacity \<Psi> = cap) &&& source \<Psi> = None &&& sink \<Psi> = \<langle>a\<rangle>
[PROOF STEP]
by(simp_all add: \<Psi>_def)
[PROOF STATE]
proof (state)
this:
edge \<Psi> = edge'
capacity \<Psi> = cap
source \<Psi> = None
sink \<Psi> = \<langle>a\<rangle>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have cap_outside1: "\<not> vertex \<Gamma> x \<Longrightarrow> cap (\<langle>x\<rangle>, y) = 0" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> vertex \<Gamma> x \<Longrightarrow> cap (\<langle>x\<rangle>, y) = 0
[PROOF STEP]
by(cases y)(auto simp add: vertex_def)
[PROOF STATE]
proof (state)
this:
\<not> vertex \<Gamma> ?x \<Longrightarrow> cap (\<langle>?x\<rangle>, ?y) = 0

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have capacity_A_weight: "d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x" if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y\<in>range Some. f (x, the y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y\<in>range Some. f (x, the y))
[PROOF STEP]
using that disjoint a(1)
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
a \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y\<in>range Some. f (x, the y))
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
a \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. cap (\<langle>x\<rangle>, y)) \<le> (\<Sum>\<^sup>+ y\<in>range Some. f (x, the y))
[PROOF STEP]
by(auto 4 4 intro!: nn_integral_mono simp add: nn_integral_count_space_indicator notin_range_Some currentD_outside[OF f] split: split_indicator dest: edge_antiparallel bipartite_E)
[PROOF STATE]
proof (state)
this:
d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y\<in>range Some. f (x, the y))

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y\<in>range Some. f (x, the y))

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> = d_OUT f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. f (x, the y)) = d_OUT f x
[PROOF STEP]
by(simp add: d_OUT_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. f (x, the y)) = d_OUT f x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. f (x, the y)) = d_OUT f x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f x \<le> weight \<Gamma> x
[PROOF STEP]
using f'
[PROOF STATE]
proof (prove)
using this:
current \<Gamma> f

goal (1 subgoal):
 1. d_OUT f x \<le> weight \<Gamma> x
[PROOF STEP]
by(rule currentD_weight_OUT)
[PROOF STATE]
proof (state)
this:
d_OUT f x \<le> weight \<Gamma> x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Gamma> \<Longrightarrow> d_OUT cap \<langle>?x\<rangle> \<le> weight \<Gamma> ?x

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have flow_attainability: "flow_attainability \<Psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow_attainability \<Psi>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. countable \<^bold>E\<^bsub>\<Psi>\<^esub>
 2. source \<Psi> \<noteq> sink \<Psi>
 3. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 4. \<And>e. capacity \<Psi> e \<noteq> \<top>
 5. \<And>x. x \<noteq> sink \<Psi> \<Longrightarrow> d_IN (capacity \<Psi>) x \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) x \<noteq> \<top>
 6. \<And>x. \<not> edge \<Psi> x x
 7. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
have "\<^bold>E\<^bsub>\<Psi>\<^esub> = (\<lambda>(x, y). (\<langle>x\<rangle>, \<langle>y\<rangle>)) ` \<^bold>E \<union> (\<lambda>(x, y). (\<langle>y\<rangle>, \<langle>x\<rangle>)) ` \<^bold>E \<union> (\<lambda>x. (None, \<langle>x\<rangle>)) ` (\<^bold>V \<inter> - A \<Gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>E\<^bsub>\<Psi>\<^esub> = (\<lambda>(x, y). (\<langle>x\<rangle>, \<langle>y\<rangle>)) ` \<^bold>E \<union> (\<lambda>(x, y). (\<langle>y\<rangle>, \<langle>x\<rangle>)) ` \<^bold>E \<union> (\<lambda>x. (None, \<langle>x\<rangle>)) ` (\<^bold>V \<inter> - A \<Gamma>)
[PROOF STEP]
by(auto simp add: edge'_def split: option.split_asm)
[PROOF STATE]
proof (state)
this:
\<^bold>E\<^bsub>\<Psi>\<^esub> = (\<lambda>(x, y). (\<langle>x\<rangle>, \<langle>y\<rangle>)) ` \<^bold>E \<union> (\<lambda>(x, y). (\<langle>y\<rangle>, \<langle>x\<rangle>)) ` \<^bold>E \<union> (\<lambda>x. (None, \<langle>x\<rangle>)) ` (\<^bold>V \<inter> - A \<Gamma>)

goal (7 subgoals):
 1. countable \<^bold>E\<^bsub>\<Psi>\<^esub>
 2. source \<Psi> \<noteq> sink \<Psi>
 3. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 4. \<And>e. capacity \<Psi> e \<noteq> \<top>
 5. \<And>x. x \<noteq> sink \<Psi> \<Longrightarrow> d_IN (capacity \<Psi>) x \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) x \<noteq> \<top>
 6. \<And>x. \<not> edge \<Psi> x x
 7. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
thus "countable \<^bold>E\<^bsub>\<Psi>\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<^bold>E\<^bsub>\<Psi>\<^esub> = (\<lambda>(x, y). (\<langle>x\<rangle>, \<langle>y\<rangle>)) ` \<^bold>E \<union> (\<lambda>(x, y). (\<langle>y\<rangle>, \<langle>x\<rangle>)) ` \<^bold>E \<union> (\<lambda>x. (None, \<langle>x\<rangle>)) ` (\<^bold>V \<inter> - A \<Gamma>)

goal (1 subgoal):
 1. countable \<^bold>E\<^bsub>\<Psi>\<^esub>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
countable \<^bold>E\<^bsub>\<Psi>\<^esub>

goal (6 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>e. capacity \<Psi> e \<noteq> \<top>
 4. \<And>x. x \<noteq> sink \<Psi> \<Longrightarrow> d_IN (capacity \<Psi>) x \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) x \<noteq> \<top>
 5. \<And>x. \<not> edge \<Psi> x x
 6. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>e. capacity \<Psi> e \<noteq> \<top>
 4. \<And>x. x \<noteq> sink \<Psi> \<Longrightarrow> d_IN (capacity \<Psi>) x \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) x \<noteq> \<top>
 5. \<And>x. \<not> edge \<Psi> x x
 6. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>e. capacity \<Psi> e \<noteq> \<top>
 4. \<And>x. x \<noteq> sink \<Psi> \<Longrightarrow> d_IN (capacity \<Psi>) x \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) x \<noteq> \<top>
 5. \<And>x. \<not> edge \<Psi> x x
 6. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
assume "v \<noteq> sink \<Psi>"
[PROOF STATE]
proof (state)
this:
v \<noteq> sink \<Psi>

goal (6 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>e. capacity \<Psi> e \<noteq> \<top>
 4. \<And>x. x \<noteq> sink \<Psi> \<Longrightarrow> d_IN (capacity \<Psi>) x \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) x \<noteq> \<top>
 5. \<And>x. \<not> edge \<Psi> x x
 6. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
consider (sink) "v = None" | (A) x where "v = \<langle>x\<rangle>" "x \<in> A \<Gamma>"
      | (B) y where "v = \<langle>y\<rangle>" "y \<notin> A \<Gamma>" "y \<in> \<^bold>V" | (outside) x where "v = \<langle>x\<rangle>" "x \<notin> \<^bold>V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v = None \<Longrightarrow> thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by(cases v) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>v = None \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis; \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (6 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>e. capacity \<Psi> e \<noteq> \<top>
 4. \<And>x. x \<noteq> sink \<Psi> \<Longrightarrow> d_IN (capacity \<Psi>) x \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) x \<noteq> \<top>
 5. \<And>x. \<not> edge \<Psi> x x
 6. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>v = None \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis; \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>v = None \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis; \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. v = None \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 3. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 4. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
case sink
[PROOF STATE]
proof (state)
this:
v = None

goal (4 subgoals):
 1. v = None \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 3. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 4. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v = None

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
by(simp add: d_IN_def)
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>

goal (3 subgoals):
 1. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 3. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 3. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
case (A x)
[PROOF STATE]
proof (state)
this:
v = \<langle>x\<rangle>
x \<in> A \<Gamma>

goal (3 subgoals):
 1. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 3. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v = \<langle>x\<rangle>
x \<in> A \<Gamma>

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
using capacity_A_weight[of x]
[PROOF STATE]
proof (prove)
using this:
v = \<langle>x\<rangle>
x \<in> A \<Gamma>
x \<in> A \<Gamma> \<Longrightarrow> d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
by (auto simp: top_unique)
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
case (B y)
[PROOF STATE]
proof (state)
this:
v = \<langle>y\<rangle>
y \<notin> A \<Gamma>
y \<in> \<^bold>V

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
have "d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x)
[PROOF STEP]
using B disjoint bipartite_V a(1)
[PROOF STATE]
proof (prove)
using this:
v = \<langle>y\<rangle>
y \<notin> A \<Gamma>
y \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>
a \<in> A \<Gamma>

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x)
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
using this:
v = \<langle>y\<rangle>
y \<notin> A \<Gamma>
y \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>
a \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x. capacity \<Psi> (x, v)) \<le> (\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x)
[PROOF STEP]
by(auto 4 4 intro!: nn_integral_mono simp add: nn_integral_count_space_indicator notin_range_Some currentD_outside[OF f] split: split_indicator dest: edge_antiparallel bipartite_E)
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x)

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x)

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ x\<in>range Some. f (the x, y)) + u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x) = (\<Sum>\<^sup>+ x\<in>range Some. f (the x, y)) + u y
[PROOF STEP]
by(subst nn_integral_add)(simp_all add: nn_integral_count_space_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x) = (\<Sum>\<^sup>+ x\<in>range Some. f (the x, y)) + u y

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ x. f (the x, y) * indicator (range Some) x + u y * indicator {None} x) = (\<Sum>\<^sup>+ x\<in>range Some. f (the x, y)) + u y

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
have "\<dots> = d_IN f y + u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x\<in>range Some. f (the x, y)) + u y = d_IN f y + u y
[PROOF STEP]
by(simp add: d_IN_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ x\<in>range Some. f (the x, y)) + u y = d_IN f y + u y

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ x\<in>range Some. f (the x, y)) + u y = d_IN f y + u y

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
have "d_IN f y \<le> weight \<Gamma> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN f y \<le> weight \<Gamma> y
[PROOF STEP]
using f'
[PROOF STATE]
proof (prove)
using this:
current \<Gamma> f

goal (1 subgoal):
 1. d_IN f y \<le> weight \<Gamma> y
[PROOF STEP]
by(rule currentD_weight_IN)
[PROOF STATE]
proof (state)
this:
d_IN f y \<le> weight \<Gamma> y

goal (2 subgoals):
 1. \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
 2. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x ya. x \<le> ya \<Longrightarrow> x + u y \<le> ya + u y) \<Longrightarrow> d_IN (capacity \<Psi>) v \<le> weight \<Gamma> y + u y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x ya. x \<le> ya \<Longrightarrow> x + u y \<le> ya + u y) \<Longrightarrow> d_IN (capacity \<Psi>) v \<le> weight \<Gamma> y + u y

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
by(auto simp add: add_right_mono top_unique split: if_split_asm)
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
case outside
[PROOF STATE]
proof (state)
this:
v = \<langle>x\<rangle>
x \<notin> \<^bold>V

goal (1 subgoal):
 1. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
hence "d_OUT (capacity \<Psi>) v = 0"
[PROOF STATE]
proof (prove)
using this:
v = \<langle>x\<rangle>
x \<notin> \<^bold>V

goal (1 subgoal):
 1. d_OUT (capacity \<Psi>) v = 0
[PROOF STEP]
by(auto simp add: d_OUT_def nn_integral_0_iff_AE AE_count_space cap_def vertex_def split: option.split)
[PROOF STATE]
proof (state)
this:
d_OUT (capacity \<Psi>) v = 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT (capacity \<Psi>) v = 0

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<noteq> \<top> \<or> d_OUT (capacity \<Psi>) v \<noteq> \<top>

goal (5 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>e. capacity \<Psi> e \<noteq> \<top>
 4. \<And>x. \<not> edge \<Psi> x x
 5. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>e. capacity \<Psi> e \<noteq> \<top>
 4. \<And>x. \<not> edge \<Psi> x x
 5. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
show "capacity \<Psi> e \<noteq> \<top>" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. capacity \<Psi> e \<noteq> \<top>
[PROOF STEP]
using weight_finite
[PROOF STATE]
proof (prove)
using this:
weight \<Gamma> ?x \<noteq> \<top>

goal (1 subgoal):
 1. capacity \<Psi> e \<noteq> \<top>
[PROOF STEP]
by(auto simp add: cap_def max_def vertex_def currentD_finite[OF f'] split: option.split prod.split simp del: weight_finite)
[PROOF STATE]
proof (state)
this:
capacity \<Psi> ?e \<noteq> \<top>

goal (4 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>e. e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> e = 0
 3. \<And>x. \<not> edge \<Psi> x x
 4. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
show "capacity \<Psi> e = 0" if "e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub>" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. capacity \<Psi> e = 0
[PROOF STEP]
using that bipartite_V disjoint
[PROOF STATE]
proof (prove)
using this:
e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub>
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. capacity \<Psi> e = 0
[PROOF STEP]
by(auto simp add: cap_def max_def intro: u_outside split: option.split prod.split)
[PROOF STATE]
proof (state)
this:
?e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> ?e = 0

goal (3 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>x. \<not> edge \<Psi> x x
 3. \<And>x. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
show "\<not> edge \<Psi> x (source \<Psi>)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> edge \<Psi> ?x (source \<Psi>)

goal (2 subgoals):
 1. source \<Psi> \<noteq> sink \<Psi>
 2. \<And>x. \<not> edge \<Psi> x x
[PROOF STEP]
show "\<not> edge \<Psi> x x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> edge \<Psi> x x
[PROOF STEP]
by(cases x)(simp_all add: no_loop)
[PROOF STATE]
proof (state)
this:
\<not> edge \<Psi> ?x ?x

goal (1 subgoal):
 1. source \<Psi> \<noteq> sink \<Psi>
[PROOF STEP]
show "source \<Psi> \<noteq> sink \<Psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. source \<Psi> \<noteq> sink \<Psi>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
source \<Psi> \<noteq> sink \<Psi>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
flow_attainability \<Psi>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
flow_attainability \<Psi>
[PROOF STEP]
interpret \<Psi>: flow_attainability "\<Psi>"
[PROOF STATE]
proof (prove)
using this:
flow_attainability \<Psi>

goal (1 subgoal):
 1. flow_attainability \<Psi>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define \<alpha> where "\<alpha> = (\<Squnion>g\<in>{g. flow \<Psi> g}. value_flow \<Psi> g)"
[PROOF STATE]
proof (state)
this:
\<alpha> = \<Squnion> (value_flow \<Psi> ` {g. flow \<Psi> g})

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have \<alpha>_le: "\<alpha> \<le> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
have "\<alpha> \<le> d_OUT cap None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<le> d_OUT cap None
[PROOF STEP]
unfolding \<alpha>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>)) \<le> d_OUT cap None
[PROOF STEP]
by(rule SUP_least)(auto intro!: d_OUT_mono dest: flowD_capacity)
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> d_OUT cap None

goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> d_OUT cap None

goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
have "\<dots> \<le> \<integral>\<^sup>+ y. cap (None, y) \<partial>count_space (range Some)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT cap None \<le> (\<Sum>\<^sup>+ y\<in>range Some. cap (None, y))
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. cap (None, y)) \<le> (\<Sum>\<^sup>+ y\<in>range Some. cap (None, y))
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator notin_range_Some intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (state)
this:
d_OUT cap None \<le> (\<Sum>\<^sup>+ y\<in>range Some. cap (None, y))

goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT cap None \<le> (\<Sum>\<^sup>+ y\<in>range Some. cap (None, y))

goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
have "\<dots> \<le> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. cap (None, y)) \<le> \<epsilon>
[PROOF STEP]
unfolding \<epsilon>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. cap (None, y)) \<le> integral\<^sup>N (count_space (B \<Gamma>)) u
[PROOF STEP]
by (subst (2) nn_integral_count_space_indicator, auto simp add: nn_integral_count_space_reindex u_outside intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. cap (None, y)) \<le> \<epsilon>

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

goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> \<epsilon>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> \<epsilon>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> \<le> \<epsilon>
[PROOF STEP]
have finite_flow: "\<alpha> \<noteq> \<top>"
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<le> \<epsilon>

goal (1 subgoal):
 1. \<alpha> \<noteq> \<top>
[PROOF STEP]
using finite_\<epsilon>
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<le> \<epsilon>
\<epsilon> \<noteq> \<top>

goal (1 subgoal):
 1. \<alpha> \<noteq> \<top>
[PROOF STEP]
by (auto simp: top_unique)
[PROOF STATE]
proof (state)
this:
\<alpha> \<noteq> \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
from \<Psi>.ex_max_flow
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. flow \<Psi> f \<and> value_flow \<Psi> f = \<Squnion> (value_flow \<Psi> ` {g. flow \<Psi> g}) \<and> (\<forall>x. d_IN f x \<le> value_flow \<Psi> f)
[PROOF STEP]
obtain j where j: "flow \<Psi> j"
    and value_j: "value_flow \<Psi> j = \<alpha>"
    and IN_j: "\<And>x. d_IN j x \<le> \<alpha>"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. flow \<Psi> f \<and> value_flow \<Psi> f = \<Squnion> (value_flow \<Psi> ` {g. flow \<Psi> g}) \<and> (\<forall>x. d_IN f x \<le> value_flow \<Psi> f)

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>flow \<Psi> j; value_flow \<Psi> j = \<alpha>; \<And>x. d_IN j x \<le> \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding \<alpha>_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f. flow \<Psi> f \<and> value_flow \<Psi> f = \<Squnion> (value_flow \<Psi> ` {g. flow \<Psi> g}) \<and> (\<forall>x. d_IN f x \<le> value_flow \<Psi> f)

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>flow \<Psi> j; value_flow \<Psi> j = \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>)); \<And>x. d_IN j x \<le> \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
flow \<Psi> j
value_flow \<Psi> j = \<alpha>
d_IN j ?x \<le> \<alpha>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have j_le_f: "j (Some x, Some y) \<le> f (x, y)" if "edge \<Gamma> x y" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j (\<langle>x\<rangle>, \<langle>y\<rangle>) \<le> f (x, y)
[PROOF STEP]
using that flowD_capacity[OF j, of "(Some x, Some y)"] a(1) disjoint
[PROOF STATE]
proof (prove)
using this:
edge \<Gamma> x y
j (\<langle>x\<rangle>, \<langle>y\<rangle>) \<le> capacity \<Psi> (\<langle>x\<rangle>, \<langle>y\<rangle>)
a \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. j (\<langle>x\<rangle>, \<langle>y\<rangle>) \<le> f (x, y)
[PROOF STEP]
by(auto split: if_split_asm dest: bipartite_E intro: order_trans)
[PROOF STATE]
proof (state)
this:
edge \<Gamma> ?x ?y \<Longrightarrow> j (\<langle>?x\<rangle>, \<langle>?y\<rangle>) \<le> f (?x, ?y)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have IN_j_finite [simp]: "d_IN j x \<noteq> \<top>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j x \<noteq> \<top>
[PROOF STEP]
using finite_flow
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<noteq> \<top>

goal (1 subgoal):
 1. d_IN j x \<noteq> \<top>
[PROOF STEP]
by(rule neq_top_trans)(simp add: IN_j)
[PROOF STATE]
proof (state)
this:
d_IN j ?x \<noteq> \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have j_finite[simp]: "j (x, y) < \<top>" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j (x, y) < \<top>
[PROOF STEP]
by (rule le_less_trans[OF d_IN_ge_point]) (simp add: IN_j_finite[of y] less_top[symmetric])
[PROOF STATE]
proof (state)
this:
j (?x, ?y) < \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_j_finite: "d_OUT j x \<noteq> \<top>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT j x \<noteq> \<top>
[PROOF STEP]
proof(cases "x = source \<Psi> \<or> x = sink \<Psi>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = source \<Psi> \<or> x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
 2. \<not> (x = source \<Psi> \<or> x = sink \<Psi>) \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = source \<Psi> \<or> x = sink \<Psi>

goal (2 subgoals):
 1. x = source \<Psi> \<or> x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
 2. \<not> (x = source \<Psi> \<or> x = sink \<Psi>) \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x = source \<Psi> \<or> x = sink \<Psi>

goal (1 subgoal):
 1. d_OUT j x \<noteq> \<top>
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = source \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
 2. x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
case left
[PROOF STATE]
proof (state)
this:
x = source \<Psi>

goal (2 subgoals):
 1. x = source \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
 2. x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x = source \<Psi>

goal (1 subgoal):
 1. d_OUT j x \<noteq> \<top>
[PROOF STEP]
using finite_flow value_j
[PROOF STATE]
proof (prove)
using this:
x = source \<Psi>
\<alpha> \<noteq> \<top>
value_flow \<Psi> j = \<alpha>

goal (1 subgoal):
 1. d_OUT j x \<noteq> \<top>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_OUT j x \<noteq> \<top>

goal (1 subgoal):
 1. x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
case right
[PROOF STATE]
proof (state)
this:
x = sink \<Psi>

goal (1 subgoal):
 1. x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
have "d_OUT (capacity \<Psi>) \<langle>a\<rangle> \<noteq> \<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (capacity \<Psi>) \<langle>a\<rangle> \<noteq> \<top>
[PROOF STEP]
using capacity_A_weight[of a] a(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<Gamma> \<Longrightarrow> d_OUT cap \<langle>a\<rangle> \<le> weight \<Gamma> a
a \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT (capacity \<Psi>) \<langle>a\<rangle> \<noteq> \<top>
[PROOF STEP]
by(auto simp: top_unique)
[PROOF STATE]
proof (state)
this:
d_OUT (capacity \<Psi>) \<langle>a\<rangle> \<noteq> \<top>

goal (1 subgoal):
 1. x = sink \<Psi> \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT (capacity \<Psi>) \<langle>a\<rangle> \<noteq> \<top>

goal (1 subgoal):
 1. d_OUT j x \<noteq> \<top>
[PROOF STEP]
unfolding right[simplified]
[PROOF STATE]
proof (prove)
using this:
d_OUT (capacity \<Psi>) \<langle>a\<rangle> \<noteq> \<top>

goal (1 subgoal):
 1. d_OUT j \<langle>a\<rangle> \<noteq> \<top>
[PROOF STEP]
by(rule neq_top_trans)(rule d_OUT_mono flowD_capacity[OF j])+
[PROOF STATE]
proof (state)
this:
d_OUT j x \<noteq> \<top>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT j x \<noteq> \<top>

goal (1 subgoal):
 1. \<not> (x = source \<Psi> \<or> x = sink \<Psi>) \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (x = source \<Psi> \<or> x = sink \<Psi>) \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (x = source \<Psi> \<or> x = sink \<Psi>)

goal (1 subgoal):
 1. \<not> (x = source \<Psi> \<or> x = sink \<Psi>) \<Longrightarrow> d_OUT j x \<noteq> \<top>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (x = source \<Psi> \<or> x = sink \<Psi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (x = source \<Psi> \<or> x = sink \<Psi>)

goal (1 subgoal):
 1. d_OUT j x \<noteq> \<top>
[PROOF STEP]
by(simp add: flowD_KIR[OF j])
[PROOF STATE]
proof (state)
this:
d_OUT j x \<noteq> \<top>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT j ?x \<noteq> \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have IN_j_le_weight: "d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
proof(cases "x \<in> A \<Gamma>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> A \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
case xA: True
[PROOF STATE]
proof (state)
this:
x \<in> A \<Gamma>

goal (2 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> A \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
proof(cases "x = a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = a

goal (2 subgoals):
 1. x = a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "d_IN j \<langle>x\<rangle> \<le> \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> \<alpha>
[PROOF STEP]
by(rule IN_j)
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> \<alpha>

goal (2 subgoals):
 1. x = a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> \<alpha>

goal (2 subgoals):
 1. x = a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
by(rule \<alpha>_le)
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> \<epsilon>

goal (2 subgoals):
 1. x = a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> \<epsilon>

goal (2 subgoals):
 1. x = a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<epsilon> < weight \<Gamma> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon> < weight \<Gamma> a
[PROOF STEP]
using \<epsilon>_less diff_le_self_ennreal less_le_trans
[PROOF STATE]
proof (prove)
using this:
\<epsilon> < weight \<Gamma> a - d_OUT f a
?a - ?b \<le> ?a
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. \<epsilon> < weight \<Gamma> a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<epsilon> < weight \<Gamma> a

goal (2 subgoals):
 1. x = a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN j \<langle>x\<rangle> < weight \<Gamma> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN j \<langle>x\<rangle> < weight \<Gamma> a

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
d_IN j \<langle>x\<rangle> < weight \<Gamma> a
x = a

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
by(auto intro: order.strict_implies_order)
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> a

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "d_IN j \<langle>x\<rangle> = d_OUT j \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
using flowD_KIR[OF j, of "Some x"] False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<langle>x\<rangle> \<noteq> source \<Psi>; \<langle>x\<rangle> \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j \<langle>x\<rangle>
x \<noteq> a

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> = d_OUT j \<langle>x\<rangle>

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> = d_OUT j \<langle>x\<rangle>

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> d_OUT cap \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT j \<langle>x\<rangle> \<le> d_OUT cap \<langle>x\<rangle>
[PROOF STEP]
using flowD_capacity[OF j]
[PROOF STATE]
proof (prove)
using this:
j ?e \<le> capacity \<Psi> ?e

goal (1 subgoal):
 1. d_OUT j \<langle>x\<rangle> \<le> d_OUT cap \<langle>x\<rangle>
[PROOF STEP]
by(auto intro: d_OUT_mono)
[PROOF STATE]
proof (state)
this:
d_OUT j \<langle>x\<rangle> \<le> d_OUT cap \<langle>x\<rangle>

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT j \<langle>x\<rangle> \<le> d_OUT cap \<langle>x\<rangle>

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
using xA
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
by(rule capacity_A_weight)
[PROOF STATE]
proof (state)
this:
d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. x \<noteq> a \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. x \<notin> A \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> A \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
case xA: False
[PROOF STATE]
proof (state)
this:
x \<notin> A \<Gamma>

goal (1 subgoal):
 1. x \<notin> A \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
proof(cases "x \<in> B \<Gamma>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> B \<Gamma>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "d_IN j \<langle>x\<rangle> \<le> d_IN cap \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> d_IN cap \<langle>x\<rangle>
[PROOF STEP]
using flowD_capacity[OF j]
[PROOF STATE]
proof (prove)
using this:
j ?e \<le> capacity \<Psi> ?e

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> d_IN cap \<langle>x\<rangle>
[PROOF STEP]
by(auto intro: d_IN_mono)
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> d_IN cap \<langle>x\<rangle>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> d_IN cap \<langle>x\<rangle>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> (\<Sum>\<^sup>+ z. f (the z, x) * indicator (range Some) z) + (\<Sum>\<^sup>+ z :: 'v option. u x * indicator {None} z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN cap \<langle>x\<rangle> \<le> (\<integral>\<^sup>+z\<in>range Some. f (the z, x)\<partial>count_space UNIV) + (\<integral>\<^sup>+z\<in>{None}. u x\<partial>count_space UNIV)
[PROOF STEP]
using True disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. d_IN cap \<langle>x\<rangle> \<le> (\<integral>\<^sup>+z\<in>range Some. f (the z, x)\<partial>count_space UNIV) + (\<integral>\<^sup>+z\<in>{None}. u x\<partial>count_space UNIV)
[PROOF STEP]
by(subst nn_integral_add[symmetric])(auto simp add: vertex_def currentD_outside[OF f] d_IN_def B_out intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (state)
this:
d_IN cap \<langle>x\<rangle> \<le> (\<integral>\<^sup>+z\<in>range Some. f (the z, x)\<partial>count_space UNIV) + (\<integral>\<^sup>+z\<in>{None}. u x\<partial>count_space UNIV)

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN cap \<langle>x\<rangle> \<le> (\<integral>\<^sup>+z\<in>range Some. f (the z, x)\<partial>count_space UNIV) + (\<integral>\<^sup>+z\<in>{None}. u x\<partial>count_space UNIV)

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> = d_IN f x + u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+z\<in>range Some. f (the z, x)\<partial>count_space UNIV) + (\<integral>\<^sup>+z\<in>{None}. u x\<partial>count_space UNIV) = d_IN f x + u x
[PROOF STEP]
by(simp add: nn_integral_count_space_indicator[symmetric] nn_integral_count_space_reindex d_IN_def)
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+z\<in>range Some. f (the z, x)\<partial>count_space UNIV) + (\<integral>\<^sup>+z\<in>{None}. u x\<partial>count_space UNIV) = d_IN f x + u x

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+z\<in>range Some. f (the z, x)\<partial>count_space UNIV) + (\<integral>\<^sup>+z\<in>{None}. u x\<partial>count_space UNIV) = d_IN f x + u x

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN f x + u x \<le> weight \<Gamma> x
[PROOF STEP]
using currentD_weight_IN[OF f, of x] u_finite[of x]
[PROOF STATE]
proof (prove)
using this:
d_IN f x \<le> weight (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) x
u x \<noteq> \<top>

goal (1 subgoal):
 1. d_IN f x + u x \<le> weight \<Gamma> x
[PROOF STEP]
using \<epsilon>_less u
[PROOF STATE]
proof (prove)
using this:
d_IN f x \<le> weight (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) x
u x \<noteq> \<top>
\<epsilon> < weight \<Gamma> a - d_OUT f a
u \<le> weight \<Gamma>

goal (1 subgoal):
 1. d_IN f x + u x \<le> weight \<Gamma> x
[PROOF STEP]
by (auto simp add: ennreal_le_minus_iff le_fun_def)
[PROOF STATE]
proof (state)
this:
d_IN f x + u x \<le> weight \<Gamma> x

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> B \<Gamma>

goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
with xA
[PROOF STATE]
proof (chain)
picking this:
x \<notin> A \<Gamma>
x \<notin> B \<Gamma>
[PROOF STEP]
have "x \<notin> \<^bold>V"
[PROOF STATE]
proof (prove)
using this:
x \<notin> A \<Gamma>
x \<notin> B \<Gamma>

goal (1 subgoal):
 1. x \<notin> \<^bold>V
[PROOF STEP]
using bipartite_V
[PROOF STATE]
proof (prove)
using this:
x \<notin> A \<Gamma>
x \<notin> B \<Gamma>
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>

goal (1 subgoal):
 1. x \<notin> \<^bold>V
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<notin> \<^bold>V

goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> \<^bold>V
[PROOF STEP]
have "d_IN j \<langle>x\<rangle> = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<^bold>V

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> = 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<^bold>V
x \<notin> B \<Gamma>

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> = 0
[PROOF STEP]
by(auto simp add: d_IN_def nn_integral_0_iff emeasure_count_space_eq_0 vertex_def edge'_def split: option.split_asm intro!: \<Psi>.flowD_outside[OF j])
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> = 0

goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d_IN j \<langle>x\<rangle> = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN j \<langle>x\<rangle> = 0

goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> \<le> weight \<Gamma> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>?x\<rangle> \<le> weight \<Gamma> ?x

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
let ?j = "j \<circ> map_prod Some Some \<circ> prod.swap"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have finite_j_OUT: "(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) \<noteq> \<top>" (is "?j_OUT \<noteq> _") if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) \<noteq> \<top>
[PROOF STEP]
using currentD_finite_OUT[OF f', of x]
[PROOF STATE]
proof (prove)
using this:
d_OUT f x \<noteq> \<top>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) \<noteq> \<top>
[PROOF STEP]
by(rule neq_top_trans)(auto intro!: nn_integral_mono j_le_f simp add: d_OUT_def nn_integral_count_space_indicator outgoing_def split: split_indicator)
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Gamma> \<Longrightarrow> (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T ?x. j (\<langle>?x\<rangle>, \<langle>y\<rangle>)) \<noteq> \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have j_OUT_eq: "?j_OUT x = d_OUT j \<langle>x\<rangle>" if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "?j_OUT x = (\<Sum>\<^sup>+ y\<in>range Some. j (Some x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))
[PROOF STEP]
using that disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex)(auto 4 4 simp add: nn_integral_count_space_indicator outgoing_def intro!: nn_integral_cong \<Psi>.flowD_outside[OF j] dest: bipartite_E split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "\<dots> = d_OUT j \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
by(auto simp add: d_OUT_def nn_integral_count_space_indicator notin_range_Some intro!: nn_integral_cong \<Psi>.flowD_outside[OF j] split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y)) = d_OUT j \<langle>x\<rangle>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Gamma> \<Longrightarrow> (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T ?x. j (\<langle>?x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>?x\<rangle>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define g where "g = f \<oplus> ?j"
[PROOF STATE]
proof (state)
this:
g = f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have g_simps: "g (x, y) = (f \<oplus> ?j) (x, y)" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (x, y) = (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) (x, y)
[PROOF STEP]
by(simp add: g_def)
[PROOF STATE]
proof (state)
this:
g (?x, ?y) = (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) (?x, ?y)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_g_A: "d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>" if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "d_OUT g x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>))
[PROOF STEP]
by(auto simp add: d_OUT_def g_simps currentD_outside[OF f'] outgoing_def nn_integral_count_space_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
d_OUT g x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT g x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))"
      (is "_ = _ - ?j_OUT")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))
[PROOF STEP]
using finite_j_OUT[OF that]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) \<noteq> \<top>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))
[PROOF STEP]
by(subst nn_integral_diff)(auto simp add: AE_count_space outgoing_def intro!: order_trans[OF j_le_f])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>) - j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y)) + (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (Some y, Some x)) - ?j_OUT"
      (is "_ = ?f + ?j_IN - _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y)) + (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))
[PROOF STEP]
by(subst nn_integral_add) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y)) + (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y) + j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y)) + (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "?f = d_OUT f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y)) = d_OUT f x
[PROOF STEP]
by(subst d_OUT_alt_def[where G=\<Gamma>])(simp_all add: currentD_outside[OF f])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y)) = d_OUT f x

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. f (x, y)) = d_OUT f x

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "?j_OUT = d_OUT j \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
by(rule j_OUT_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = d_OUT j \<langle>x\<rangle>

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "?j_IN = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))
[PROOF STEP]
using that disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex)(auto 4 4 simp add: nn_integral_count_space_indicator outgoing_def intro!: nn_integral_cong \<Psi>.flowD_outside[OF j] split: split_indicator dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
have "\<dots> = d_IN j (Some x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle>
[PROOF STEP]
using that disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle>
[PROOF STEP]
by(auto 4 3 simp add: d_IN_def nn_integral_count_space_indicator notin_range_Some intro!: nn_integral_cong \<Psi>.flowD_outside[OF j] split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle>

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>

goal (1 subgoal):
 1. d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> A \<Gamma> \<Longrightarrow> d_OUT g ?x = d_OUT f ?x + d_IN j \<langle>?x\<rangle> - d_OUT j \<langle>?x\<rangle>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_g_B: "d_OUT g x = 0" if "x \<notin> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g x = 0
[PROOF STEP]
using disjoint that
[PROOF STATE]
proof (prove)
using this:
A \<Gamma> \<inter> B \<Gamma> = {}
x \<notin> A \<Gamma>

goal (1 subgoal):
 1. d_OUT g x = 0
[PROOF STEP]
by(auto simp add: d_OUT_def nn_integral_0_iff_AE AE_count_space g_simps dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
?x \<notin> A \<Gamma> \<Longrightarrow> d_OUT g ?x = 0

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_g_a: "d_OUT g a < weight \<Gamma> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g a < weight \<Gamma> a
[PROOF STEP]
using a(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT g a < weight \<Gamma> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
have "d_OUT g a = d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g a = d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle>
[PROOF STEP]
using a(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT g a = d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle>
[PROOF STEP]
by(rule OUT_g_A)
[PROOF STATE]
proof (state)
this:
d_OUT g a = d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle>

goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT g a = d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle>

goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> \<le> d_OUT f a + d_IN j \<langle>a\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle> \<le> d_OUT f a + d_IN j \<langle>a\<rangle>
[PROOF STEP]
by(rule diff_le_self_ennreal)
[PROOF STATE]
proof (state)
this:
d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle> \<le> d_OUT f a + d_IN j \<langle>a\<rangle>

goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT f a + d_IN j \<langle>a\<rangle> - d_OUT j \<langle>a\<rangle> \<le> d_OUT f a + d_IN j \<langle>a\<rangle>

goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> < weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f a + d_IN j \<langle>a\<rangle> < weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon>
[PROOF STEP]
using finite_\<epsilon> \<epsilon>_less currentD_finite_OUT[OF f']
[PROOF STATE]
proof (prove)
using this:
\<epsilon> \<noteq> \<top>
\<epsilon> < weight \<Gamma> a - d_OUT f a
d_OUT f ?x \<noteq> \<top>

goal (1 subgoal):
 1. d_OUT f a + d_IN j \<langle>a\<rangle> < weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon>
[PROOF STEP]
by (simp add: less_diff_eq_ennreal less_top ac_simps)
[PROOF STATE]
proof (state)
this:
d_OUT f a + d_IN j \<langle>a\<rangle> < weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon>

goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT f a + d_IN j \<langle>a\<rangle> < weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon>

goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon> \<le> weight \<Gamma> a
[PROOF STEP]
using IN_j[THEN order_trans, OF \<alpha>_le]
[PROOF STATE]
proof (prove)
using this:
d_IN j ?x1 \<le> \<epsilon>

goal (1 subgoal):
 1. weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon> \<le> weight \<Gamma> a
[PROOF STEP]
by (simp add: ennreal_minus_le_iff)
[PROOF STATE]
proof (state)
this:
weight \<Gamma> a + d_IN j \<langle>a\<rangle> - \<epsilon> \<le> weight \<Gamma> a

goal (1 subgoal):
 1. a \<in> A \<Gamma> \<Longrightarrow> d_OUT g a < weight \<Gamma> a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT g a < weight \<Gamma> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT g a < weight \<Gamma> a

goal (1 subgoal):
 1. d_OUT g a < weight \<Gamma> a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT g a < weight \<Gamma> a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT g a < weight \<Gamma> a

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_jj: "d_OUT ?j x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "d_OUT ?j x = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))
[PROOF STEP]
by(simp add: d_OUT_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_IN j \<langle>x\<rangle> - (\<Sum>\<^sup>+ y. j (y, \<langle>x\<rangle>) * indicator {None} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (y, \<langle>x\<rangle>)\<partial>count_space UNIV)
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ xa. j (xa, \<langle>x\<rangle>)) - (\<integral>\<^sup>+y\<in>{None}. j (y, \<langle>x\<rangle>)\<partial>count_space UNIV)
[PROOF STEP]
by(subst nn_integral_diff[symmetric])(auto simp add: max_def \<Psi>.flowD_finite[OF j] AE_count_space nn_integral_count_space_indicator split: split_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (y, \<langle>x\<rangle>)\<partial>count_space UNIV)

goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (y, \<langle>x\<rangle>)\<partial>count_space UNIV)

goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (y, \<langle>x\<rangle>)\<partial>count_space UNIV) = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
by(simp add: max_def)
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (y, \<langle>x\<rangle>)\<partial>count_space UNIV) = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x = d_IN j \<langle>x\<rangle> - j (None, \<langle>x\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) ?x = d_IN j \<langle>?x\<rangle> - j (None, \<langle>?x\<rangle>)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_jj_finite [simp]: "d_OUT ?j x \<noteq> \<top>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) x \<noteq> \<top>
[PROOF STEP]
by(simp add: OUT_jj)
[PROOF STATE]
proof (state)
this:
d_OUT (j \<circ> map_prod Some Some \<circ> prod.swap) ?x \<noteq> \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have IN_g: "d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
proof(cases "x \<in> B \<Gamma>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> B \<Gamma>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have finite: "(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (Some y, Some x)) \<noteq> \<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>
[PROOF STEP]
using currentD_finite_IN[OF f', of x]
[PROOF STATE]
proof (prove)
using this:
d_IN f x \<noteq> \<top>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>
[PROOF STEP]
by(rule neq_top_trans)(auto intro!: nn_integral_mono j_le_f simp add: d_IN_def nn_integral_count_space_indicator incoming_def split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "d_IN g x = d_IN (f \<oplus> ?j) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g x = d_IN (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) x
[PROOF STEP]
by(simp add: g_def)
[PROOF STATE]
proof (state)
this:
d_IN g x = d_IN (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) x

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN g x = d_IN (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) x

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (Some x, Some y) - j (Some y, Some x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>) - j (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
by(auto simp add: d_IN_def currentD_outside[OF f'] incoming_def nn_integral_count_space_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
d_IN (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>) - j (\<langle>y\<rangle>, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (f \<oplus> (j \<circ> map_prod Some Some \<circ> prod.swap)) x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>) - j (\<langle>y\<rangle>, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (Some x, Some y)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (Some y, Some x))"
      (is "_ = _ - ?j_IN")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>) - j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
using finite
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>) - j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
by(subst nn_integral_diff)(auto simp add: AE_count_space incoming_def intro!: order_trans[OF j_le_f])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>) - j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>) - j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x)) + (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (Some x, Some y)) - ?j_IN"
      (is "_ = ?f + ?j_OUT - _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x)) + (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
by(subst nn_integral_add) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x)) + (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x) + j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x)) + (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) - (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "?f = d_IN f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x)) = d_IN f x
[PROOF STEP]
by(subst d_IN_alt_def[where G=\<Gamma>])(simp_all add: currentD_outside[OF f])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x)) = d_IN f x

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. f (y, x)) = d_IN f x

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "?j_OUT = (\<Sum>\<^sup>+ y\<in>range Some. j (Some x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))
[PROOF STEP]
using True disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex)(auto 4 4 simp add: nn_integral_count_space_indicator incoming_def intro!: nn_integral_cong \<Psi>.flowD_outside[OF j] split: split_indicator dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>x\<rangle>, \<langle>y\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_OUT j (Some x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
using disjoint
[PROOF STATE]
proof (prove)
using this:
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y)) = d_OUT j \<langle>x\<rangle>
[PROOF STEP]
by(auto 4 3 simp add: d_OUT_def nn_integral_count_space_indicator notin_range_Some intro!: nn_integral_cong \<Psi>.flowD_outside[OF j] split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y)) = d_OUT j \<langle>x\<rangle>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (\<langle>x\<rangle>, y)) = d_OUT j \<langle>x\<rangle>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_IN j (Some x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KIR j \<langle>x\<rangle>
[PROOF STEP]
using flowD_KIR[OF j, of "Some x"] True a disjoint
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<langle>x\<rangle> \<noteq> source \<Psi>; \<langle>x\<rangle> \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j \<langle>x\<rangle>
x \<in> B \<Gamma>
a \<in> A \<Gamma>
a \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. KIR j \<langle>x\<rangle>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
KIR j \<langle>x\<rangle>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
KIR j \<langle>x\<rangle>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "?j_IN = (\<Sum>\<^sup>+ y\<in>range Some. j (y, Some x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))
[PROOF STEP]
using True disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex)(auto 4 4 simp add: nn_integral_count_space_indicator incoming_def intro!: nn_integral_cong \<Psi>.flowD_outside[OF j] dest: bipartite_E split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>))

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_IN j (Some x) - (\<Sum>\<^sup>+ y :: 'v option. j (None, Some x) * indicator {None} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ xa. j (xa, \<langle>x\<rangle>)) - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)
[PROOF STEP]
using flowD_capacity[OF j, of "(None, Some x)"]
[PROOF STATE]
proof (prove)
using this:
j (None, \<langle>x\<rangle>) \<le> capacity \<Psi> (None, \<langle>x\<rangle>)

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ xa. j (xa, \<langle>x\<rangle>)) - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)
[PROOF STEP]
by(subst nn_integral_diff[symmetric])
        (auto simp add: nn_integral_count_space_indicator AE_count_space top_unique image_iff
              intro!: nn_integral_cong ennreal_diff_self split: split_indicator if_split_asm)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Some. j (y, \<langle>x\<rangle>)) = d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
have "d_IN f x + d_IN j (Some x) - \<dots> = d_IN f x + j (None, Some x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN f x + d_IN j \<langle>x\<rangle> - (d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)) = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
using ennreal_add_diff_cancel_right[OF IN_j_finite[of "Some x"], of "d_IN f x + j (None, Some x)"]
[PROOF STATE]
proof (prove)
using this:
d_IN f x + j (None, \<langle>x\<rangle>) + d_IN j \<langle>x\<rangle> - d_IN j \<langle>x\<rangle> = d_IN f x + j (None, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_IN f x + d_IN j \<langle>x\<rangle> - (d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)) = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
apply(subst diff_diff_ennreal')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. d_IN f x + j (None, \<langle>x\<rangle>) + d_IN j \<langle>x\<rangle> - d_IN j \<langle>x\<rangle> = d_IN f x + j (None, \<langle>x\<rangle>) \<Longrightarrow> \<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV \<le> d_IN j \<langle>x\<rangle>
 2. d_IN f x + j (None, \<langle>x\<rangle>) + d_IN j \<langle>x\<rangle> - d_IN j \<langle>x\<rangle> = d_IN f x + j (None, \<langle>x\<rangle>) \<Longrightarrow> d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV) \<le> d_IN f x + d_IN j \<langle>x\<rangle>
 3. d_IN f x + j (None, \<langle>x\<rangle>) + d_IN j \<langle>x\<rangle> - d_IN j \<langle>x\<rangle> = d_IN f x + j (None, \<langle>x\<rangle>) \<Longrightarrow> d_IN f x + d_IN j \<langle>x\<rangle> + (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV) - d_IN j \<langle>x\<rangle> = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
apply(auto simp add: d_IN_def intro!: nn_integral_ge_point ennreal_diff_le_mono_left)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ xa. f (xa, x)) + j (None, \<langle>x\<rangle>) + (\<Sum>\<^sup>+ xa. j (xa, \<langle>x\<rangle>)) - (\<Sum>\<^sup>+ xa. j (xa, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ xa. f (xa, x)) + j (None, \<langle>x\<rangle>) \<Longrightarrow> (\<Sum>\<^sup>+ xa. f (xa, x)) + (\<Sum>\<^sup>+ xa. j (xa, \<langle>x\<rangle>)) + j (None, \<langle>x\<rangle>) - (\<Sum>\<^sup>+ xa. j (xa, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ xa. f (xa, x)) + j (None, \<langle>x\<rangle>)
[PROOF STEP]
apply(simp add: ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d_IN f x + d_IN j \<langle>x\<rangle> - (d_IN j \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{None}. j (None, \<langle>x\<rangle>)\<partial>count_space UNIV)) = d_IN f x + j (None, \<langle>x\<rangle>)

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)

goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> B \<Gamma>

goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
hence "d_IN g x = 0" "d_IN f x = 0" "j (None, \<langle>x\<rangle>) = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> B \<Gamma>

goal (1 subgoal):
 1. d_IN g x = 0 &&& d_IN f x = 0 &&& j (None, \<langle>x\<rangle>) = 0
[PROOF STEP]
using disjoint currentD_IN[OF f', of x] bipartite_V currentD_outside_IN[OF f'] u_outside[OF False] flowD_capacity[OF j, of "(None, \<langle>x\<rangle>)"]
[PROOF STATE]
proof (prove)
using this:
x \<notin> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
x \<in> A \<Gamma> \<Longrightarrow> d_IN f x = 0
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>
?x \<notin> \<^bold>V \<Longrightarrow> d_IN f ?x = 0
u x = 0
j (None, \<langle>x\<rangle>) \<le> capacity \<Psi> (None, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_IN g x = 0 &&& d_IN f x = 0 &&& j (None, \<langle>x\<rangle>) = 0
[PROOF STEP]
by(cases "vertex \<Gamma> x"; auto simp add: d_IN_def nn_integral_0_iff_AE AE_count_space g_simps dest: bipartite_E split: if_split_asm)+
[PROOF STATE]
proof (state)
this:
d_IN g x = 0
d_IN f x = 0
j (None, \<langle>x\<rangle>) = 0

goal (1 subgoal):
 1. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN g x = 0
d_IN f x = 0
j (None, \<langle>x\<rangle>) = 0

goal (1 subgoal):
 1. d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_IN g x = d_IN f x + j (None, \<langle>x\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN g ?x = d_IN f ?x + j (None, \<langle>?x\<rangle>)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have g: "current \<Gamma> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. current \<Gamma> g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. d_OUT g x \<le> weight \<Gamma> x
 2. \<And>x. d_IN g x \<le> weight \<Gamma> x
 3. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> g e = 0
[PROOF STEP]
show "d_OUT g x \<le> weight \<Gamma> x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
proof(cases "x \<in> A \<Gamma>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT g x \<le> weight \<Gamma> x
 2. x \<notin> A \<Gamma> \<Longrightarrow> d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> A \<Gamma>

goal (2 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT g x \<le> weight \<Gamma> x
 2. x \<notin> A \<Gamma> \<Longrightarrow> d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<notin> A \<Gamma>

goal (1 subgoal):
 1. d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
by(simp add: OUT_g_B)
[PROOF STATE]
proof (state)
this:
d_OUT g x \<le> weight \<Gamma> x

goal (1 subgoal):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
with OUT_g_a
[PROOF STATE]
proof (chain)
picking this:
d_OUT g a < weight \<Gamma> a
x \<in> A \<Gamma>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT g a < weight \<Gamma> a
x \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT g x \<le> weight \<Gamma> x
[PROOF STEP]
by(cases "x = a")(simp_all add: OUT_g_A flowD_KIR[OF j] currentD_weight_OUT[OF f'])
[PROOF STATE]
proof (state)
this:
d_OUT g x \<le> weight \<Gamma> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT g ?x \<le> weight \<Gamma> ?x

goal (2 subgoals):
 1. \<And>x. d_IN g x \<le> weight \<Gamma> x
 2. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> g e = 0
[PROOF STEP]
show "d_IN g x \<le> weight \<Gamma> x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
proof(cases "x \<in> B \<Gamma>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> B \<Gamma>

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
hence "d_IN g x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> B \<Gamma>

goal (1 subgoal):
 1. d_IN g x = 0
[PROOF STEP]
using disjoint
[PROOF STATE]
proof (prove)
using this:
x \<notin> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. d_IN g x = 0
[PROOF STEP]
by(auto simp add: d_IN_def nn_integral_0_iff_AE AE_count_space g_simps dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
d_IN g x = 0

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
 2. x \<notin> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN g x = 0

goal (1 subgoal):
 1. d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_IN g x \<le> weight \<Gamma> x

goal (1 subgoal):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
have "d_IN g x \<le> (weight \<Gamma> x - u x) + u x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g x \<le> weight \<Gamma> x - u x + u x
[PROOF STEP]
unfolding IN_g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN f x + j (None, \<langle>x\<rangle>) \<le> weight \<Gamma> x - u x + u x
[PROOF STEP]
using currentD_weight_IN[OF f, of x] flowD_capacity[OF j, of "(None, Some x)"] True bipartite_V
[PROOF STATE]
proof (prove)
using this:
d_IN f x \<le> weight (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) x
j (None, \<langle>x\<rangle>) \<le> capacity \<Psi> (None, \<langle>x\<rangle>)
x \<in> B \<Gamma>
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>

goal (1 subgoal):
 1. d_IN f x + j (None, \<langle>x\<rangle>) \<le> weight \<Gamma> x - u x + u x
[PROOF STEP]
by(intro add_mono)(simp_all split: if_split_asm)
[PROOF STATE]
proof (state)
this:
d_IN g x \<le> weight \<Gamma> x - u x + u x

goal (1 subgoal):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN g x \<le> weight \<Gamma> x - u x + u x

goal (1 subgoal):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> = weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight \<Gamma> x - u x + u x = weight \<Gamma> x
[PROOF STEP]
using u
[PROOF STATE]
proof (prove)
using this:
u \<le> weight \<Gamma>

goal (1 subgoal):
 1. weight \<Gamma> x - u x + u x = weight \<Gamma> x
[PROOF STEP]
by (intro diff_add_cancel_ennreal) (simp add: le_fun_def)
[PROOF STATE]
proof (state)
this:
weight \<Gamma> x - u x + u x = weight \<Gamma> x

goal (1 subgoal):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN g x \<le> weight \<Gamma> x

goal (1 subgoal):
 1. d_IN g x \<le> weight \<Gamma> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN g x \<le> weight \<Gamma> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN g ?x \<le> weight \<Gamma> ?x

goal (1 subgoal):
 1. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> g e = 0
[PROOF STEP]
show "g e = 0" if "e \<notin> \<^bold>E" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g e = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
e \<notin> \<^bold>E

goal (1 subgoal):
 1. g e = 0
[PROOF STEP]
by(cases e)(auto simp add: g_simps)
[PROOF STATE]
proof (state)
this:
?e \<notin> \<^bold>E \<Longrightarrow> g ?e = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
current \<Gamma> g

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define cap' where "cap' = (\<lambda>(x, y). if edge \<Gamma> x y then g (x, y) else if edge \<Gamma> y x then 1 else 0)"
[PROOF STATE]
proof (state)
this:
cap' = (\<lambda>(x, y). if edge \<Gamma> x y then g (x, y) else if edge \<Gamma> y x then 1 else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have cap'_simps [simp]: "cap' (x, y) = (if edge \<Gamma> x y then g (x, y) else if edge \<Gamma> y x then 1 else 0)"
    for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cap' (x, y) = (if edge \<Gamma> x y then g (x, y) else if edge \<Gamma> y x then 1 else 0)
[PROOF STEP]
by(simp add: cap'_def)
[PROOF STATE]
proof (state)
this:
cap' (?x, ?y) = (if edge \<Gamma> ?x ?y then g (?x, ?y) else if edge \<Gamma> ?y ?x then 1 else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define G where "G = \<lparr>edge = \<lambda>x y. cap' (x, y) > 0\<rparr>"
[PROOF STATE]
proof (state)
this:
G = \<lparr>edge = \<lambda>x y. 0 < cap' (x, y)\<rparr>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have G_sel [simp]: "edge G x y \<longleftrightarrow> cap' (x, y) > 0" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge G x y = (0 < cap' (x, y))
[PROOF STEP]
by(simp add: G_def)
[PROOF STATE]
proof (state)
this:
edge G ?x ?y = (0 < cap' (?x, ?y))

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define reachable where "reachable x = (edge G)\<^sup>*\<^sup>* x a" for x
[PROOF STATE]
proof (state)
this:
reachable ?x = (edge G)\<^sup>*\<^sup>* ?x a

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have reachable_alt_def: "reachable \<equiv> \<lambda>x. \<exists>p. path G x p a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachable \<equiv> \<lambda>x. \<exists>p. path G x p a
[PROOF STEP]
by(simp add: reachable_def [abs_def] rtranclp_eq_rtrancl_path)
[PROOF STATE]
proof (state)
this:
reachable \<equiv> \<lambda>x. \<exists>p. path G x p a

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have [simp]: "reachable a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachable a
[PROOF STEP]
by(auto simp add: reachable_def)
[PROOF STATE]
proof (state)
this:
reachable a

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have AB_edge: "edge G x y" if "edge \<Gamma> y x" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge G x y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge \<Gamma> y x

goal (1 subgoal):
 1. edge G x y
[PROOF STEP]
by(auto dest: edge_antiparallel simp add: min_def le_neq_trans add_eq_0_iff_both_eq_0)
[PROOF STATE]
proof (state)
this:
edge \<Gamma> ?y ?x \<Longrightarrow> edge G ?x ?y

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have reachable_AB: "reachable y" if "reachable x" "(x, y) \<in> \<^bold>E" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachable y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
reachable x
(x, y) \<in> \<^bold>E

goal (1 subgoal):
 1. reachable y
[PROOF STEP]
by(auto simp add: reachable_def simp del: G_sel dest!: AB_edge intro: rtrancl_path.step)
[PROOF STATE]
proof (state)
this:
\<lbrakk>reachable ?x; (?x, ?y) \<in> \<^bold>E\<rbrakk> \<Longrightarrow> reachable ?y

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have reachable_BA: "g (x, y) = 0" if "reachable y" "(x, y) \<in> \<^bold>E" "\<not> reachable x" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (x, y) = 0
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g (x, y) \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "g (x, y) \<noteq> 0"
[PROOF STATE]
proof (state)
this:
g (x, y) \<noteq> 0

goal (1 subgoal):
 1. g (x, y) \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g (x, y) \<noteq> 0
[PROOF STEP]
have "g (x, y) > 0"
[PROOF STATE]
proof (prove)
using this:
g (x, y) \<noteq> 0

goal (1 subgoal):
 1. 0 < g (x, y)
[PROOF STEP]
by (simp add: zero_less_iff_neq_zero)
[PROOF STATE]
proof (state)
this:
0 < g (x, y)

goal (1 subgoal):
 1. g (x, y) \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
hence "edge G x y"
[PROOF STATE]
proof (prove)
using this:
0 < g (x, y)

goal (1 subgoal):
 1. edge G x y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < g (x, y)
reachable y
(x, y) \<in> \<^bold>E
\<not> reachable x

goal (1 subgoal):
 1. edge G x y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
edge G x y

goal (1 subgoal):
 1. g (x, y) \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
edge G x y
[PROOF STEP]
have "reachable x"
[PROOF STATE]
proof (prove)
using this:
edge G x y

goal (1 subgoal):
 1. reachable x
[PROOF STEP]
using \<open>reachable y\<close>
[PROOF STATE]
proof (prove)
using this:
edge G x y
reachable y

goal (1 subgoal):
 1. reachable x
[PROOF STEP]
unfolding reachable_def
[PROOF STATE]
proof (prove)
using this:
edge G x y
(edge G)\<^sup>*\<^sup>* y a

goal (1 subgoal):
 1. (edge G)\<^sup>*\<^sup>* x a
[PROOF STEP]
by(rule converse_rtranclp_into_rtranclp)
[PROOF STATE]
proof (state)
this:
reachable x

goal (1 subgoal):
 1. g (x, y) \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
with \<open>\<not> reachable x\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> reachable x
reachable x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> reachable x
reachable x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>reachable ?y; (?x, ?y) \<in> \<^bold>E; \<not> reachable ?x\<rbrakk> \<Longrightarrow> g (?x, ?y) = 0

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have reachable_V: "vertex \<Gamma> x" if "reachable x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vertex \<Gamma> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vertex \<Gamma> x
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
reachable x
[PROOF STEP]
obtain p where p: "path G x p a"
[PROOF STATE]
proof (prove)
using this:
reachable x

goal (1 subgoal):
 1. (\<And>p. path G x p a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding reachable_alt_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p. path G x p a

goal (1 subgoal):
 1. (\<And>p. path G x p a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
path G x p a

goal (1 subgoal):
 1. vertex \<Gamma> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path G x p a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path G x p a

goal (1 subgoal):
 1. vertex \<Gamma> x
[PROOF STEP]
using rtrancl_path_nth[OF p, of 0] a(1) A_vertex
[PROOF STATE]
proof (prove)
using this:
path G x p a
0 < length p \<Longrightarrow> edge G ((x # p) ! 0) (p ! 0)
a \<in> A \<Gamma>
A \<Gamma> \<subseteq> \<^bold>V

goal (1 subgoal):
 1. vertex \<Gamma> x
[PROOF STEP]
by(cases "p = []")(auto 4 3 simp add: vertex_def elim: rtrancl_path.cases split: if_split_asm)
[PROOF STATE]
proof (state)
this:
vertex \<Gamma> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
reachable ?x \<Longrightarrow> vertex \<Gamma> ?x

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have finite_j_IN: "(\<integral>\<^sup>+ y. j (Some y, Some x) \<partial>count_space (\<^bold>I\<^bold>N x)) \<noteq> \<top>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>
[PROOF STEP]
have "(\<integral>\<^sup>+ y. j (Some y, Some x) \<partial>count_space (\<^bold>I\<^bold>N x)) \<le> d_IN f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<le> d_IN f x
[PROOF STEP]
by(auto intro!: nn_integral_mono j_le_f simp add: d_IN_def nn_integral_count_space_indicator incoming_def split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<le> d_IN f x

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<le> d_IN f x

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>
[PROOF STEP]
using currentD_finite_IN[OF f', of x]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<le> d_IN f x
d_IN f x \<noteq> \<top>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>
[PROOF STEP]
by (auto simp: top_unique)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. j (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<noteq> \<top>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N ?x. j (\<langle>y\<rangle>, \<langle>?x\<rangle>)) \<noteq> \<top>

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have j_outside: "j (x, y) = 0" if "\<not> edge \<Psi> x y" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j (x, y) = 0
[PROOF STEP]
using that flowD_capacity[OF j, of "(x, y)"] \<Psi>.capacity_outside[of "(x, y)"]
[PROOF STATE]
proof (prove)
using this:
\<not> edge \<Psi> x y
j (x, y) \<le> capacity \<Psi> (x, y)
(x, y) \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> (x, y) = 0

goal (1 subgoal):
 1. j (x, y) = 0
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<not> edge \<Psi> ?x ?y \<Longrightarrow> j (?x, ?y) = 0

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
define h where "h = (\<lambda>(x, y). if reachable x \<and> reachable y then g (x, y) else 0)"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>(x, y). if reachable x \<and> reachable y then g (x, y) else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have h_simps [simp]: "h (x, y) = (if reachable x \<and> reachable y then g (x, y) else 0)" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h (x, y) = (if reachable x \<and> reachable y then g (x, y) else 0)
[PROOF STEP]
by(simp add: h_def)
[PROOF STATE]
proof (state)
this:
h (?x, ?y) = (if reachable ?x \<and> reachable ?y then g (?x, ?y) else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have h_le_g: "h e \<le> g e" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h e \<le> g e
[PROOF STEP]
by(cases e) simp
[PROOF STATE]
proof (state)
this:
h ?e \<le> g ?e

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_h: "d_OUT h x = (if reachable x then d_OUT g x else 0)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
have "d_OUT h x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y))
[PROOF STEP]
using h_le_g currentD_outside[OF g]
[PROOF STATE]
proof (prove)
using this:
h ?e \<le> g ?e
\<not> edge \<Gamma> ?x ?y \<Longrightarrow> g (?x, ?y) = 0

goal (1 subgoal):
 1. d_OUT h x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y))
[PROOF STEP]
by(intro d_OUT_alt_def) auto
[PROOF STATE]
proof (state)
this:
d_OUT h x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y))

goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT h x = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y))

goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. if reachable x then g (x, y) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. if reachable x then g (x, y) else 0)
[PROOF STEP]
by(auto intro!: nn_integral_cong simp add: outgoing_def dest: reachable_AB)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. if reachable x then g (x, y) else 0)

goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. h (x, y)) = (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. if reachable x then g (x, y) else 0)

goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
have "\<dots> = (if reachable x then d_OUT g x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. if reachable x then g (x, y) else 0) = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
by(auto intro!: d_OUT_alt_def[symmetric] currentD_outside[OF g])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>O\<^bold>U\<^bold>T x. if reachable x then g (x, y) else 0) = (if reachable x then d_OUT g x else 0)

goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT h x = (if reachable x then d_OUT g x else 0)

goal (1 subgoal):
 1. d_OUT h x = (if reachable x then d_OUT g x else 0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT h x = (if reachable x then d_OUT g x else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT h ?x = (if reachable ?x then d_OUT g ?x else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have IN_h: "d_IN h x = (if reachable x then d_IN g x else 0)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
have "d_IN h x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x))
[PROOF STEP]
using h_le_g currentD_outside[OF g]
[PROOF STATE]
proof (prove)
using this:
h ?e \<le> g ?e
\<not> edge \<Gamma> ?x ?y \<Longrightarrow> g (?x, ?y) = 0

goal (1 subgoal):
 1. d_IN h x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x))
[PROOF STEP]
by(intro d_IN_alt_def) auto
[PROOF STATE]
proof (state)
this:
d_IN h x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x))

goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN h x = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x))

goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. if reachable x then g (y, x) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. if reachable x then g (y, x) else 0)
[PROOF STEP]
by(auto intro!: nn_integral_cong simp add: incoming_def dest: reachable_BA)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. if reachable x then g (y, x) else 0)

goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. h (y, x)) = (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. if reachable x then g (y, x) else 0)

goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
have "\<dots> = (if reachable x then d_IN g x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. if reachable x then g (y, x) else 0) = (if reachable x then d_IN g x else 0)
[PROOF STEP]
by(auto intro!: d_IN_alt_def[symmetric] currentD_outside[OF g])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>\<^bold>I\<^bold>N x. if reachable x then g (y, x) else 0) = (if reachable x then d_IN g x else 0)

goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN h x = (if reachable x then d_IN g x else 0)

goal (1 subgoal):
 1. d_IN h x = (if reachable x then d_IN g x else 0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN h x = (if reachable x then d_IN g x else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN h ?x = (if reachable ?x then d_IN g ?x else 0)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have h: "current \<Gamma> h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. current \<Gamma> h
[PROOF STEP]
using g h_le_g
[PROOF STATE]
proof (prove)
using this:
current \<Gamma> g
h ?e \<le> g ?e

goal (1 subgoal):
 1. current \<Gamma> h
[PROOF STEP]
proof(rule current_leI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<notin> A \<Gamma> \<Longrightarrow> d_OUT h x \<le> d_IN h x
[PROOF STEP]
show "d_OUT h x \<le> d_IN h x" if "x \<notin> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h x \<le> d_IN h x
[PROOF STEP]
by(simp add: OUT_h IN_h currentD_OUT_IN[OF g that])
[PROOF STATE]
proof (state)
this:
?x \<notin> A \<Gamma> \<Longrightarrow> d_OUT h ?x \<le> d_IN h ?x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
current \<Gamma> h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have reachable_full: "j (None, \<langle>y\<rangle>) = u y" if reach: "reachable y" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) = u y
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
assume "j (None, \<langle>y\<rangle>) \<noteq> u y"
[PROOF STATE]
proof (state)
this:
j (None, \<langle>y\<rangle>) \<noteq> u y

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
with flowD_capacity[OF j, of "(None, \<langle>y\<rangle>)"]
[PROOF STATE]
proof (chain)
picking this:
j (None, \<langle>y\<rangle>) \<le> capacity \<Psi> (None, \<langle>y\<rangle>)
j (None, \<langle>y\<rangle>) \<noteq> u y
[PROOF STEP]
have le: "j (None, \<langle>y\<rangle>) < u y"
[PROOF STATE]
proof (prove)
using this:
j (None, \<langle>y\<rangle>) \<le> capacity \<Psi> (None, \<langle>y\<rangle>)
j (None, \<langle>y\<rangle>) \<noteq> u y

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) < u y
[PROOF STEP]
by(auto split: if_split_asm simp add: u_outside \<Psi>.flowD_outside[OF j] zero_less_iff_neq_zero)
[PROOF STATE]
proof (state)
this:
j (None, \<langle>y\<rangle>) < u y

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j (None, \<langle>y\<rangle>) < u y
[PROOF STEP]
obtain y: "y \<in> B \<Gamma>" and uy: "u y > 0"
[PROOF STATE]
proof (prove)
using this:
j (None, \<langle>y\<rangle>) < u y

goal (1 subgoal):
 1. (\<lbrakk>y \<in> B \<Gamma>; 0 < u y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using u_outside[of y]
[PROOF STATE]
proof (prove)
using this:
j (None, \<langle>y\<rangle>) < u y
y \<notin> B \<Gamma> \<Longrightarrow> u y = 0

goal (1 subgoal):
 1. (\<lbrakk>y \<in> B \<Gamma>; 0 < u y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases "y \<in> B \<Gamma>"; cases "u y = 0") (auto simp add: zero_less_iff_neq_zero)
[PROOF STATE]
proof (state)
this:
y \<in> B \<Gamma>
0 < u y

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
from reach
[PROOF STATE]
proof (chain)
picking this:
reachable y
[PROOF STEP]
obtain q where q: "path G y q a" and distinct: "distinct (y # q)"
[PROOF STATE]
proof (prove)
using this:
reachable y

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>path G y q a; distinct (y # q)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding reachable_alt_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p. path G y p a

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>path G y q a; distinct (y # q)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto elim: rtrancl_path_distinct)
[PROOF STATE]
proof (state)
this:
path G y q a
distinct (y # q)

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have q_Nil: "q \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<noteq> []
[PROOF STEP]
using q a(1) disjoint y
[PROOF STATE]
proof (prove)
using this:
path G y q a
a \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
y \<in> B \<Gamma>

goal (1 subgoal):
 1. q \<noteq> []
[PROOF STEP]
by(auto elim!: rtrancl_path.cases)
[PROOF STATE]
proof (state)
this:
q \<noteq> []

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
let ?E = "zip (y # q) q"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
define E where "E = (None, Some y) # map (map_prod Some Some) ?E"
[PROOF STATE]
proof (state)
this:
E = (None, \<langle>y\<rangle>) # map (map_prod Some Some) (zip (y # q) q)

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
define \<zeta> where "\<zeta> = Min (insert (u y - j (None, Some y)) (cap' ` set ?E))"
[PROOF STATE]
proof (state)
this:
\<zeta> = Min (insert (u y - j (None, \<langle>y\<rangle>)) (cap' ` set (zip (y # q) q)))

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
let ?j' = "\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
define j' where "j' = cleanup ?j'"
[PROOF STATE]
proof (state)
this:
j' = cleanup (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e)

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have j_free: "0 < cap' e" if "e \<in> set ?E" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < cap' e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
e \<in> set (zip (y # q) q)

goal (1 subgoal):
 1. 0 < cap' e
[PROOF STEP]
unfolding E_def list.sel
[PROOF STATE]
proof (prove)
using this:
e \<in> set (zip (y # q) q)

goal (1 subgoal):
 1. 0 < cap' e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e \<in> set (zip (y # q) q) \<Longrightarrow> 0 < cap' e
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
e \<in> set (zip (y # q) q)
[PROOF STEP]
obtain i where e: "e = ((y # q) ! i, q ! i)"
        and i: "i < length q"
[PROOF STATE]
proof (prove)
using this:
e \<in> set (zip (y # q) q)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>e = ((y # q) ! i, q ! i); i < length q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: set_zip)
[PROOF STATE]
proof (state)
this:
e = ((y # q) ! i, q ! i)
i < length q

goal (1 subgoal):
 1. e \<in> set (zip (y # q) q) \<Longrightarrow> 0 < cap' e
[PROOF STEP]
have e': "edge G ((y # q) ! i) (q ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge G ((y # q) ! i) (q ! i)
[PROOF STEP]
using q i
[PROOF STATE]
proof (prove)
using this:
path G y q a
i < length q

goal (1 subgoal):
 1. edge G ((y # q) ! i) (q ! i)
[PROOF STEP]
by(rule rtrancl_path_nth)
[PROOF STATE]
proof (state)
this:
edge G ((y # q) ! i) (q ! i)

goal (1 subgoal):
 1. e \<in> set (zip (y # q) q) \<Longrightarrow> 0 < cap' e
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
edge G ((y # q) ! i) (q ! i)

goal (1 subgoal):
 1. 0 < cap' e
[PROOF STEP]
using e
[PROOF STATE]
proof (prove)
using this:
edge G ((y # q) ! i) (q ! i)
e = ((y # q) ! i, q ! i)

goal (1 subgoal):
 1. 0 < cap' e
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
0 < cap' e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?e \<in> set (zip (y # q) q) \<Longrightarrow> 0 < cap' ?e

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have \<zeta>_pos: "0 < \<zeta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<zeta>
[PROOF STEP]
unfolding \<zeta>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Min (insert (u y - j (None, \<langle>y\<rangle>)) (cap' ` set (zip (y # q) q)))
[PROOF STEP]
using le
[PROOF STATE]
proof (prove)
using this:
j (None, \<langle>y\<rangle>) < u y

goal (1 subgoal):
 1. 0 < Min (insert (u y - j (None, \<langle>y\<rangle>)) (cap' ` set (zip (y # q) q)))
[PROOF STEP]
by(auto intro: j_free diff_gr0_ennreal)
[PROOF STATE]
proof (state)
this:
0 < \<zeta>

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have \<zeta>_le: "\<zeta> \<le> cap' e" if "e \<in> set ?E" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> \<le> cap' e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
e \<in> set (zip (y # q) q)

goal (1 subgoal):
 1. \<zeta> \<le> cap' e
[PROOF STEP]
unfolding \<zeta>_def
[PROOF STATE]
proof (prove)
using this:
e \<in> set (zip (y # q) q)

goal (1 subgoal):
 1. Min (insert (u y - j (None, \<langle>y\<rangle>)) (cap' ` set (zip (y # q) q))) \<le> cap' e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?e \<in> set (zip (y # q) q) \<Longrightarrow> \<zeta> \<le> cap' ?e

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have finite_\<zeta> [simplified]: "\<zeta> < \<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> < \<top>
[PROOF STEP]
unfolding \<zeta>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min (insert (u y - j (None, \<langle>y\<rangle>)) (cap' ` set (zip (y # q) q))) < \<top>
[PROOF STEP]
by(intro Min_less_iff[THEN iffD2])(auto simp add: less_top[symmetric])
[PROOF STATE]
proof (state)
this:
\<zeta> < \<top>

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have E_antiparallel: "(x', y') \<in> set ?E \<Longrightarrow> (y', x') \<notin> set ?E" for x' y'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x', y') \<in> set (zip (y # q) q) \<Longrightarrow> (y', x') \<notin> set (zip (y # q) q)
[PROOF STEP]
using distinct
[PROOF STATE]
proof (prove)
using this:
distinct (y # q)

goal (1 subgoal):
 1. (x', y') \<in> set (zip (y # q) q) \<Longrightarrow> (y', x') \<notin> set (zip (y # q) q)
[PROOF STEP]
apply(auto simp add: in_set_zip nth_Cons in_set_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i ia. \<lbrakk>\<forall>i<length q. q ! i \<noteq> y; distinct q; i < length q; ia < length q; y' = (case ia of 0 \<Rightarrow> y | Suc x \<Rightarrow> q ! x); x' = q ! ia; (case i of 0 \<Rightarrow> y | Suc x \<Rightarrow> q ! x) = q ! ia; q ! i = (case ia of 0 \<Rightarrow> y | Suc x \<Rightarrow> q ! x)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(auto simp add: distinct_conv_nth split: nat.split_asm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x2 x2a. \<lbrakk>q ! Suc x2a = q ! x2; \<forall>i<length q. q ! i \<noteq> y; \<forall>i<length q. \<forall>j<length q. i \<noteq> j \<longrightarrow> q ! i \<noteq> q ! j; Suc x2a < length q; Suc x2 < length q; y' = q ! x2; x' = q ! Suc x2; q ! x2a = q ! Suc x2\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis Suc_lessD less_Suc_eq less_irrefl_nat)
[PROOF STATE]
proof (state)
this:
(?x', ?y') \<in> set (zip (y # q) q) \<Longrightarrow> (?y', ?x') \<notin> set (zip (y # q) q)

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have OUT_j': "d_OUT ?j' x' = \<zeta> * card (set [(x'', y) \<leftarrow> E. x'' = x']) + d_OUT j x'" for x'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
have "d_OUT ?j' x' = d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_OUT j x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_OUT j x'
[PROOF STEP]
using \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
0 < \<zeta>

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_OUT j x'
[PROOF STEP]
by(intro d_OUT_add)
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_OUT j x'

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_OUT j x'

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
have "d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = \<integral>\<^sup>+ y. \<zeta> * indicator (set E) (x', y) \<partial>count_space UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (x', y))
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. if (x', y) \<in> set E then \<zeta> else 0) = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (x', y))
[PROOF STEP]
by(rule nn_integral_cong)(simp)
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (x', y))

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (x', y))

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ e. \<zeta> * indicator (set E) e \<partial>embed_measure (count_space UNIV) (Pair x'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (x', y)) = \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (Pair x')
[PROOF STEP]
by(simp add: measurable_embed_measure1 nn_integral_embed_measure)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (x', y)) = \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (Pair x')

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (x', y)) = \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (Pair x')

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ e. \<zeta> * indicator (set [(x'', y) \<leftarrow> E. x'' = x']) e \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (Pair x') = \<integral>\<^sup>+e\<in>set (filter (\<lambda>(x'', y). x'' = x') E). \<zeta>\<partial>count_space UNIV
[PROOF STEP]
by(auto simp add: embed_measure_count_space' nn_integral_count_space_indicator intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (Pair x') = \<integral>\<^sup>+e\<in>set (filter (\<lambda>(x'', y). x'' = x') E). \<zeta>\<partial>count_space UNIV

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (Pair x') = \<integral>\<^sup>+e\<in>set (filter (\<lambda>(x'', y). x'' = x') E). \<zeta>\<partial>count_space UNIV

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
have "\<dots> = \<zeta> * card (set [(x'', y) \<leftarrow> E. x'' = x'])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+e\<in>set (filter (\<lambda>(x'', y). x'' = x') E). \<zeta>\<partial>count_space UNIV = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E)))
[PROOF STEP]
using \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
0 < \<zeta>

goal (1 subgoal):
 1. \<integral>\<^sup>+e\<in>set (filter (\<lambda>(x'', y). x'' = x') E). \<zeta>\<partial>count_space UNIV = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E)))
[PROOF STEP]
by(simp add: nn_integral_cmult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+e\<in>set (filter (\<lambda>(x'', y). x'' = x') E). \<zeta>\<partial>count_space UNIV = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E)))

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'

goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) ?x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = ?x') E))) + d_OUT j ?x'

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have IN_j': "d_IN ?j' x' = \<zeta> * card (set [(y, x'') \<leftarrow> E. x'' = x']) + d_IN j x'" for x'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
have "d_IN ?j' x' = d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_IN j x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_IN j x'
[PROOF STEP]
using \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
0 < \<zeta>

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_IN j x'
[PROOF STEP]
by(intro d_IN_add)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_IN j x'

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' + d_IN j x'

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
have "d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = \<integral>\<^sup>+ y. \<zeta> * indicator (set E) (y, x') \<partial>count_space UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (y, x'))
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x. if (x, x') \<in> set E then \<zeta> else 0) = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (y, x'))
[PROOF STEP]
by(rule nn_integral_cong)(simp)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (y, x'))

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>e. if e \<in> set E then \<zeta> else 0) x' = (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (y, x'))

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ e. \<zeta> * indicator (set E) e \<partial>embed_measure (count_space UNIV) (\<lambda>y. (y, x')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (y, x')) = \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (\<lambda>y. (y, x'))
[PROOF STEP]
by(simp add: measurable_embed_measure1 nn_integral_embed_measure)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (y, x')) = \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (\<lambda>y. (y, x'))

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. \<zeta> * indicator (set E) (y, x')) = \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (\<lambda>y. (y, x'))

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ e. \<zeta> * indicator (set [(y, x'') \<leftarrow> E. x'' = x']) e \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (\<lambda>y. (y, x')) = \<integral>\<^sup>+e\<in>set (filter (\<lambda>(y, x''). x'' = x') E). \<zeta>\<partial>count_space UNIV
[PROOF STEP]
by(auto simp add: embed_measure_count_space' nn_integral_count_space_indicator intro!: nn_integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (\<lambda>y. (y, x')) = \<integral>\<^sup>+e\<in>set (filter (\<lambda>(y, x''). x'' = x') E). \<zeta>\<partial>count_space UNIV

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+e\<in>set E. \<zeta>\<partial>embed_measure (count_space UNIV) (\<lambda>y. (y, x')) = \<integral>\<^sup>+e\<in>set (filter (\<lambda>(y, x''). x'' = x') E). \<zeta>\<partial>count_space UNIV

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
have "\<dots> = \<zeta> * card (set [(y, x'') \<leftarrow> E. x'' = x'])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+e\<in>set (filter (\<lambda>(y, x''). x'' = x') E). \<zeta>\<partial>count_space UNIV = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E)))
[PROOF STEP]
using \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
0 < \<zeta>

goal (1 subgoal):
 1. \<integral>\<^sup>+e\<in>set (filter (\<lambda>(y, x''). x'' = x') E). \<zeta>\<partial>count_space UNIV = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E)))
[PROOF STEP]
by(auto simp add: nn_integral_cmult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+e\<in>set (filter (\<lambda>(y, x''). x'' = x') E). \<zeta>\<partial>count_space UNIV = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E)))

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) ?x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = ?x') E))) + d_IN j ?x'

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have j': "flow \<Psi> j'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow \<Psi> j'
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. j' e \<le> capacity \<Psi> e
 2. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
fix e :: "'v option edge"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. j' e \<le> capacity \<Psi> e
 2. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
consider (None) "e = (None, Some y)"
        | (Some) x y where "e = (Some x, Some y)" "(x, y) \<in> set ?E"
        | (old) x y where "e = (Some x, Some y)" "(x, y) \<notin> set ?E"
        | y' where "e = (None, Some y')" "y \<noteq> y'"
        | "e = (None, None)" | x where "e = (Some x, None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>e = (None, \<langle>y\<rangle>) \<Longrightarrow> thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> thesis; \<And>y'. \<lbrakk>e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> thesis; e = (None, None) \<Longrightarrow> thesis; \<And>x. e = (\<langle>x\<rangle>, None) \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by(cases e; case_tac a; case_tac b)(auto)
[PROOF STATE]
proof (state)
this:
\<lbrakk>e = (None, \<langle>y\<rangle>) \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>y'. \<lbrakk>e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> ?thesis; e = (None, None) \<Longrightarrow> ?thesis; \<And>x. e = (\<langle>x\<rangle>, None) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (2 subgoals):
 1. \<And>e. j' e \<le> capacity \<Psi> e
 2. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>e = (None, \<langle>y\<rangle>) \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>y'. \<lbrakk>e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> ?thesis; e = (None, None) \<Longrightarrow> ?thesis; \<And>x. e = (\<langle>x\<rangle>, None) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "j' e \<le> capacity \<Psi> e"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>e = (None, \<langle>y\<rangle>) \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>y'. \<lbrakk>e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> ?thesis; e = (None, None) \<Longrightarrow> ?thesis; \<And>x. e = (\<langle>x\<rangle>, None) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
using uy \<zeta>_pos flowD_capacity[OF j, of e]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>e = (None, \<langle>y\<rangle>) \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>x ya. \<lbrakk>e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> ?thesis; \<And>y'. \<lbrakk>e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> ?thesis; e = (None, None) \<Longrightarrow> ?thesis; \<And>x. e = (\<langle>x\<rangle>, None) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
0 < u y
0 < \<zeta>
j e \<le> capacity \<Psi> e

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
proof(cases)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y\<rangle>)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 6. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
e = (None, \<langle>y\<rangle>)

goal (6 subgoals):
 1. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y\<rangle>)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 6. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "\<zeta> \<le> u y - j (None, Some y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> \<le> u y - j (None, \<langle>y\<rangle>)
[PROOF STEP]
by(simp add: \<zeta>_def)
[PROOF STATE]
proof (state)
this:
\<zeta> \<le> u y - j (None, \<langle>y\<rangle>)

goal (6 subgoals):
 1. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y\<rangle>)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 6. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<zeta> \<le> u y - j (None, \<langle>y\<rangle>)
[PROOF STEP]
have "\<zeta> + j (None, Some y) \<le> u y"
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<le> u y - j (None, \<langle>y\<rangle>)

goal (1 subgoal):
 1. \<zeta> + j (None, \<langle>y\<rangle>) \<le> u y
[PROOF STEP]
using \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<le> u y - j (None, \<langle>y\<rangle>)
0 < \<zeta>

goal (1 subgoal):
 1. \<zeta> + j (None, \<langle>y\<rangle>) \<le> u y
[PROOF STEP]
by (auto simp add: ennreal_le_minus_iff)
[PROOF STATE]
proof (state)
this:
\<zeta> + j (None, \<langle>y\<rangle>) \<le> u y

goal (6 subgoals):
 1. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y\<rangle>)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 6. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<zeta> + j (None, \<langle>y\<rangle>) \<le> u y

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
using reachable_V[OF reach] None \<Psi>.flowD_outside[OF j, of "(Some y, None)"] uy
[PROOF STATE]
proof (prove)
using this:
\<zeta> + j (None, \<langle>y\<rangle>) \<le> u y
vertex \<Gamma> y
e = (None, \<langle>y\<rangle>)
(\<langle>y\<rangle>, None) \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> j (\<langle>y\<rangle>, None) = 0
0 < u y

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
by(auto simp add: j'_def E_def)
[PROOF STATE]
proof (state)
this:
j' e \<le> capacity \<Psi> e

goal (5 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
case (Some x' y')
[PROOF STATE]
proof (state)
this:
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<in> set (zip (y # q) q)

goal (5 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have e: "\<zeta> \<le> cap' (x', y')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> \<le> cap' (x', y')
[PROOF STEP]
using Some(2)
[PROOF STATE]
proof (prove)
using this:
(x', y') \<in> set (zip (y # q) q)

goal (1 subgoal):
 1. \<zeta> \<le> cap' (x', y')
[PROOF STEP]
by(rule \<zeta>_le)
[PROOF STATE]
proof (state)
this:
\<zeta> \<le> cap' (x', y')

goal (5 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<zeta> \<le> cap' (x', y')
[PROOF STEP]
consider (backward) "edge \<Gamma> x' y'" "x' \<noteq> a" | (forward) "edge \<Gamma> y' x'" "\<not> edge \<Gamma> x' y'"
          | (a') "edge \<Gamma> x' y'" "x' = a"
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<le> cap' (x', y')

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using Some \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<le> cap' (x', y')
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<in> set (zip (y # q) q)
0 < \<zeta>

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by(auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> ?thesis; \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> ?thesis; \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (5 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<in> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 5. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> ?thesis; \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> ?thesis; \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> ?thesis; \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> ?thesis; \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
case backward
[PROOF STATE]
proof (state)
this:
edge \<Gamma> x' y'
x' \<noteq> a

goal (3 subgoals):
 1. \<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "\<zeta> \<le> f (x', y') + j (Some y', Some x') - j (Some x', Some y')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> \<le> f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
[PROOF STEP]
using e backward Some(1)
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<le> cap' (x', y')
edge \<Gamma> x' y'
x' \<noteq> a
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)

goal (1 subgoal):
 1. \<zeta> \<le> f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
[PROOF STEP]
by(simp add: g_simps)
[PROOF STATE]
proof (state)
this:
\<zeta> \<le> f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>)

goal (3 subgoals):
 1. \<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
hence "\<zeta> + j (Some x', Some y') - j (Some y', Some x') \<le> (f (x', y') + j (Some y', Some x') - j (Some x', Some y')) + j (Some x', Some y') - j (Some y', Some x')"
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<le> f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>)

goal (1 subgoal):
 1. \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>)
[PROOF STEP]
by(intro ennreal_minus_mono add_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>)

goal (3 subgoals):
 1. \<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>)

goal (3 subgoals):
 1. \<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "\<dots> = f (x', y')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) = f (x', y')
[PROOF STEP]
using j_le_f[OF \<open>edge \<Gamma> x' y'\<close>]
[PROOF STATE]
proof (prove)
using this:
j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) \<le> f (x', y')

goal (1 subgoal):
 1. f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) = f (x', y')
[PROOF STEP]
by(simp_all add: add_increasing2 less_top diff_add_assoc2_ennreal)
[PROOF STATE]
proof (state)
this:
f (x', y') + j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) - j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) = f (x', y')

goal (3 subgoals):
 1. \<lbrakk>edge \<Gamma> x' y'; x' \<noteq> a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> f (x', y')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> f (x', y')

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
using Some backward
[PROOF STATE]
proof (prove)
using this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> f (x', y')
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<in> set (zip (y # q) q)
edge \<Gamma> x' y'
x' \<noteq> a

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
by(auto simp add: j'_def E_def dest: in_set_tlD E_antiparallel)
[PROOF STATE]
proof (state)
this:
j' e \<le> capacity \<Psi> e

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
case forward
[PROOF STATE]
proof (state)
this:
edge \<Gamma> y' x'
\<not> edge \<Gamma> x' y'

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "\<zeta> + j (Some x', Some y') - j (Some y', Some x') \<le> \<zeta> + j (Some x', Some y')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
[PROOF STEP]
by(rule diff_le_self_ennreal)
[PROOF STATE]
proof (state)
this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>)

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>)

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "j (Some x', Some y') \<le> d_IN j (Some y')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) \<le> d_IN j \<langle>y'\<rangle>
[PROOF STEP]
by(rule d_IN_ge_point)
[PROOF STATE]
proof (state)
this:
j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) \<le> d_IN j \<langle>y'\<rangle>

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) \<le> d_IN j \<langle>y'\<rangle>

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>y'\<rangle> \<le> weight \<Gamma> y'
[PROOF STEP]
by(rule IN_j_le_weight)
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>y'\<rangle> \<le> weight \<Gamma> y'

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>y'\<rangle> \<le> weight \<Gamma> y'

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "\<zeta> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> \<le> 1
[PROOF STEP]
using e forward
[PROOF STATE]
proof (prove)
using this:
\<zeta> \<le> cap' (x', y')
edge \<Gamma> y' x'
\<not> edge \<Gamma> x' y'

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

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> \<zeta> + x \<le> \<zeta> + y; \<And>x y. x \<le> y \<Longrightarrow> \<zeta> + x \<le> \<zeta> + y; \<And>x y. x \<le> y \<Longrightarrow> x + weight \<Gamma> y' \<le> y + weight \<Gamma> y'\<rbrakk> \<Longrightarrow> \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> 1 + weight \<Gamma> y'
[PROOF STEP]
have "\<zeta> + j (Some x', Some y') - j (Some y', Some x') \<le> max (weight \<Gamma> x') (weight \<Gamma> y') + 1"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> \<zeta> + x \<le> \<zeta> + y; \<And>x y. x \<le> y \<Longrightarrow> \<zeta> + x \<le> \<zeta> + y; \<And>x y. x \<le> y \<Longrightarrow> x + weight \<Gamma> y' \<le> y + weight \<Gamma> y'\<rbrakk> \<Longrightarrow> \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> 1 + weight \<Gamma> y'

goal (1 subgoal):
 1. \<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> max (weight \<Gamma> x') (weight \<Gamma> y') + 1
[PROOF STEP]
by(simp add: add_left_mono add_right_mono max_def)(metis (no_types, lifting) add.commute add_right_mono less_imp_le less_le_trans not_le)
[PROOF STATE]
proof (state)
this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> max (weight \<Gamma> x') (weight \<Gamma> y') + 1

goal (2 subgoals):
 1. \<lbrakk>edge \<Gamma> y' x'; \<not> edge \<Gamma> x' y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> max (weight \<Gamma> x') (weight \<Gamma> y') + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> max (weight \<Gamma> x') (weight \<Gamma> y') + 1

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
using Some forward e
[PROOF STATE]
proof (prove)
using this:
\<zeta> + j (\<langle>x'\<rangle>, \<langle>y'\<rangle>) - j (\<langle>y'\<rangle>, \<langle>x'\<rangle>) \<le> max (weight \<Gamma> x') (weight \<Gamma> y') + 1
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<in> set (zip (y # q) q)
edge \<Gamma> y' x'
\<not> edge \<Gamma> x' y'
\<zeta> \<le> cap' (x', y')

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
by(auto simp add: j'_def E_def max_def dest: in_set_tlD E_antiparallel)
[PROOF STATE]
proof (state)
this:
j' e \<le> capacity \<Psi> e

goal (1 subgoal):
 1. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
case a'
[PROOF STATE]
proof (state)
this:
edge \<Gamma> x' y'
x' = a

goal (1 subgoal):
 1. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
with Some
[PROOF STATE]
proof (chain)
picking this:
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<in> set (zip (y # q) q)
edge \<Gamma> x' y'
x' = a
[PROOF STEP]
have "a \<in> set (map fst (zip (y # q) q))"
[PROOF STATE]
proof (prove)
using this:
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<in> set (zip (y # q) q)
edge \<Gamma> x' y'
x' = a

goal (1 subgoal):
 1. a \<in> set (map fst (zip (y # q) q))
[PROOF STEP]
by(auto intro: rev_image_eqI)
[PROOF STATE]
proof (state)
this:
a \<in> set (map fst (zip (y # q) q))

goal (1 subgoal):
 1. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a \<in> set (map fst (zip (y # q) q))

goal (1 subgoal):
 1. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "map fst (zip (y # q) q) = butlast (y # q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map fst (zip (y # q) q) = butlast (y # q)
[PROOF STEP]
by(induction q arbitrary: y) auto
[PROOF STATE]
proof (state)
this:
map fst (zip (y # q) q) = butlast (y # q)

goal (1 subgoal):
 1. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a \<in> set (butlast (y # q))
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
a \<in> set (butlast (y # q))

goal (1 subgoal):
 1. False
[PROOF STEP]
using rtrancl_path_last[OF q q_Nil] distinct q_Nil
[PROOF STATE]
proof (prove)
using this:
a \<in> set (butlast (y # q))
last q = a
distinct (y # q)
q \<noteq> []

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

goal (1 subgoal):
 1. \<lbrakk>edge \<Gamma> x' y'; x' = a\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
j' e \<le> capacity \<Psi> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
j' e \<le> capacity \<Psi> e

goal (4 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
case (old x' y')
[PROOF STATE]
proof (state)
this:
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<notin> set (zip (y # q) q)

goal (4 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
hence "j' e \<le> j e"
[PROOF STATE]
proof (prove)
using this:
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<notin> set (zip (y # q) q)

goal (1 subgoal):
 1. j' e \<le> j e
[PROOF STEP]
using \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
e = (\<langle>x'\<rangle>, \<langle>y'\<rangle>)
(x', y') \<notin> set (zip (y # q) q)
0 < \<zeta>

goal (1 subgoal):
 1. j' e \<le> j e
[PROOF STEP]
by(auto simp add: j'_def E_def intro!: diff_le_self_ennreal)
[PROOF STATE]
proof (state)
this:
j' e \<le> j e

goal (4 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
j' e \<le> j e

goal (4 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
have "j e \<le> capacity \<Psi> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j e \<le> capacity \<Psi> e
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
flow \<Psi> j

goal (1 subgoal):
 1. j e \<le> capacity \<Psi> e
[PROOF STEP]
by(rule flowD_capacity)
[PROOF STATE]
proof (state)
this:
j e \<le> capacity \<Psi> e

goal (4 subgoals):
 1. \<And>x ya. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, \<langle>ya\<rangle>); (x, ya) \<notin> set (zip (y # q) q)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 4. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
j' e \<le> capacity \<Psi> e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
j' e \<le> capacity \<Psi> e

goal (1 subgoal):
 1. j' e \<le> capacity \<Psi> e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
j' e \<le> capacity \<Psi> e

goal (3 subgoals):
 1. \<And>y'. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, \<langle>y'\<rangle>); y \<noteq> y'\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 2. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (None, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
 3. \<And>x. \<lbrakk>0 < u y; 0 < \<zeta>; j e \<le> capacity \<Psi> e; e = (\<langle>x\<rangle>, None)\<rbrakk> \<Longrightarrow> j' e \<le> capacity \<Psi> e
[PROOF STEP]
qed(auto simp add: j'_def E_def \<Psi>.flowD_outside[OF j] uy)
[PROOF STATE]
proof (state)
this:
j' e \<le> capacity \<Psi> e

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
fix x'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
assume x': "x' \<noteq> source \<Psi>" "x' \<noteq> sink \<Psi>"
[PROOF STATE]
proof (state)
this:
x' \<noteq> source \<Psi>
x' \<noteq> sink \<Psi>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x' \<noteq> source \<Psi>
x' \<noteq> sink \<Psi>
[PROOF STEP]
obtain x'' where x'': "x' = Some x''"
[PROOF STATE]
proof (prove)
using this:
x' \<noteq> source \<Psi>
x' \<noteq> sink \<Psi>

goal (1 subgoal):
 1. (\<And>x''. x' = \<langle>x''\<rangle> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' = \<langle>x''\<rangle>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
have "d_OUT ?j' x' = \<zeta> * card (set [(x'', y) \<leftarrow> E. x'' = x']) + d_OUT j x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'
[PROOF STEP]
by(rule OUT_j')
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = x') E))) + d_OUT j x'

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
have "card (set [(x'', y) \<leftarrow> E. x'' = x']) = card (set [(y, x'') \<leftarrow> E. x'' = x'])" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "?lhs = length [(x'', y) \<leftarrow> E. x'' = x']"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = length (filter (\<lambda>(x'', y). x'' = x') E)
[PROOF STEP]
using distinct
[PROOF STATE]
proof (prove)
using this:
distinct (y # q)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = length (filter (\<lambda>(x'', y). x'' = x') E)
[PROOF STEP]
by(subst distinct_card)(auto simp add: E_def filter_map distinct_map inj_map_prod' distinct_zipI1)
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x'', y). x'' = x') E)) = length (filter (\<lambda>(x'', y). x'' = x') E)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x'', y). x'' = x') E)) = length (filter (\<lambda>(x'', y). x'' = x') E)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "\<dots> = length [x''' \<leftarrow> map fst ?E. x''' = x'']"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>(x'', y). x'' = x') E) = length (filter (\<lambda>x'''. x''' = x'') (map fst (zip (y # q) q)))
[PROOF STEP]
by(simp add: E_def x'' split_beta cong: filter_cong)
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>(x'', y). x'' = x') E) = length (filter (\<lambda>x'''. x''' = x'') (map fst (zip (y # q) q)))

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>(x'', y). x'' = x') E) = length (filter (\<lambda>x'''. x''' = x'') (map fst (zip (y # q) q)))

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "map fst ?E = butlast (y # q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map fst (zip (y # q) q) = butlast (y # q)
[PROOF STEP]
by(induction q arbitrary: y) simp_all
[PROOF STATE]
proof (state)
this:
map fst (zip (y # q) q) = butlast (y # q)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map fst (zip (y # q) q) = butlast (y # q)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "[x''' \<leftarrow> butlast (y # q). x''' = x''] = [x''' \<leftarrow> y # q. x''' = x'']"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>x'''. x''' = x'') (butlast (y # q)) = filter (\<lambda>x'''. x''' = x'') (y # q)
[PROOF STEP]
using q_Nil rtrancl_path_last[OF q q_Nil] x' x''
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []
last q = a
x' \<noteq> source \<Psi>
x' \<noteq> sink \<Psi>
x' = \<langle>x''\<rangle>

goal (1 subgoal):
 1. filter (\<lambda>x'''. x''' = x'') (butlast (y # q)) = filter (\<lambda>x'''. x''' = x'') (y # q)
[PROOF STEP]
by(cases q rule: rev_cases) simp_all
[PROOF STATE]
proof (state)
this:
filter (\<lambda>x'''. x''' = x'') (butlast (y # q)) = filter (\<lambda>x'''. x''' = x'') (y # q)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter (\<lambda>x'''. x''' = x'') (butlast (y # q)) = filter (\<lambda>x'''. x''' = x'') (y # q)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "q = map snd ?E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q = map snd (zip (y # q) q)
[PROOF STEP]
by(induction q arbitrary: y) auto
[PROOF STATE]
proof (state)
this:
q = map snd (zip (y # q) q)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
q = map snd (zip (y # q) q)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "length [x''' \<leftarrow> y # \<dots>. x''' = x''] = length [x'' \<leftarrow> map snd E. x'' = x']"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>x'''. x''' = x'') (y # map snd (zip (y # q) q))) = length (filter (\<lambda>x''. x'' = x') (map snd E))
[PROOF STEP]
using x''
[PROOF STATE]
proof (prove)
using this:
x' = \<langle>x''\<rangle>

goal (1 subgoal):
 1. length (filter (\<lambda>x'''. x''' = x'') (y # map snd (zip (y # q) q))) = length (filter (\<lambda>x''. x'' = x') (map snd E))
[PROOF STEP]
by(simp add: E_def cong: filter_cong)
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x'''. x''' = x'') (y # map snd (zip (y # q) q))) = length (filter (\<lambda>x''. x'' = x') (map snd E))

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x'''. x''' = x'') (y # map snd (zip (y # q) q))) = length (filter (\<lambda>x''. x'' = x') (map snd E))

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "\<dots> = length [(y, x'') \<leftarrow> E. x'' = x']"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>x''. x'' = x') (map snd E)) = length (filter (\<lambda>(y, x''). x'' = x') E)
[PROOF STEP]
by(simp cong: filter_cong add: split_beta)
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x''. x'' = x') (map snd E)) = length (filter (\<lambda>(y, x''). x'' = x') E)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>x''. x'' = x') (map snd E)) = length (filter (\<lambda>(y, x''). x'' = x') E)

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>(y, x''). x'' = x') E) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
using distinct
[PROOF STATE]
proof (prove)
using this:
distinct (y # q)

goal (1 subgoal):
 1. length (filter (\<lambda>(y, x''). x'' = x') E) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
by(subst distinct_card)(auto simp add: E_def filter_map distinct_map inj_map_prod' distinct_zipI1)
[PROOF STATE]
proof (state)
this:
length (filter (\<lambda>(y, x''). x'' = x') E) = card (set (filter (\<lambda>(y, x''). x'' = x') E))

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (set (filter (\<lambda>a. case a of (x'', y) \<Rightarrow> x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (set (filter (\<lambda>a. case a of (x'', y) \<Rightarrow> x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))

goal (1 subgoal):
 1. card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set (filter (\<lambda>(x'', y). x'' = x') E)) = card (set (filter (\<lambda>(y, x''). x'' = x') E))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
have "\<zeta> * \<dots> + d_OUT j x' =  d_IN ?j' x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_OUT j x' = d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x'
[PROOF STEP]
unfolding flowD_KIR[OF j x']
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x' = d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x'
[PROOF STEP]
by(rule IN_j'[symmetric])
[PROOF STATE]
proof (state)
this:
\<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_OUT j x' = d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x'

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_OUT j x' = d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x'

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
have "d_IN ?j' x' \<noteq> \<top>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' \<noteq> \<top>
[PROOF STEP]
using \<Psi>.flowD_finite_IN[OF j x'(2)] finite_\<zeta> IN_j'[of x']
[PROOF STATE]
proof (prove)
using this:
d_IN j x' \<noteq> \<top>
\<zeta> < \<top>
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' = \<zeta> * of_nat (card (set (filter (\<lambda>(y, x''). x'' = x') E))) + d_IN j x'

goal (1 subgoal):
 1. d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' \<noteq> \<top>
[PROOF STEP]
by (auto simp: top_add ennreal_mult_eq_top_iff)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' \<noteq> \<top>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR j' x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
KIR (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x'
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' \<noteq> \<top>
[PROOF STEP]
show "KIR j' x'"
[PROOF STATE]
proof (prove)
using this:
KIR (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x'
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' \<noteq> \<top>

goal (1 subgoal):
 1. KIR j' x'
[PROOF STEP]
unfolding j'_def
[PROOF STATE]
proof (prove)
using this:
KIR (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x'
d_IN (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) x' \<noteq> \<top>

goal (1 subgoal):
 1. KIR (cleanup (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e)) x'
[PROOF STEP]
by(rule KIR_cleanup)
[PROOF STATE]
proof (state)
this:
KIR j' x'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
flow \<Psi> j'

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
hence "value_flow \<Psi> j' \<le> \<alpha>"
[PROOF STATE]
proof (prove)
using this:
flow \<Psi> j'

goal (1 subgoal):
 1. value_flow \<Psi> j' \<le> \<alpha>
[PROOF STEP]
unfolding \<alpha>_def
[PROOF STATE]
proof (prove)
using this:
flow \<Psi> j'

goal (1 subgoal):
 1. value_flow \<Psi> j' \<le> \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>))
[PROOF STEP]
by(auto intro: SUP_upper)
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j' \<le> \<alpha>

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j' \<le> \<alpha>

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
have "value_flow \<Psi> j' > value_flow \<Psi> j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
have "value_flow \<Psi> j + 0 < value_flow \<Psi> j + \<zeta> * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. value_flow \<Psi> j + 0 < value_flow \<Psi> j + \<zeta> * 1
[PROOF STEP]
using \<zeta>_pos value_j finite_flow
[PROOF STATE]
proof (prove)
using this:
0 < \<zeta>
value_flow \<Psi> j = \<alpha>
\<alpha> \<noteq> \<top>

goal (1 subgoal):
 1. value_flow \<Psi> j + 0 < value_flow \<Psi> j + \<zeta> * 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j + 0 < value_flow \<Psi> j + \<zeta> * 1

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j + 0 < value_flow \<Psi> j + \<zeta> * 1

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
have "[(x', y') \<leftarrow> E. x' = None] = [(None, Some y)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>(x', y'). x' = None) E = [(None, \<langle>y\<rangle>)]
[PROOF STEP]
using q_Nil
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []

goal (1 subgoal):
 1. filter (\<lambda>(x', y'). x' = None) E = [(None, \<langle>y\<rangle>)]
[PROOF STEP]
by(cases q)(auto simp add: E_def filter_map cong: filter_cong split_beta)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>(x', y'). x' = None) E = [(None, \<langle>y\<rangle>)]

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
hence "\<zeta> * 1 \<le> \<zeta> * card (set [(x', y') \<leftarrow> E. x' = None])"
[PROOF STATE]
proof (prove)
using this:
filter (\<lambda>(x', y'). x' = None) E = [(None, \<langle>y\<rangle>)]

goal (1 subgoal):
 1. \<zeta> * 1 \<le> \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E)))
[PROOF STEP]
using \<zeta>_pos
[PROOF STATE]
proof (prove)
using this:
filter (\<lambda>(x', y'). x' = None) E = [(None, \<langle>y\<rangle>)]
0 < \<zeta>

goal (1 subgoal):
 1. \<zeta> * 1 \<le> \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E)))
[PROOF STEP]
by(intro mult_left_mono)(auto simp add: E_def real_of_nat_ge_one_iff neq_Nil_conv card.insert_remove)
[PROOF STATE]
proof (state)
this:
\<zeta> * 1 \<le> \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E)))

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<zeta> * 1 \<le> \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E)))

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
have "value_flow \<Psi> j + \<dots> = value_flow \<Psi> ?j'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. value_flow \<Psi> j + \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E))) = value_flow \<Psi> (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e)
[PROOF STEP]
using OUT_j'
[PROOF STATE]
proof (prove)
using this:
d_OUT (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) ?x' = \<zeta> * of_nat (card (set (filter (\<lambda>(x'', y). x'' = ?x') E))) + d_OUT j ?x'

goal (1 subgoal):
 1. value_flow \<Psi> j + \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E))) = value_flow \<Psi> (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e)
[PROOF STEP]
by(simp add: add.commute)
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j + \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E))) = value_flow \<Psi> (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e)

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j + \<zeta> * of_nat (card (set (filter (\<lambda>(x', y'). x' = None) E))) = value_flow \<Psi> (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e)

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
have "\<dots> = value_flow \<Psi> j'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. value_flow \<Psi> (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) = value_flow \<Psi> j'
[PROOF STEP]
unfolding j'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. value_flow \<Psi> (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) = value_flow \<Psi> (cleanup (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e))
[PROOF STEP]
by(subst value_flow_cleanup)(auto simp add: E_def \<Psi>.flowD_outside[OF j])
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> (\<lambda>e. (if e \<in> set E then \<zeta> else 0) + j e) = value_flow \<Psi> j'

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> value_flow \<Psi> j + x \<le> value_flow \<Psi> j + y) \<Longrightarrow> value_flow \<Psi> j + 0 < value_flow \<Psi> j'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> value_flow \<Psi> j + x \<le> value_flow \<Psi> j + y) \<Longrightarrow> value_flow \<Psi> j + 0 < value_flow \<Psi> j'

goal (1 subgoal):
 1. value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
by(simp add: add_left_mono)
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j < value_flow \<Psi> j'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
value_flow \<Psi> j < value_flow \<Psi> j'

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) \<noteq> u y \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
value_flow \<Psi> j' \<le> \<alpha>
value_flow \<Psi> j < value_flow \<Psi> j'
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
value_flow \<Psi> j' \<le> \<alpha>
value_flow \<Psi> j < value_flow \<Psi> j'

goal (1 subgoal):
 1. False
[PROOF STEP]
using finite_flow \<zeta>_pos value_j
[PROOF STATE]
proof (prove)
using this:
value_flow \<Psi> j' \<le> \<alpha>
value_flow \<Psi> j < value_flow \<Psi> j'
\<alpha> \<noteq> \<top>
0 < \<zeta>
value_flow \<Psi> j = \<alpha>

goal (1 subgoal):
 1. False
[PROOF STEP]
by(cases "value_flow \<Psi> j" \<zeta> rule: ennreal2_cases) simp_all
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
reachable ?y \<Longrightarrow> j (None, \<langle>?y\<rangle>) = u ?y

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have sep_h: "y \<in> TER h" if reach: "reachable y" and y: "y \<in> B \<Gamma>" and TER: "y \<in> ?TER f" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> TER h
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
assume y': "y \<notin> TER h"
[PROOF STATE]
proof (state)
this:
y \<notin> TER h

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
from y a(1) disjoint
[PROOF STATE]
proof (chain)
picking this:
y \<in> B \<Gamma>
a \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
[PROOF STEP]
have yna: "y \<noteq> a"
[PROOF STATE]
proof (prove)
using this:
y \<in> B \<Gamma>
a \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. y \<noteq> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<noteq> a

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
from reach
[PROOF STATE]
proof (chain)
picking this:
reachable y
[PROOF STEP]
obtain p' where "path G y p' a"
[PROOF STATE]
proof (prove)
using this:
reachable y

goal (1 subgoal):
 1. (\<And>p'. path G y p' a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding reachable_alt_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p. path G y p a

goal (1 subgoal):
 1. (\<And>p'. path G y p' a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
path G y p' a

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path G y p' a
[PROOF STEP]
obtain p' where p': "path G y p' a" and distinct: "distinct (y # p')"
[PROOF STATE]
proof (prove)
using this:
path G y p' a

goal (1 subgoal):
 1. (\<And>p'. \<lbrakk>path G y p' a; distinct (y # p')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(rule rtrancl_path_distinct)
[PROOF STATE]
proof (state)
this:
path G y p' a
distinct (y # p')

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
have SINK: "y \<in> SINK h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> SINK h
[PROOF STEP]
using y disjoint
[PROOF STATE]
proof (prove)
using this:
y \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. y \<in> SINK h
[PROOF STEP]
by(auto simp add: SINK.simps d_OUT_def nn_integral_0_iff emeasure_count_space_eq_0 intro: currentD_outside[OF g] dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
y \<in> SINK h

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
have hg: "d_IN h y = d_IN g y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h y = d_IN g y
[PROOF STEP]
using reach
[PROOF STATE]
proof (prove)
using this:
reachable y

goal (1 subgoal):
 1. d_IN h y = d_IN g y
[PROOF STEP]
by(simp add: IN_h)
[PROOF STATE]
proof (state)
this:
d_IN h y = d_IN g y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN h y = d_IN g y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = d_IN f y + j (None, Some y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g y = d_IN f y + j (None, \<langle>y\<rangle>)
[PROOF STEP]
by(simp add: IN_g)
[PROOF STATE]
proof (state)
this:
d_IN g y = d_IN f y + j (None, \<langle>y\<rangle>)

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN g y = d_IN f y + j (None, \<langle>y\<rangle>)

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
have "d_IN f y = weight \<Gamma> y - u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN f y = weight \<Gamma> y - u y
[PROOF STEP]
using currentD_weight_IN[OF f, of y] y disjoint TER
[PROOF STATE]
proof (prove)
using this:
d_IN f y \<le> weight (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) y
y \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f

goal (1 subgoal):
 1. d_IN f y = weight \<Gamma> y - u y
[PROOF STEP]
by(auto elim!: SAT.cases)
[PROOF STATE]
proof (state)
this:
d_IN f y = weight \<Gamma> y - u y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN f y = weight \<Gamma> y - u y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
have "d_IN h y < weight \<Gamma> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h y < weight \<Gamma> y
[PROOF STEP]
using y' currentD_weight_IN[OF g, of y] y disjoint SINK
[PROOF STATE]
proof (prove)
using this:
y \<notin> TER h
d_IN g y \<le> weight \<Gamma> y
y \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
y \<in> SINK h

goal (1 subgoal):
 1. d_IN h y < weight \<Gamma> y
[PROOF STEP]
by(auto intro: SAT.intros)
[PROOF STATE]
proof (state)
this:
d_IN h y < weight \<Gamma> y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
d_IN h y = weight \<Gamma> y - u y + j (None, \<langle>y\<rangle>)
d_IN h y < weight \<Gamma> y
[PROOF STEP]
have le: "j (None, Some y) < u y"
[PROOF STATE]
proof (prove)
using this:
d_IN h y = weight \<Gamma> y - u y + j (None, \<langle>y\<rangle>)
d_IN h y < weight \<Gamma> y

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) < u y
[PROOF STEP]
by(cases "weight \<Gamma> y" "u y" "j (None, Some y)" rule: ennreal3_cases; cases "u y \<le> weight \<Gamma> y")
        (auto simp: ennreal_minus ennreal_plus[symmetric] add_top ennreal_less_iff ennreal_neg simp del: ennreal_plus)
[PROOF STATE]
proof (state)
this:
j (None, \<langle>y\<rangle>) < u y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
j (None, \<langle>y\<rangle>) < u y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
from reach
[PROOF STATE]
proof (chain)
picking this:
reachable y
[PROOF STEP]
have "j (None, \<langle>y\<rangle>) = u y"
[PROOF STATE]
proof (prove)
using this:
reachable y

goal (1 subgoal):
 1. j (None, \<langle>y\<rangle>) = u y
[PROOF STEP]
by(rule reachable_full)
[PROOF STATE]
proof (state)
this:
j (None, \<langle>y\<rangle>) = u y

goal (1 subgoal):
 1. y \<notin> TER h \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
j (None, \<langle>y\<rangle>) < u y
j (None, \<langle>y\<rangle>) = u y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
j (None, \<langle>y\<rangle>) < u y
j (None, \<langle>y\<rangle>) = u y

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>reachable ?y; ?y \<in> B \<Gamma>; ?y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f\<rbrakk> \<Longrightarrow> ?y \<in> TER h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have w': "wave \<Gamma> h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wave \<Gamma> h
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. separating \<Gamma> (TER h)
 2. current \<Gamma> h
[PROOF STEP]
show sep: "separating \<Gamma> (TER h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. separating \<Gamma> (TER h)
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> separating \<Gamma> (TER h)

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> separating \<Gamma> (TER h)
[PROOF STEP]
obtain x p y where x: "x \<in> A \<Gamma>" and y: "y \<in> B \<Gamma>" and p: "path \<Gamma> x p y"
        and x': "x \<notin> TER h" and bypass: "\<And>z. z \<in> set p \<Longrightarrow> z \<notin> TER h"
[PROOF STATE]
proof (prove)
using this:
\<not> separating \<Gamma> (TER h)

goal (1 subgoal):
 1. (\<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y; x \<notin> TER h; \<And>z. z \<in> set p \<Longrightarrow> z \<notin> TER h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: separating_gen.simps)
[PROOF STATE]
proof (state)
this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y
x \<notin> TER h
?z \<in> set p \<Longrightarrow> ?z \<notin> TER h

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
from p disjoint x y
[PROOF STATE]
proof (chain)
picking this:
path \<Gamma> x p y
A \<Gamma> \<inter> B \<Gamma> = {}
x \<in> A \<Gamma>
y \<in> B \<Gamma>
[PROOF STEP]
have p_eq: "p = [y]" and edge: "(x, y) \<in> \<^bold>E"
[PROOF STATE]
proof (prove)
using this:
path \<Gamma> x p y
A \<Gamma> \<inter> B \<Gamma> = {}
x \<in> A \<Gamma>
y \<in> B \<Gamma>

goal (1 subgoal):
 1. p = [y] &&& (x, y) \<in> \<^bold>E
[PROOF STEP]
by -(erule rtrancl_path.cases, auto dest: bipartite_E)+
[PROOF STATE]
proof (state)
this:
p = [y]
(x, y) \<in> \<^bold>E

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
from p_eq bypass
[PROOF STATE]
proof (chain)
picking this:
p = [y]
?z \<in> set p \<Longrightarrow> ?z \<notin> TER h
[PROOF STEP]
have y': "y \<notin> TER h"
[PROOF STATE]
proof (prove)
using this:
p = [y]
?z \<in> set p \<Longrightarrow> ?z \<notin> TER h

goal (1 subgoal):
 1. y \<notin> TER h
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<notin> TER h

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
have "reachable x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachable x
[PROOF STEP]
using x'
[PROOF STATE]
proof (prove)
using this:
x \<notin> TER h

goal (1 subgoal):
 1. reachable x
[PROOF STEP]
by(rule contrapos_np)(simp add: SINK.simps d_OUT_def SAT.A x)
[PROOF STATE]
proof (state)
this:
reachable x

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
hence reach: "reachable y"
[PROOF STATE]
proof (prove)
using this:
reachable x

goal (1 subgoal):
 1. reachable y
[PROOF STEP]
using edge
[PROOF STATE]
proof (prove)
using this:
reachable x
(x, y) \<in> \<^bold>E

goal (1 subgoal):
 1. reachable y
[PROOF STEP]
by(rule reachable_AB)
[PROOF STATE]
proof (state)
this:
reachable y

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
have *: "x \<notin> \<E>\<^bsub>?\<Gamma>\<^esub> (?TER f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
[PROOF STEP]
using x'
[PROOF STATE]
proof (prove)
using this:
x \<notin> TER h

goal (1 subgoal):
 1. x \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
[PROOF STEP]
proof(rule contrapos_nn)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
assume *: "x \<in> \<E>\<^bsub>?\<Gamma>\<^esub> (?TER f)"
[PROOF STATE]
proof (state)
this:
x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
have "d_OUT h x \<le> d_OUT g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h x \<le> d_OUT g x
[PROOF STEP]
using h_le_g
[PROOF STATE]
proof (prove)
using this:
h ?e \<le> g ?e

goal (1 subgoal):
 1. d_OUT h x \<le> d_OUT g x
[PROOF STEP]
by(rule d_OUT_mono)
[PROOF STATE]
proof (state)
this:
d_OUT h x \<le> d_OUT g x

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT h x \<le> d_OUT g x

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
[PROOF STEP]
have "x \<noteq> a"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)

goal (1 subgoal):
 1. x \<noteq> a
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
a \<in> A \<Gamma>
a \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)

goal (1 subgoal):
 1. x \<noteq> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<noteq> a

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> a
[PROOF STEP]
have "d_OUT j (Some x) = d_IN j (Some x)"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> a

goal (1 subgoal):
 1. KIR j \<langle>x\<rangle>
[PROOF STEP]
by(auto intro: flowD_KIR[OF j])
[PROOF STATE]
proof (state)
this:
KIR j \<langle>x\<rangle>

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
hence "d_OUT g x \<le> d_OUT f x"
[PROOF STATE]
proof (prove)
using this:
KIR j \<langle>x\<rangle>

goal (1 subgoal):
 1. d_OUT g x \<le> d_OUT f x
[PROOF STEP]
using OUT_g_A[OF x] IN_j[of "Some x"] finite_flow
[PROOF STATE]
proof (prove)
using this:
KIR j \<langle>x\<rangle>
d_OUT g x = d_OUT f x + d_IN j \<langle>x\<rangle> - d_OUT j \<langle>x\<rangle>
d_IN j \<langle>x\<rangle> \<le> \<alpha>
\<alpha> \<noteq> \<top>

goal (1 subgoal):
 1. d_OUT g x \<le> d_OUT f x
[PROOF STEP]
by(auto split: if_split_asm)
[PROOF STATE]
proof (state)
this:
d_OUT g x \<le> d_OUT f x

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT g x \<le> d_OUT f x

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f x = 0
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)

goal (1 subgoal):
 1. d_OUT f x = 0
[PROOF STEP]
by(auto elim: SINK.cases)
[PROOF STATE]
proof (state)
this:
d_OUT f x = 0

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT h x \<le> 0
[PROOF STEP]
have "x \<in> SINK h"
[PROOF STATE]
proof (prove)
using this:
d_OUT h x \<le> 0

goal (1 subgoal):
 1. x \<in> SINK h
[PROOF STEP]
by(simp add: SINK.simps)
[PROOF STATE]
proof (state)
this:
x \<in> SINK h

goal (1 subgoal):
 1. x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) \<Longrightarrow> x \<in> TER h
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> A \<Gamma>
x \<in> SINK h
[PROOF STEP]
show "x \<in> TER h"
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
x \<in> SINK h

goal (1 subgoal):
 1. x \<in> TER h
[PROOF STEP]
by(simp add: SAT.A)
[PROOF STATE]
proof (state)
this:
x \<in> TER h

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
from p p_eq x y
[PROOF STATE]
proof (chain)
picking this:
path \<Gamma> x p y
p = [y]
x \<in> A \<Gamma>
y \<in> B \<Gamma>
[PROOF STEP]
have "path ?\<Gamma> x [y] y" "x \<in> A ?\<Gamma>" "y \<in> B ?\<Gamma>"
[PROOF STATE]
proof (prove)
using this:
path \<Gamma> x p y
p = [y]
x \<in> A \<Gamma>
y \<in> B \<Gamma>

goal (1 subgoal):
 1. path (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) x [y] y &&& x \<in> A (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) &&& y \<in> B (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
path (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>) x [y] y
x \<in> A (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>)
y \<in> B (\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>)

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
from * separatingD[OF separating_essential, OF waveD_separating, OF w this]
[PROOF STATE]
proof (chain)
picking this:
x \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
(\<exists>z\<in>set [y]. z \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)) \<or> x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
[PROOF STEP]
have "y \<in> ?TER f"
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
(\<exists>z\<in>set [y]. z \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)) \<or> x \<in> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)

goal (1 subgoal):
 1. y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
with reach y
[PROOF STATE]
proof (chain)
picking this:
reachable y
y \<in> B \<Gamma>
y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f
[PROOF STEP]
have "y \<in> TER h"
[PROOF STATE]
proof (prove)
using this:
reachable y
y \<in> B \<Gamma>
y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f

goal (1 subgoal):
 1. y \<in> TER h
[PROOF STEP]
by(rule sep_h)
[PROOF STATE]
proof (state)
this:
y \<in> TER h

goal (1 subgoal):
 1. \<not> separating \<Gamma> (TER h) \<Longrightarrow> False
[PROOF STEP]
with y'
[PROOF STATE]
proof (chain)
picking this:
y \<notin> TER h
y \<in> TER h
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y \<notin> TER h
y \<in> TER h

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
separating \<Gamma> (TER h)

goal (1 subgoal):
 1. current \<Gamma> h
[PROOF STEP]
qed(rule h)
[PROOF STATE]
proof (state)
this:
wave \<Gamma> h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have OUT_g_a: "d_OUT g a = d_OUT h a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g a = d_OUT h a
[PROOF STEP]
by(simp add: OUT_h)
[PROOF STATE]
proof (state)
this:
d_OUT g a = d_OUT h a

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
have "a \<notin> \<E> (TER h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> \<E> (TER h)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
assume *: "a \<in> \<E> (TER h)"
[PROOF STATE]
proof (state)
this:
a \<in> \<E> (TER h)

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
have "j (Some a, Some y) = 0" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j (\<langle>a\<rangle>, \<langle>y\<rangle>) = 0
[PROOF STEP]
using flowD_capacity[OF j, of "(Some a, Some y)"] a(1) disjoint
[PROOF STATE]
proof (prove)
using this:
j (\<langle>a\<rangle>, \<langle>y\<rangle>) \<le> capacity \<Psi> (\<langle>a\<rangle>, \<langle>y\<rangle>)
a \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. j (\<langle>a\<rangle>, \<langle>y\<rangle>) = 0
[PROOF STEP]
by(auto split: if_split_asm dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
j (\<langle>a\<rangle>, \<langle>?y\<rangle>) = 0

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j (\<langle>a\<rangle>, \<langle>?y\<rangle>) = 0
[PROOF STEP]
have "d_OUT f a \<le> d_OUT g a"
[PROOF STATE]
proof (prove)
using this:
j (\<langle>a\<rangle>, \<langle>?y\<rangle>) = 0

goal (1 subgoal):
 1. d_OUT f a \<le> d_OUT g a
[PROOF STEP]
unfolding d_OUT_def
      \<comment> \<open>This step requires that @{term j} does not decrease the outflow of @{term a}. That's
          why we set the capacity of the outgoing edges from @{term "Some a"} in @{term \<Psi>} to @{term "0 :: ennreal"}\<close>
[PROOF STATE]
proof (prove)
using this:
j (\<langle>a\<rangle>, \<langle>?y\<rangle>) = 0

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f (a, y)) \<le> (\<Sum>\<^sup>+ y. g (a, y))
[PROOF STEP]
by(intro nn_integral_mono)(auto simp add: g_simps currentD_outside[OF f] intro: )
[PROOF STATE]
proof (state)
this:
d_OUT f a \<le> d_OUT g a

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d_OUT f a \<le> d_OUT g a
[PROOF STEP]
have "a \<in> SINK f"
[PROOF STATE]
proof (prove)
using this:
d_OUT f a \<le> d_OUT g a

goal (1 subgoal):
 1. a \<in> SINK f
[PROOF STEP]
using OUT_g_a *
[PROOF STATE]
proof (prove)
using this:
d_OUT f a \<le> d_OUT g a
d_OUT g a = d_OUT h a
a \<in> \<E> (TER h)

goal (1 subgoal):
 1. a \<in> SINK f
[PROOF STEP]
by(simp add: SINK.simps)
[PROOF STATE]
proof (state)
this:
a \<in> SINK f

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
with a(1)
[PROOF STATE]
proof (chain)
picking this:
a \<in> A \<Gamma>
a \<in> SINK f
[PROOF STEP]
have "a \<in> ?TER f"
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<Gamma>
a \<in> SINK f

goal (1 subgoal):
 1. a \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f
[PROOF STEP]
by(auto intro: SAT.A)
[PROOF STATE]
proof (state)
this:
a \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
with a(2)
[PROOF STATE]
proof (chain)
picking this:
a \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
a \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f
[PROOF STEP]
have a': "\<not> essential \<Gamma> (B \<Gamma>) (?TER f) a"
[PROOF STATE]
proof (prove)
using this:
a \<notin> \<E>\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
a \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f

goal (1 subgoal):
 1. \<not> essential \<Gamma> (B \<Gamma>) (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> essential \<Gamma> (B \<Gamma>) (TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f) a

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
a \<in> \<E> (TER h)
[PROOF STEP]
obtain y where ay: "edge \<Gamma> a y" and y: "y \<in> B \<Gamma>" and y': "y \<notin> TER h"
[PROOF STATE]
proof (prove)
using this:
a \<in> \<E> (TER h)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>edge \<Gamma> a y; y \<in> B \<Gamma>; y \<notin> TER h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using disjoint a(1)
[PROOF STATE]
proof (prove)
using this:
a \<in> \<E> (TER h)
A \<Gamma> \<inter> B \<Gamma> = {}
a \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>edge \<Gamma> a y; y \<in> B \<Gamma>; y \<notin> TER h\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto 4 4 simp add: essential_def elim: rtrancl_path.cases dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
edge \<Gamma> a y
y \<in> B \<Gamma>
y \<notin> TER h

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
from not_essentialD[OF a' rtrancl_path.step, OF ay rtrancl_path.base y]
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> y \<and> (\<exists>z\<in>set [y]. z \<noteq> a \<and> z \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)
[PROOF STEP]
have TER: "y \<in> ?TER f"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> y \<and> (\<exists>z\<in>set [y]. z \<noteq> a \<and> z \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f)

goal (1 subgoal):
 1. y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
have "reachable y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachable y
[PROOF STEP]
using \<open>reachable a\<close>
[PROOF STATE]
proof (prove)
using this:
reachable a

goal (1 subgoal):
 1. reachable y
[PROOF STEP]
by(rule reachable_AB)(simp add: ay)
[PROOF STATE]
proof (state)
this:
reachable y

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
hence "y \<in> TER h"
[PROOF STATE]
proof (prove)
using this:
reachable y

goal (1 subgoal):
 1. y \<in> TER h
[PROOF STEP]
using y TER
[PROOF STATE]
proof (prove)
using this:
reachable y
y \<in> B \<Gamma>
y \<in> TER\<^bsub>\<Gamma>\<lparr>weight := weight \<Gamma> - u\<rparr>\<^esub> f

goal (1 subgoal):
 1. y \<in> TER h
[PROOF STEP]
by(rule sep_h)
[PROOF STATE]
proof (state)
this:
y \<in> TER h

goal (1 subgoal):
 1. a \<in> \<E> (TER h) \<Longrightarrow> False
[PROOF STEP]
with y'
[PROOF STATE]
proof (chain)
picking this:
y \<notin> TER h
y \<in> TER h
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y \<notin> TER h
y \<in> TER h

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<notin> \<E> (TER h)

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
with \<open>a \<in> A \<Gamma>\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<in> A \<Gamma>
a \<notin> \<E> (TER h)
[PROOF STEP]
have "hindrance \<Gamma> h"
[PROOF STATE]
proof (prove)
using this:
a \<in> A \<Gamma>
a \<notin> \<E> (TER h)

goal (1 subgoal):
 1. hindrance \<Gamma> h
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "d_OUT h a = d_OUT g a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h a = d_OUT g a
[PROOF STEP]
by(simp add: OUT_g_a)
[PROOF STATE]
proof (state)
this:
d_OUT h a = d_OUT g a

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT h a = d_OUT g a

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> \<le> d_OUT f a + \<integral>\<^sup>+ y. j (Some y, Some a) \<partial>count_space UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT g a \<le> d_OUT f a + (\<Sum>\<^sup>+ y. j (\<langle>y\<rangle>, \<langle>a\<rangle>))
[PROOF STEP]
unfolding d_OUT_def d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (a, y)) \<le> (\<Sum>\<^sup>+ y. f (a, y)) + (\<Sum>\<^sup>+ y. j (\<langle>y\<rangle>, \<langle>a\<rangle>))
[PROOF STEP]
by(subst nn_integral_add[symmetric])(auto simp add: g_simps intro!: nn_integral_mono diff_le_self_ennreal)
[PROOF STATE]
proof (state)
this:
d_OUT g a \<le> d_OUT f a + (\<Sum>\<^sup>+ y. j (\<langle>y\<rangle>, \<langle>a\<rangle>))

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT g a \<le> d_OUT f a + (\<Sum>\<^sup>+ y. j (\<langle>y\<rangle>, \<langle>a\<rangle>))

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "(\<integral>\<^sup>+ y. j (Some y, Some a) \<partial>count_space UNIV) = (\<integral>\<^sup>+ y. j (y, Some a) \<partial>embed_measure (count_space UNIV) Some)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. j (\<langle>y\<rangle>, \<langle>a\<rangle>)) = \<integral>\<^sup>+ y. j (y, \<langle>a\<rangle>) \<partial>embed_measure (count_space UNIV) Some
[PROOF STEP]
by(simp add: nn_integral_embed_measure measurable_embed_measure1)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. j (\<langle>y\<rangle>, \<langle>a\<rangle>)) = \<integral>\<^sup>+ y. j (y, \<langle>a\<rangle>) \<partial>embed_measure (count_space UNIV) Some

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. j (\<langle>y\<rangle>, \<langle>a\<rangle>)) = \<integral>\<^sup>+ y. j (y, \<langle>a\<rangle>) \<partial>embed_measure (count_space UNIV) Some

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> \<le> d_IN j (Some a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. j (y, \<langle>a\<rangle>) \<partial>embed_measure (count_space UNIV) Some \<le> d_IN j \<langle>a\<rangle>
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. j (y, \<langle>a\<rangle>) \<partial>embed_measure (count_space UNIV) Some \<le> (\<Sum>\<^sup>+ x. j (x, \<langle>a\<rangle>))
[PROOF STEP]
by(auto simp add: embed_measure_count_space nn_integral_count_space_indicator intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. j (y, \<langle>a\<rangle>) \<partial>embed_measure (count_space UNIV) Some \<le> d_IN j \<langle>a\<rangle>

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. j (y, \<langle>a\<rangle>) \<partial>embed_measure (count_space UNIV) Some \<le> d_IN j \<langle>a\<rangle>

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> \<le> \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN j \<langle>a\<rangle> \<le> \<alpha>
[PROOF STEP]
by(rule IN_j)
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>a\<rangle> \<le> \<alpha>

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN j \<langle>a\<rangle> \<le> \<alpha>

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> \<le> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<le> \<epsilon>
[PROOF STEP]
by(rule \<alpha>_le)
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> \<epsilon>

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> \<epsilon>

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "d_OUT f a + \<dots> < d_OUT f a + (weight \<Gamma> a - d_OUT f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f a + \<epsilon> < d_OUT f a + (weight \<Gamma> a - d_OUT f a)
[PROOF STEP]
using \<epsilon>_less
[PROOF STATE]
proof (prove)
using this:
\<epsilon> < weight \<Gamma> a - d_OUT f a

goal (1 subgoal):
 1. d_OUT f a + \<epsilon> < d_OUT f a + (weight \<Gamma> a - d_OUT f a)
[PROOF STEP]
using currentD_finite_OUT[OF f']
[PROOF STATE]
proof (prove)
using this:
\<epsilon> < weight \<Gamma> a - d_OUT f a
d_OUT f ?x \<noteq> \<top>

goal (1 subgoal):
 1. d_OUT f a + \<epsilon> < d_OUT f a + (weight \<Gamma> a - d_OUT f a)
[PROOF STEP]
by (simp add: ennreal_add_left_cancel_less)
[PROOF STATE]
proof (state)
this:
d_OUT f a + \<epsilon> < d_OUT f a + (weight \<Gamma> a - d_OUT f a)

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT f a + \<epsilon> < d_OUT f a + (weight \<Gamma> a - d_OUT f a)

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
have "\<dots> = weight \<Gamma> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f a + (weight \<Gamma> a - d_OUT f a) = weight \<Gamma> a
[PROOF STEP]
using a_le
[PROOF STATE]
proof (prove)
using this:
d_OUT f a < weight \<Gamma> a

goal (1 subgoal):
 1. d_OUT f a + (weight \<Gamma> a - d_OUT f a) = weight \<Gamma> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_OUT f a + (weight \<Gamma> a - d_OUT f a) = weight \<Gamma> a

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> d_OUT f a + x \<le> d_OUT f a + y; \<And>x y. x \<le> y \<Longrightarrow> d_OUT f a + x \<le> d_OUT f a + y; \<And>x y. x \<le> y \<Longrightarrow> d_OUT f a + x \<le> d_OUT f a + y\<rbrakk> \<Longrightarrow> d_OUT h a < weight \<Gamma> a
[PROOF STEP]
show "d_OUT h a < weight \<Gamma> a"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> d_OUT f a + x \<le> d_OUT f a + y; \<And>x y. x \<le> y \<Longrightarrow> d_OUT f a + x \<le> d_OUT f a + y; \<And>x y. x \<le> y \<Longrightarrow> d_OUT f a + x \<le> d_OUT f a + y\<rbrakk> \<Longrightarrow> d_OUT h a < weight \<Gamma> a

goal (1 subgoal):
 1. d_OUT h a < weight \<Gamma> a
[PROOF STEP]
by(simp add: add_left_mono)
[PROOF STATE]
proof (state)
this:
d_OUT h a < weight \<Gamma> a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
hindrance \<Gamma> h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
hindrance \<Gamma> h
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hindrance \<Gamma> h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
using h w'
[PROOF STATE]
proof (prove)
using this:
hindrance \<Gamma> h
current \<Gamma> h
wave \<Gamma> h

goal (1 subgoal):
 1. hindered \<Gamma>
[PROOF STEP]
by(blast intro: hindered.intros)
[PROOF STATE]
proof (state)
this:
hindered \<Gamma>

goal:
No subgoals!
[PROOF STEP]
qed