[STATEMENT]
lemma unhinder_bipartite:
  assumes h: "\<And>n :: nat. current \<Gamma> (h n)"
  and SAT: "\<And>n. (B \<Gamma> \<inter> \<^bold>V) - {b} \<subseteq> SAT \<Gamma> (h n)"
  and b: "b \<in> B \<Gamma>"
  and IN: "(SUP n. d_IN (h n) b) = weight \<Gamma> b"
  and h0_b: "\<And>n. d_IN (h 0) b \<le> d_IN (h n) b"
  and b_V: "b \<in> \<^bold>V"
  shows "\<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
write Inner ("\<langle>_\<rangle>")
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
define edge'
    where "edge' xo yo =
      (case (xo, yo) of
        (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> edge \<Gamma> x y \<or> edge \<Gamma> y x
      | (\<langle>x\<rangle>, SINK) \<Rightarrow> x \<in> A \<Gamma>
      | (SOURCE, \<langle>y\<rangle>) \<Rightarrow> y = b
      | (SINK, \<langle>x\<rangle>) \<Rightarrow> x \<in> A \<Gamma>
      | _ \<Rightarrow> False)" for xo yo
[PROOF STATE]
proof (state)
this:
edge' ?xo ?yo = (case (?xo, ?yo) of (SOURCE, \<langle>y\<rangle>) \<Rightarrow> y = b | (SOURCE, _) \<Rightarrow> False | (vertex.SINK, \<langle>x\<rangle>) \<Rightarrow> x \<in> A \<Gamma> | (vertex.SINK, _) \<Rightarrow> False | (\<langle>x\<rangle>, SOURCE) \<Rightarrow> False | (\<langle>x\<rangle>, vertex.SINK) \<Rightarrow> x \<in> A \<Gamma> | (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> edge \<Gamma> x y \<or> edge \<Gamma> y x)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have edge'_simps [simp]:
    "edge' \<langle>x\<rangle> \<langle>y\<rangle> \<longleftrightarrow> edge \<Gamma> x y \<or> edge \<Gamma> y x"
    "edge' \<langle>x\<rangle> SINK \<longleftrightarrow> x \<in> A \<Gamma>"
    "edge' SOURCE yo \<longleftrightarrow> yo = \<langle>b\<rangle>"
    "edge' SINK \<langle>x\<rangle> \<longleftrightarrow> x \<in> A \<Gamma>"
    "edge' SINK SINK \<longleftrightarrow> False"
    "edge' xo SOURCE \<longleftrightarrow> False"
    for x y yo xo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (edge' \<langle>x\<rangle> \<langle>y\<rangle> = (edge \<Gamma> x y \<or> edge \<Gamma> y x) &&& edge' \<langle>x\<rangle> vertex.SINK = (x \<in> A \<Gamma>) &&& edge' SOURCE yo = (yo = \<langle>b\<rangle>)) &&& edge' vertex.SINK \<langle>x\<rangle> = (x \<in> A \<Gamma>) &&& edge' vertex.SINK vertex.SINK = False &&& edge' xo SOURCE = False
[PROOF STEP]
by(simp_all add: edge'_def split: vertex.split)
[PROOF STATE]
proof (state)
this:
edge' \<langle>?x\<rangle> \<langle>?y\<rangle> = (edge \<Gamma> ?x ?y \<or> edge \<Gamma> ?y ?x)
edge' \<langle>?x\<rangle> vertex.SINK = (?x \<in> A \<Gamma>)
edge' SOURCE ?yo = (?yo = \<langle>b\<rangle>)
edge' vertex.SINK \<langle>?x\<rangle> = (?x \<in> A \<Gamma>)
edge' vertex.SINK vertex.SINK = False
edge' ?xo SOURCE = False

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have edge'E: "thesis" if "edge' xo yo"
    "\<And>x y. \<lbrakk> xo = \<langle>x\<rangle>; yo = \<langle>y\<rangle>; edge \<Gamma> x y \<or> edge \<Gamma> y x \<rbrakk> \<Longrightarrow> thesis"
    "\<And>x. \<lbrakk> xo = \<langle>x\<rangle>; yo = SINK; x \<in> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis"
    "\<And>x. \<lbrakk> xo = SOURCE; yo = \<langle>b\<rangle> \<rbrakk> \<Longrightarrow> thesis"
    "\<And>y. \<lbrakk> xo = SINK; yo = \<langle>y\<rangle>; y \<in> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis"
    for xo yo thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' xo yo
\<lbrakk>xo = \<langle>?x\<rangle>; yo = \<langle>?y\<rangle>; edge \<Gamma> ?x ?y \<or> edge \<Gamma> ?y ?x\<rbrakk> \<Longrightarrow> thesis
\<lbrakk>xo = \<langle>?x\<rangle>; yo = vertex.SINK; ?x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis
\<lbrakk>xo = SOURCE; yo = \<langle>b\<rangle>\<rbrakk> \<Longrightarrow> thesis
\<lbrakk>xo = vertex.SINK; yo = \<langle>?y\<rangle>; ?y \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(auto simp add: edge'_def split: option.split_asm vertex.split_asm)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' ?xo ?yo; \<And>x y. \<lbrakk>?xo = \<langle>x\<rangle>; ?yo = \<langle>y\<rangle>; edge \<Gamma> x y \<or> edge \<Gamma> y x\<rbrakk> \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>?xo = \<langle>x\<rangle>; ?yo = vertex.SINK; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis; \<And>x. \<lbrakk>?xo = SOURCE; ?yo = \<langle>b\<rangle>\<rbrakk> \<Longrightarrow> ?thesis; \<And>y. \<lbrakk>?xo = vertex.SINK; ?yo = \<langle>y\<rangle>; y \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have edge'_Inner1 [elim!]: "thesis" if "edge' \<langle>x\<rangle> yo"
    "\<And>y. \<lbrakk> yo = \<langle>y\<rangle>; edge \<Gamma> x y \<or> edge \<Gamma> y x \<rbrakk> \<Longrightarrow> thesis"
    "\<lbrakk> yo = SINK; x \<in> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis"
    for x yo thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' \<langle>x\<rangle> yo
\<lbrakk>yo = \<langle>?y1\<rangle>; edge \<Gamma> x ?y1 \<or> edge \<Gamma> ?y1 x\<rbrakk> \<Longrightarrow> thesis
\<lbrakk>yo = vertex.SINK; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(auto elim: edge'E)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' \<langle>?x1\<rangle> ?yo1; \<And>y. \<lbrakk>?yo1 = \<langle>y\<rangle>; edge \<Gamma> ?x1 y \<or> edge \<Gamma> y ?x1\<rbrakk> \<Longrightarrow> ?thesis1; \<lbrakk>?yo1 = vertex.SINK; ?x1 \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have edge'_Inner2 [elim!]: "thesis" if "edge' xo \<langle>y\<rangle>"
    "\<And>x. \<lbrakk> xo = \<langle>x\<rangle>; edge \<Gamma> x y \<or> edge \<Gamma> y x \<rbrakk> \<Longrightarrow> thesis"
    "\<lbrakk> xo = SOURCE; y = b \<rbrakk> \<Longrightarrow> thesis"
    "\<lbrakk> xo = SINK; y \<in> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis"
    for xo y thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' xo \<langle>y\<rangle>
\<lbrakk>xo = \<langle>?x1\<rangle>; edge \<Gamma> ?x1 y \<or> edge \<Gamma> y ?x1\<rbrakk> \<Longrightarrow> thesis
\<lbrakk>xo = SOURCE; y = b\<rbrakk> \<Longrightarrow> thesis
\<lbrakk>xo = vertex.SINK; y \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(auto elim: edge'E)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' ?xo1 \<langle>?y1\<rangle>; \<And>x. \<lbrakk>?xo1 = \<langle>x\<rangle>; edge \<Gamma> x ?y1 \<or> edge \<Gamma> ?y1 x\<rbrakk> \<Longrightarrow> ?thesis1; \<lbrakk>?xo1 = SOURCE; ?y1 = b\<rbrakk> \<Longrightarrow> ?thesis1; \<lbrakk>?xo1 = vertex.SINK; ?y1 \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have edge'_SINK1 [elim!]: "thesis" if "edge' SINK yo"
    "\<And>y. \<lbrakk> yo = \<langle>y\<rangle>; y \<in> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis"
    for yo thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' vertex.SINK yo
\<lbrakk>yo = \<langle>?y1\<rangle>; ?y1 \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(auto elim: edge'E)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' vertex.SINK ?yo1; \<And>y. \<lbrakk>?yo1 = \<langle>y\<rangle>; y \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have edge'_SINK2 [elim!]: "thesis" if "edge' xo SINK"
    "\<And>x. \<lbrakk> xo = \<langle>x\<rangle>; x \<in> A \<Gamma> \<rbrakk> \<Longrightarrow> thesis"
    for xo thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
edge' xo vertex.SINK
\<lbrakk>xo = \<langle>?x1\<rangle>; ?x1 \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(auto elim: edge'E)
[PROOF STATE]
proof (state)
this:
\<lbrakk>edge' ?xo1 vertex.SINK; \<And>x. \<lbrakk>?xo1 = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
define cap
    where "cap xoyo =
      (case xoyo of
        (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> if edge \<Gamma> x y then h 0 (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) else 0
      | (\<langle>x\<rangle>, SINK) \<Rightarrow> if x \<in> A \<Gamma> then weight \<Gamma> x - d_OUT (h 0) x else 0
      | (SOURCE, yo) \<Rightarrow> if yo = \<langle>b\<rangle> then weight \<Gamma> b - d_IN (h 0) b else 0
      | (SINK, \<langle>y\<rangle>) \<Rightarrow> if y \<in> A \<Gamma> then weight \<Gamma> y else 0
      | _ \<Rightarrow> 0)" for xoyo
[PROOF STATE]
proof (state)
this:
cap ?xoyo = (case ?xoyo of (SOURCE, yo) \<Rightarrow> if yo = \<langle>b\<rangle> then weight \<Gamma> b - d_IN (h 0) b else 0 | (vertex.SINK, \<langle>y\<rangle>) \<Rightarrow> if y \<in> A \<Gamma> then weight \<Gamma> y else 0 | (vertex.SINK, _) \<Rightarrow> 0 | (\<langle>x\<rangle>, SOURCE) \<Rightarrow> 0 | (\<langle>x\<rangle>, vertex.SINK) \<Rightarrow> if x \<in> A \<Gamma> then weight \<Gamma> x - d_OUT (h 0) x else 0 | (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> if edge \<Gamma> x y then h 0 (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) else 0)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have cap_simps [simp]:
    "cap (\<langle>x\<rangle>, \<langle>y\<rangle>) = (if edge \<Gamma> x y then h 0 (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) else 0)"
    "cap (\<langle>x\<rangle>, SINK) = (if x \<in> A \<Gamma> then weight \<Gamma> x - d_OUT (h 0) x else 0)"
    "cap (SOURCE, yo) = (if yo = \<langle>b\<rangle> then weight \<Gamma> b - d_IN (h 0) b else 0)"
    "cap (SINK, \<langle>y\<rangle>) = (if y \<in> A \<Gamma> then weight \<Gamma> y else 0)"
    "cap (SINK, SINK) = 0"
    "cap (xo, SOURCE) = 0"
    for x y yo xo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cap (\<langle>x\<rangle>, \<langle>y\<rangle>) = (if edge \<Gamma> x y then h 0 (x, y) else if edge \<Gamma> y x then max (weight \<Gamma> x) (weight \<Gamma> y) else 0) &&& cap (\<langle>x\<rangle>, vertex.SINK) = (if x \<in> A \<Gamma> then weight \<Gamma> x - d_OUT (h 0) x else 0) &&& cap (SOURCE, yo) = (if yo = \<langle>b\<rangle> then weight \<Gamma> b - d_IN (h 0) b else 0)) &&& cap (vertex.SINK, \<langle>y\<rangle>) = (if y \<in> A \<Gamma> then weight \<Gamma> y else 0) &&& cap (vertex.SINK, vertex.SINK) = 0 &&& cap (xo, SOURCE) = 0
[PROOF STEP]
by(simp_all add: cap_def split: vertex.split)
[PROOF STATE]
proof (state)
this:
cap (\<langle>?x1\<rangle>, \<langle>?y1\<rangle>) = (if edge \<Gamma> ?x1 ?y1 then h 0 (?x1, ?y1) else if edge \<Gamma> ?y1 ?x1 then max (weight \<Gamma> ?x1) (weight \<Gamma> ?y1) else 0)
cap (\<langle>?x1\<rangle>, vertex.SINK) = (if ?x1 \<in> A \<Gamma> then weight \<Gamma> ?x1 - d_OUT (h 0) ?x1 else 0)
cap (SOURCE, ?yo1) = (if ?yo1 = \<langle>b\<rangle> then weight \<Gamma> b - d_IN (h 0) b else 0)
cap (vertex.SINK, \<langle>?y1\<rangle>) = (if ?y1 \<in> A \<Gamma> then weight \<Gamma> ?y1 else 0)
cap (vertex.SINK, vertex.SINK) = 0
cap (?xo1, SOURCE) = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
define \<Psi> where "\<Psi> = \<lparr>edge = edge', capacity = cap, source = SOURCE, sink = SINK\<rparr>"
[PROOF STATE]
proof (state)
this:
\<Psi> = \<lparr>edge = edge', capacity = cap, source = SOURCE, sink = vertex.SINK\<rparr>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have \<Psi>_sel [simp]:
    "edge \<Psi> = edge'"
    "capacity \<Psi> = cap"
    "source \<Psi> = SOURCE"
    "sink \<Psi> = SINK"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (edge \<Psi> = edge' &&& capacity \<Psi> = cap) &&& source \<Psi> = SOURCE &&& sink \<Psi> = vertex.SINK
[PROOF STEP]
by(simp_all add: \<Psi>_def)
[PROOF STATE]
proof (state)
this:
edge \<Psi> = edge'
capacity \<Psi> = cap
source \<Psi> = SOURCE
sink \<Psi> = vertex.SINK

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[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]
using A_vertex
[PROOF STATE]
proof (prove)
using this:
A \<Gamma> \<subseteq> \<^bold>V

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> ?x1 \<Longrightarrow> cap (\<langle>?x1\<rangle>, ?y1) = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have capacity_A_weight: "d_OUT cap \<langle>x\<rangle> \<le> 2 * 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> 2 * weight \<Gamma> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
have "d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y. h 0 (x, inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {SINK} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} 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. d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} y)
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. cap (\<langle>x\<rangle>, y)) \<le> (\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} y)
[PROOF STEP]
by(auto intro!: nn_integral_mono diff_le_self_ennreal simp add: A_in notin_range_Inner  split: split_indicator)
[PROOF STATE]
proof (state)
this:
d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} y)

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT cap \<langle>x\<rangle> \<le> (\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} y)

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, inner y)) + weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} y) = (\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, vertex.inner y)) + weight \<Gamma> x
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator nn_integral_add)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} y) = (\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, vertex.inner y)) + weight \<Gamma> x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h 0 (x, vertex.inner y) * indicator (range Inner) y + weight \<Gamma> x * indicator {vertex.SINK} y) = (\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, vertex.inner y)) + weight \<Gamma> x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
have "(\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, inner y)) = d_OUT (h 0) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, vertex.inner y)) = d_OUT (h 0) x
[PROOF STEP]
by(simp add: d_OUT_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, vertex.inner y)) = d_OUT (h 0) x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. h 0 (x, vertex.inner y)) = d_OUT (h 0) x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x \<le> weight \<Gamma> x
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
current \<Gamma> (h ?n)

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

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

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x
[PROOF STEP]
unfolding one_add_one[symmetric] distrib_right
[PROOF STATE]
proof (prove)
using this:
(\<And>xa y. xa \<le> y \<Longrightarrow> xa + weight \<Gamma> x \<le> y + weight \<Gamma> x) \<Longrightarrow> d_OUT cap \<langle>x\<rangle> \<le> weight \<Gamma> x + weight \<Gamma> x

goal (1 subgoal):
 1. d_OUT cap \<langle>x\<rangle> \<le> 1 * weight \<Gamma> x + 1 * weight \<Gamma> x
[PROOF STEP]
by(simp add: add_right_mono)
[PROOF STATE]
proof (state)
this:
d_OUT cap \<langle>x\<rangle> \<le> 2 * weight \<Gamma> x

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

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[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> \<subseteq> (\<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. (\<langle>x\<rangle>, SINK)) ` A \<Gamma> \<union> (\<lambda>x. (SINK, \<langle>x\<rangle>)) ` A \<Gamma> \<union> {(SOURCE, \<langle>b\<rangle>)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>E\<^bsub>\<Psi>\<^esub> \<subseteq> (\<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. (\<langle>x\<rangle>, vertex.SINK)) ` A \<Gamma> \<union> (\<lambda>x. (vertex.SINK, \<langle>x\<rangle>)) ` A \<Gamma> \<union> {(SOURCE, \<langle>b\<rangle>)}
[PROOF STEP]
by(auto simp add: edge'_def split: vertex.split_asm)
[PROOF STATE]
proof (state)
this:
\<^bold>E\<^bsub>\<Psi>\<^esub> \<subseteq> (\<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. (\<langle>x\<rangle>, vertex.SINK)) ` A \<Gamma> \<union> (\<lambda>x. (vertex.SINK, \<langle>x\<rangle>)) ` A \<Gamma> \<union> {(SOURCE, \<langle>b\<rangle>)}

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]
moreover
[PROOF STATE]
proof (state)
this:
\<^bold>E\<^bsub>\<Psi>\<^esub> \<subseteq> (\<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. (\<langle>x\<rangle>, vertex.SINK)) ` A \<Gamma> \<union> (\<lambda>x. (vertex.SINK, \<langle>x\<rangle>)) ` A \<Gamma> \<union> {(SOURCE, \<langle>b\<rangle>)}

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 "countable (A \<Gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (A \<Gamma>)
[PROOF STEP]
using A_vertex
[PROOF STATE]
proof (prove)
using this:
A \<Gamma> \<subseteq> \<^bold>V

goal (1 subgoal):
 1. countable (A \<Gamma>)
[PROOF STEP]
by(rule countable_subset) simp
[PROOF STATE]
proof (state)
this:
countable (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]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<^bold>E\<^bsub>\<Psi>\<^esub> \<subseteq> (\<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. (\<langle>x\<rangle>, vertex.SINK)) ` A \<Gamma> \<union> (\<lambda>x. (vertex.SINK, \<langle>x\<rangle>)) ` A \<Gamma> \<union> {(SOURCE, \<langle>b\<rangle>)}
countable (A \<Gamma>)
[PROOF STEP]
show "countable \<^bold>E\<^bsub>\<Psi>\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<^bold>E\<^bsub>\<Psi>\<^esub> \<subseteq> (\<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. (\<langle>x\<rangle>, vertex.SINK)) ` A \<Gamma> \<union> (\<lambda>x. (vertex.SINK, \<langle>x\<rangle>)) ` A \<Gamma> \<union> {(SOURCE, \<langle>b\<rangle>)}
countable (A \<Gamma>)

goal (1 subgoal):
 1. countable \<^bold>E\<^bsub>\<Psi>\<^esub>
[PROOF STEP]
by(auto elim: countable_subset)
[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]
then
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> sink \<Psi>
[PROOF STEP]
consider (source) "v = SOURCE" | (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)
using this:
v \<noteq> sink \<Psi>

goal (1 subgoal):
 1. \<lbrakk>v = SOURCE \<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 = SOURCE \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1; \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

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 = SOURCE \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1; \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1
[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 = SOURCE \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1; \<And>y. \<lbrakk>v = \<langle>y\<rangle>; y \<notin> A \<Gamma>; y \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>v = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

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 = SOURCE \<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 source
[PROOF STATE]
proof (state)
this:
v = SOURCE

goal (4 subgoals):
 1. v = SOURCE \<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 = SOURCE

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> 2 * 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 ennreal_mult_eq_top_iff)
[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. h 0 (inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. h 0 (vertex.inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} x)
[PROOF STEP]
using B bipartite_V
[PROOF STATE]
proof (prove)
using this:
v = \<langle>y\<rangle>
y \<notin> A \<Gamma>
y \<in> \<^bold>V
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>

goal (1 subgoal):
 1. d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. h 0 (vertex.inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} x)
[PROOF STEP]
by(auto 4 4 intro!: nn_integral_mono simp add: diff_le_self_ennreal   d_IN_def notin_range_Inner nn_integral_count_space_indicator currentD_outside[OF h] split: split_indicator dest: bipartite_E)
[PROOF STATE]
proof (state)
this:
d_IN (capacity \<Psi>) v \<le> (\<Sum>\<^sup>+ x. h 0 (vertex.inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} 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. h 0 (vertex.inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} 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 Inner. h 0 (inner x, y)) + weight \<Gamma> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x. h 0 (vertex.inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} x) = (\<Sum>\<^sup>+ x\<in>range Inner. h 0 (vertex.inner x, y)) + weight \<Gamma> b
[PROOF STEP]
by(simp add: nn_integral_add nn_integral_count_space_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ x. h 0 (vertex.inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} x) = (\<Sum>\<^sup>+ x\<in>range Inner. h 0 (vertex.inner x, y)) + weight \<Gamma> b

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. h 0 (vertex.inner x, y) * indicator (range Inner) x + weight \<Gamma> b * indicator {SOURCE} x) = (\<Sum>\<^sup>+ x\<in>range Inner. h 0 (vertex.inner x, y)) + weight \<Gamma> b

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 "(\<Sum>\<^sup>+ x\<in>range Inner. h 0 (inner x, y)) = d_IN (h 0) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x\<in>range Inner. h 0 (vertex.inner x, y)) = d_IN (h 0) y
[PROOF STEP]
by(simp add: d_IN_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ x\<in>range Inner. h 0 (vertex.inner x, y)) = d_IN (h 0) 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 Inner. h 0 (vertex.inner x, y)) = d_IN (h 0) 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 (h 0) y \<le> weight \<Gamma> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) y \<le> weight \<Gamma> y
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
current \<Gamma> (h ?n)

goal (1 subgoal):
 1. d_IN (h 0) y \<le> weight \<Gamma> y
[PROOF STEP]
by(rule currentD_weight_IN)
[PROOF STATE]
proof (state)
this:
d_IN (h 0) 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 y. x \<le> y \<Longrightarrow> x + weight \<Gamma> b \<le> y + weight \<Gamma> b) \<Longrightarrow> d_IN (capacity \<Psi>) v \<le> weight \<Gamma> y + weight \<Gamma> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x + weight \<Gamma> b \<le> y + weight \<Gamma> b) \<Longrightarrow> d_IN (capacity \<Psi>) v \<le> weight \<Gamma> y + weight \<Gamma> b

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: top_unique add_right_mono 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]
using A_vertex
[PROOF STATE]
proof (prove)
using this:
v = \<langle>x\<rangle>
x \<notin> \<^bold>V
A \<Gamma> \<subseteq> \<^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: vertex.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]
by(auto simp add: cap_def max_def vertex_def currentD_finite[OF h] split: vertex.split prod.split)
[PROOF STATE]
proof (state)
this:
capacity \<Psi> ?e1 \<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
[PROOF STATE]
proof (prove)
using this:
e \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub>

goal (1 subgoal):
 1. capacity \<Psi> e = 0
[PROOF STEP]
by(auto simp add: cap_def max_def split: prod.split; split vertex.split)+
[PROOF STATE]
proof (state)
this:
?e1 \<notin> \<^bold>E\<^bsub>\<Psi>\<^esub> \<Longrightarrow> capacity \<Psi> ?e1 = 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]
using b
[PROOF STATE]
proof (prove)
using this:
b \<in> B \<Gamma>

goal (1 subgoal):
 1. \<not> edge \<Psi> x (source \<Psi>)
[PROOF STEP]
by(auto simp add: B_out)
[PROOF STATE]
proof (state)
this:
\<not> edge \<Psi> ?x1 (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> ?x1 ?x1

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. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[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. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
define \<alpha> where "\<alpha> = (SUP f\<in>{f. flow \<Psi> f}. value_flow \<Psi> f)"
[PROOF STATE]
proof (state)
this:
\<alpha> = \<Squnion> (value_flow \<Psi> ` {f. flow \<Psi> f})

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
define f
    where "f n xoyo =
    (case xoyo of
      (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> if edge \<Gamma> x y then h 0 (x, y) - h n (x, y) else if edge \<Gamma> y x then h n (y, x) - h 0 (y, x) else 0
    | (SOURCE, \<langle>y\<rangle>) \<Rightarrow> if y = b then d_IN (h n) b - d_IN (h 0) b else 0
    | (\<langle>x\<rangle>, SINK) \<Rightarrow> if x \<in> A \<Gamma> then d_OUT (h n) x - d_OUT (h 0) x else 0
    | (SINK, \<langle>y\<rangle>) \<Rightarrow> if y \<in> A \<Gamma> then d_OUT (h 0) y - d_OUT (h n) y else 0
    | _ \<Rightarrow> 0)" for n xoyo
[PROOF STATE]
proof (state)
this:
f ?n ?xoyo = (case ?xoyo of (SOURCE, \<langle>y\<rangle>) \<Rightarrow> if y = b then d_IN (h ?n) b - d_IN (h 0) b else 0 | (SOURCE, _) \<Rightarrow> 0 | (vertex.SINK, \<langle>y\<rangle>) \<Rightarrow> if y \<in> A \<Gamma> then d_OUT (h 0) y - d_OUT (h ?n) y else 0 | (vertex.SINK, _) \<Rightarrow> 0 | (\<langle>x\<rangle>, SOURCE) \<Rightarrow> 0 | (\<langle>x\<rangle>, vertex.SINK) \<Rightarrow> if x \<in> A \<Gamma> then d_OUT (h ?n) x - d_OUT (h 0) x else 0 | (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Rightarrow> if edge \<Gamma> x y then h 0 (x, y) - h ?n (x, y) else if edge \<Gamma> y x then h ?n (y, x) - h 0 (y, x) else 0)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have f_cases: thesis if "\<And>x y. e = (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Longrightarrow> thesis" "\<And>y. e = (SOURCE, \<langle>y\<rangle>) \<Longrightarrow> thesis"
    "\<And>x. e = (\<langle>x\<rangle>, SINK) \<Longrightarrow> thesis" "\<And>y. e = (SINK, \<langle>y\<rangle>) \<Longrightarrow> thesis" "e = (SINK, SINK) \<Longrightarrow> thesis"
    "\<And>xo. e = (xo, SOURCE) \<Longrightarrow> thesis" "e = (SOURCE, SINK) \<Longrightarrow> thesis"
    for e :: "'v vertex edge" and thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
e = (\<langle>?x1\<rangle>, \<langle>?y1\<rangle>) \<Longrightarrow> thesis
e = (SOURCE, \<langle>?y1\<rangle>) \<Longrightarrow> thesis
e = (\<langle>?x1\<rangle>, vertex.SINK) \<Longrightarrow> thesis
e = (vertex.SINK, \<langle>?y1\<rangle>) \<Longrightarrow> thesis
e = (vertex.SINK, vertex.SINK) \<Longrightarrow> thesis
e = (?xo1, SOURCE) \<Longrightarrow> thesis
e = (SOURCE, vertex.SINK) \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by(cases e; cases "fst e" "snd e" rule: vertex.exhaust[case_product vertex.exhaust]) simp_all
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>x y. ?e1 = (\<langle>x\<rangle>, \<langle>y\<rangle>) \<Longrightarrow> ?thesis1; \<And>y. ?e1 = (SOURCE, \<langle>y\<rangle>) \<Longrightarrow> ?thesis1; \<And>x. ?e1 = (\<langle>x\<rangle>, vertex.SINK) \<Longrightarrow> ?thesis1; \<And>y. ?e1 = (vertex.SINK, \<langle>y\<rangle>) \<Longrightarrow> ?thesis1; ?e1 = (vertex.SINK, vertex.SINK) \<Longrightarrow> ?thesis1; \<And>xo. ?e1 = (xo, SOURCE) \<Longrightarrow> ?thesis1; ?e1 = (SOURCE, vertex.SINK) \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have f_simps [simp]:
    "f n (\<langle>x\<rangle>, \<langle>y\<rangle>) = (if edge \<Gamma> x y then h 0 (x, y) - h n (x, y) else if edge \<Gamma> y x then h n (y, x) - h 0 (y, x) else 0)"
    "f n (SOURCE, \<langle>y\<rangle>) = (if y = b then d_IN (h n) b - d_IN (h 0) b else 0)"
    "f n (\<langle>x\<rangle>, SINK) = (if x \<in> A \<Gamma> then d_OUT (h n) x - d_OUT (h 0) x else 0)"
    "f n (SINK, \<langle>y\<rangle>) = (if y \<in> A \<Gamma> then d_OUT (h 0) y - d_OUT (h n) y else 0)"
    "f n (SOURCE, SINK) = 0"
    "f n (SINK, SINK) = 0"
    "f n (xo, SOURCE) = 0"
    for n x y xo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f n (\<langle>x\<rangle>, \<langle>y\<rangle>) = (if edge \<Gamma> x y then h 0 (x, y) - h n (x, y) else if edge \<Gamma> y x then h n (y, x) - h 0 (y, x) else 0) &&& f n (SOURCE, \<langle>y\<rangle>) = (if y = b then d_IN (h n) b - d_IN (h 0) b else 0) &&& f n (\<langle>x\<rangle>, vertex.SINK) = (if x \<in> A \<Gamma> then d_OUT (h n) x - d_OUT (h 0) x else 0)) &&& (f n (vertex.SINK, \<langle>y\<rangle>) = (if y \<in> A \<Gamma> then d_OUT (h 0) y - d_OUT (h n) y else 0) &&& f n (SOURCE, vertex.SINK) = 0) &&& f n (vertex.SINK, vertex.SINK) = 0 &&& f n (xo, SOURCE) = 0
[PROOF STEP]
by(simp_all add: f_def split: vertex.split)
[PROOF STATE]
proof (state)
this:
f ?n1 (\<langle>?x1\<rangle>, \<langle>?y1\<rangle>) = (if edge \<Gamma> ?x1 ?y1 then h 0 (?x1, ?y1) - h ?n1 (?x1, ?y1) else if edge \<Gamma> ?y1 ?x1 then h ?n1 (?y1, ?x1) - h 0 (?y1, ?x1) else 0)
f ?n1 (SOURCE, \<langle>?y1\<rangle>) = (if ?y1 = b then d_IN (h ?n1) b - d_IN (h 0) b else 0)
f ?n1 (\<langle>?x1\<rangle>, vertex.SINK) = (if ?x1 \<in> A \<Gamma> then d_OUT (h ?n1) ?x1 - d_OUT (h 0) ?x1 else 0)
f ?n1 (vertex.SINK, \<langle>?y1\<rangle>) = (if ?y1 \<in> A \<Gamma> then d_OUT (h 0) ?y1 - d_OUT (h ?n1) ?y1 else 0)
f ?n1 (SOURCE, vertex.SINK) = 0
f ?n1 (vertex.SINK, vertex.SINK) = 0
f ?n1 (?xo1, SOURCE) = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have OUT_f_SOURCE: "d_OUT (f n) SOURCE = d_IN (h n) b - d_IN (h 0) b" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (f n) SOURCE = d_IN (h n) b - d_IN (h 0) b
[PROOF STEP]
proof(rule trans)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d_OUT (f n) SOURCE = ?s
 2. ?s = d_IN (h n) b - d_IN (h 0) b
[PROOF STEP]
show "d_OUT (f n) SOURCE = (\<Sum>\<^sup>+ y. f n (SOURCE, y) * indicator {\<langle>b\<rangle>} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (f n) SOURCE = \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f n (SOURCE, y)\<partial>count_space UNIV
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (SOURCE, y)) = \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f n (SOURCE, y)\<partial>count_space UNIV
[PROOF STEP]
apply(rule nn_integral_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> space (count_space UNIV) \<Longrightarrow> f n (SOURCE, x) = f n (SOURCE, x) * indicator {\<langle>b\<rangle>} x
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> space (count_space UNIV) \<Longrightarrow> f n (SOURCE, x) = f n (SOURCE, x) * indicator {\<langle>b\<rangle>} x
[PROOF STEP]
by(cases x) auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d_OUT (f n) SOURCE = \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f n (SOURCE, y)\<partial>count_space UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f n (SOURCE, y)\<partial>count_space UNIV = d_IN (h n) b - d_IN (h 0) b
[PROOF STEP]
show "\<dots> = d_IN (h n) b - d_IN (h 0) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f n (SOURCE, y)\<partial>count_space UNIV = d_IN (h n) b - d_IN (h 0) b
[PROOF STEP]
using h0_b[of n]
[PROOF STATE]
proof (prove)
using this:
d_IN (h 0) b \<le> d_IN (h n) b

goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f n (SOURCE, y)\<partial>count_space UNIV = d_IN (h n) b - d_IN (h 0) b
[PROOF STEP]
by(auto simp add: max_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f n (SOURCE, y)\<partial>count_space UNIV = d_IN (h n) b - d_IN (h 0) b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT (f ?n1) SOURCE = d_IN (h ?n1) b - d_IN (h 0) b

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have OUT_f_outside: "d_OUT (f n) \<langle>x\<rangle> = 0" if "x \<notin> \<^bold>V" for x n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (f n) \<langle>x\<rangle> = 0
[PROOF STEP]
using A_vertex that
[PROOF STATE]
proof (prove)
using this:
A \<Gamma> \<subseteq> \<^bold>V
x \<notin> \<^bold>V

goal (1 subgoal):
 1. d_OUT (f n) \<langle>x\<rangle> = 0
[PROOF STEP]
apply(clarsimp simp add: d_OUT_def nn_integral_0_iff emeasure_count_space_eq_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>A \<Gamma> \<subseteq> \<^bold>V; \<not> vertex \<Gamma> x\<rbrakk> \<Longrightarrow> f n (\<langle>x\<rangle>, xa) = 0
[PROOF STEP]
subgoal for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<Gamma> \<subseteq> \<^bold>V; \<not> vertex \<Gamma> x\<rbrakk> \<Longrightarrow> f n (\<langle>x\<rangle>, y) = 0
[PROOF STEP]
by(cases y)(auto simp add: vertex_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
?x1 \<notin> \<^bold>V \<Longrightarrow> d_OUT (f ?n1) \<langle>?x1\<rangle> = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have IN_f_outside: "d_IN (f n) \<langle>x\<rangle> = 0" if "x \<notin> \<^bold>V" for x n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (f n) \<langle>x\<rangle> = 0
[PROOF STEP]
using b_V that
[PROOF STATE]
proof (prove)
using this:
b \<in> \<^bold>V
x \<notin> \<^bold>V

goal (1 subgoal):
 1. d_IN (f n) \<langle>x\<rangle> = 0
[PROOF STEP]
apply(clarsimp simp add: d_IN_def nn_integral_0_iff emeasure_count_space_eq_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>vertex \<Gamma> b; \<not> vertex \<Gamma> x\<rbrakk> \<Longrightarrow> f n (xa, \<langle>x\<rangle>) = 0
[PROOF STEP]
subgoal for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>vertex \<Gamma> b; \<not> vertex \<Gamma> x\<rbrakk> \<Longrightarrow> f n (y, \<langle>x\<rangle>) = 0
[PROOF STEP]
by(cases y)(auto simp add: currentD_outside_OUT[OF h] vertex_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
?x1 \<notin> \<^bold>V \<Longrightarrow> d_IN (f ?n1) \<langle>?x1\<rangle> = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have f: "flow \<Psi> (f n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flow \<Psi> (f n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e. f n e \<le> capacity \<Psi> e
 2. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR (f n) x
[PROOF STEP]
show f_le: "f n e \<le> capacity \<Psi> e" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n e \<le> capacity \<Psi> e
[PROOF STEP]
using currentD_weight_out[OF h] currentD_weight_IN[OF h] currentD_weight_OUT[OF h]
[PROOF STATE]
proof (prove)
using this:
h ?n1 (?x, ?y) \<le> weight \<Gamma> ?x
d_IN (h ?n1) ?x \<le> weight \<Gamma> ?x
d_OUT (h ?n1) ?x \<le> weight \<Gamma> ?x

goal (1 subgoal):
 1. f n e \<le> capacity \<Psi> e
[PROOF STEP]
by(cases e rule: f_cases)
        (auto dest: edge_antiparallel simp add: not_le le_max_iff_disj intro: ennreal_minus_mono ennreal_diff_le_mono_left)
[PROOF STATE]
proof (state)
this:
f n ?e1 \<le> capacity \<Psi> ?e1

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR (f n) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xo \<noteq> source \<Psi>
xo \<noteq> sink \<Psi>
[PROOF STEP]
consider (A) x where "xo = \<langle>x\<rangle>" "x \<in> A \<Gamma>" | (B) x where "xo = \<langle>x\<rangle>" "x \<in> B \<Gamma>" "x \<in> \<^bold>V"
      | (outside) x where "xo = \<langle>x\<rangle>" "x \<notin> \<^bold>V"
[PROOF STATE]
proof (prove)
using this:
xo \<noteq> source \<Psi>
xo \<noteq> sink \<Psi>

goal (1 subgoal):
 1. \<lbrakk>\<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> thesis; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using bipartite_V
[PROOF STATE]
proof (prove)
using this:
xo \<noteq> source \<Psi>
xo \<noteq> sink \<Psi>
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>

goal (1 subgoal):
 1. \<lbrakk>\<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> thesis; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> thesis; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by(cases xo) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> source \<Psi>; x \<noteq> sink \<Psi>\<rbrakk> \<Longrightarrow> KIR (f n) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1
[PROOF STEP]
show "KIR (f n) xo"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1; \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. KIR (f n) xo
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
 3. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
case outside
[PROOF STATE]
proof (state)
this:
xo = \<langle>x\<rangle>
x \<notin> \<^bold>V

goal (3 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
 3. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<notin> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<notin> \<^bold>V

goal (1 subgoal):
 1. KIR (f n) xo
[PROOF STEP]
by(simp add: OUT_f_outside IN_f_outside)
[PROOF STATE]
proof (state)
this:
KIR (f n) xo

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
case A
[PROOF STATE]
proof (state)
this:
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have finite1: "(\<Sum>\<^sup>+ y. h n (x, y) * indicator A y) \<noteq> \<top>" for A n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>A. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>
[PROOF STEP]
using currentD_finite_OUT[OF h, of n x, unfolded d_OUT_def]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ y. h n (x, y)) \<noteq> \<top>

goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>A. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>
[PROOF STEP]
by(rule neq_top_trans)(auto intro!: nn_integral_mono simp add: split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>?A1. h ?n1 (x, y)\<partial>count_space UNIV \<noteq> \<top>

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
let ?h0_ge_hn = "{y. h 0 (x, y) \<ge> h n (x, y)}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
let ?h0_lt_hn = "{y. h 0 (x, y) < h n (x, y)}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "d_OUT (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {SINK} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {vertex.SINK} y)
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {vertex.SINK} y)
[PROOF STEP]
by(intro nn_integral_cong)(auto split: split_indicator simp add: notin_range_Inner)
[PROOF STATE]
proof (state)
this:
d_OUT (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {vertex.SINK} y)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {vertex.SINK} y)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) + f n (\<langle>x\<rangle>, SINK)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {vertex.SINK} y) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) + f n (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
by(simp add: nn_integral_add nn_integral_count_space_indicator max.left_commute max.commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {vertex.SINK} y) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) + f n (\<langle>x\<rangle>, vertex.SINK)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y + f n (\<langle>x\<rangle>, y) * indicator {vertex.SINK} y) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) + f n (\<langle>x\<rangle>, vertex.SINK)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "(\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y))
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y))
[PROOF STEP]
apply(simp add: nn_integral_count_space_reindex cong: nn_integral_cong_simp outgoing_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. if edge \<Gamma> x xa then h 0 (x, xa) - h n (x, xa) else if edge \<Gamma> xa x then h n (xa, x) - h 0 (xa, x) else 0) = (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y))
[PROOF STEP]
apply(auto simp add: nn_integral_count_space_indicator outgoing_def A_in max.absorb1 currentD_outside[OF h] intro!: nn_integral_cong split: split_indicator dest: edge_antiparallel)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y))

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y))

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y. h 0 (x, y) * indicator ?h0_ge_hn y) - (\<Sum>\<^sup>+ y. h n (x, y) * indicator ?h0_ge_hn y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y)) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV)
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>y. h 0 (x, y) * indicator {y. h n (x, y) \<le> h 0 (x, y)} y) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h n (x, y) * indicator {y. h n (x, y) \<le> h 0 (x, y)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h n (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa \<le> h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa
 5. (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa - h n (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa)
[PROOF STEP]
apply(simp_all add: AE_count_space finite1 split: split_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa - h n (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa)
[PROOF STEP]
apply(rule nn_integral_cong; auto simp add: max_def not_le split: split_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. h 0 (x, xa) < h n (x, xa) \<Longrightarrow> h 0 (x, xa) - h n (x, xa) = 0
[PROOF STEP]
by (metis diff_eq_0_ennreal le_less not_le top_greatest)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y)) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h 0 (x, y) - h n (x, y)) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. h n (x, y) * indicator ?h0_ge_hn y) = d_OUT (h n) x - (\<Sum>\<^sup>+ y. h n (x, y) * indicator ?h0_lt_hn y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV = d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV = (\<Sum>\<^sup>+ y. h n (x, y)) - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>y. h n (x, y)) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h n (x, y) * indicator {y. h 0 (x, y) < h n (x, y)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa \<le> h n (x, xa)
 5. \<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV = (\<Sum>\<^sup>+ xa. h n (x, xa) - h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa)
[PROOF STEP]
apply(auto simp add: AE_count_space finite1 currentD_finite[OF h] split: split_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV = d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h n (x, y)\<partial>count_space UNIV = d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. h 0 (x, y) * indicator ?h0_ge_hn y) - \<dots> + f n (\<langle>x\<rangle>, SINK) =
        (\<Sum>\<^sup>+ y. h 0 (x, y) * indicator ?h0_ge_hn y) + (\<Sum>\<^sup>+ y. h n (x, y) * indicator ?h0_lt_hn y) - min (d_OUT (h n) x) (d_OUT (h 0) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - (d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)) + f n (\<langle>x\<rangle>, vertex.SINK) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)
[PROOF STEP]
using finite1[of n "{_}"] A finite1[of n UNIV]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+y\<in>{?uu4}. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>
\<integral>\<^sup>+y\<in>UNIV. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>

goal (1 subgoal):
 1. (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - (d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)) + f n (\<langle>x\<rangle>, vertex.SINK) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)
[PROOF STEP]
apply (subst diff_diff_ennreal')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<And>uu. \<integral>\<^sup>+y\<in>{uu}. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; \<integral>\<^sup>+y\<in>UNIV. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV \<le> d_OUT (h n) x
 2. \<lbrakk>\<And>uu. \<integral>\<^sup>+y\<in>{uu}. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; \<integral>\<^sup>+y\<in>UNIV. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>\<rbrakk> \<Longrightarrow> d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) \<le> \<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV
 3. \<lbrakk>\<And>uu. \<integral>\<^sup>+y\<in>{uu}. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; \<integral>\<^sup>+y\<in>UNIV. h n (x, y)\<partial>count_space UNIV \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - d_OUT (h n) x + f n (\<langle>x\<rangle>, vertex.SINK) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)
[PROOF STEP]
apply (auto simp: d_OUT_def finite1 AE_count_space nn_integral_diff[symmetric] top_unique nn_integral_add[symmetric]
                    split: split_indicator intro!: nn_integral_mono ennreal_diff_self)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>uu. h n (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h n (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h n (x, y)) + ((\<Sum>\<^sup>+ y. h n (x, y)) - (\<Sum>\<^sup>+ y. h 0 (x, y))) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - min (\<Sum>\<^sup>+ y. h n (x, y)) (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (simp add: min_def not_le diff_eq_0_ennreal finite1 less_top[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>uu. h n (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h n (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y)) \<longrightarrow> (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h n (x, y)) + ((\<Sum>\<^sup>+ y. h n (x, y)) - (\<Sum>\<^sup>+ y. h 0 (x, y))) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (subst diff_add_assoc2_ennreal)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>uu. h n (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h n (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ y. h n (x, y)) \<le> (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa)
 2. \<lbrakk>\<And>uu. h n (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h n (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y)) \<longrightarrow> (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) + ((\<Sum>\<^sup>+ y. h n (x, y)) - (\<Sum>\<^sup>+ y. h 0 (x, y))) - (\<Sum>\<^sup>+ y. h n (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (auto simp: add_diff_eq_ennreal intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>uu. h n (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h n (x, y)) \<noteq> \<top>; (\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y))\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) + (\<Sum>\<^sup>+ y. h n (x, y)) - (\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<Sum>\<^sup>+ y. h n (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (subst diff_diff_commute_ennreal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>uu. h n (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h n (x, y)) \<noteq> \<top>; (\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y))\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) + (\<Sum>\<^sup>+ y. h n (x, y)) - (\<Sum>\<^sup>+ y. h n (x, y)) - (\<Sum>\<^sup>+ y. h 0 (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (simp add: ennreal_add_diff_cancel )
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - (d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)) + f n (\<langle>x\<rangle>, vertex.SINK) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - (d_OUT (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV)) + f n (\<langle>x\<rangle>, vertex.SINK) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y. h n (x, y) * indicator ?h0_lt_hn y) - (d_OUT (h 0) x - (\<Sum>\<^sup>+ y. h 0 (x, y) * indicator ?h0_ge_hn y)) + f n (SINK, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x) = (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV)) + f n (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV)) + f n (vertex.SINK, \<langle>x\<rangle>) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)
[PROOF STEP]
using finite1[of 0 "{_}"] A finite1[of 0 UNIV]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+y\<in>{?uu4}. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>
\<integral>\<^sup>+y\<in>UNIV. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>

goal (1 subgoal):
 1. (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV)) + f n (vertex.SINK, \<langle>x\<rangle>) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)
[PROOF STEP]
apply (subst diff_diff_ennreal')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<And>uu. \<integral>\<^sup>+y\<in>{uu}. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; \<integral>\<^sup>+y\<in>UNIV. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV \<le> d_OUT (h 0) x
 2. \<lbrakk>\<And>uu. \<integral>\<^sup>+y\<in>{uu}. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; \<integral>\<^sup>+y\<in>UNIV. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>\<rbrakk> \<Longrightarrow> d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) \<le> \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV
 3. \<lbrakk>\<And>uu. \<integral>\<^sup>+y\<in>{uu}. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; \<integral>\<^sup>+y\<in>UNIV. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) - d_OUT (h 0) x + f n (vertex.SINK, \<langle>x\<rangle>) = (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x)
[PROOF STEP]
apply (auto simp: d_OUT_def finite1 AE_count_space nn_integral_diff[symmetric] top_unique nn_integral_add[symmetric]
                    split: split_indicator intro!: nn_integral_mono ennreal_diff_self)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)) + ((\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<Sum>\<^sup>+ y. h n (x, y))) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - min (\<Sum>\<^sup>+ y. h n (x, y)) (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (simp add: min_def not_le diff_eq_0_ennreal finite1 less_top[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> ((\<Sum>\<^sup>+ y. h n (x, y)) \<le> (\<Sum>\<^sup>+ y. h 0 (x, y)) \<longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)) + ((\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<Sum>\<^sup>+ y. h n (x, y))) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h n (x, y))) \<and> ((\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y)) \<longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)))
[PROOF STEP]
apply (subst diff_add_assoc2_ennreal)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ y. h 0 (x, y)) \<le> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa)
 2. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>\<rbrakk> \<Longrightarrow> ((\<Sum>\<^sup>+ y. h n (x, y)) \<le> (\<Sum>\<^sup>+ y. h 0 (x, y)) \<longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) + ((\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<Sum>\<^sup>+ y. h n (x, y))) - (\<Sum>\<^sup>+ y. h 0 (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h n (x, y))) \<and> ((\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y)) \<longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)))
[PROOF STEP]
apply (auto simp: add_diff_eq_ennreal intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>; (\<Sum>\<^sup>+ y. h n (x, y)) \<le> (\<Sum>\<^sup>+ y. h 0 (x, y))\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) + (\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<Sum>\<^sup>+ y. h n (x, y)) - (\<Sum>\<^sup>+ y. h 0 (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h n (x, y))
 2. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>; (\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y))\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (subst diff_diff_commute_ennreal)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>; (\<Sum>\<^sup>+ y. h n (x, y)) \<le> (\<Sum>\<^sup>+ y. h 0 (x, y))\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) + (\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<Sum>\<^sup>+ y. h n (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h n (x, y))
 2. \<lbrakk>\<And>uu. h 0 (x, uu) \<noteq> \<top>; xo = \<langle>x\<rangle>; x \<in> A \<Gamma>; (\<Sum>\<^sup>+ y. h 0 (x, y)) \<noteq> \<top>; (\<Sum>\<^sup>+ y. h 0 (x, y)) < (\<Sum>\<^sup>+ y. h n (x, y))\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa + h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y)) = (\<Sum>\<^sup>+ xa. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa + h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) - (\<Sum>\<^sup>+ y. h 0 (x, y))
[PROOF STEP]
apply (simp_all add: ennreal_add_diff_cancel ac_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x) = (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV)) + f n (vertex.SINK, \<langle>x\<rangle>)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) + (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - min (d_OUT (h n) x) (d_OUT (h 0) x) = (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV)) + f n (vertex.SINK, \<langle>x\<rangle>)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "d_OUT (h 0) x - (\<Sum>\<^sup>+ y. h 0 (x, y) * indicator ?h0_ge_hn y) = (\<Sum>\<^sup>+ y. h 0 (x, y) * indicator ?h0_lt_hn y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) = \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h 0 (x, y)) - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) = \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>y. h 0 (x, y)) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h 0 (x, y) * indicator {y. h n (x, y) \<le> h 0 (x, y)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa \<le> h 0 (x, xa)
 5. (\<Sum>\<^sup>+ xa. h 0 (x, xa) - h 0 (x, xa) * indicator {y. h n (x, y) \<le> h 0 (x, y)} xa) = \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV
[PROOF STEP]
apply(auto simp add: AE_count_space finite1 currentD_finite[OF h] split: split_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) = \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (h 0) x - (\<integral>\<^sup>+y\<in>{y. h n (x, y) \<le> h 0 (x, y)}. h 0 (x, y)\<partial>count_space UNIV) = \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. h n (x, y) * indicator ?h0_lt_hn y) - \<dots> = (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV) = (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y))
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>y. h n (x, y) * indicator {y. h 0 (x, y) < h n (x, y)} y) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h 0 (x, y) * indicator {y. h 0 (x, y) < h n (x, y)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h 0 (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa \<le> h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa
 5. (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa - h 0 (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) = (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y))
[PROOF STEP]
apply(simp_all add: AE_count_space finite1 order.strict_implies_order split: split_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ xa. h n (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa - h 0 (x, xa) * indicator {y. h 0 (x, y) < h n (x, y)} xa) = (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y))
[PROOF STEP]
apply(rule nn_integral_cong; auto simp add: currentD_finite[OF h] top_unique less_top[symmetric] not_less split: split_indicator intro!: diff_eq_0_ennreal)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV) = (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y))

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h n (x, y)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (x, y) < h n (x, y)}. h 0 (x, y)\<partial>count_space UNIV) = (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y))

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>))
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>))
[PROOF STEP]
apply(simp add: nn_integral_count_space_reindex cong: nn_integral_cong_simp outgoing_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y)) = (\<Sum>\<^sup>+ xa. if edge \<Gamma> xa x then h 0 (xa, x) - h n (xa, x) else if edge \<Gamma> x xa then h n (x, xa) - h 0 (x, xa) else 0)
[PROOF STEP]
apply(auto simp add: nn_integral_count_space_indicator outgoing_def A_in max.commute currentD_outside[OF h] intro!: nn_integral_cong split: split_indicator dest: edge_antiparallel)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>))

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h n (x, y) - h 0 (x, y)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>))

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> + f n (SINK, \<langle>x\<rangle>) = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SINK} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (vertex.SINK, \<langle>x\<rangle>) = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {vertex.SINK} y)
[PROOF STEP]
by(simp add: nn_integral_add nn_integral_count_space_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (vertex.SINK, \<langle>x\<rangle>) = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {vertex.SINK} y)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (vertex.SINK, \<langle>x\<rangle>) = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {vertex.SINK} y)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = d_IN (f n) \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {vertex.SINK} y) = d_IN (f n) \<langle>x\<rangle>
[PROOF STEP]
using A b disjoint
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>
b \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {vertex.SINK} y) = d_IN (f n) \<langle>x\<rangle>
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>
b \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {vertex.SINK} y) = (\<Sum>\<^sup>+ xa. f n (xa, \<langle>x\<rangle>))
[PROOF STEP]
by(intro nn_integral_cong)(auto split: split_indicator simp add: notin_range_Inner)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {vertex.SINK} y) = d_IN (f n) \<langle>x\<rangle>

goal (2 subgoals):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> A \<Gamma>\<rbrakk> \<Longrightarrow> KIR (f n) xo
 2. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
KIR (f n) \<langle>x\<rangle>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
KIR (f n) \<langle>x\<rangle>

goal (1 subgoal):
 1. KIR (f n) xo
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
KIR (f n) \<langle>x\<rangle>
xo = \<langle>x\<rangle>
x \<in> A \<Gamma>

goal (1 subgoal):
 1. KIR (f n) xo
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
KIR (f n) xo

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
case (B x)
[PROOF STATE]
proof (state)
this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have finite1: "(\<Sum>\<^sup>+ y. h n (y, x) * indicator A y) \<noteq> \<top>" for A n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>A. h n (y, x)\<partial>count_space UNIV \<noteq> \<top>
[PROOF STEP]
using currentD_finite_IN[OF h, of n x, unfolded d_IN_def]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ xa. h n (xa, x)) \<noteq> \<top>

goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>A. h n (y, x)\<partial>count_space UNIV \<noteq> \<top>
[PROOF STEP]
by(rule neq_top_trans)(auto intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>?A1. h ?n1 (y, x)\<partial>count_space UNIV \<noteq> \<top>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have finite_h[simp]: "h n (y, x) < \<top>" for y n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h n (y, x) < \<top>
[PROOF STEP]
using finite1[of n "{y}"]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+y\<in>{y}. h n (y, x)\<partial>count_space UNIV \<noteq> \<top>

goal (1 subgoal):
 1. h n (y, x) < \<top>
[PROOF STEP]
by (simp add: less_top)
[PROOF STATE]
proof (state)
this:
h ?n1 (?y1, x) < \<top>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
let ?h0_gt_hn = "{y. h 0 (y, x) > h n (y, x)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
let ?h0_le_hn = "{y. h 0 (y, x) \<le> h n (y, x)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have eq: "d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
proof(cases "x = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
 2. x \<noteq> b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = b

goal (2 subgoals):
 1. x = b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
 2. x \<noteq> b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
with currentD_finite_IN[OF h, of _ b]
[PROOF STATE]
proof (chain)
picking this:
d_IN (h ?n1) b \<noteq> \<top>
x = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN (h ?n1) b \<noteq> \<top>
x = b

goal (1 subgoal):
 1. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
by(simp add: add_diff_self_ennreal h0_b)
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x

goal (1 subgoal):
 1. x \<noteq> b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> b

goal (1 subgoal):
 1. x \<noteq> b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
with B SAT
[PROOF STATE]
proof (chain)
picking this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
B \<Gamma> \<inter> \<^bold>V - {b} \<subseteq> SAT \<Gamma> (h ?n)
x \<noteq> b
[PROOF STEP]
have "x \<in> SAT \<Gamma> (h n)" "x \<in> SAT \<Gamma> (h 0)"
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
B \<Gamma> \<inter> \<^bold>V - {b} \<subseteq> SAT \<Gamma> (h ?n)
x \<noteq> b

goal (1 subgoal):
 1. x \<in> SAT \<Gamma> (h n) &&& x \<in> SAT \<Gamma> (h 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> SAT \<Gamma> (h n)
x \<in> SAT \<Gamma> (h 0)

goal (1 subgoal):
 1. x \<noteq> b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
with B disjoint
[PROOF STATE]
proof (chain)
picking this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}
x \<in> SAT \<Gamma> (h n)
x \<in> SAT \<Gamma> (h 0)
[PROOF STEP]
have "d_IN (h n) x = d_IN (h 0) x"
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}
x \<in> SAT \<Gamma> (h n)
x \<in> SAT \<Gamma> (h 0)

goal (1 subgoal):
 1. d_IN (h n) x = d_IN (h 0) x
[PROOF STEP]
by(auto simp add: currentD_SAT[OF h])
[PROOF STATE]
proof (state)
this:
d_IN (h n) x = d_IN (h 0) x

goal (1 subgoal):
 1. x \<noteq> b \<Longrightarrow> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN (h n) x = d_IN (h 0) x

goal (1 subgoal):
 1. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
d_IN (h n) x = d_IN (h 0) x
x \<noteq> b

goal (1 subgoal):
 1. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x
[PROOF STEP]
by(simp add: currentD_finite_IN[OF h])
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) = d_IN (h n) x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "d_IN (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y)
[PROOF STEP]
using B disjoint
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. d_IN (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y)
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ xa. f n (xa, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y)
[PROOF STEP]
by(intro nn_integral_cong)(auto split: split_indicator simp add: notin_range_Inner)
[PROOF STATE]
proof (state)
this:
d_IN (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (f n) \<langle>x\<rangle> = (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (SOURCE, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
using h0_b[of n]
[PROOF STATE]
proof (prove)
using this:
d_IN (h 0) b \<le> d_IN (h n) b

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
by(simp add: nn_integral_add nn_integral_count_space_indicator max_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (SOURCE, \<langle>x\<rangle>)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. f n (y, \<langle>x\<rangle>) * indicator (range Inner) y + f n (y, \<langle>x\<rangle>) * indicator {SOURCE} y) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) + f n (SOURCE, \<langle>x\<rangle>)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "(\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x))
[PROOF STEP]
using B disjoint
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x))
[PROOF STEP]
apply(simp add: nn_integral_count_space_reindex cong: nn_integral_cong_simp outgoing_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; vertex \<Gamma> x; A \<Gamma> \<inter> B \<Gamma> = {}\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ xa. if edge \<Gamma> xa x then h 0 (xa, x) - h n (xa, x) else if edge \<Gamma> x xa then h n (x, xa) - h 0 (x, xa) else 0) = (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x))
[PROOF STEP]
apply(auto simp add: nn_integral_count_space_indicator outgoing_def B_out max.commute currentD_outside[OF h] intro!: nn_integral_cong split: split_indicator dest: edge_antiparallel)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y. h 0 (y, x) * indicator ?h0_gt_hn y) - (\<Sum>\<^sup>+ y. h n (y, x) * indicator ?h0_gt_hn y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x)) = (\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>y. h 0 (y, x) * indicator {y. h n (y, x) < h 0 (y, x)} y) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h n (y, x) * indicator {y. h n (y, x) < h 0 (y, x)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h n (xa, x) * indicator {y. h n (y, x) < h 0 (y, x)} xa \<le> h 0 (xa, x) * indicator {y. h n (y, x) < h 0 (y, x)} xa
 5. (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x)) = (\<Sum>\<^sup>+ xa. h 0 (xa, x) * indicator {y. h n (y, x) < h 0 (y, x)} xa - h n (xa, x) * indicator {y. h n (y, x) < h 0 (y, x)} xa)
[PROOF STEP]
apply(simp_all add: AE_count_space finite1 order.strict_implies_order split: split_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x)) = (\<Sum>\<^sup>+ xa. h 0 (xa, x) * indicator {y. h n (y, x) < h 0 (y, x)} xa - h n (xa, x) * indicator {y. h n (y, x) < h 0 (y, x)} xa)
[PROOF STEP]
apply(rule nn_integral_cong; auto simp add: currentD_finite[OF h] top_unique less_top[symmetric] not_less split: split_indicator intro!: diff_eq_0_ennreal)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x)) = (\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h 0 (y, x) - h n (y, x)) = (\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have eq_h_0: "(\<Sum>\<^sup>+ y. h 0 (y, x) * indicator ?h0_gt_hn y) = d_IN (h 0) x - (\<Sum>\<^sup>+ y. h 0 (y, x) * indicator ?h0_le_hn y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV = d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV = (\<Sum>\<^sup>+ xa. h 0 (xa, x)) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>xa. h 0 (xa, x)) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h 0 (y, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h 0 (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa \<le> h 0 (xa, x)
 5. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV = (\<Sum>\<^sup>+ xa. h 0 (xa, x) - h 0 (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa)
[PROOF STEP]
apply(auto simp add: AE_count_space finite1 currentD_finite[OF h] split: split_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV = d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h 0 (y, x)\<partial>count_space UNIV = d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have eq_h_n: "(\<Sum>\<^sup>+ y. h n (y, x) * indicator ?h0_gt_hn y) = d_IN (h n) x - (\<Sum>\<^sup>+ y. h n (y, x) * indicator ?h0_le_hn y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV = d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV = (\<Sum>\<^sup>+ xa. h n (xa, x)) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>xa. h n (xa, x)) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h n (y, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h n (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa \<le> h n (xa, x)
 5. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV = (\<Sum>\<^sup>+ xa. h n (xa, x) - h n (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa)
[PROOF STEP]
apply(auto simp add: AE_count_space finite1 currentD_finite[OF h] split: split_indicator intro!: nn_integral_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV = d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV = d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "d_IN (h 0) x - (\<Sum>\<^sup>+ y. h 0 (y, x) * indicator ?h0_le_hn y) - (d_IN (h n) x - (\<Sum>\<^sup>+ y. h n (y, x) * indicator ?h0_le_hn y)) + f n (SOURCE, \<langle>x\<rangle>) =
                (\<Sum>\<^sup>+ y. h n (y, x) * indicator ?h0_le_hn y) - (\<Sum>\<^sup>+ y. h 0 (y, x) * indicator ?h0_le_hn y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) + f n (SOURCE, \<langle>x\<rangle>) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply (subst diff_add_assoc2_ennreal)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) \<le> d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
 2. d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) + f n (SOURCE, \<langle>x\<rangle>) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) \<le> d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
by (auto simp add: eq_h_0[symmetric] eq_h_n[symmetric] split: split_indicator intro!: nn_integral_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) + f n (SOURCE, \<langle>x\<rangle>) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply (subst diff_add_assoc2_ennreal)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV \<le> d_IN (h 0) x
 2. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV \<le> d_IN (h 0) x
[PROOF STEP]
by (auto simp: d_IN_def split: split_indicator intro!: nn_integral_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply (subst diff_diff_commute_ennreal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply (subst diff_diff_ennreal')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV \<le> d_IN (h n) x
 2. d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) \<le> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>)
 3. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) + (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV \<le> d_IN (h n) x
[PROOF STEP]
by (auto simp: d_IN_def split: split_indicator intro!: nn_integral_mono) []
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) \<le> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>)
 2. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) + (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) \<le> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
unfolding eq_h_n[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{y. h n (y, x) < h 0 (y, x)}. h n (y, x)\<partial>count_space UNIV \<le> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
by (rule add_increasing2)
             (auto simp add: d_IN_def split: split_indicator intro!: nn_integral_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) + (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply (subst diff_add_assoc2_ennreal[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d_IN (h n) x \<le> d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>)
 2. d_IN (h 0) x + f n (SOURCE, \<langle>x\<rangle>) - d_IN (h n) x + (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d_IN (h n) x \<le> d_IN (h n) x
 2. d_IN (h n) x - d_IN (h n) x + (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
using currentD_finite_IN[OF h]
[PROOF STATE]
proof (prove)
using this:
d_IN (h ?n1) ?x \<noteq> \<top>

goal (2 subgoals):
 1. d_IN (h n) x \<le> d_IN (h n) x
 2. d_IN (h n) x - d_IN (h n) x + (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) + f n (SOURCE, \<langle>x\<rangle>) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) - (d_IN (h n) x - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV)) + f n (SOURCE, \<langle>x\<rangle>) = (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. h n (y, x) * indicator ?h0_le_hn y) - (\<Sum>\<^sup>+ y. h 0 (y, x) * indicator ?h0_le_hn y) = (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x))
[PROOF STEP]
apply(subst nn_integral_diff[symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. (\<lambda>y. h n (y, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} y) \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>y. h 0 (y, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} y) \<in> borel_measurable (count_space UNIV)
 3. \<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV \<noteq> \<infinity>
 4. AE xa in count_space UNIV. h 0 (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa \<le> h n (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa
 5. (\<Sum>\<^sup>+ xa. h n (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa - h 0 (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa) = (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x))
[PROOF STEP]
apply(simp_all add: AE_count_space max_def finite1 split: split_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ xa. h n (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa - h 0 (xa, x) * indicator {y. h 0 (y, x) \<le> h n (y, x)} xa) = (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x))
[PROOF STEP]
apply(rule nn_integral_cong; auto simp add: not_le split: split_indicator)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. h n (xa, x) < h 0 (xa, x) \<Longrightarrow> h n (xa, x) - h 0 (xa, x) = 0
[PROOF STEP]
by (metis diff_eq_0_ennreal le_less not_le top_greatest)
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h n (y, x)\<partial>count_space UNIV) - (\<integral>\<^sup>+y\<in>{y. h 0 (y, x) \<le> h n (y, x)}. h 0 (y, x)\<partial>count_space UNIV) = (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y))
[PROOF STEP]
using B disjoint
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y))
[PROOF STEP]
apply(simp add: nn_integral_count_space_reindex cong: nn_integral_cong_simp outgoing_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; vertex \<Gamma> x; A \<Gamma> \<inter> B \<Gamma> = {}\<rbrakk> \<Longrightarrow> (\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x)) = (\<Sum>\<^sup>+ xa. if edge \<Gamma> x xa then h 0 (x, xa) - h n (x, xa) else if edge \<Gamma> xa x then h n (xa, x) - h 0 (xa, x) else 0)
[PROOF STEP]
apply(auto simp add: B_out currentD_outside[OF h] max.commute intro!: nn_integral_cong split: split_indicator dest: edge_antiparallel)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. h n (y, x) - h 0 (y, x)) = (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y) * indicator (range Inner) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = \<integral>\<^sup>+y\<in>range Inner. f n (\<langle>x\<rangle>, y)\<partial>count_space UNIV
[PROOF STEP]
by(simp add: nn_integral_add nn_integral_count_space_indicator max.left_commute max.commute)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = \<integral>\<^sup>+y\<in>range Inner. f n (\<langle>x\<rangle>, y)\<partial>count_space UNIV

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. f n (\<langle>x\<rangle>, y)) = \<integral>\<^sup>+y\<in>range Inner. f n (\<langle>x\<rangle>, y)\<partial>count_space UNIV

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
have "\<dots> = d_OUT (f n) \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>range Inner. f n (\<langle>x\<rangle>, y)\<partial>count_space UNIV = d_OUT (f n) \<langle>x\<rangle>
[PROOF STEP]
using B disjoint
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>range Inner. f n (\<langle>x\<rangle>, y)\<partial>count_space UNIV = d_OUT (f n) \<langle>x\<rangle>
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
using this:
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>range Inner. f n (\<langle>x\<rangle>, y)\<partial>count_space UNIV = (\<Sum>\<^sup>+ y. f n (\<langle>x\<rangle>, y))
[PROOF STEP]
by(intro nn_integral_cong)(auto split: split_indicator simp add: notin_range_Inner)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>range Inner. f n (\<langle>x\<rangle>, y)\<partial>count_space UNIV = d_OUT (f n) \<langle>x\<rangle>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>xo = \<langle>x\<rangle>; x \<in> B \<Gamma>; x \<in> \<^bold>V\<rbrakk> \<Longrightarrow> KIR (f n) xo
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN (f n) \<langle>x\<rangle> = d_OUT (f n) \<langle>x\<rangle>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN (f n) \<langle>x\<rangle> = d_OUT (f n) \<langle>x\<rangle>

goal (1 subgoal):
 1. KIR (f n) xo
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
d_IN (f n) \<langle>x\<rangle> = d_OUT (f n) \<langle>x\<rangle>
xo = \<langle>x\<rangle>
x \<in> B \<Gamma>
x \<in> \<^bold>V

goal (1 subgoal):
 1. KIR (f n) xo
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
KIR (f n) xo

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

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

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have "weight \<Gamma> b - d_IN (h 0) b = (SUP n. value_flow \<Psi> (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight \<Gamma> b - d_IN (h 0) b = (\<Squnion>n. value_flow \<Psi> (f n))
[PROOF STEP]
using OUT_f_SOURCE currentD_finite_IN[OF h, of 0 b] IN
[PROOF STATE]
proof (prove)
using this:
d_OUT (f ?n1) SOURCE = d_IN (h ?n1) b - d_IN (h 0) b
d_IN (h 0) b \<noteq> \<top>
(\<Squnion>n. d_IN (h n) b) = weight \<Gamma> b

goal (1 subgoal):
 1. weight \<Gamma> b - d_IN (h 0) b = (\<Squnion>n. value_flow \<Psi> (f n))
[PROOF STEP]
by (simp add: SUP_diff_ennreal less_top)
[PROOF STATE]
proof (state)
this:
weight \<Gamma> b - d_IN (h 0) b = (\<Squnion>n. value_flow \<Psi> (f n))

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
weight \<Gamma> b - d_IN (h 0) b = (\<Squnion>n. value_flow \<Psi> (f n))

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have "(SUP n. value_flow \<Psi> (f n)) \<le> \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>n. value_flow \<Psi> (f n)) \<le> \<alpha>
[PROOF STEP]
unfolding \<alpha>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>n. value_flow \<Psi> (f n)) \<le> \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>))
[PROOF STEP]
apply(rule SUP_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n \<in> UNIV \<Longrightarrow> value_flow \<Psi> (f n) \<le> \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>))
[PROOF STEP]
apply(rule SUP_upper)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n \<in> UNIV \<Longrightarrow> f n \<in> Collect (flow \<Psi>)
[PROOF STEP]
apply(simp add: f)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. value_flow \<Psi> (f n)) \<le> \<alpha>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Squnion>n. value_flow \<Psi> (f n)) \<le> \<alpha>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have "\<alpha> \<le> weight \<Gamma> b - d_IN (h 0) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
unfolding \<alpha>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>)) \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
proof(rule SUP_least; clarsimp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
assume f: "flow \<Psi> f"
[PROOF STATE]
proof (state)
this:
flow \<Psi> f

goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
have "d_OUT f SOURCE = (\<Sum>\<^sup>+ y. f (SOURCE, y) * indicator {\<langle>b\<rangle>} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT f SOURCE = \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f (SOURCE, y)\<partial>count_space UNIV
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. f (SOURCE, y)) = \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f (SOURCE, y)\<partial>count_space UNIV
[PROOF STEP]
apply(rule nn_integral_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> space (count_space UNIV) \<Longrightarrow> f (SOURCE, x) = f (SOURCE, x) * indicator {\<langle>b\<rangle>} x
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> space (count_space UNIV) \<Longrightarrow> f (SOURCE, x) = f (SOURCE, x) * indicator {\<langle>b\<rangle>} x
[PROOF STEP]
using flowD_capacity[OF f, of "(SOURCE, x)"]
[PROOF STATE]
proof (prove)
using this:
f (SOURCE, x) \<le> capacity \<Psi> (SOURCE, x)

goal (1 subgoal):
 1. x \<in> space (count_space UNIV) \<Longrightarrow> f (SOURCE, x) = f (SOURCE, x) * indicator {\<langle>b\<rangle>} x
[PROOF STEP]
by(auto split: split_indicator)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d_OUT f SOURCE = \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f (SOURCE, y)\<partial>count_space UNIV

goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT f SOURCE = \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f (SOURCE, y)\<partial>count_space UNIV

goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
have "\<dots> = f (SOURCE, \<langle>b\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f (SOURCE, y)\<partial>count_space UNIV = f (SOURCE, \<langle>b\<rangle>)
[PROOF STEP]
by(simp add: max_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f (SOURCE, y)\<partial>count_space UNIV = f (SOURCE, \<langle>b\<rangle>)

goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{\<langle>b\<rangle>}. f (SOURCE, y)\<partial>count_space UNIV = f (SOURCE, \<langle>b\<rangle>)

goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> b - d_IN (h 0) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (SOURCE, \<langle>b\<rangle>) \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
using flowD_capacity[OF f, of "(SOURCE, \<langle>b\<rangle>)"]
[PROOF STATE]
proof (prove)
using this:
f (SOURCE, \<langle>b\<rangle>) \<le> capacity \<Psi> (SOURCE, \<langle>b\<rangle>)

goal (1 subgoal):
 1. f (SOURCE, \<langle>b\<rangle>) \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (SOURCE, \<langle>b\<rangle>) \<le> weight \<Gamma> b - d_IN (h 0) b

goal (1 subgoal):
 1. \<And>f. flow \<Psi> f \<Longrightarrow> d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
show "d_OUT f SOURCE \<le> \<dots>"
[PROOF STATE]
proof (prove)
using this:
d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b

goal (1 subgoal):
 1. d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT f SOURCE \<le> weight \<Gamma> b - d_IN (h 0) b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<alpha> \<le> weight \<Gamma> b - d_IN (h 0) b

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
weight \<Gamma> b - d_IN (h 0) b \<le> \<alpha>
\<alpha> \<le> weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
have \<alpha>: "\<alpha> = weight \<Gamma> b - d_IN (h 0) b"
[PROOF STATE]
proof (prove)
using this:
weight \<Gamma> b - d_IN (h 0) b \<le> \<alpha>
\<alpha> \<le> weight \<Gamma> b - d_IN (h 0) b

goal (1 subgoal):
 1. \<alpha> = weight \<Gamma> b - d_IN (h 0) b
[PROOF STEP]
by(rule antisym[rotated])
[PROOF STATE]
proof (state)
this:
\<alpha> = weight \<Gamma> b - d_IN (h 0) b

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
hence \<alpha>_finite: "\<alpha> \<noteq> \<top>"
[PROOF STATE]
proof (prove)
using this:
\<alpha> = weight \<Gamma> b - d_IN (h 0) b

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

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[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 g where g: "flow \<Psi> g"
    and value_g: "value_flow \<Psi> g = \<alpha>"
    and IN_g: "\<And>x. d_IN g x \<le> value_flow \<Psi> g"
[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>g. \<lbrakk>flow \<Psi> g; value_flow \<Psi> g = \<alpha>; \<And>x. d_IN g x \<le> value_flow \<Psi> g\<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>g. \<lbrakk>flow \<Psi> g; value_flow \<Psi> g = \<Squnion> (value_flow \<Psi> ` Collect (flow \<Psi>)); \<And>x. d_IN g x \<le> value_flow \<Psi> g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
flow \<Psi> g
value_flow \<Psi> g = \<alpha>
d_IN g ?x1 \<le> value_flow \<Psi> g

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have g_le_h0: "g (\<langle>x\<rangle>, \<langle>y\<rangle>) \<le> h 0 (x, y)" if "edge \<Gamma> x y" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (\<langle>x\<rangle>, \<langle>y\<rangle>) \<le> h 0 (x, y)
[PROOF STEP]
using flowD_capacity[OF g, of "(\<langle>x\<rangle>, \<langle>y\<rangle>)"] that
[PROOF STATE]
proof (prove)
using this:
g (\<langle>x\<rangle>, \<langle>y\<rangle>) \<le> capacity \<Psi> (\<langle>x\<rangle>, \<langle>y\<rangle>)
edge \<Gamma> x y

goal (1 subgoal):
 1. g (\<langle>x\<rangle>, \<langle>y\<rangle>) \<le> h 0 (x, y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
edge \<Gamma> ?x1 ?y1 \<Longrightarrow> g (\<langle>?x1\<rangle>, \<langle>?y1\<rangle>) \<le> h 0 (?x1, ?y1)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
note [simp] = \<Psi>.flowD_finite[OF g]
[PROOF STATE]
proof (state)
this:
g ?e \<noteq> \<top>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have g_SOURCE: "g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
proof(cases "x = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
 2. x \<noteq> b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = b

goal (2 subgoals):
 1. x = b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
 2. x \<noteq> b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
have "g (SOURCE, \<langle>x\<rangle>) = (\<Sum>\<^sup>+ y. g (SOURCE, y) * indicator {\<langle>x\<rangle>} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (SOURCE, \<langle>x\<rangle>) = \<integral>\<^sup>+y\<in>{\<langle>x\<rangle>}. g (SOURCE, y)\<partial>count_space UNIV
[PROOF STEP]
by(simp add: max_def)
[PROOF STATE]
proof (state)
this:
g (SOURCE, \<langle>x\<rangle>) = \<integral>\<^sup>+y\<in>{\<langle>x\<rangle>}. g (SOURCE, y)\<partial>count_space UNIV

goal (2 subgoals):
 1. x = b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
 2. x \<noteq> b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g (SOURCE, \<langle>x\<rangle>) = \<integral>\<^sup>+y\<in>{\<langle>x\<rangle>}. g (SOURCE, y)\<partial>count_space UNIV

goal (2 subgoals):
 1. x = b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
 2. x \<noteq> b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
have "\<dots> = value_flow \<Psi> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{\<langle>x\<rangle>}. g (SOURCE, y)\<partial>count_space UNIV = value_flow \<Psi> g
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{\<langle>x\<rangle>}. g (SOURCE, y)\<partial>count_space UNIV = (\<Sum>\<^sup>+ y. g (source \<Psi>, y))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
x = b

goal (1 subgoal):
 1. \<integral>\<^sup>+y\<in>{\<langle>x\<rangle>}. g (SOURCE, y)\<partial>count_space UNIV = (\<Sum>\<^sup>+ y. g (source \<Psi>, y))
[PROOF STEP]
by(intro nn_integral_cong)(auto split: split_indicator intro: \<Psi>.flowD_outside[OF g])
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+y\<in>{\<langle>x\<rangle>}. g (SOURCE, y)\<partial>count_space UNIV = value_flow \<Psi> g

goal (2 subgoals):
 1. x = b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
 2. x \<noteq> b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
g (SOURCE, \<langle>x\<rangle>) = value_flow \<Psi> g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g (SOURCE, \<langle>x\<rangle>) = value_flow \<Psi> g

goal (1 subgoal):
 1. g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
using value_g
[PROOF STATE]
proof (prove)
using this:
g (SOURCE, \<langle>x\<rangle>) = value_flow \<Psi> g
value_flow \<Psi> g = \<alpha>

goal (1 subgoal):
 1. g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
by(simp add: True)
[PROOF STATE]
proof (state)
this:
g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)

goal (1 subgoal):
 1. x \<noteq> b \<Longrightarrow> g (SOURCE, \<langle>x\<rangle>) = (if x = b then \<alpha> else 0)
[PROOF STEP]
qed(simp add: \<Psi>.flowD_outside[OF g])
[PROOF STATE]
proof (state)
this:
g (SOURCE, \<langle>?x1\<rangle>) = (if ?x1 = b then \<alpha> else 0)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
let ?g = "\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
define h' where "h' = h 0 \<oplus> ?g"
[PROOF STATE]
proof (state)
this:
h' = h 0 \<oplus> (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>))

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have h'_simps: "h' (x, y) = (if edge \<Gamma> x y then h 0 (x, y) + g (\<langle>y\<rangle>, \<langle>x\<rangle>) - g (\<langle>x\<rangle>, \<langle>y\<rangle>) else 0)" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h' (x, y) = (if edge \<Gamma> x y then h 0 (x, y) + g (\<langle>y\<rangle>, \<langle>x\<rangle>) - g (\<langle>x\<rangle>, \<langle>y\<rangle>) else 0)
[PROOF STEP]
by(simp add: h'_def)
[PROOF STATE]
proof (state)
this:
h' (?x1, ?y1) = (if edge \<Gamma> ?x1 ?y1 then h 0 (?x1, ?y1) + g (\<langle>?y1\<rangle>, \<langle>?x1\<rangle>) - g (\<langle>?x1\<rangle>, \<langle>?y1\<rangle>) else 0)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have OUT_h'_B [simp]: "d_OUT h' x = 0" if "x \<in> B \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h' x = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. d_OUT h' x = 0
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. h' (x, y)) = 0
[PROOF STEP]
by(simp add: nn_integral_0_iff emeasure_count_space_eq_0)(simp add: h'_simps B_out)
[PROOF STATE]
proof (state)
this:
?x1 \<in> B \<Gamma> \<Longrightarrow> d_OUT h' ?x1 = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have IN_h'_A [simp]: "d_IN h' x = 0" if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h' x = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. d_IN h' x = 0
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ xa. h' (xa, x)) = 0
[PROOF STEP]
by(simp add: nn_integral_0_iff emeasure_count_space_eq_0)(simp add: h'_simps A_in)
[PROOF STATE]
proof (state)
this:
?x1 \<in> A \<Gamma> \<Longrightarrow> d_IN h' ?x1 = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have h'_outside: "h' e = 0" if "e \<notin> \<^bold>E" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h' e = 0
[PROOF STEP]
unfolding h'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h 0 \<oplus> (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>))) e = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
e \<notin> \<^bold>E

goal (1 subgoal):
 1. (h 0 \<oplus> (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>))) e = 0
[PROOF STEP]
by(rule plus_flow_outside)
[PROOF STATE]
proof (state)
this:
?e1 \<notin> \<^bold>E \<Longrightarrow> h' ?e1 = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have OUT_h'_outside: "d_OUT h' x = 0" and IN_h'_outside: "d_IN h' x = 0" if "x \<notin> \<^bold>V" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h' x = 0 &&& d_IN h' x = 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<notin> \<^bold>V

goal (1 subgoal):
 1. d_OUT h' x = 0 &&& d_IN h' x = 0
[PROOF STEP]
by(auto simp add: d_OUT_def d_IN_def nn_integral_0_iff emeasure_count_space_eq_0 vertex_def intro: h'_outside)
[PROOF STATE]
proof (state)
this:
?x1 \<notin> \<^bold>V \<Longrightarrow> d_OUT h' ?x1 = 0
?x1 \<notin> \<^bold>V \<Longrightarrow> d_IN h' ?x1 = 0

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have g_le_OUT: "g (SINK, \<langle>x\<rangle>) \<le> d_OUT g \<langle>x\<rangle>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (vertex.SINK, \<langle>x\<rangle>) \<le> d_OUT g \<langle>x\<rangle>
[PROOF STEP]
by (subst flowD_KIR[OF g]) (simp_all add: d_IN_ge_point)
[PROOF STATE]
proof (state)
this:
g (vertex.SINK, \<langle>?x1\<rangle>) \<le> d_OUT g \<langle>?x1\<rangle>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have OUT_g_A: "d_OUT ?g x = d_OUT g \<langle>x\<rangle> - g (SINK, \<langle>x\<rangle>)" if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "d_OUT ?g x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex d_OUT_def)
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_IN g \<langle>x\<rangle> - (\<Sum>\<^sup>+ y. g (y, \<langle>x\<rangle>) * indicator {SINK} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) = d_IN g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (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 Inner. g (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ xa. g (xa, \<langle>x\<rangle>)) - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (y, \<langle>x\<rangle>)\<partial>count_space UNIV)
[PROOF STEP]
using that b disjoint flowD_capacity[OF g, of "(SOURCE, \<langle>x\<rangle>)"]
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
b \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
g (SOURCE, \<langle>x\<rangle>) \<le> capacity \<Psi> (SOURCE, \<langle>x\<rangle>)

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

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) = d_IN g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (y, \<langle>x\<rangle>)\<partial>count_space UNIV)

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_OUT g \<langle>x\<rangle> - g (SINK, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (y, \<langle>x\<rangle>)\<partial>count_space UNIV) = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
by(simp add: flowD_KIR[OF g] max_def)
[PROOF STATE]
proof (state)
this:
d_IN g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (y, \<langle>x\<rangle>)\<partial>count_space UNIV) = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> A \<Gamma> \<Longrightarrow> d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) ?x1 = d_OUT g \<langle>?x1\<rangle> - g (vertex.SINK, \<langle>?x1\<rangle>)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have IN_g_A: "d_IN ?g x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, SINK)" if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
have "d_IN ?g x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex d_IN_def)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
have "\<dots> = d_OUT g \<langle>x\<rangle> - (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, y) * indicator {SINK} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) = d_OUT g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (\<langle>x\<rangle>, y)\<partial>count_space UNIV)
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, y)) - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (\<langle>x\<rangle>, y)\<partial>count_space UNIV)
[PROOF STEP]
using that b disjoint flowD_capacity[OF g, of "(\<langle>x\<rangle>, SOURCE)"]
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
b \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
g (\<langle>x\<rangle>, SOURCE) \<le> capacity \<Psi> (\<langle>x\<rangle>, SOURCE)

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) = (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, y)) - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (\<langle>x\<rangle>, y)\<partial>count_space UNIV)
[PROOF STEP]
by(subst nn_integral_diff[symmetric])
        (auto simp add: nn_integral_count_space_indicator notin_range_Inner max_def intro!: nn_integral_cong split: split_indicator if_split_asm)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) = d_OUT g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (\<langle>x\<rangle>, y)\<partial>count_space UNIV)

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) = d_OUT g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{vertex.SINK}. g (\<langle>x\<rangle>, y)\<partial>count_space UNIV)

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

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

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> A \<Gamma> \<Longrightarrow> d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) ?x1 = d_OUT g \<langle>?x1\<rangle> - g (\<langle>?x1\<rangle>, vertex.SINK)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have OUT_g_B: "d_OUT ?g x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)" if "x \<in> B \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "d_OUT ?g x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex d_OUT_def)
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_IN g \<langle>x\<rangle> - (\<Sum>\<^sup>+ y. g (y, \<langle>x\<rangle>) * indicator {SOURCE} y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) = d_IN g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{SOURCE}. g (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 Inner. g (y, \<langle>x\<rangle>)) = (\<Sum>\<^sup>+ xa. g (xa, \<langle>x\<rangle>)) - (\<integral>\<^sup>+y\<in>{SOURCE}. g (y, \<langle>x\<rangle>)\<partial>count_space UNIV)
[PROOF STEP]
using that b disjoint flowD_capacity[OF g, of "(SINK, \<langle>x\<rangle>)"]
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>
b \<in> B \<Gamma>
A \<Gamma> \<inter> B \<Gamma> = {}
g (vertex.SINK, \<langle>x\<rangle>) \<le> capacity \<Psi> (vertex.SINK, \<langle>x\<rangle>)

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

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) = d_IN g \<langle>x\<rangle> - (\<integral>\<^sup>+y\<in>{SOURCE}. g (y, \<langle>x\<rangle>)\<partial>count_space UNIV)

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

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

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> B \<Gamma> \<Longrightarrow> d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) ?x1 = d_IN g \<langle>?x1\<rangle> - g (SOURCE, \<langle>?x1\<rangle>)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have IN_g_B: "d_IN ?g x = d_OUT g \<langle>x\<rangle>" if "x \<in> B \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>
[PROOF STEP]
have "d_IN ?g x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))
[PROOF STEP]
by(simp add: nn_integral_count_space_reindex d_IN_def)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))

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

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

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

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> B \<Gamma> \<Longrightarrow> d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) ?x1 = d_OUT g \<langle>?x1\<rangle>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have finite_g_IN: "d_IN ?g x \<noteq> \<top>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<noteq> \<top>
[PROOF STEP]
using \<alpha>_finite
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<noteq> \<top>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<noteq> \<top>
[PROOF STEP]
proof(rule neq_top_trans)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
have "d_IN ?g x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))
[PROOF STEP]
by(auto simp add: d_IN_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y))

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
have "\<dots> \<le> d_OUT g \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) \<le> d_OUT g \<langle>x\<rangle>
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) \<le> (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, y))
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) \<le> d_OUT g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (\<langle>x\<rangle>, y)) \<le> d_OUT g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
have "\<dots> = d_IN g \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KIR g \<langle>x\<rangle>
[PROOF STEP]
by(rule flowD_KIR[OF g]) simp_all
[PROOF STATE]
proof (state)
this:
KIR g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
KIR g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
have "\<dots> \<le> \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g \<langle>x\<rangle> \<le> \<alpha>
[PROOF STEP]
using IN_g value_g
[PROOF STATE]
proof (prove)
using this:
d_IN g ?x1 \<le> value_flow \<Psi> g
value_flow \<Psi> g = \<alpha>

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

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
show "d_IN ?g x \<le> \<alpha>"
[PROOF STATE]
proof (prove)
using this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) ?x1 \<noteq> \<top>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have OUT_h'_A: "d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, SINK) - g (SINK, \<langle>x\<rangle>)" if "x \<in> A \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "d_OUT h' x = d_OUT (h 0) x + (\<Sum>\<^sup>+ y. ?g (x, y) * indicator \<^bold>E (x, y)) - (\<Sum>\<^sup>+ y. ?g (y, x) * indicator \<^bold>E (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) - (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y))
[PROOF STEP]
unfolding h'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0 \<oplus> (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>))) x = d_OUT (h 0) x + (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) - (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y))
[PROOF STEP]
apply(subst OUT_plus_flow[of \<Gamma> "h 0" ?g, OF currentD_outside'[OF h]])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> e \<notin> \<^bold>E
 2. \<And>x y. edge \<Gamma> x y \<Longrightarrow> (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) \<le> h 0 (x, y)
 3. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<noteq> \<top>
 4. d_OUT (h 0) x + (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) - (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_OUT (h 0) x + (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) - (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y))
[PROOF STEP]
apply(auto simp add: g_le_h0 finite_g_IN)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d_OUT h' x = d_OUT (h 0) x + (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) - (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y))

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT h' x = d_OUT (h 0) x + (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) - (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y))

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. ?g (x, y) * indicator \<^bold>E (x, y)) = d_OUT ?g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = (\<Sum>\<^sup>+ y. case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = (\<Sum>\<^sup>+ y. case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
by(auto simp add: A_in split: split_indicator intro!: nn_integral_cong \<Psi>.flowD_outside[OF g])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. (case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots>  = d_OUT g \<langle>x\<rangle> - g (SINK, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
by(rule OUT_g_A)
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. ?g (y, x) * indicator \<^bold>E (x, y)) = d_IN ?g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = (\<Sum>\<^sup>+ xa. case (xa, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
by(auto simp add: A_in split: split_indicator intro!: nn_integral_cong \<Psi>.flowD_outside[OF g])
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. (case (y, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>)) * indicator \<^bold>E (x, y)) = d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, SINK)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
by(rule IN_g_A)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
have "d_OUT (h 0) x + (d_OUT g \<langle>x\<rangle> - g (SINK, \<langle>x\<rangle>)) - \<dots> = d_OUT (h 0) x + g (\<langle>x\<rangle>, SINK) - g (SINK, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + (d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)) - (d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(simp add: g_le_OUT add_diff_eq_ennreal d_OUT_ge_point)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>) - (d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(subst diff_diff_commute_ennreal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + d_OUT g \<langle>x\<rangle> - (d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)) - g (vertex.SINK, \<langle>x\<rangle>) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(simp add: add_increasing d_OUT_ge_point g_le_OUT diff_diff_ennreal')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + d_OUT g \<langle>x\<rangle> + g (\<langle>x\<rangle>, vertex.SINK) - d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(subst add.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + (d_OUT g \<langle>x\<rangle> + g (\<langle>x\<rangle>, vertex.SINK)) - d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(subst (2) add.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + (g (\<langle>x\<rangle>, vertex.SINK) + d_OUT g \<langle>x\<rangle>) - d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(subst add.assoc[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) + d_OUT g \<langle>x\<rangle> - d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(subst ennreal_add_diff_cancel_right)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d_OUT g \<langle>x\<rangle> \<noteq> \<top>
 2. d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
apply(simp_all add: \<Psi>.flowD_finite_OUT[OF g])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
d_OUT (h 0) x + (d_OUT g \<langle>x\<rangle> - g (vertex.SINK, \<langle>x\<rangle>)) - (d_OUT g \<langle>x\<rangle> - g (\<langle>x\<rangle>, vertex.SINK)) = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> A \<Gamma> \<Longrightarrow> d_OUT h' ?x1 = d_OUT (h 0) ?x1 + g (\<langle>?x1\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>?x1\<rangle>)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have finite_g_OUT: "d_OUT ?g x \<noteq> \<top>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<noteq> \<top>
[PROOF STEP]
using \<alpha>_finite
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<noteq> \<top>

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<noteq> \<top>
[PROOF STEP]
proof(rule neq_top_trans)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
have "d_OUT ?g x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))
[PROOF STEP]
by(auto simp add: d_OUT_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>))

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
have "\<dots> \<le> d_IN g \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) \<le> d_IN g \<langle>x\<rangle>
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) \<le> (\<Sum>\<^sup>+ xa. g (xa, \<langle>x\<rangle>))
[PROOF STEP]
by(auto simp add: nn_integral_count_space_indicator intro!: nn_integral_mono split: split_indicator)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) \<le> d_IN g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inner. g (y, \<langle>x\<rangle>)) \<le> d_IN g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
have "\<dots> \<le> \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN g \<langle>x\<rangle> \<le> \<alpha>
[PROOF STEP]
using IN_g value_g
[PROOF STATE]
proof (prove)
using this:
d_IN g ?x1 \<le> value_flow \<Psi> g
value_flow \<Psi> g = \<alpha>

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

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
show "d_OUT ?g x \<le> \<alpha>"
[PROOF STATE]
proof (prove)
using this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x \<le> \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) ?x1 \<noteq> \<top>

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have IN_h'_B: "d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)" if "x \<in> B \<Gamma>" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have g_le: "g (SOURCE, \<langle>x\<rangle>) \<le> d_IN g \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (SOURCE, \<langle>x\<rangle>) \<le> d_IN g \<langle>x\<rangle>
[PROOF STEP]
by (rule d_IN_ge_point)
[PROOF STATE]
proof (state)
this:
g (SOURCE, \<langle>x\<rangle>) \<le> d_IN g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "d_IN h' x = d_IN (h 0) x + (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) - (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) - (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x))
[PROOF STEP]
unfolding h'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0 \<oplus> (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>))) x = d_IN (h 0) x + (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) - (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x))
[PROOF STEP]
by(subst IN_plus_flow[of \<Gamma> "h 0" ?g, OF currentD_outside'[OF h]])
        (auto simp add: g_le_h0 finite_g_OUT)
[PROOF STATE]
proof (state)
this:
d_IN h' x = d_IN (h 0) x + (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) - (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x))

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN h' x = d_IN (h 0) x + (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) - (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x))

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) = d_IN ?g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) = d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) = (\<Sum>\<^sup>+ xa. case (xa, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) = (\<Sum>\<^sup>+ xa. case (xa, x) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
by(intro nn_integral_cong)(auto split: split_indicator intro!: \<Psi>.flowD_outside[OF g] simp add: B_out)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) = d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. g (\<langle>x\<rangle>, \<langle>y\<rangle>) * indicator \<^bold>E (y, x)) = d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_OUT g \<langle>x\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>
[PROOF STEP]
by(rule IN_g_B)
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_OUT g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "(\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x)) = d_OUT ?g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x)) = d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x
[PROOF STEP]
unfolding d_OUT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x)) = (\<Sum>\<^sup>+ y. case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x)) = (\<Sum>\<^sup>+ y. case (x, y) of (x, y) \<Rightarrow> g (\<langle>y\<rangle>, \<langle>x\<rangle>))
[PROOF STEP]
by(intro nn_integral_cong)(auto split: split_indicator intro!: \<Psi>.flowD_outside[OF g] simp add: B_out)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x)) = d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y. g (\<langle>y\<rangle>, \<langle>x\<rangle>) * indicator \<^bold>E (y, x)) = d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "\<dots> = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
by(rule OUT_g_B)
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (\<lambda>(x, y). g (\<langle>y\<rangle>, \<langle>x\<rangle>)) x = d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
have "d_IN (h 0) x + d_OUT g \<langle>x\<rangle> - \<dots> = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x + d_OUT g \<langle>x\<rangle> - (d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)) = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
using \<Psi>.flowD_finite_IN[OF g] g_le
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> sink \<Psi> \<Longrightarrow> d_IN g ?x \<noteq> \<top>
g (SOURCE, \<langle>x\<rangle>) \<le> d_IN g \<langle>x\<rangle>

goal (1 subgoal):
 1. d_IN (h 0) x + d_OUT g \<langle>x\<rangle> - (d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)) = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
by(cases "d_IN (h 0) x"; cases "d_IN g \<langle>x\<rangle>"; cases "d_IN g \<langle>x\<rangle>"; cases "g (SOURCE, \<langle>x\<rangle>)")
        (auto simp: flowD_KIR[OF g] top_add ennreal_minus_if ennreal_plus_if simp del: ennreal_plus)
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x + d_OUT g \<langle>x\<rangle> - (d_IN g \<langle>x\<rangle> - g (SOURCE, \<langle>x\<rangle>)) = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> B \<Gamma> \<Longrightarrow> d_IN h' ?x1 = d_IN (h 0) ?x1 + g (SOURCE, \<langle>?x1\<rangle>)

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have h': "current \<Gamma> h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. current \<Gamma> h'
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. d_OUT h' x \<le> weight \<Gamma> x
 2. \<And>x. d_IN h' x \<le> weight \<Gamma> x
 3. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> h' e = 0
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. d_OUT h' x \<le> weight \<Gamma> x
 2. \<And>x. d_IN h' x \<le> weight \<Gamma> x
 3. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> h' e = 0
[PROOF STEP]
consider (A) "x \<in> A \<Gamma>" | (B) "x \<in> B \<Gamma>" | (outside) "x \<notin> \<^bold>V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A \<Gamma> \<Longrightarrow> thesis; x \<in> B \<Gamma> \<Longrightarrow> thesis; x \<notin> \<^bold>V \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using bipartite_V
[PROOF STATE]
proof (prove)
using this:
\<^bold>V \<subseteq> A \<Gamma> \<union> B \<Gamma>

goal (1 subgoal):
 1. \<lbrakk>x \<in> A \<Gamma> \<Longrightarrow> thesis; x \<in> B \<Gamma> \<Longrightarrow> thesis; x \<notin> \<^bold>V \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> A \<Gamma> \<Longrightarrow> ?thesis1; x \<in> B \<Gamma> \<Longrightarrow> ?thesis1; x \<notin> \<^bold>V \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (3 subgoals):
 1. \<And>x. d_OUT h' x \<le> weight \<Gamma> x
 2. \<And>x. d_IN h' x \<le> weight \<Gamma> x
 3. \<And>e. e \<notin> \<^bold>E \<Longrightarrow> h' e = 0
[PROOF STEP]
note cases = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> A \<Gamma> \<Longrightarrow> ?thesis1; x \<in> B \<Gamma> \<Longrightarrow> ?thesis1; x \<notin> \<^bold>V \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

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

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> A \<Gamma>
[PROOF STEP]
have "d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, SINK) - g (SINK, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>

goal (1 subgoal):
 1. d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)
[PROOF STEP]
by(simp add: OUT_h'_A)
[PROOF STATE]
proof (state)
this:
d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT h' x = d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>)

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> d_OUT (h 0) x + g (\<langle>x\<rangle>, SINK)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>) \<le> d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK)
[PROOF STEP]
by(rule diff_le_self_ennreal)
[PROOF STATE]
proof (state)
this:
d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>) \<le> d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK)

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK) - g (vertex.SINK, \<langle>x\<rangle>) \<le> d_OUT (h 0) x + g (\<langle>x\<rangle>, vertex.SINK)

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
have "g (\<langle>x\<rangle>, SINK) \<le> weight \<Gamma> x - d_OUT (h 0) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (\<langle>x\<rangle>, vertex.SINK) \<le> weight \<Gamma> x - d_OUT (h 0) x
[PROOF STEP]
using flowD_capacity[OF g, of "(\<langle>x\<rangle>, SINK)"] A
[PROOF STATE]
proof (prove)
using this:
g (\<langle>x\<rangle>, vertex.SINK) \<le> capacity \<Psi> (\<langle>x\<rangle>, vertex.SINK)
x \<in> A \<Gamma>

goal (1 subgoal):
 1. g (\<langle>x\<rangle>, vertex.SINK) \<le> weight \<Gamma> x - d_OUT (h 0) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g (\<langle>x\<rangle>, vertex.SINK) \<le> weight \<Gamma> x - d_OUT (h 0) x

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g (\<langle>x\<rangle>, vertex.SINK) \<le> weight \<Gamma> x - d_OUT (h 0) x

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
have "d_OUT (h 0) x + \<dots> = weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_OUT (h 0) x + (weight \<Gamma> x - d_OUT (h 0) x) = weight \<Gamma> x
[PROOF STEP]
by(simp add: add_diff_eq_ennreal add_diff_inverse_ennreal  currentD_finite_OUT[OF h] currentD_weight_OUT[OF h])
[PROOF STATE]
proof (state)
this:
d_OUT (h 0) x + (weight \<Gamma> x - d_OUT (h 0) x) = weight \<Gamma> x

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>xa y. xa \<le> y \<Longrightarrow> d_OUT (h 0) x + xa \<le> d_OUT (h 0) x + y) \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>xa y. xa \<le> y \<Longrightarrow> d_OUT (h 0) x + xa \<le> d_OUT (h 0) x + y) \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x

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

goal (2 subgoals):
 1. x \<in> B \<Gamma> \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
 2. x \<notin> \<^bold>V \<Longrightarrow> d_OUT h' x \<le> weight \<Gamma> x
[PROOF STEP]
qed(simp_all add: OUT_h'_outside )
[PROOF STATE]
proof (state)
this:
d_OUT h' x \<le> weight \<Gamma> x

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

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
[PROOF STEP]
hence "d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)"
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma>

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)
[PROOF STEP]
by(rule IN_h'_B)
[PROOF STATE]
proof (state)
this:
d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN h' x = d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>)

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
[PROOF STEP]
have "\<dots> \<le> weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>) \<le> weight \<Gamma> x
[PROOF STEP]
by(simp add: g_SOURCE \<alpha> currentD_weight_IN[OF h] add_diff_eq_ennreal add_diff_inverse_ennreal currentD_finite_IN[OF h])
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x + g (SOURCE, \<langle>x\<rangle>) \<le> weight \<Gamma> x

goal (3 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 2. x \<in> B \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 3. x \<notin> \<^bold>V \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN h' x \<le> weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN h' x \<le> weight \<Gamma> x

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

goal (2 subgoals):
 1. x \<in> A \<Gamma> \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
 2. x \<notin> \<^bold>V \<Longrightarrow> d_IN h' x \<le> weight \<Gamma> x
[PROOF STEP]
qed(simp_all add:  IN_h'_outside)
[PROOF STATE]
proof (state)
this:
d_IN h' x \<le> weight \<Gamma> x

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

goal (1 subgoal):
 1. h' e = 0
[PROOF STEP]
by(simp split: prod.split_asm add: h'_simps)
[PROOF STATE]
proof (state)
this:
?e1 \<notin> \<^bold>E \<Longrightarrow> h' ?e1 = 0

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

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
current \<Gamma> h'

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have SAT_h': "B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Gamma> \<inter> \<^bold>V \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
show "x \<in> SAT \<Gamma> h'" if "x \<in> B \<Gamma> \<inter> \<^bold>V" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> SAT \<Gamma> h'
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma> \<inter> \<^bold>V

goal (1 subgoal):
 1. x \<in> SAT \<Gamma> h'
[PROOF STEP]
proof(cases "x = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x = b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
 2. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = b

goal (2 subgoals):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x = b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
 2. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
have "d_IN h' x = weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h' x = weight \<Gamma> x
[PROOF STEP]
using that True
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma> \<inter> \<^bold>V
x = b

goal (1 subgoal):
 1. d_IN h' x = weight \<Gamma> x
[PROOF STEP]
by(simp add: IN_h'_B g_SOURCE \<alpha> currentD_weight_IN[OF h] add_diff_eq_ennreal add_diff_inverse_ennreal currentD_finite_IN[OF h])
[PROOF STATE]
proof (state)
this:
d_IN h' x = weight \<Gamma> x

goal (2 subgoals):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x = b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
 2. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN h' x = weight \<Gamma> x

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

goal (1 subgoal):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> b

goal (1 subgoal):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
have "d_IN h' x = d_IN (h 0) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x
[PROOF STEP]
using that False
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma> \<inter> \<^bold>V
x \<noteq> b

goal (1 subgoal):
 1. d_IN h' x = d_IN (h 0) x
[PROOF STEP]
by(simp add: IN_h'_B g_SOURCE)
[PROOF STATE]
proof (state)
this:
d_IN h' x = d_IN (h 0) x

goal (1 subgoal):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN h' x = d_IN (h 0) x

goal (1 subgoal):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
have "\<dots> = weight \<Gamma> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (h 0) x = weight \<Gamma> x
[PROOF STEP]
using SAT[of 0, THEN subsetD, of x] False that currentD_SAT[OF h, of x 0] disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> B \<Gamma> \<inter> \<^bold>V - {b} \<Longrightarrow> x \<in> SAT \<Gamma> (h 0)
x \<noteq> b
x \<in> B \<Gamma> \<inter> \<^bold>V
(x \<in> SAT \<Gamma> (h 0)) = (x \<in> A \<Gamma> \<or> d_IN (h 0) x = weight \<Gamma> x)
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. d_IN (h 0) x = weight \<Gamma> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d_IN (h 0) x = weight \<Gamma> x

goal (1 subgoal):
 1. \<lbrakk>x \<in> B \<Gamma> \<inter> \<^bold>V; x \<noteq> b\<rbrakk> \<Longrightarrow> x \<in> SAT \<Gamma> h'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN h' x = weight \<Gamma> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN h' x = weight \<Gamma> x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x1 \<in> B \<Gamma> \<inter> \<^bold>V \<Longrightarrow> ?x1 \<in> SAT \<Gamma> h'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
have "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]
have "separating \<Gamma> (B \<Gamma> \<inter> \<^bold>V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. separating \<Gamma> (B \<Gamma> \<inter> \<^bold>V)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> B \<Gamma> \<inter> \<^bold>V) \<or> x \<in> B \<Gamma> \<inter> \<^bold>V
[PROOF STEP]
fix x y p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> B \<Gamma> \<inter> \<^bold>V) \<or> x \<in> B \<Gamma> \<inter> \<^bold>V
[PROOF STEP]
assume x: "x \<in> A \<Gamma>" and y: "y \<in> B \<Gamma>" and p: "path \<Gamma> x p y"
[PROOF STATE]
proof (state)
this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y

goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> B \<Gamma> \<inter> \<^bold>V) \<or> x \<in> B \<Gamma> \<inter> \<^bold>V
[PROOF STEP]
hence Nil: "p \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y

goal (1 subgoal):
 1. p \<noteq> []
[PROOF STEP]
using disjoint
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Gamma>
y \<in> B \<Gamma>
path \<Gamma> x p y
A \<Gamma> \<inter> B \<Gamma> = {}

goal (1 subgoal):
 1. p \<noteq> []
[PROOF STEP]
by(auto simp add: rtrancl_path_simps)
[PROOF STATE]
proof (state)
this:
p \<noteq> []

goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>x \<in> A \<Gamma>; y \<in> B \<Gamma>; path \<Gamma> x p y\<rbrakk> \<Longrightarrow> (\<exists>z\<in>set p. z \<in> B \<Gamma> \<inter> \<^bold>V) \<or> x \<in> B \<Gamma> \<inter> \<^bold>V
[PROOF STEP]
from rtrancl_path_last[OF p Nil] last_in_set[OF Nil] y rtrancl_path_Range[OF p, of y]
[PROOF STATE]
proof (chain)
picking this:
last p = y
last p \<in> set p
y \<in> B \<Gamma>
y \<in> set p \<Longrightarrow> Rangep (edge \<Gamma>) y
[PROOF STEP]
show "(\<exists>z\<in>set p. z \<in> B \<Gamma> \<inter> \<^bold>V) \<or> x \<in> B \<Gamma> \<inter> \<^bold>V"
[PROOF STATE]
proof (prove)
using this:
last p = y
last p \<in> set p
y \<in> B \<Gamma>
y \<in> set p \<Longrightarrow> Rangep (edge \<Gamma>) y

goal (1 subgoal):
 1. (\<exists>z\<in>set p. z \<in> B \<Gamma> \<inter> \<^bold>V) \<or> x \<in> B \<Gamma> \<inter> \<^bold>V
[PROOF STEP]
by(auto intro: vertexI2)
[PROOF STATE]
proof (state)
this:
(\<exists>z\<in>set p. z \<in> B \<Gamma> \<inter> \<^bold>V) \<or> x \<in> B \<Gamma> \<inter> \<^bold>V

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
separating \<Gamma> (B \<Gamma> \<inter> \<^bold>V)

goal (2 subgoals):
 1. separating \<Gamma> (TER h')
 2. current \<Gamma> h'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
separating \<Gamma> (B \<Gamma> \<inter> \<^bold>V)

goal (2 subgoals):
 1. separating \<Gamma> (TER h')
 2. current \<Gamma> h'
[PROOF STEP]
have TER: "B \<Gamma> \<inter> \<^bold>V \<subseteq> TER h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<Gamma> \<inter> \<^bold>V \<subseteq> TER h'
[PROOF STEP]
using SAT_h'
[PROOF STATE]
proof (prove)
using this:
B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'

goal (1 subgoal):
 1. B \<Gamma> \<inter> \<^bold>V \<subseteq> TER h'
[PROOF STEP]
by(auto simp add: SINK)
[PROOF STATE]
proof (state)
this:
B \<Gamma> \<inter> \<^bold>V \<subseteq> TER h'

goal (2 subgoals):
 1. separating \<Gamma> (TER h')
 2. current \<Gamma> h'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
separating \<Gamma> (B \<Gamma> \<inter> \<^bold>V)
B \<Gamma> \<inter> \<^bold>V \<subseteq> TER h'
[PROOF STEP]
show "separating \<Gamma> (TER h')"
[PROOF STATE]
proof (prove)
using this:
separating \<Gamma> (B \<Gamma> \<inter> \<^bold>V)
B \<Gamma> \<inter> \<^bold>V \<subseteq> TER h'

goal (1 subgoal):
 1. separating \<Gamma> (TER h')
[PROOF STEP]
by(rule separating_weakening)
[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. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
current \<Gamma> h'
B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
wave \<Gamma> h'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
current \<Gamma> h'
B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
wave \<Gamma> h'

goal (1 subgoal):
 1. \<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>h'. current \<Gamma> h' \<and> wave \<Gamma> h' \<and> B \<Gamma> \<inter> \<^bold>V \<subseteq> SAT \<Gamma> h'

goal:
No subgoals!
[PROOF STEP]
qed