[STATEMENT]
lemma card_grab [simp]:
  assumes "infinite N" shows "card (fst (grab N n)) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (fst (grab N n)) = n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (fst (grab N n)) = n
[PROOF STEP]
have "N \<inter> enumerate N ` {..<n} = enumerate N ` {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<inter> enum N ` {..<n} = enum N ` {..<n}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
infinite N

goal (1 subgoal):
 1. N \<inter> enum N ` {..<n} = enum N ` {..<n}
[PROOF STEP]
by (auto simp: enumerate_in_set)
[PROOF STATE]
proof (state)
this:
N \<inter> enum N ` {..<n} = enum N ` {..<n}

goal (1 subgoal):
 1. card (fst (grab N n)) = n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
infinite N
N \<inter> enum N ` {..<n} = enum N ` {..<n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite N
N \<inter> enum N ` {..<n} = enum N ` {..<n}

goal (1 subgoal):
 1. card (fst (grab N n)) = n
[PROOF STEP]
by (simp add: card_image grab_def strict_mono_enum strict_mono_imp_inj_on)
[PROOF STATE]
proof (state)
this:
card (fst (grab N n)) = n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma APPEND[import_const APPEND : append]:
  "(\<forall>l::'A list. [] @ l = l) \<and> (\<forall>(h::'A) t l. (h # t) @ l = h # t @ l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>l. [] @ l = l) \<and> (\<forall>h t l. (h # t) @ l = h # t @ l)
[PROOF STEP]
by simp


[STATEMENT]
lemma echelon_form_of_unit:
  fixes A::"'a::{bezout_domain_div}^'n::{mod_type}^'n::{mod_type}"
  shows "is_unit (fst (echelon_form_of_det A k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (fst (echelon_form_of_det A k))
[PROOF STEP]
unfolding echelon_form_of_det_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (fst (echelon_form_of_upt_k_det k (1::'a, A) (ncols A - 1)))
[PROOF STEP]
by (rule echelon_form_of_upt_k_det_unit)


[STATEMENT]
lemma "karatsuba_cost \<in> \<Theta>(\<lambda>n. real n powr log 2 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. karatsuba_cost \<in> \<Theta>(\<lambda>n. real n powr log 2 3)
[PROOF STEP]
using karatsuba_cost_pos
[PROOF STATE]
proof (prove)
using this:
1 \<le> ?n \<Longrightarrow> 0 < karatsuba_cost ?n

goal (1 subgoal):
 1. karatsuba_cost \<in> \<Theta>(\<lambda>n. real n powr log 2 3)
[PROOF STEP]
by (master_theorem 1 p': 1) (auto simp add: powr_divide eventually_at_top_linorder)


[STATEMENT]
lemma (in PolynRg) pol_deg_eq_c_max:"\<lbrakk>p \<in> carrier R;
       pol_coeff S c; p = polyn_expr R X (fst c) c\<rbrakk> \<Longrightarrow>
                   deg_n R S X p = c_max S c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c\<rbrakk> \<Longrightarrow> deg_n R S X p = c_max S c
[PROOF STEP]
apply (cut_tac subring, frule subring_Ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c; Subring R S; Ring S\<rbrakk> \<Longrightarrow> deg_n R S X p = c_max S c
[PROOF STEP]
apply (frule polyn_c_max[of c])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c; Subring R S; Ring S; polyn_expr R X (fst c) c = polyn_expr R X (c_max S c) c\<rbrakk> \<Longrightarrow> deg_n R S X p = c_max S c
[PROOF STEP]
apply (frule pol_SOME_2[of p])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c; Subring R S; Ring S; polyn_expr R X (fst c) c = polyn_expr R X (c_max S c) c; pol_coeff S (SOME c. cf_sol R S X p c) \<and> p = polyn_expr R X (fst (SOME c. cf_sol R S X p c)) (SOME c. cf_sol R S X p c)\<rbrakk> \<Longrightarrow> deg_n R S X p = c_max S c
[PROOF STEP]
apply (subst deg_n_def, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c; Subring R S; Ring S; polyn_expr R X (fst c) c = polyn_expr R X (c_max S c) c; pol_coeff S (SOME c. cf_sol R S X p c); p = polyn_expr R X (fst (SOME c. cf_sol R S X p c)) (SOME c. cf_sol R S X p c)\<rbrakk> \<Longrightarrow> c_max S (Eps (cf_sol R S X p)) = c_max S c
[PROOF STEP]
apply (rule polyn_degree_unique[of "Eps (cf_sol R S X p)" "c"], simp,
       assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; pol_coeff S c; p = polyn_expr R X (fst c) c; Subring R S; Ring S; polyn_expr R X (fst c) c = polyn_expr R X (c_max S c) c; pol_coeff S (SOME c. cf_sol R S X p c); p = polyn_expr R X (fst (SOME c. cf_sol R S X p c)) (SOME c. cf_sol R S X p c)\<rbrakk> \<Longrightarrow> polyn_expr R X (fst (Eps (cf_sol R S X p))) (Eps (cf_sol R S X p)) = polyn_expr R X (fst c) c
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Infinitesimal_add_approx_self2: "y \<in> Infinitesimal \<Longrightarrow> x \<approx> y + x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> Infinitesimal \<Longrightarrow> x \<approx> y + x
[PROOF STEP]
by (auto dest: Infinitesimal_add_approx_self simp add: add.commute)


[STATEMENT]
lemma Hd_mult_pre_one:
  "Hd*(x\<guillemotleft>1) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
have 1: "-(x\<guillemotleft>1)*Hd*(x\<guillemotleft>1) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x \<guillemotleft> (1::'a)) * Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
by (metis Hd_pre_post le_iff_sup mult_left_isotone pre_closed pre_one_right pre_post_export pre_pre_post sup_commute sup_monoid.add_0_right tests_dual.sba_dual.one_def tests_dual.top_def)
[PROOF STATE]
proof (state)
this:
- (x \<guillemotleft> (1::'a)) * Hd * (x \<guillemotleft> (1::'a)) \<le> x

goal (1 subgoal):
 1. Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
have "(x\<guillemotleft>1)*Hd*(x\<guillemotleft>1) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<guillemotleft> (1::'a)) * Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
by (metis mult_isotone mult_1_right one_def pre_below_one pre_one_mult_Hd)
[PROOF STATE]
proof (state)
this:
(x \<guillemotleft> (1::'a)) * Hd * (x \<guillemotleft> (1::'a)) \<le> x

goal (1 subgoal):
 1. Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(x \<guillemotleft> (1::'a)) * Hd * (x \<guillemotleft> (1::'a)) \<le> x

goal (1 subgoal):
 1. Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
(x \<guillemotleft> (1::'a)) * Hd * (x \<guillemotleft> (1::'a)) \<le> x
- (x \<guillemotleft> (1::'a)) * Hd * (x \<guillemotleft> (1::'a)) \<le> x

goal (1 subgoal):
 1. Hd * (x \<guillemotleft> (1::'a)) \<le> x
[PROOF STEP]
by (metis case_split_left pre_closed reflexive_one_closed tests_dual.sba_dual.one_def tests_dual.sba_dual.top_def mult_assoc)
[PROOF STATE]
proof (state)
this:
Hd * (x \<guillemotleft> (1::'a)) \<le> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma single_bin_glue_in_lists: \<comment> \<open>meaning: a single occurrence\<close>
  assumes "us = \<epsilon> \<or> last us \<noteq> x"
      and "\<not> [x,x] \<le>f us"
      and "us \<in> lists {x, y}"
  shows "glue x us \<in> lists {x \<cdot> y, y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. glue x us \<in> lists {x \<cdot> y, y}
[PROOF STEP]
using bounded_bin_glue_in_lists[of _ _ 2, simplified, OF assms]
[PROOF STATE]
proof (prove)
using this:
glue x us \<in> lists {x \<^sup>@ k \<cdot> y |k. k < 2}

goal (1 subgoal):
 1. glue x us \<in> lists {x \<cdot> y, y}
[PROOF STEP]
unfolding numeral_nat
[PROOF STATE]
proof (prove)
using this:
glue x us \<in> lists {x \<^sup>@ k \<cdot> y |k. k < Suc (Suc 0)}

goal (1 subgoal):
 1. glue x us \<in> lists {x \<cdot> y, y}
[PROOF STEP]
by (auto elim!: sub_lists_mono[rotated] less_SucE)


[STATEMENT]
lemma pred_inc[simp]: "pred\<cdot>(inc\<cdot>n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pred\<cdot>(inc\<cdot>n) = n
[PROOF STEP]
by (simp add: inc_def pred_def, transfer, simp)


[STATEMENT]
theorem is_tangle_make_vert_right:
 "(is_tangle_diagram xs)
          \<Longrightarrow> is_tangle_diagram (xs \<otimes> (basic (make_vert_block n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
proof(induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. is_tangle_diagram (basic x) \<Longrightarrow> is_tangle_diagram (basic x \<otimes> basic (make_vert_block n))
 2. \<And>x1a xs. \<lbrakk>is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n)); is_tangle_diagram (x1a * xs)\<rbrakk> \<Longrightarrow> is_tangle_diagram (x1a * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
case (basic xs)
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (basic xs)

goal (2 subgoals):
 1. \<And>x. is_tangle_diagram (basic x) \<Longrightarrow> is_tangle_diagram (basic x \<otimes> basic (make_vert_block n))
 2. \<And>x1a xs. \<lbrakk>is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n)); is_tangle_diagram (x1a * xs)\<rbrakk> \<Longrightarrow> is_tangle_diagram (x1a * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram (basic xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (basic xs \<otimes> basic (make_vert_block n))

goal (1 subgoal):
 1. \<And>x1a xs. \<lbrakk>is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n)); is_tangle_diagram (x1a * xs)\<rbrakk> \<Longrightarrow> is_tangle_diagram (x1a * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x1a xs. \<lbrakk>is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n)); is_tangle_diagram (x1a * xs)\<rbrakk> \<Longrightarrow> is_tangle_diagram (x1a * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
case (prod x xs)
[PROOF STATE]
proof (state)
this:
is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n))
is_tangle_diagram (x * xs)

goal (1 subgoal):
 1. \<And>x1a xs. \<lbrakk>is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n)); is_tangle_diagram (x1a * xs)\<rbrakk> \<Longrightarrow> is_tangle_diagram (x1a * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
proof(cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have
        "codomain_block (x \<otimes> (make_vert_block 0))
               = (codomain_block x) + codomain_block(make_vert_block 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain_block (x \<otimes> make_vert_block 0) = codomain_block x + codomain_block (make_vert_block 0)
[PROOF STEP]
using  codomain_additive
[PROOF STATE]
proof (prove)
using this:
codomain_block (?x \<otimes> ?y) = codomain_block ?x + codomain_block ?y

goal (1 subgoal):
 1. codomain_block (x \<otimes> make_vert_block 0) = codomain_block x + codomain_block (make_vert_block 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
codomain_block (x \<otimes> make_vert_block 0) = codomain_block x + codomain_block (make_vert_block 0)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
codomain_block (x \<otimes> make_vert_block 0) = codomain_block x + codomain_block (make_vert_block 0)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have "codomain_block (make_vert_block 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain_block (make_vert_block 0) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
codomain_block (make_vert_block 0) = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
codomain_block (x \<otimes> make_vert_block 0) = codomain_block x + codomain_block (make_vert_block 0)
codomain_block (make_vert_block 0) = 0
[PROOF STEP]
have "codomain_block (x \<otimes> (make_vert_block 0)) = codomain_block (x)"
[PROOF STATE]
proof (prove)
using this:
codomain_block (x \<otimes> make_vert_block 0) = codomain_block x + codomain_block (make_vert_block 0)
codomain_block (make_vert_block 0) = 0

goal (1 subgoal):
 1. codomain_block (x \<otimes> make_vert_block 0) = codomain_block x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
codomain_block (x \<otimes> make_vert_block 0) = codomain_block x

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
codomain_block (x \<otimes> make_vert_block 0) = codomain_block x

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have "is_tangle_diagram xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram xs
[PROOF STEP]
using prod.prems
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs)

goal (1 subgoal):
 1. is_tangle_diagram xs
[PROOF STEP]
by (metis is_tangle_diagram.simps(2))
[PROOF STATE]
proof (state)
this:
is_tangle_diagram xs

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram xs
[PROOF STEP]
have "is_tangle_diagram ((x \<otimes> (make_vert_block 0))*xs)"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram xs

goal (1 subgoal):
 1. is_tangle_diagram ((x \<otimes> make_vert_block 0) * xs)
[PROOF STEP]
using is_tangle_diagram.simps(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram xs
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. is_tangle_diagram ((x \<otimes> make_vert_block 0) * xs)
[PROOF STEP]
by (metis calculation prod.prems)
[PROOF STATE]
proof (state)
this:
is_tangle_diagram ((x \<otimes> make_vert_block 0) * xs)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram ((x \<otimes> make_vert_block 0) * xs)
[PROOF STEP]
have "is_tangle_diagram ((x*xs) \<otimes> (basic (make_vert_block 0)))"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ((x \<otimes> make_vert_block 0) * xs)

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block 0))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
 2. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block 0))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block 0))

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
using  "0"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block 0))
n = 0

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
n = Suc k

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have "codomain_block (make_vert_block (k+1)) = int (k+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain_block (make_vert_block (k + 1)) = int (k + 1)
[PROOF STEP]
using codomain_make_vert
[PROOF STATE]
proof (prove)
using this:
codomain_block (make_vert_block ?n) = int ?n

goal (1 subgoal):
 1. codomain_block (make_vert_block (k + 1)) = int (k + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
codomain_block (make_vert_block (k + 1)) = int (k + 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
codomain_block (make_vert_block (k + 1)) = int (k + 1)
[PROOF STEP]
have "(nat (codomain_block (make_vert_block (k+1)))) = k+1"
[PROOF STATE]
proof (prove)
using this:
codomain_block (make_vert_block (k + 1)) = int (k + 1)

goal (1 subgoal):
 1. nat (codomain_block (make_vert_block (k + 1))) = k + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat (codomain_block (make_vert_block (k + 1))) = k + 1

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat (codomain_block (make_vert_block (k + 1))) = k + 1
[PROOF STEP]
have "make_vert_block (nat (codomain_block (make_vert_block (k+1))))
                             = make_vert_block (k+1)"
[PROOF STATE]
proof (prove)
using this:
nat (codomain_block (make_vert_block (k + 1))) = k + 1

goal (1 subgoal):
 1. make_vert_block (nat (codomain_block (make_vert_block (k + 1)))) = make_vert_block (k + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
make_vert_block (nat (codomain_block (make_vert_block (k + 1)))) = make_vert_block (k + 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
make_vert_block (nat (codomain_block (make_vert_block (k + 1)))) = make_vert_block (k + 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have "codomain_wall (basic (make_vert_block (k+1)))>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < codomain_wall (basic (make_vert_block (k + 1)))
[PROOF STEP]
using make_vert_block.simps codomain_wall.simps  Suc_eq_plus1
       codomain_make_vert of_nat_0_less_iff zero_less_Suc
[PROOF STATE]
proof (prove)
using this:
make_vert_block 0 = []
make_vert_block (Suc ?n) = vert # make_vert_block ?n
codomain_wall (basic ?x) = codomain_block ?x
codomain_wall (?x * ?ys) = codomain_wall ?ys
Suc ?n = ?n + 1
codomain_block (make_vert_block ?n) = int ?n
((0::?'a) < of_nat ?n) = (0 < ?n)
0 < Suc ?n

goal (1 subgoal):
 1. 0 < codomain_wall (basic (make_vert_block (k + 1)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < codomain_wall (basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
make_vert_block (nat (codomain_block (make_vert_block (k + 1)))) = make_vert_block (k + 1)
0 < codomain_wall (basic (make_vert_block (k + 1)))
[PROOF STEP]
have 1: "(x*xs) \<otimes> (basic (make_vert_block (k+1)))
             =  (x\<otimes>(make_vert_block (k+1)))*(xs\<otimes>(basic (make_vert_block (k+1))))"
[PROOF STATE]
proof (prove)
using this:
make_vert_block (nat (codomain_block (make_vert_block (k + 1)))) = make_vert_block (k + 1)
0 < codomain_wall (basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. x * xs \<otimes> basic (make_vert_block (k + 1)) = (x \<otimes> make_vert_block (k + 1)) * (xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
using tensor.simps(2)
[PROOF STATE]
proof (prove)
using this:
make_vert_block (nat (codomain_block (make_vert_block (k + 1)))) = make_vert_block (k + 1)
0 < codomain_wall (basic (make_vert_block (k + 1)))
?x * ?xs \<otimes> basic ?y = (if codomain_block ?y = 0 then (?x \<otimes> ?y) * ?xs else (?x \<otimes> ?y) * (?xs \<otimes> basic (make_vert_block (nat (codomain_block ?y)))))

goal (1 subgoal):
 1. x * xs \<otimes> basic (make_vert_block (k + 1)) = (x \<otimes> make_vert_block (k + 1)) * (xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x * xs \<otimes> basic (make_vert_block (k + 1)) = (x \<otimes> make_vert_block (k + 1)) * (xs \<otimes> basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have "domain_wall (xs\<otimes>(basic (make_vert_block (k+1))))
                 = domain_wall xs + domain_wall (basic (make_vert_block (k+1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + domain_wall (basic (make_vert_block (k + 1)))
[PROOF STEP]
using tensor_domain_wall_additivity
[PROOF STATE]
proof (prove)
using this:
domain_wall (?xs \<otimes> ?ys) = domain_wall ?xs + domain_wall ?ys

goal (1 subgoal):
 1. domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + domain_wall (basic (make_vert_block (k + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + domain_wall (basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + domain_wall (basic (make_vert_block (k + 1)))
[PROOF STEP]
have 2:
          "domain_wall (xs\<otimes>(basic (make_vert_block (k+1))))
                  = (domain_wall xs) + int (k+1)"
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + domain_wall (basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)
[PROOF STEP]
using domain_make_vert domain_wall.simps(1)
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + domain_wall (basic (make_vert_block (k + 1)))
domain_block (make_vert_block ?n) = int ?n
domain_wall (basic ?x) = domain_block ?x

goal (1 subgoal):
 1. domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have 3: "codomain_block (x \<otimes> (make_vert_block (k+1)))
                 = codomain_block x + int (k+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain_block (x \<otimes> make_vert_block (k + 1)) = codomain_block x + int (k + 1)
[PROOF STEP]
using  codomain_additive codomain_make_vert
[PROOF STATE]
proof (prove)
using this:
codomain_block (?x \<otimes> ?y) = codomain_block ?x + codomain_block ?y
codomain_block (make_vert_block ?n) = int ?n

goal (1 subgoal):
 1. codomain_block (x \<otimes> make_vert_block (k + 1)) = codomain_block x + int (k + 1)
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
codomain_block (x \<otimes> make_vert_block (k + 1)) = codomain_block x + int (k + 1)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have "is_tangle_diagram (x*xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram (x * xs)
[PROOF STEP]
using prod.prems
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs)

goal (1 subgoal):
 1. is_tangle_diagram (x * xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (x * xs)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram (x * xs)
[PROOF STEP]
have 4:"codomain_block x = domain_wall xs"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs)

goal (1 subgoal):
 1. codomain_block x = domain_wall xs
[PROOF STEP]
using is_tangle_diagram.simps(2)
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs)
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. codomain_block x = domain_wall xs
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
codomain_block x = domain_wall xs

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
from 2 3 4
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)
codomain_block (x \<otimes> make_vert_block (k + 1)) = codomain_block x + int (k + 1)
codomain_block x = domain_wall xs
[PROOF STEP]
have
       "domain_wall (xs\<otimes>(basic (make_vert_block (k+1))))
               = codomain_block (x \<otimes> (make_vert_block (k+1))) "
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)
codomain_block (x \<otimes> make_vert_block (k + 1)) = codomain_block x + int (k + 1)
codomain_block x = domain_wall xs

goal (1 subgoal):
 1. domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = codomain_block (x \<otimes> make_vert_block (k + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = codomain_block (x \<otimes> make_vert_block (k + 1))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = codomain_block (x \<otimes> make_vert_block (k + 1))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
have "is_tangle_diagram (xs\<otimes>(basic (make_vert_block (k+1))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram (xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
using prod.hyps prod.prems
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n))
is_tangle_diagram (x * xs)

goal (1 subgoal):
 1. is_tangle_diagram (xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
by (metis Suc Suc_eq_plus1 is_tangle_diagram.simps(2))
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (xs \<otimes> basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = codomain_block (x \<otimes> make_vert_block (k + 1))
is_tangle_diagram (xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
have "is_tangle_diagram ((x*xs) \<otimes> (basic (make_vert_block (k+1))))"
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = codomain_block (x \<otimes> make_vert_block (k + 1))
is_tangle_diagram (xs \<otimes> basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = domain_wall xs + int (k + 1)
domain_wall (xs \<otimes> basic (make_vert_block (k + 1))) = codomain_block (x \<otimes> make_vert_block (k + 1))
is_tangle_diagram (xs \<otimes> basic (make_vert_block (k + 1)))
x * xs \<otimes> basic (make_vert_block (k + 1)) = (x \<otimes> make_vert_block (k + 1)) * (xs \<otimes> basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block (k + 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block (k + 1)))

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
using  Suc Suc_eq_plus1
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block (k + 1)))
n = Suc k
Suc ?n = ?n + 1

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))

goal (1 subgoal):
 1. \<And>x1a xs. \<lbrakk>is_tangle_diagram xs \<Longrightarrow> is_tangle_diagram (xs \<otimes> basic (make_vert_block n)); is_tangle_diagram (x1a * xs)\<rbrakk> \<Longrightarrow> is_tangle_diagram (x1a * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))

goal (1 subgoal):
 1. is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (x * xs \<otimes> basic (make_vert_block n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma division_of_union_self[intro]: "p division_of s \<Longrightarrow> p division_of (\<Union>p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p division_of s \<Longrightarrow> p division_of \<Union> p
[PROOF STEP]
unfolding division_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite p \<and> (\<forall>K\<in>p. K \<subseteq> s \<and> K \<noteq> {} \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>K1\<in>p. \<forall>K2\<in>p. K1 \<noteq> K2 \<longrightarrow> interior K1 \<inter> interior K2 = {}) \<and> \<Union> p = s \<Longrightarrow> finite p \<and> (\<forall>K\<in>p. K \<subseteq> \<Union> p \<and> K \<noteq> {} \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>K1\<in>p. \<forall>K2\<in>p. K1 \<noteq> K2 \<longrightarrow> interior K1 \<inter> interior K2 = {}) \<and> \<Union> p = \<Union> p
[PROOF STEP]
by auto


[STATEMENT]
lemma Rep_matrix_add[simp]:
  "Rep_matrix ((a::('a::monoid_add)matrix)+b) j i  = (Rep_matrix a j i) + (Rep_matrix b j i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_matrix (a + b) j i = Rep_matrix a j i + Rep_matrix b j i
[PROOF STEP]
by (simp add: plus_matrix_def)


[STATEMENT]
lemma cong_diff:
  "[b = c] (mod a) \<Longrightarrow> [d = e] (mod a) \<Longrightarrow> [b - d = c - e] (mod a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>[b = c] (mod a); [d = e] (mod a)\<rbrakk> \<Longrightarrow> [b - d = c - e] (mod a)
[PROOF STEP]
by (auto simp add: cong_def intro: mod_diff_cong)


[STATEMENT]
lemma locally_connected_components:
  "\<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally connected c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>locally connected S; c \<in> components S\<rbrakk> \<Longrightarrow> locally connected c
[PROOF STEP]
by (meson locally_connected_open_component locally_open_subset openin_subtopology_self)


[STATEMENT]
lemma ZObis_converse:
"((c,d) \<in> theta^-1 \<union> ZObis) = ((d,c) \<in> theta \<union> ZObis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((c, d) \<in> theta\<inverse> \<union> ZObis) = ((d, c) \<in> theta \<union> ZObis)
[PROOF STEP]
by (metis ZObis_sym converseI converse_Un converse_converse sym_conv_converse_eq)


[STATEMENT]
lemma llist_all2_LCons2:
  "llist_all2 P xs (LCons y ys) \<longleftrightarrow> (\<exists>x xs'. xs = LCons x xs' \<and> P x y \<and> llist_all2 P xs' ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llist_all2 P xs (LCons y ys) = (\<exists>x xs'. xs = LCons x xs' \<and> P x y \<and> llist_all2 P xs' ys)
[PROOF STEP]
by(cases xs) simp_all


[STATEMENT]
lemma (in Ring) ring_tOp_assoc:"\<lbrakk>x \<in> carrier R; y \<in> carrier R; z \<in> carrier R \<rbrakk>
 \<Longrightarrow> (x \<cdot>\<^sub>r y) \<cdot>\<^sub>r z = x \<cdot>\<^sub>r (y \<cdot>\<^sub>r z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R; z \<in> carrier R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r y \<cdot>\<^sub>r z = x \<cdot>\<^sub>r (y \<cdot>\<^sub>r z)
[PROOF STEP]
by (simp add:tp_assoc)


[STATEMENT]
lemma R_disj2:  "R (P \<or> Q) = (R P \<or> R Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (P \<or> Q) = (R P \<or> R Q)
[PROOF STEP]
apply (subst R_disj[simplified Healthy_def, where P="R P"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. R P = R (R P)
 2. R Q = R (R Q)
 3. R (P \<or> Q) = R (R P \<or> R Q)
[PROOF STEP]
apply (simp_all add: R_idem2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R (P \<or> Q) = R (R P \<or> R Q)
[PROOF STEP]
apply (auto simp: fun_eq_iff rp_defs split: cond_splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma floor_unique: "of_int z \<le> x \<Longrightarrow> x < of_int z + 1 \<Longrightarrow> \<lfloor>x\<rfloor> = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>of_int z \<le> x; x < of_int z + (1::'a)\<rbrakk> \<Longrightarrow> \<lfloor>x\<rfloor> = z
[PROOF STEP]
using floor_correct [of x] floor_exists1 [of x]
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>x\<rfloor> \<le> x \<and> x < of_int (\<lfloor>x\<rfloor> + 1)
\<exists>!z. of_int z \<le> x \<and> x < of_int (z + 1)

goal (1 subgoal):
 1. \<lbrakk>of_int z \<le> x; x < of_int z + (1::'a)\<rbrakk> \<Longrightarrow> \<lfloor>x\<rfloor> = z
[PROOF STEP]
by auto


[STATEMENT]
lemma (in cpx_sq_mat) rank_1_proj_unitary_eq:
  assumes "A \<in> fc_mats"
and "Complex_Matrix.unitary A"
and "j < dimR"
shows "rank_1_proj (Matrix.col A j) * (rank_1_proj (Matrix.col A j)) =  rank_1_proj (Matrix.col A j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
have "rank_1_proj (Matrix.col A j) * (rank_1_proj (Matrix.col A j)) = (1::complex) \<cdot>\<^sub>m (rank_1_proj (Matrix.col A j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = 1 \<cdot>\<^sub>m rank_1_proj (Matrix.col A j)
[PROOF STEP]
using assms rank_1_proj_unitary
[PROOF STATE]
proof (prove)
using this:
A \<in> fc_mats
Complex_Matrix.unitary A
j < dimR
\<lbrakk>?A \<in> fc_mats; Complex_Matrix.unitary ?A; ?j < dimR; ?k < dimR\<rbrakk> \<Longrightarrow> rank_1_proj (Matrix.col ?A ?j) * rank_1_proj (Matrix.col ?A ?k) = 1\<^sub>m dimR $$ (?j, ?k) \<cdot>\<^sub>m outer_prod (Matrix.col ?A ?j) (Matrix.col ?A ?k)

goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = 1 \<cdot>\<^sub>m rank_1_proj (Matrix.col A j)
[PROOF STEP]
unfolding rank_1_proj_def
[PROOF STATE]
proof (prove)
using this:
A \<in> fc_mats
Complex_Matrix.unitary A
j < dimR
\<lbrakk>?A \<in> fc_mats; Complex_Matrix.unitary ?A; ?j < dimR; ?k < dimR\<rbrakk> \<Longrightarrow> outer_prod (Matrix.col ?A ?j) (Matrix.col ?A ?j) * outer_prod (Matrix.col ?A ?k) (Matrix.col ?A ?k) = 1\<^sub>m dimR $$ (?j, ?k) \<cdot>\<^sub>m outer_prod (Matrix.col ?A ?j) (Matrix.col ?A ?k)

goal (1 subgoal):
 1. outer_prod (Matrix.col A j) (Matrix.col A j) * outer_prod (Matrix.col A j) (Matrix.col A j) = 1 \<cdot>\<^sub>m outer_prod (Matrix.col A j) (Matrix.col A j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = 1 \<cdot>\<^sub>m rank_1_proj (Matrix.col A j)

goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = 1 \<cdot>\<^sub>m rank_1_proj (Matrix.col A j)

goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
have "... = (rank_1_proj (Matrix.col A j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<cdot>\<^sub>m rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
by (simp add: smult_one)
[PROOF STATE]
proof (state)
this:
1 \<cdot>\<^sub>m rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)

goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)

goal (1 subgoal):
 1. rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rank_1_proj (Matrix.col A j) * rank_1_proj (Matrix.col A j) = rank_1_proj (Matrix.col A j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fully_faithful_functors_compose:
  assumes "fully_faithful_functor A B F" and "fully_faithful_functor B C G"
  shows "full_functor A C (G o F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_functor A C (G \<circ> F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_functor A C (G \<circ> F)
[PROOF STEP]
interpret F: fully_faithful_functor A B F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fully_faithful_functor A B F
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
fully_faithful_functor A B F

goal (1 subgoal):
 1. fully_faithful_functor A B F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_functor A C (G \<circ> F)
[PROOF STEP]
interpret G: fully_faithful_functor B C G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fully_faithful_functor B C G
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
fully_faithful_functor B C G

goal (1 subgoal):
 1. fully_faithful_functor B C G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_functor A C (G \<circ> F)
[PROOF STEP]
interpret composite_functor A B C F G
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. composite_functor A B C F G
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
interpret faithful_functor A C \<open>G o F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. faithful_functor A C local.map
[PROOF STEP]
using F.faithful_functor_axioms G.faithful_functor_axioms faithful_functors_compose
[PROOF STATE]
proof (prove)
using this:
faithful_functor A B F
faithful_functor B C G
\<lbrakk>faithful_functor ?A ?B ?F; faithful_functor ?B ?C ?G\<rbrakk> \<Longrightarrow> faithful_functor ?A ?C (?G \<circ> ?F)

goal (1 subgoal):
 1. faithful_functor A C local.map
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
interpret full_functor A C \<open>G o F\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
using F.full_functor_axioms G.full_functor_axioms full_functors_compose
[PROOF STATE]
proof (prove)
using this:
full_functor A B F
full_functor B C G
\<lbrakk>full_functor ?A ?B ?F; full_functor ?B ?C ?G\<rbrakk> \<Longrightarrow> full_functor ?A ?C (?G \<circ> ?F)

goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
show "full_functor A C (G o F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. full_functor A C local.map
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
full_functor A C local.map

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gR_add_isol: "D z y \<Longrightarrow> x \<preceq>\<^sub>R y \<Longrightarrow> z \<cdot> x \<preceq>\<^sub>R z \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>D z y; x \<preceq>\<^sub>R y\<rbrakk> \<Longrightarrow> z \<oplus> x \<preceq>\<^sub>R z \<oplus> y
[PROOF STEP]
apply (simp add: gR_rel_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>D z y; \<exists>z. D x z \<and> x \<oplus> z = y\<rbrakk> \<Longrightarrow> \<exists>za. D (z \<oplus> x) za \<and> z \<oplus> x \<oplus> za = z \<oplus> y
[PROOF STEP]
using add_assocD_var1 add_assoc_var
[PROOF STATE]
proof (prove)
using this:
D ?y ?z \<and> D ?x (?y \<oplus> ?z) \<Longrightarrow> D ?x ?y \<and> D (?x \<oplus> ?y) ?z
D ?y ?z \<and> D ?x (?y \<oplus> ?z) \<Longrightarrow> ?x \<oplus> ?y \<oplus> ?z = ?x \<oplus> (?y \<oplus> ?z)

goal (1 subgoal):
 1. \<lbrakk>D z y; \<exists>z. D x z \<and> x \<oplus> z = y\<rbrakk> \<Longrightarrow> \<exists>za. D (z \<oplus> x) za \<and> z \<oplus> x \<oplus> za = z \<oplus> y
[PROOF STEP]
by blast


[STATEMENT]
lemma dominates_sym: "(x \<rightarrow>\<^bsub>G\<^esub> y) \<longleftrightarrow> (y \<rightarrow>\<^bsub>G\<^esub> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<rightarrow> y) = (y \<rightarrow> x)
[PROOF STEP]
using graph_symmetric
[PROOF STATE]
proof (prove)
using this:
?u \<rightarrow> ?v \<Longrightarrow> ?v \<rightarrow> ?u

goal (1 subgoal):
 1. (x \<rightarrow> y) = (y \<rightarrow> x)
[PROOF STEP]
by blast


[STATEMENT]
lemma vifintersection_vempty_is[simp]: "(\<Inter>\<^sub>\<circ>i\<in>\<^sub>\<circ>0. f i) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> (VLambda 0 f `\<^sub>\<circ> 0) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma comp_transpos_1:"\<lbrakk>i \<le> n; j \<le> n; i \<noteq> j; k \<le> n\<rbrakk> \<Longrightarrow>
                           (transpos i j) ((transpos i j) k) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> n; j \<le> n; i \<noteq> j; k \<le> n\<rbrakk> \<Longrightarrow> transpos i j (transpos i j k) = k
[PROOF STEP]
apply (frule comp_transpos [of "i" "n" "j"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> n; j \<le> n; i \<noteq> j; k \<le> n; \<forall>k\<le>n. compose {i. i \<le> n} (transpos i j) (transpos i j) k = k\<rbrakk> \<Longrightarrow> transpos i j (transpos i j k) = k
[PROOF STEP]
apply (simp add:compose_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma coeff_primitive_part: "content f * coeff (primitive_part f) i = coeff f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content f * coeff (primitive_part f) i = coeff f i
[PROOF STEP]
using arg_cong[OF content_times_primitive_part[of f], of "\<lambda>f. coeff f _", unfolded coeff_smult]
[PROOF STATE]
proof (prove)
using this:
content f * coeff (primitive_part f) ?uu3 = coeff f ?uu3

goal (1 subgoal):
 1. content f * coeff (primitive_part f) i = coeff f i
[PROOF STEP]
.


[STATEMENT]
lemma red_supsetI [intro]:
  assumes "\<And>q. is_red B q \<Longrightarrow> is_red A q" and "is_red A p" and "\<not> is_red B p"
  shows "A \<sqsupset>p B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<sqsupset>p B
[PROOF STEP]
unfolding red_supset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>p. is_red A p \<and> \<not> is_red B p) \<and> (\<forall>p. is_red B p \<longrightarrow> is_red A p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_red B ?q41 \<Longrightarrow> is_red A ?q41
is_red A p
\<not> is_red B p

goal (1 subgoal):
 1. (\<exists>p. is_red A p \<and> \<not> is_red B p) \<and> (\<forall>p. is_red B p \<longrightarrow> is_red A p)
[PROOF STEP]
by auto


[STATEMENT]
lemma connected_components_of_eq_empty:
   "connected_components_of X = {} \<longleftrightarrow> topspace X = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_components_of X = {}) = (topspace X = {})
[PROOF STEP]
by (simp add: connected_components_of_def)


[STATEMENT]
lemma equiv_unconnected_on: "equiv V (uconnected_on E' V)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv V (Restr (uconnected E') V)
[PROOF STEP]
apply (rule equivI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. refl_on V (Restr (uconnected E') V)
 2. sym (Restr (uconnected E') V)
 3. trans (Restr (uconnected E') V)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. refl_on V (Restr (uconnected E') V)
[PROOF STEP]
by (auto simp: refl_on_def uconnected_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sym (Restr (uconnected E') V)
 2. trans (Restr (uconnected E') V)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sym (Restr (uconnected E') V)
[PROOF STEP]
apply(clarsimp simp: sym_def uconnected_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y p. \<lbrakk>epath E' x p y; x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> \<exists>p. epath E' y p x
[PROOF STEP]
subgoal for x y p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>epath E' x p y; x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> \<exists>p. epath E' y p x
[PROOF STEP]
apply (rule exI[where x="rev p"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>epath E' x p y; x \<in> V; y \<in> V\<rbrakk> \<Longrightarrow> epath E' y (rev p) x
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (Restr (uconnected E') V)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (Restr (uconnected E') V)
[PROOF STEP]
apply(clarsimp simp: trans_def uconnected_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z p pa. \<lbrakk>epath E' x p y; x \<in> V; y \<in> V; z \<in> V; epath E' y pa z\<rbrakk> \<Longrightarrow> \<exists>p. epath E' x p z
[PROOF STEP]
subgoal for x y z p q
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>epath E' x p y; x \<in> V; y \<in> V; z \<in> V; epath E' y q z\<rbrakk> \<Longrightarrow> \<exists>p. epath E' x p z
[PROOF STEP]
apply (rule exI[where x="p@q"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>epath E' x p y; x \<in> V; y \<in> V; z \<in> V; epath E' y q z\<rbrakk> \<Longrightarrow> epath E' x (p @ q) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hol_pal_lem4:
  assumes S: "convex S" "open S"
      and abc: "a \<in> S" "b \<in> S" "c \<in> S" and "d \<noteq> 0"
      and holf1: "f holomorphic_on {z. z \<in> S \<and> d \<bullet> z < k}"
      and holf2: "f holomorphic_on {z. z \<in> S \<and> k < d \<bullet> z}"
      and contf: "continuous_on S f"
    shows "contour_integral (linepath a b) f +
           contour_integral (linepath b c) f +
           contour_integral (linepath c a) f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
proof (cases "d \<bullet> a \<le> k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d \<bullet> a \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
 2. \<not> d \<bullet> a \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
d \<bullet> a \<le> k

goal (2 subgoals):
 1. d \<bullet> a \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
 2. \<not> d \<bullet> a \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
by (rule hol_pal_lem3 [OF S abc \<open>d \<noteq> 0\<close> True holf1 holf2 contf])
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0

goal (1 subgoal):
 1. \<not> d \<bullet> a \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> d \<bullet> a \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> d \<bullet> a \<le> k

goal (1 subgoal):
 1. \<not> d \<bullet> a \<le> k \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
using \<open>d \<noteq> 0\<close> hol_pal_lem3 [OF S abc, of "-d" "-k"] False
[PROOF STATE]
proof (prove)
using this:
d \<noteq> 0
\<lbrakk>- d \<noteq> 0; - d \<bullet> a \<le> - k; ?f holomorphic_on {z \<in> S. - d \<bullet> z < - k}; ?f holomorphic_on {z \<in> S. - k < - d \<bullet> z}; continuous_on S ?f\<rbrakk> \<Longrightarrow> contour_integral (linepath a b) ?f + contour_integral (linepath b c) ?f + contour_integral (linepath c a) ?f = 0
\<not> d \<bullet> a \<le> k

goal (1 subgoal):
 1. contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0
[PROOF STEP]
by (simp_all add: holf1 holf2 contf)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ln_Reals_eq: "\<lbrakk>x \<in> \<real>; Re x > 0\<rbrakk> \<Longrightarrow> ln x = of_real (ln (Re x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; 0 < Re x\<rbrakk> \<Longrightarrow> ln x = complex_of_real (ln (Re x))
[PROOF STEP]
using Ln_of_real
[PROOF STATE]
proof (prove)
using this:
0 < ?z \<Longrightarrow> ln (complex_of_real ?z) = complex_of_real (ln ?z)

goal (1 subgoal):
 1. \<lbrakk>x \<in> \<real>; 0 < Re x\<rbrakk> \<Longrightarrow> ln x = complex_of_real (ln (Re x))
[PROOF STEP]
by force


[STATEMENT]
lemma transpose_mat_elems: "elements_mat A = elements_mat A\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elements_mat A = elements_mat A\<^sup>T
[PROOF STEP]
by fastforce


[STATEMENT]
lemma interval_integral_cong_AE:
  assumes [measurable]: "f \<in> borel_measurable borel" "g \<in> borel_measurable borel"
  assumes "AE x \<in> einterval (min a b) (max a b) in lborel. f x = g x"
  shows "interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable borel
g \<in> borel_measurable borel
AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
proof (induct a b rule: linorder_wlog)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<le> b; f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
 2. \<And>a b. \<lbrakk>\<lbrakk>f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min b a) (max b a) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g; f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
case (sym a b)
[PROOF STATE]
proof (state)
this:
\<lbrakk>f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min b a) (max b a) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g
f \<in> borel_measurable borel
g \<in> borel_measurable borel
AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x

goal (2 subgoals):
 1. \<And>a b. \<lbrakk>a \<le> b; f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
 2. \<And>a b. \<lbrakk>\<lbrakk>f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min b a) (max b a) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g; f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min b a) (max b a) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g
f \<in> borel_measurable borel
g \<in> borel_measurable borel
AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min b a) (max b a) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel b a f = interval_lebesgue_integral lborel b a g
f \<in> borel_measurable borel
g \<in> borel_measurable borel
AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
by (simp add: min.commute max.commute interval_integral_endpoints_reverse[of a b])
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
case (le a b)
[PROOF STATE]
proof (state)
this:
a \<le> b
f \<in> borel_measurable borel
g \<in> borel_measurable borel
AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>a \<le> b; f \<in> borel_measurable borel; g \<in> borel_measurable borel; AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x\<rbrakk> \<Longrightarrow> interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<le> b
f \<in> borel_measurable borel
g \<in> borel_measurable borel
AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a \<le> b
f \<in> borel_measurable borel
g \<in> borel_measurable borel
AE x\<in>einterval (min a b) (max a b) in lborel. f x = g x

goal (1 subgoal):
 1. interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g
[PROOF STEP]
by (auto simp: interval_lebesgue_integral_def max_def min_def
             intro!: set_lebesgue_integral_cong_AE)
[PROOF STATE]
proof (state)
this:
interval_lebesgue_integral lborel a b f = interval_lebesgue_integral lborel a b g

goal:
No subgoals!
[PROOF STEP]
qed