[STATEMENT]
theorem boruvka_mst:
  "VARS f j h c e d
  { symmetric g }
  f := bot;
  WHILE -(forest_components f) \<sqinter> g \<noteq> bot
    INV { boruvka_outer_invariant f g }
    DO
      j := top;
      h := f;
      d := bot;
      WHILE j \<noteq> bot
        INV { boruvka_inner_invariant j f h g d }
        DO
          c := choose_component (forest_components h) j;
          e := minarc(c * -c\<^sup>T \<sqinter> g);
          IF e \<le> -(forest_components f) THEN
            f := f \<sqinter> -e\<^sup>T;
            f := (f \<sqinter> -(top * e * f\<^sup>T\<^sup>\<star>)) \<squnion> (f \<sqinter> top * e * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> e;
            d := d \<squnion> e
          ELSE
            SKIP
          FI;
          j := j \<sqinter> -c
        OD
    OD
  { minimum_spanning_forest f g }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {symmetric g}
f := bot; WHILE - forest_components f \<sqinter> g \<noteq> bot INV {boruvka_outer_invariant f g}  VAR {0}
DO j := top; h := f; d := bot; WHILE j \<noteq> bot INV {boruvka_inner_invariant j f h g d}  VAR {0}
DO c := choose_component (forest_components h) j; e := minarc (c * - c\<^sup>T \<sqinter> g); IF e \<le> - forest_components f THEN f := f - e\<^sup>T; f := f - top * e * f\<^sup>T\<^sup>\<star> \<squnion> (f \<sqinter> top * e * f\<^sup>T\<^sup>\<star>)\<^sup>T \<squnion> e; d := d \<squnion> e  ELSE SKIP FI; j := j - c OD OD
{minimum_spanning_forest f g}
[PROOF STEP]
proof vcg_simp
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. symmetric g \<Longrightarrow> boruvka_outer_invariant bot g
 2. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 3. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 4. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 5. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
assume 1: "symmetric g"
[PROOF STATE]
proof (state)
this:
symmetric g

goal (5 subgoals):
 1. symmetric g \<Longrightarrow> boruvka_outer_invariant bot g
 2. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 3. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 4. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 5. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
show "boruvka_outer_invariant bot g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boruvka_outer_invariant bot g
[PROOF STEP]
using 1 boruvka_outer_invariant_def kruskal_exists_minimal_spanning
[PROOF STATE]
proof (prove)
using this:
symmetric g
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)
symmetric ?g \<Longrightarrow> \<exists>f. minimum_spanning_forest f ?g

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

goal (4 subgoals):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 2. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 3. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 4. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 2. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 3. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 4. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 2. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 3. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 4. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?F = "forest_components f"
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 2. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 3. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 4. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
assume 1: "boruvka_outer_invariant f g \<and> - ?F \<sqinter> g \<noteq> bot"
[PROOF STATE]
proof (state)
this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot

goal (4 subgoals):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 2. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 3. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 4. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have 2: "equivalence ?F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equivalence (forest_components f)
[PROOF STEP]
using 1 boruvka_outer_invariant_def forest_components_equivalence
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)
injective ?x \<Longrightarrow> equivalence (forest_components ?x)

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

goal (4 subgoals):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot \<Longrightarrow> boruvka_inner_invariant top f f g bot
 2. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 3. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 4. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
show "boruvka_inner_invariant top f f g bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boruvka_inner_invariant top f f g bot
[PROOF STEP]
proof (unfold boruvka_inner_invariant_def, intro conjI)
[PROOF STATE]
proof (state)
goal (13 subgoals):
 1. boruvka_outer_invariant f g
 2. g \<noteq> bot
 3. regular bot
 4. regular top
 5. surjective top
 6. regular f
 7. injective f
 8. pd_kleene_allegory_class.acyclic f
 9. times_top_class.total (forest_components f)
 10. forest_modulo_equivalence (forest_components f) bot
A total of 13 subgoals...
[PROOF STEP]
show "boruvka_outer_invariant f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boruvka_outer_invariant f g
[PROOF STEP]
by (simp add: 1)
[PROOF STATE]
proof (state)
this:
boruvka_outer_invariant f g

goal (12 subgoals):
 1. g \<noteq> bot
 2. regular bot
 3. regular top
 4. surjective top
 5. regular f
 6. injective f
 7. pd_kleene_allegory_class.acyclic f
 8. times_top_class.total (forest_components f)
 9. forest_modulo_equivalence (forest_components f) bot
 10. bot * top \<le> - top
A total of 12 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (12 subgoals):
 1. g \<noteq> bot
 2. regular bot
 3. regular top
 4. surjective top
 5. regular f
 6. injective f
 7. pd_kleene_allegory_class.acyclic f
 8. times_top_class.total (forest_components f)
 9. forest_modulo_equivalence (forest_components f) bot
 10. bot * top \<le> - top
A total of 12 subgoals...
[PROOF STEP]
show "g \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<noteq> bot
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot

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

goal (11 subgoals):
 1. regular bot
 2. regular top
 3. surjective top
 4. regular f
 5. injective f
 6. pd_kleene_allegory_class.acyclic f
 7. times_top_class.total (forest_components f)
 8. forest_modulo_equivalence (forest_components f) bot
 9. bot * top \<le> - top
 10. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
A total of 11 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (11 subgoals):
 1. regular bot
 2. regular top
 3. surjective top
 4. regular f
 5. injective f
 6. pd_kleene_allegory_class.acyclic f
 7. times_top_class.total (forest_components f)
 8. forest_modulo_equivalence (forest_components f) bot
 9. bot * top \<le> - top
 10. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
A total of 11 subgoals...
[PROOF STEP]
show "surjective top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surjective top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
surjective top

goal (10 subgoals):
 1. regular bot
 2. regular top
 3. regular f
 4. injective f
 5. pd_kleene_allegory_class.acyclic f
 6. times_top_class.total (forest_components f)
 7. forest_modulo_equivalence (forest_components f) bot
 8. bot * top \<le> - top
 9. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 10. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. regular bot
 2. regular top
 3. regular f
 4. injective f
 5. pd_kleene_allegory_class.acyclic f
 6. times_top_class.total (forest_components f)
 7. forest_modulo_equivalence (forest_components f) bot
 8. bot * top \<le> - top
 9. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 10. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "regular top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
regular top

goal (9 subgoals):
 1. regular bot
 2. regular f
 3. injective f
 4. pd_kleene_allegory_class.acyclic f
 5. times_top_class.total (forest_components f)
 6. forest_modulo_equivalence (forest_components f) bot
 7. bot * top \<le> - top
 8. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 9. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. regular bot
 2. regular f
 3. injective f
 4. pd_kleene_allegory_class.acyclic f
 5. times_top_class.total (forest_components f)
 6. forest_modulo_equivalence (forest_components f) bot
 7. bot * top \<le> - top
 8. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 9. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "regular bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
regular bot

goal (8 subgoals):
 1. regular f
 2. injective f
 3. pd_kleene_allegory_class.acyclic f
 4. times_top_class.total (forest_components f)
 5. forest_modulo_equivalence (forest_components f) bot
 6. bot * top \<le> - top
 7. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 8. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. regular f
 2. injective f
 3. pd_kleene_allegory_class.acyclic f
 4. times_top_class.total (forest_components f)
 5. forest_modulo_equivalence (forest_components f) bot
 6. bot * top \<le> - top
 7. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 8. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "regular f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular f
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. regular f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
regular f

goal (7 subgoals):
 1. injective f
 2. pd_kleene_allegory_class.acyclic f
 3. times_top_class.total (forest_components f)
 4. forest_modulo_equivalence (forest_components f) bot
 5. bot * top \<le> - top
 6. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 7. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. injective f
 2. pd_kleene_allegory_class.acyclic f
 3. times_top_class.total (forest_components f)
 4. forest_modulo_equivalence (forest_components f) bot
 5. bot * top \<le> - top
 6. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 7. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "injective f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective f
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. injective f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
injective f

goal (6 subgoals):
 1. pd_kleene_allegory_class.acyclic f
 2. times_top_class.total (forest_components f)
 3. forest_modulo_equivalence (forest_components f) bot
 4. bot * top \<le> - top
 5. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 6. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. pd_kleene_allegory_class.acyclic f
 2. times_top_class.total (forest_components f)
 3. forest_modulo_equivalence (forest_components f) bot
 4. bot * top \<le> - top
 5. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 6. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "pd_kleene_allegory_class.acyclic f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic f
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g \<noteq> bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pd_kleene_allegory_class.acyclic f

goal (5 subgoals):
 1. times_top_class.total (forest_components f)
 2. forest_modulo_equivalence (forest_components f) bot
 3. bot * top \<le> - top
 4. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 5. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. times_top_class.total (forest_components f)
 2. forest_modulo_equivalence (forest_components f) bot
 3. bot * top \<le> - top
 4. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 5. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "forest_modulo_equivalence ?F bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. forest_modulo_equivalence (forest_components f) bot
[PROOF STEP]
by (simp add: 2 forest_modulo_equivalence_def)
[PROOF STATE]
proof (state)
this:
forest_modulo_equivalence (forest_components f) bot

goal (4 subgoals):
 1. times_top_class.total (forest_components f)
 2. bot * top \<le> - top
 3. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 4. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. times_top_class.total (forest_components f)
 2. bot * top \<le> - top
 3. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 4. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "bot * top \<le> - top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bot * top \<le> - top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bot * top \<le> - top

goal (3 subgoals):
 1. times_top_class.total (forest_components f)
 2. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 3. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. times_top_class.total (forest_components f)
 2. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 3. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "times_top_class.total (?F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. times_top_class.total (forest_components f)
[PROOF STEP]
by (simp add: star.circ_right_top mult_assoc)
[PROOF STATE]
proof (state)
this:
times_top_class.total (forest_components f)

goal (2 subgoals):
 1. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 2. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
 2. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<squnion> f\<^sup>T = f \<squnion> f\<^sup>T \<squnion> bot \<squnion> bot\<^sup>T

goal (1 subgoal):
 1. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "\<forall> a b. forest_modulo_equivalence_path a b ?F bot \<and> a \<le> - ?F \<sqinter> -- g \<and> b \<le> bot \<longrightarrow> sum (b \<sqinter> g) \<le> sum (a \<sqinter> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
by (metis (full_types) forest_modulo_equivalence_path_def bot_unique mult_left_zero mult_right_zero top.extremum)
[PROOF STATE]
proof (state)
this:
\<forall>a b. forest_modulo_equivalence_path a b (forest_components f) bot \<and> a \<le> - forest_components f - - g \<and> b \<le> bot \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
boruvka_inner_invariant top f f g bot

goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
fix f j h d
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?c = "choose_component (forest_components h) j"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?p = "path f h j g"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?F = "forest_components f"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?H = "forest_components h"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?e = "selected_edge h j g"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?f' = "f \<sqinter> -?e\<^sup>T \<sqinter> -?p \<squnion> (f \<sqinter> -?e\<^sup>T \<sqinter> ?p)\<^sup>T \<squnion> ?e"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?d' = "d \<squnion> ?e"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
let ?j' = "j \<sqinter> -?c"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
assume 1: "boruvka_inner_invariant j f h g d \<and> j \<noteq> bot"
[PROOF STATE]
proof (state)
this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot

goal (3 subgoals):
 1. \<And>f j h d. boruvka_inner_invariant j f h g d \<and> j \<noteq> bot \<Longrightarrow> (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
 2. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 3. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
show "(?e \<le> -?F \<longrightarrow> boruvka_inner_invariant ?j' ?f' h g ?d') \<and> (\<not> ?e \<le> -?F \<longrightarrow> boruvka_inner_invariant ?j' f h g d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)
[PROOF STEP]
proof (intro conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
 2. \<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d
[PROOF STEP]
show "?e \<le> -?F \<longrightarrow> boruvka_inner_invariant ?j' ?f' h g ?d'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
proof (cases "?e = bot")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. selected_edge h j g = bot \<Longrightarrow> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
 2. selected_edge h j g \<noteq> bot \<Longrightarrow> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
selected_edge h j g = bot

goal (2 subgoals):
 1. selected_edge h j g = bot \<Longrightarrow> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
 2. selected_edge h j g \<noteq> bot \<Longrightarrow> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
selected_edge h j g = bot

goal (1 subgoal):
 1. selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
using 1 second_inner_invariant_when_e_bot
[PROOF STATE]
proof (prove)
using this:
selected_edge h j g = bot
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
\<lbrakk>selected_edge ?h ?j ?g = bot; selected_edge ?h ?j ?g \<le> - forest_components ?f; boruvka_inner_invariant ?j ?f ?h ?g ?d\<rbrakk> \<Longrightarrow> boruvka_inner_invariant (?j - choose_component (forest_components ?h) ?j) (?f - selected_edge ?h ?j ?g\<^sup>T - path ?f ?h ?j ?g \<squnion> ((?f - selected_edge ?h ?j ?g\<^sup>T) \<sqinter> path ?f ?h ?j ?g)\<^sup>T \<squnion> selected_edge ?h ?j ?g) ?h ?g (?d \<squnion> selected_edge ?h ?j ?g)

goal (1 subgoal):
 1. selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)

goal (1 subgoal):
 1. selected_edge h j g \<noteq> bot \<Longrightarrow> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. selected_edge h j g \<noteq> bot \<Longrightarrow> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
selected_edge h j g \<noteq> bot

goal (1 subgoal):
 1. selected_edge h j g \<noteq> bot \<Longrightarrow> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
selected_edge h j g \<noteq> bot

goal (1 subgoal):
 1. selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
using 1 second_inner_invariant_when_e_not_bot
[PROOF STATE]
proof (prove)
using this:
selected_edge h j g \<noteq> bot
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
\<lbrakk>boruvka_inner_invariant ?j ?f ?h ?g ?d; ?j \<noteq> bot; selected_edge ?h ?j ?g \<le> - forest_components ?f; selected_edge ?h ?j ?g \<noteq> bot\<rbrakk> \<Longrightarrow> boruvka_inner_invariant (?j - choose_component (forest_components ?h) ?j) (?f - selected_edge ?h ?j ?g\<^sup>T - path ?f ?h ?j ?g \<squnion> ((?f - selected_edge ?h ?j ?g\<^sup>T) \<sqinter> path ?f ?h ?j ?g)\<^sup>T \<squnion> selected_edge ?h ?j ?g) ?h ?g (?d \<squnion> selected_edge ?h ?j ?g)

goal (1 subgoal):
 1. selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)

goal (1 subgoal):
 1. \<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d
[PROOF STEP]
show "\<not> ?e \<le> -?F \<longrightarrow> boruvka_inner_invariant ?j' f h g d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d
[PROOF STEP]
proof (rule impI, unfold boruvka_inner_invariant_def, intro conjI)
[PROOF STATE]
proof (state)
goal (13 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> boruvka_outer_invariant f g
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> g \<noteq> bot
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular (j - choose_component (forest_components h) j)
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> vector (j - choose_component (forest_components h) j)
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 10. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
A total of 13 subgoals...
[PROOF STEP]
show "boruvka_outer_invariant f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boruvka_outer_invariant f g
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. boruvka_outer_invariant f g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
boruvka_outer_invariant f g

goal (12 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> g \<noteq> bot
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular (j - choose_component (forest_components h) j)
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> vector (j - choose_component (forest_components h) j)
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 10. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
A total of 12 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (12 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> g \<noteq> bot
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular (j - choose_component (forest_components h) j)
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> vector (j - choose_component (forest_components h) j)
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 10. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
A total of 12 subgoals...
[PROOF STEP]
show "g \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<noteq> bot
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. g \<noteq> bot
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
g \<noteq> bot

goal (11 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular (j - choose_component (forest_components h) j)
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> vector (j - choose_component (forest_components h) j)
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 10. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
A total of 11 subgoals...
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (11 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular (j - choose_component (forest_components h) j)
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> vector (j - choose_component (forest_components h) j)
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 10. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
A total of 11 subgoals...
[PROOF STEP]
show "vector ?j'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector (j - choose_component (forest_components h) j)
[PROOF STEP]
using 1 boruvka_inner_invariant_def component_is_vector vector_complement_closed vector_inf_closed
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))
vector (choose_component ?e ?v)
vector ?x \<Longrightarrow> vector (- ?x)
\<lbrakk>vector ?x; vector ?y\<rbrakk> \<Longrightarrow> vector (?x \<sqinter> ?y)

goal (1 subgoal):
 1. vector (j - choose_component (forest_components h) j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vector (j - choose_component (forest_components h) j)

goal (10 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular (j - choose_component (forest_components h) j)
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 10. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular (j - choose_component (forest_components h) j)
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 10. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "regular ?j'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (j - choose_component (forest_components h) j)
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. regular (j - choose_component (forest_components h) j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
regular (j - choose_component (forest_components h) j)

goal (9 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular d
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 9. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "regular d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular d
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. regular d
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
regular d

goal (8 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> regular h
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 8. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "regular h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular h
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. regular h
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
regular h

goal (7 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> injective h
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 7. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "injective h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective h
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. injective h
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
injective h

goal (6 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> pd_kleene_allegory_class.acyclic h
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 6. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "pd_kleene_allegory_class.acyclic h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic h
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic h
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pd_kleene_allegory_class.acyclic h

goal (5 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_modulo_equivalence (forest_components h) d
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 5. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "forest_modulo_equivalence ?H d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. forest_modulo_equivalence (forest_components h) d
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. forest_modulo_equivalence (forest_components h) d
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
forest_modulo_equivalence (forest_components h) d

goal (4 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> d * top \<le> - (j - choose_component (forest_components h) j)
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 4. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "d * top \<le> -?j'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d * top \<le> - (j - choose_component (forest_components h) j)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot

goal (1 subgoal):
 1. d * top \<le> - (j - choose_component (forest_components h) j)
[PROOF STEP]
by (meson boruvka_inner_invariant_def dual_order.trans p_antitone_inf)
[PROOF STATE]
proof (state)
this:
d * top \<le> - (j - choose_component (forest_components h) j)

goal (3 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 3. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "?H * ?j' = ?j'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
[PROOF STEP]
using 1 fc_j_eq_j_inv boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
\<lbrakk>forest ?h; forest_components ?h * ?j = ?j\<rbrakk> \<Longrightarrow> forest_components ?h * (?j - choose_component (forest_components ?h) ?j) = ?j - choose_component (forest_components ?h) ?j
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
forest_components h * (j - choose_component (forest_components h) j) = j - choose_component (forest_components h) j

goal (2 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
 2. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<squnion> f\<^sup>T = h \<squnion> h\<^sup>T \<squnion> d \<squnion> d\<^sup>T

goal (1 subgoal):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
show "\<not> ?e \<le> -?F \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b ?H d \<and> a \<le> -?H \<sqinter> --g \<and> b \<le> d \<longrightarrow> sum(b \<sqinter> g) \<le> sum(a \<sqinter> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
using 1 boruvka_inner_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant j f h g d \<and> j \<noteq> bot
boruvka_inner_invariant ?j ?f ?h ?g ?d \<equiv> boruvka_outer_invariant ?f ?g \<and> ?g \<noteq> bot \<and> regular ?d \<and> regular ?j \<and> vector ?j \<and> regular ?h \<and> forest ?h \<and> forest_components ?h * ?j = ?j \<and> forest_modulo_equivalence (forest_components ?h) ?d \<and> ?d * top \<le> - ?j \<and> ?f \<squnion> ?f\<^sup>T = ?h \<squnion> ?h\<^sup>T \<squnion> ?d \<squnion> ?d\<^sup>T \<and> (\<forall>a b. forest_modulo_equivalence_path a b (forest_components ?h) ?d \<and> a \<le> - forest_components ?h - - ?g \<and> b \<le> ?d \<longrightarrow> sum_class.sum (b \<sqinter> ?g) \<le> sum_class.sum (a \<sqinter> ?g))

goal (1 subgoal):
 1. \<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> selected_edge h j g \<le> - forest_components f \<Longrightarrow> \<forall>a b. forest_modulo_equivalence_path a b (forest_components h) d \<and> a \<le> - forest_components h - - g \<and> b \<le> d \<longrightarrow> sum_class.sum (b \<sqinter> g) \<le> sum_class.sum (a \<sqinter> g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) (f - selected_edge h j g\<^sup>T - path f h j g \<squnion> ((f - selected_edge h j g\<^sup>T) \<sqinter> path f h j g)\<^sup>T \<squnion> selected_edge h j g) h g (d \<squnion> selected_edge h j g)) \<and> (\<not> selected_edge h j g \<le> - forest_components f \<longrightarrow> boruvka_inner_invariant (j - choose_component (forest_components h) j) f h g d)

goal (2 subgoals):
 1. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 2. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 2. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
fix f h d
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 2. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
assume "boruvka_inner_invariant bot f h g d"
[PROOF STATE]
proof (state)
this:
boruvka_inner_invariant bot f h g d

goal (2 subgoals):
 1. \<And>f h d. boruvka_inner_invariant bot f h g d \<Longrightarrow> boruvka_outer_invariant f g
 2. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
thus "boruvka_outer_invariant f g"
[PROOF STATE]
proof (prove)
using this:
boruvka_inner_invariant bot f h g d

goal (1 subgoal):
 1. boruvka_outer_invariant f g
[PROOF STEP]
by (meson boruvka_inner_invariant_def)
[PROOF STATE]
proof (state)
this:
boruvka_outer_invariant f g

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
assume 1: "boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot"
[PROOF STATE]
proof (state)
this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
hence 2:"spanning_forest f g"
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot

goal (1 subgoal):
 1. spanning_forest f g
[PROOF STEP]
proof (unfold spanning_forest_def, intro conjI)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> injective f
 2. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> pd_kleene_allegory_class.acyclic f
 3. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> f \<le> - - g
 4. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> components g \<le> forest_components f
 5. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
show "injective f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective f
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. injective f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
injective f

goal (4 subgoals):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> pd_kleene_allegory_class.acyclic f
 2. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> f \<le> - - g
 3. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> components g \<le> forest_components f
 4. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> pd_kleene_allegory_class.acyclic f
 2. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> f \<le> - - g
 3. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> components g \<le> forest_components f
 4. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
show "acyclic f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic f
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. pd_kleene_allegory_class.acyclic f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
pd_kleene_allegory_class.acyclic f

goal (3 subgoals):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> f \<le> - - g
 2. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> components g \<le> forest_components f
 3. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> f \<le> - - g
 2. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> components g \<le> forest_components f
 3. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
show "f \<le> --g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<le> - - g
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. f \<le> - - g
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f \<le> - - g

goal (2 subgoals):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> components g \<le> forest_components f
 2. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> components g \<le> forest_components f
 2. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
show "components g \<le> forest_components f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
let ?F = "forest_components f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
have "-?F \<sqinter> g \<le> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - forest_components f \<sqinter> g \<le> bot
[PROOF STEP]
by (simp add: 1)
[PROOF STATE]
proof (state)
this:
- forest_components f \<sqinter> g \<le> bot

goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
hence "--g \<le> bot \<squnion> --?F"
[PROOF STATE]
proof (prove)
using this:
- forest_components f \<sqinter> g \<le> bot

goal (1 subgoal):
 1. - - g \<le> bot \<squnion> - - forest_components f
[PROOF STEP]
using 1 shunting_p p_antitone pseudo_complement
[PROOF STATE]
proof (prove)
using this:
- forest_components f \<sqinter> g \<le> bot
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
(?x \<sqinter> ?y \<le> - ?z) = (?x \<le> - ?z \<squnion> - ?y)
?x \<le> ?y \<Longrightarrow> - ?y \<le> - ?x
(?x \<sqinter> ?y = bot) = (?x \<le> - ?y)

goal (1 subgoal):
 1. - - g \<le> bot \<squnion> - - forest_components f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- - g \<le> bot \<squnion> - - forest_components f

goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
hence "--g \<le> ?F"
[PROOF STATE]
proof (prove)
using this:
- - g \<le> bot \<squnion> - - forest_components f

goal (1 subgoal):
 1. - - g \<le> forest_components f
[PROOF STEP]
using 1 boruvka_outer_invariant_def pp_dist_comp pp_dist_star regular_conv_closed
[PROOF STATE]
proof (prove)
using this:
- - g \<le> bot \<squnion> - - forest_components f
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)
- - (?x * ?y) = - - ?x * - - ?y
- - ?x\<^sup>\<star> = components ?x
regular ?x \<Longrightarrow> regular (?x\<^sup>T)

goal (1 subgoal):
 1. - - g \<le> forest_components f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- - g \<le> forest_components f

goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
hence "(--g)\<^sup>\<star> \<le> ?F\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
- - g \<le> forest_components f

goal (1 subgoal):
 1. components g \<le> forest_components f\<^sup>\<star>
[PROOF STEP]
by (simp add: star_isotone)
[PROOF STATE]
proof (state)
this:
components g \<le> forest_components f\<^sup>\<star>

goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
components g \<le> forest_components f\<^sup>\<star>

goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
using 1 boruvka_outer_invariant_def forest_components_star
[PROOF STATE]
proof (prove)
using this:
components g \<le> forest_components f\<^sup>\<star>
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)
injective ?x \<Longrightarrow> forest_components ?x\<^sup>\<star> = forest_components ?x

goal (1 subgoal):
 1. components g \<le> forest_components f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
components g \<le> forest_components f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
components g \<le> forest_components f

goal (1 subgoal):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot; boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot\<rbrakk> \<Longrightarrow> regular f
[PROOF STEP]
show "regular f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular f
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

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

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

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
[PROOF STEP]
obtain w where 3: "minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T"
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot

goal (1 subgoal):
 1. (\<And>w. minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. (\<And>w. minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
hence "w = w \<sqinter> --g"
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T

goal (1 subgoal):
 1. w = w - - g
[PROOF STEP]
by (simp add: inf.absorb1 minimum_spanning_forest_def spanning_forest_def)
[PROOF STATE]
proof (state)
this:
w = w - - g

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w = w - - g

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... \<le> w \<sqinter> components g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w - - g \<le> w \<sqinter> components g
[PROOF STEP]
by (metis inf.sup_right_isotone star.circ_increasing)
[PROOF STATE]
proof (state)
this:
w - - g \<le> w \<sqinter> components g

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w - - g \<le> w \<sqinter> components g

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... \<le> w \<sqinter> f\<^sup>T\<^sup>\<star> * f\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqinter> components g \<le> w \<sqinter> forest_components f
[PROOF STEP]
using 2 spanning_forest_def inf.sup_right_isotone
[PROOF STATE]
proof (prove)
using this:
spanning_forest f g
spanning_forest ?f ?g \<equiv> forest ?f \<and> ?f \<le> - - ?g \<and> components ?g \<le> forest_components ?f \<and> regular ?f
?y \<le> ?x \<Longrightarrow> ?z \<sqinter> ?y \<le> ?z \<sqinter> ?x

goal (1 subgoal):
 1. w \<sqinter> components g \<le> w \<sqinter> forest_components f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w \<sqinter> components g \<le> w \<sqinter> forest_components f

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
w \<sqinter> components g \<le> w \<sqinter> forest_components f

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... \<le> f \<squnion> f\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqinter> forest_components f \<le> f \<squnion> f\<^sup>T
[PROOF STEP]
proof (rule cancel_separate_6[where z=w and y="w\<^sup>T"])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. injective w
 2. f\<^sup>T \<le> w\<^sup>T \<squnion> w
 3. f \<le> w\<^sup>T \<squnion> w
 4. injective w
 5. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
show "injective w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective w
[PROOF STEP]
using 3 minimum_spanning_forest_def spanning_forest_def
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T
minimum_spanning_forest ?f ?g \<equiv> spanning_forest ?f ?g \<and> (\<forall>u. spanning_forest u ?g \<longrightarrow> sum_class.sum (?f \<sqinter> ?g) \<le> sum_class.sum (u \<sqinter> ?g))
spanning_forest ?f ?g \<equiv> forest ?f \<and> ?f \<le> - - ?g \<and> components ?g \<le> forest_components ?f \<and> regular ?f

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

goal (4 subgoals):
 1. f\<^sup>T \<le> w\<^sup>T \<squnion> w
 2. f \<le> w\<^sup>T \<squnion> w
 3. injective w
 4. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f\<^sup>T \<le> w\<^sup>T \<squnion> w
 2. f \<le> w\<^sup>T \<squnion> w
 3. injective w
 4. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
show "f\<^sup>T \<le> w\<^sup>T \<squnion> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f\<^sup>T \<le> w\<^sup>T \<squnion> w
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T

goal (1 subgoal):
 1. f\<^sup>T \<le> w\<^sup>T \<squnion> w
[PROOF STEP]
by (metis conv_dist_inf conv_dist_sup conv_involutive inf.cobounded2 inf.orderE)
[PROOF STATE]
proof (state)
this:
f\<^sup>T \<le> w\<^sup>T \<squnion> w

goal (3 subgoals):
 1. f \<le> w\<^sup>T \<squnion> w
 2. injective w
 3. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f \<le> w\<^sup>T \<squnion> w
 2. injective w
 3. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
show "f \<le> w\<^sup>T \<squnion> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<le> w\<^sup>T \<squnion> w
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T

goal (1 subgoal):
 1. f \<le> w\<^sup>T \<squnion> w
[PROOF STEP]
by (simp add: sup_commute)
[PROOF STATE]
proof (state)
this:
f \<le> w\<^sup>T \<squnion> w

goal (2 subgoals):
 1. injective w
 2. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. injective w
 2. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
show "injective w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injective w
[PROOF STEP]
using 3 minimum_spanning_forest_def spanning_forest_def
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T
minimum_spanning_forest ?f ?g \<equiv> spanning_forest ?f ?g \<and> (\<forall>u. spanning_forest u ?g \<longrightarrow> sum_class.sum (?f \<sqinter> ?g) \<le> sum_class.sum (u \<sqinter> ?g))
spanning_forest ?f ?g \<equiv> forest ?f \<and> ?f \<le> - - ?g \<and> components ?g \<le> forest_components ?f \<and> regular ?f

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

goal (1 subgoal):
 1. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
show "w \<sqinter> w\<^sup>T\<^sup>\<star> = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T

goal (1 subgoal):
 1. w \<sqinter> w\<^sup>T\<^sup>\<star> = bot
[PROOF STEP]
by (metis acyclic_star_below_complement comp_inf.mult_right_isotone inf_p le_bot minimum_spanning_forest_def spanning_forest_def)
[PROOF STATE]
proof (state)
this:
w \<sqinter> w\<^sup>T\<^sup>\<star> = bot

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w \<sqinter> forest_components f \<le> f \<squnion> f\<^sup>T

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
w \<le> f \<squnion> f\<^sup>T
[PROOF STEP]
have 4: "w \<le> f \<squnion> f\<^sup>T"
[PROOF STATE]
proof (prove)
using this:
w \<le> f \<squnion> f\<^sup>T

goal (1 subgoal):
 1. w \<le> f \<squnion> f\<^sup>T
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w \<le> f \<squnion> f\<^sup>T

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "sum (f \<sqinter> g) = sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_class.sum (f \<sqinter> g) = sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g))
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T

goal (1 subgoal):
 1. sum_class.sum (f \<sqinter> g) = sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g))
[PROOF STEP]
by (metis inf_absorb2 inf.assoc)
[PROOF STATE]
proof (state)
this:
sum_class.sum (f \<sqinter> g) = sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_class.sum (f \<sqinter> g) = sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... = sum (w \<sqinter> (f \<sqinter> g)) + sum (w\<^sup>T \<sqinter> (f \<sqinter> g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g)) = sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w\<^sup>T \<sqinter> (f \<sqinter> g))
[PROOF STEP]
using 3 inf.commute acyclic_asymmetric sum_disjoint minimum_spanning_forest_def spanning_forest_def
[PROOF STATE]
proof (prove)
using this:
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T
?a \<sqinter> ?b = ?b \<sqinter> ?a
pd_kleene_allegory_class.acyclic ?w \<Longrightarrow> asymmetric ?w
?x \<sqinter> ?y = bot \<Longrightarrow> sum_class.sum ((?x \<squnion> ?y) \<sqinter> ?z) = sum_class.sum (?x \<sqinter> ?z) + sum_class.sum (?y \<sqinter> ?z)
minimum_spanning_forest ?f ?g \<equiv> spanning_forest ?f ?g \<and> (\<forall>u. spanning_forest u ?g \<longrightarrow> sum_class.sum (?f \<sqinter> ?g) \<le> sum_class.sum (u \<sqinter> ?g))
spanning_forest ?f ?g \<equiv> forest ?f \<and> ?f \<le> - - ?g \<and> components ?g \<le> forest_components ?f \<and> regular ?f

goal (1 subgoal):
 1. sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g)) = sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w\<^sup>T \<sqinter> (f \<sqinter> g))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g)) = sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w\<^sup>T \<sqinter> (f \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_class.sum ((w \<squnion> w\<^sup>T) \<sqinter> (f \<sqinter> g)) = sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w\<^sup>T \<sqinter> (f \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... = sum (w \<sqinter> (f \<sqinter> g)) + sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w\<^sup>T \<sqinter> (f \<sqinter> g)) = sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T))
[PROOF STEP]
by (metis conv_dist_inf conv_involutive sum_conv)
[PROOF STATE]
proof (state)
this:
sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w\<^sup>T \<sqinter> (f \<sqinter> g)) = sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w\<^sup>T \<sqinter> (f \<sqinter> g)) = sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... = sum (f \<sqinter> (w \<sqinter> g)) + sum (f\<^sup>T \<sqinter> (w \<sqinter> g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))
[PROOF STEP]
have 51:"f\<^sup>T \<sqinter> (w \<sqinter> g) = f\<^sup>T \<sqinter> (w \<sqinter> g\<^sup>T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f\<^sup>T \<sqinter> (w \<sqinter> g) = f\<^sup>T \<sqinter> (w \<sqinter> g\<^sup>T)
[PROOF STEP]
using 1 boruvka_outer_invariant_def
[PROOF STATE]
proof (prove)
using this:
boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot
boruvka_outer_invariant ?f ?g \<equiv> symmetric ?g \<and> forest ?f \<and> ?f \<le> - - ?g \<and> regular ?f \<and> (\<exists>w. minimum_spanning_forest w ?g \<and> ?f \<le> w \<squnion> w\<^sup>T)

goal (1 subgoal):
 1. f\<^sup>T \<sqinter> (w \<sqinter> g) = f\<^sup>T \<sqinter> (w \<sqinter> g\<^sup>T)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f\<^sup>T \<sqinter> (w \<sqinter> g) = f\<^sup>T \<sqinter> (w \<sqinter> g\<^sup>T)

goal (1 subgoal):
 1. sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))
[PROOF STEP]
have 52:"f \<sqinter> (w \<sqinter> g) = w \<sqinter> (f \<sqinter> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<sqinter> (w \<sqinter> g) = w \<sqinter> (f \<sqinter> g)
[PROOF STEP]
by (simp add: inf.left_commute)
[PROOF STATE]
proof (state)
this:
f \<sqinter> (w \<sqinter> g) = w \<sqinter> (f \<sqinter> g)

goal (1 subgoal):
 1. sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<sqinter> (w \<sqinter> g) = w \<sqinter> (f \<sqinter> g)

goal (1 subgoal):
 1. sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))
[PROOF STEP]
using 51 52 abel_semigroup.left_commute inf.abel_semigroup_axioms
[PROOF STATE]
proof (prove)
using this:
f \<sqinter> (w \<sqinter> g) = w \<sqinter> (f \<sqinter> g)
f\<^sup>T \<sqinter> (w \<sqinter> g) = f\<^sup>T \<sqinter> (w \<sqinter> g\<^sup>T)
f \<sqinter> (w \<sqinter> g) = w \<sqinter> (f \<sqinter> g)
abel_semigroup ?f \<Longrightarrow> ?f ?b (?f ?a ?c) = ?f ?a (?f ?b ?c)
abel_semigroup (\<sqinter>)

goal (1 subgoal):
 1. sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_class.sum (w \<sqinter> (f \<sqinter> g)) + sum_class.sum (w \<sqinter> (f\<^sup>T \<sqinter> g\<^sup>T)) = sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... = sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g)) = sum_class.sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g))
[PROOF STEP]
using 2 acyclic_asymmetric inf.sup_monoid.add_commute sum_disjoint spanning_forest_def
[PROOF STATE]
proof (prove)
using this:
spanning_forest f g
pd_kleene_allegory_class.acyclic ?w \<Longrightarrow> asymmetric ?w
?a \<sqinter> ?b = ?b \<sqinter> ?a
?x \<sqinter> ?y = bot \<Longrightarrow> sum_class.sum ((?x \<squnion> ?y) \<sqinter> ?z) = sum_class.sum (?x \<sqinter> ?z) + sum_class.sum (?y \<sqinter> ?z)
spanning_forest ?f ?g \<equiv> forest ?f \<and> ?f \<le> - - ?g \<and> components ?g \<le> forest_components ?f \<and> regular ?f

goal (1 subgoal):
 1. sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g)) = sum_class.sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g)) = sum_class.sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_class.sum (f \<sqinter> (w \<sqinter> g)) + sum_class.sum (f\<^sup>T \<sqinter> (w \<sqinter> g)) = sum_class.sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g))

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
have "... = sum (w \<sqinter> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_class.sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g)) = sum_class.sum (w \<sqinter> g)
[PROOF STEP]
using 4
[PROOF STATE]
proof (prove)
using this:
w \<le> f \<squnion> f\<^sup>T

goal (1 subgoal):
 1. sum_class.sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g)) = sum_class.sum (w \<sqinter> g)
[PROOF STEP]
by (metis inf_absorb2 inf.assoc)
[PROOF STATE]
proof (state)
this:
sum_class.sum ((f \<squnion> f\<^sup>T) \<sqinter> (w \<sqinter> g)) = sum_class.sum (w \<sqinter> g)

goal (1 subgoal):
 1. \<And>f. boruvka_outer_invariant f g \<and> - forest_components f \<sqinter> g = bot \<Longrightarrow> minimum_spanning_forest f g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_class.sum (f \<sqinter> g) = sum_class.sum (w \<sqinter> g)
[PROOF STEP]
show "minimum_spanning_forest f g"
[PROOF STATE]
proof (prove)
using this:
sum_class.sum (f \<sqinter> g) = sum_class.sum (w \<sqinter> g)

goal (1 subgoal):
 1. minimum_spanning_forest f g
[PROOF STEP]
using 2 3 minimum_spanning_forest_def
[PROOF STATE]
proof (prove)
using this:
sum_class.sum (f \<sqinter> g) = sum_class.sum (w \<sqinter> g)
spanning_forest f g
minimum_spanning_forest w g \<and> f \<le> w \<squnion> w\<^sup>T
minimum_spanning_forest ?f ?g \<equiv> spanning_forest ?f ?g \<and> (\<forall>u. spanning_forest u ?g \<longrightarrow> sum_class.sum (?f \<sqinter> ?g) \<le> sum_class.sum (u \<sqinter> ?g))

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

goal:
No subgoals!
[PROOF STEP]
qed